/* tslint:disable */
/* eslint-disable */
/**
 * Fabro Run API
 * HTTP API for managing Fabro workflow run executions.
 *
 * The version of the OpenAPI document: 0.2.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


// May contain unused imports in some cases
// @ts-ignore
import type { DiffStats } from './diff-stats';

/**
 * Metadata for a `PaginatedRunFileList` response.  Replaces `PaginationMeta` on the files endpoint — the naturally-bounded list does not use cursor pagination but exposes caps and a degraded-response path instead.
 */
export interface RunFilesMeta {
    /**
     * Source used to materialize this response. `sandbox` honors the requested scope from the run-owned sandbox; `final_patch` is fallback committed/final diff data from stored run state.
     */
    'source': RunFilesMetaSourceEnum;
    /**
     * Diff scope materialized for this response.
     */
    'scope': RunFilesMetaScopeEnum;
    'stats': DiffStats;
    /**
     * True when any cap (file count, per-file size, or aggregate size) was hit for this response.
     */
    'truncated': boolean;
    /**
     * Number of files dropped because the aggregate 5 MiB budget was exhausted. Zero or absent when no files were dropped for budget reasons.
     */
    'files_omitted_by_budget'?: number;
    /**
     * Total files changed in the run (before caps were applied). May exceed `data.length` when truncation occurred.
     */
    'total_changed': number;
    /**
     * Head SHA the diff (or patch) was resolved against.
     */
    'to_sha'?: string;
    /**
     * Commit time of `to_sha`, used by the UI for the \"Checkpoint Xm ago\" freshness label on Running runs.
     */
    'to_sha_committed_at'?: string;
    /**
     * When `true`, every entry in `data` has null `contents` on both sides; non-sensitive non-flagged entries also include `unified_patch`. Entries flagged `sensitive` / `binary` / `symlink` / `submodule` / `truncated` render via the same placeholders used in the live path (the flags drive rendering; contents are null in degraded mode regardless). The data shape is otherwise identical to the live path.
     */
    'degraded'?: boolean;
    /**
     * Why the response degraded. Absent when `degraded` is `false` or omitted.
     */
    'degraded_reason'?: RunFilesMetaDegradedReasonEnum;
}

export const RunFilesMetaSourceEnum = {
    SANDBOX: 'sandbox',
    FINAL_PATCH: 'final_patch'
} as const;

export type RunFilesMetaSourceEnum = typeof RunFilesMetaSourceEnum[keyof typeof RunFilesMetaSourceEnum];
export const RunFilesMetaScopeEnum = {
    COMMITTED: 'committed',
    UNCOMMITTED: 'uncommitted',
    ALL: 'all',
    RANGE: 'range'
} as const;

export type RunFilesMetaScopeEnum = typeof RunFilesMetaScopeEnum[keyof typeof RunFilesMetaScopeEnum];
export const RunFilesMetaDegradedReasonEnum = {
    SANDBOX_UNREACHABLE: 'sandbox_unreachable',
    SANDBOX_GONE: 'sandbox_gone',
    PROVIDER_UNSUPPORTED: 'provider_unsupported'
} as const;

export type RunFilesMetaDegradedReasonEnum = typeof RunFilesMetaDegradedReasonEnum[keyof typeof RunFilesMetaDegradedReasonEnum];
