/* 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';
import type { Action } from './Action';
import {
    ActionFromJSON,
    ActionFromJSONTyped,
    ActionToJSON,
} from './Action';
import type { ProgressItem } from './ProgressItem';
import {
    ProgressItemFromJSON,
    ProgressItemFromJSONTyped,
    ProgressItemToJSON,
} from './ProgressItem';
import type { GateInfo } from './GateInfo';
import {
    GateInfoFromJSON,
    GateInfoFromJSONTyped,
    GateInfoToJSON,
} from './GateInfo';

/**
 * 
 * @export
 * @interface ProcessStage
 */
export interface ProcessStage {
    /**
     * 
     * @type {string}
     * @memberof ProcessStage
     */
    name?: string;
    /**
     * 
     * @type {string}
     * @memberof ProcessStage
     */
    description?: string;
    /**
     * 
     * @type {Array<ProgressItem>}
     * @memberof ProcessStage
     */
    progress_items?: Array<ProgressItem>;
    /**
     * 
     * @type {Array<Action>}
     * @memberof ProcessStage
     */
    actions?: Array<Action>;
    /**
     * 
     * @type {Array<GateInfo>}
     * @memberof ProcessStage
     */
    approvals?: Array<GateInfo>;
    /**
     * 
     * @type {number}
     * @memberof ProcessStage
     */
    incoming_stage?: number;
    /**
     * 
     * @type {number}
     * @memberof ProcessStage
     */
    outgoing_stage?: number;
    /**
     * 
     * @type {number}
     * @memberof ProcessStage
     */
    stage_type?: number;
}

/**
 * Check if a given object implements the ProcessStage interface.
 */
export function instanceOfProcessStage(value: object): value is ProcessStage {
    return true;
}

export function ProcessStageFromJSON(json: any): ProcessStage {
    return ProcessStageFromJSONTyped(json, false);
}

export function ProcessStageFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProcessStage {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'] == null ? undefined : json['name'],
        'description': json['description'] == null ? undefined : json['description'],
        'progress_items': json['progress_items'] == null ? undefined : ((json['progress_items'] as Array<any>).map(ProgressItemFromJSON)),
        'actions': json['actions'] == null ? undefined : ((json['actions'] as Array<any>).map(ActionFromJSON)),
        'approvals': json['approvals'] == null ? undefined : ((json['approvals'] as Array<any>).map(GateInfoFromJSON)),
        'incoming_stage': json['incoming_stage'] == null ? undefined : json['incoming_stage'],
        'outgoing_stage': json['outgoing_stage'] == null ? undefined : json['outgoing_stage'],
        'stage_type': json['stage_type'] == null ? undefined : json['stage_type'],
    };
}

export function ProcessStageToJSON(value?: ProcessStage | null): any {
    if (value == null) {
        return value;
    }
    return {
        
        'name': value['name'],
        'description': value['description'],
        'progress_items': value['progress_items'] == null ? undefined : ((value['progress_items'] as Array<any>).map(ProgressItemToJSON)),
        'actions': value['actions'] == null ? undefined : ((value['actions'] as Array<any>).map(ActionToJSON)),
        'approvals': value['approvals'] == null ? undefined : ((value['approvals'] as Array<any>).map(GateInfoToJSON)),
        'incoming_stage': value['incoming_stage'],
        'outgoing_stage': value['outgoing_stage'],
        'stage_type': value['stage_type'],
    };
}

