/* tslint:disable */
/* eslint-disable */
/**
 * chomestatus API
 * The API for chromestatus.com. chromestatus.com is the official tool used for tracking feature launches in Blink (the browser engine that powers Chrome and many other web browsers). This tool guides feature owners through our launch process and serves as a primary source for developer information that then ripples throughout the web developer ecosystem. More details at: https://github.com/GoogleChrome/chromium-dashboard
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { mapValues } from '../runtime';
/**
 * 
 * @export
 * @interface SummaryProgressStep
 */
export interface SummaryProgressStep {
    /**
     * The concrete step or tool execution stage in the AI generation pipeline:
     * - UNKNOWN: Fallback for unknown or unsupported execution steps
     * - SEARCH_MDN: Querying MDN documentation
     * - VERIFY_DOC_LINK: Checking external documentation links
     * - READ_SPEC: Fetching and parsing W3C/WHATWG specification
     * - READ_EXPLAINER: Fetching feature explainer document
     * 
     * @type {string}
     * @memberof SummaryProgressStep
     */
    step: SummaryProgressStepStepEnum;
    /**
     * Execution status of this step:
     * - IN_PROGRESS: Step is currently running
     * - SUCCESS: Step completed successfully
     * - FAILED: Step failed to complete
     * - RETRYING: Step is re-attempting execution after a transient issue
     * 
     * @type {string}
     * @memberof SummaryProgressStep
     */
    status: SummaryProgressStepStatusEnum;
    /**
     * Human-readable progress update, completion summary, or error reason when status is FAILED.
     * @type {string}
     * @memberof SummaryProgressStep
     */
    message?: string;
    /**
     * Timestamp when this step began execution.
     * @type {Date}
     * @memberof SummaryProgressStep
     */
    start_timestamp: Date;
    /**
     * Timestamp when this step reached a terminal state (SUCCESS or FAILED). Null while step is active (IN_PROGRESS or RETRYING).
     * @type {Date}
     * @memberof SummaryProgressStep
     */
    end_timestamp?: Date;
}


/**
 * @export
 */
export const SummaryProgressStepStepEnum = {
    UNKNOWN: 'UNKNOWN',
    SEARCH_MDN: 'SEARCH_MDN',
    VERIFY_DOC_LINK: 'VERIFY_DOC_LINK',
    READ_SPEC: 'READ_SPEC',
    READ_EXPLAINER: 'READ_EXPLAINER'
} as const;
export type SummaryProgressStepStepEnum = typeof SummaryProgressStepStepEnum[keyof typeof SummaryProgressStepStepEnum];

/**
 * @export
 */
export const SummaryProgressStepStatusEnum = {
    IN_PROGRESS: 'IN_PROGRESS',
    SUCCESS: 'SUCCESS',
    FAILED: 'FAILED',
    RETRYING: 'RETRYING'
} as const;
export type SummaryProgressStepStatusEnum = typeof SummaryProgressStepStatusEnum[keyof typeof SummaryProgressStepStatusEnum];


/**
 * Check if a given object implements the SummaryProgressStep interface.
 */
export function instanceOfSummaryProgressStep(value: object): value is SummaryProgressStep {
    if (!('step' in value) || value['step'] === undefined) return false;
    if (!('status' in value) || value['status'] === undefined) return false;
    if (!('start_timestamp' in value) || value['start_timestamp'] === undefined) return false;
    return true;
}

export function SummaryProgressStepFromJSON(json: any): SummaryProgressStep {
    return SummaryProgressStepFromJSONTyped(json, false);
}

export function SummaryProgressStepFromJSONTyped(json: any, ignoreDiscriminator: boolean): SummaryProgressStep {
    if (json == null) {
        return json;
    }
    return {
        
        'step': json['step'],
        'status': json['status'],
        'message': json['message'] == null ? undefined : json['message'],
        'start_timestamp': (new Date(json['start_timestamp'])),
        'end_timestamp': json['end_timestamp'] == null ? undefined : (new Date(json['end_timestamp'])),
    };
}

export function SummaryProgressStepToJSON(value?: SummaryProgressStep | null): any {
    if (value == null) {
        return value;
    }
    return {
        
        'step': value['step'],
        'status': value['status'],
        'message': value['message'],
        'start_timestamp': ((value['start_timestamp']).toISOString()),
        'end_timestamp': value['end_timestamp'] == null ? undefined : ((value['end_timestamp'] as any).toISOString()),
    };
}

