/* 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 { DiffFile } from './diff-file';

/**
 * A before/after pair showing changes to a single file.  Contents conventions for non-modify cases: - Added: `old_file.contents` is empty string; `new_file` holds the added contents. - Deleted: `new_file.contents` is empty string; `old_file` holds the removed contents. - Renamed (no content change): both sides hold identical contents; `old_file.name != new_file.name`. - Symlink / submodule / binary / sensitive / truncated: contents are empty strings; consumers must render a placeholder based on the flag set. - Degraded responses: contents are null on every entry; regular text diffs include `unified_patch`.
 */
export interface FileDiff {
    'old_file': DiffFile;
    'new_file': DiffFile;
    /**
     * Optional classification of the change. Clients that don\'t recognize a value should fall back to inspecting the old/new contents.
     */
    'change_kind'?: FileDiffChangeKindEnum;
    /**
     * When `true`, `new_file.contents` and `old_file.contents` are empty strings because the file exceeded a cap (see `truncation_reason`).
     */
    'truncated'?: boolean;
    /**
     * Reason this file\'s contents were omitted. Absent when `truncated` is `false` or omitted.
     */
    'truncation_reason'?: FileDiffTruncationReasonEnum;
    /**
     * When `true`, the file is non-textual; `contents` on both sides are empty strings.
     */
    'binary'?: boolean;
    /**
     * When `true`, the file path matched the server\'s sensitive-path denylist; `contents` on both sides are empty strings regardless of truncation or binary flags.
     */
    'sensitive'?: boolean;
    /**
     * Per-file unified-patch text (the `diff --git` section verbatim). Populated only for regular non-flagged text-diff entries in degraded mode. Absent for sensitive, binary, symlink, submodule, truncated, and live-path entries.
     */
    'unified_patch'?: string | null;
}

export const FileDiffChangeKindEnum = {
    ADDED: 'added',
    MODIFIED: 'modified',
    DELETED: 'deleted',
    RENAMED: 'renamed',
    SYMLINK: 'symlink',
    SUBMODULE: 'submodule'
} as const;

export type FileDiffChangeKindEnum = typeof FileDiffChangeKindEnum[keyof typeof FileDiffChangeKindEnum];
export const FileDiffTruncationReasonEnum = {
    FILE_TOO_LARGE: 'file_too_large',
    BUDGET_EXHAUSTED: 'budget_exhausted'
} as const;

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