/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.10.0-rc1
 * Contact: hello@goauthentik.io
 *
 * 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 { FlowSetRequest } from './FlowSetRequest';
import {
    FlowSetRequestFromJSON,
    FlowSetRequestFromJSONTyped,
    FlowSetRequestToJSON,
    FlowSetRequestToJSONTyped,
} from './FlowSetRequest';

/**
 * SourceStage Serializer
 * @export
 * @interface SourceStageRequest
 */
export interface SourceStageRequest {
    /**
     * 
     * @type {string}
     * @memberof SourceStageRequest
     */
    name: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof SourceStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * 
     * @type {string}
     * @memberof SourceStageRequest
     */
    source: string;
    /**
     * Amount of time a user can take to return from the source to continue the flow (Format: hours=-1;minutes=-2;seconds=-3)
     * @type {string}
     * @memberof SourceStageRequest
     */
    resumeTimeout?: string;
}

/**
 * Check if a given object implements the SourceStageRequest interface.
 */
export function instanceOfSourceStageRequest(value: object): value is SourceStageRequest {
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('source' in value) || value['source'] === undefined) return false;
    return true;
}

export function SourceStageRequestFromJSON(json: any): SourceStageRequest {
    return SourceStageRequestFromJSONTyped(json, false);
}

export function SourceStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceStageRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'],
        'flowSet': json['flow_set'] == null ? undefined : ((json['flow_set'] as Array<any>).map(FlowSetRequestFromJSON)),
        'source': json['source'],
        'resumeTimeout': json['resume_timeout'] == null ? undefined : json['resume_timeout'],
    };
}

export function SourceStageRequestToJSON(json: any): SourceStageRequest {
    return SourceStageRequestToJSONTyped(json, false);
}

export function SourceStageRequestToJSONTyped(value?: SourceStageRequest | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'name': value['name'],
        'flow_set': value['flowSet'] == null ? undefined : ((value['flowSet'] as Array<any>).map(FlowSetRequestToJSON)),
        'source': value['source'],
        'resume_timeout': value['resumeTimeout'],
    };
}

