/* 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 PatchedSourceStageRequest
 */
export interface PatchedSourceStageRequest {
    /**
     * 
     * @type {string}
     * @memberof PatchedSourceStageRequest
     */
    name?: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof PatchedSourceStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * 
     * @type {string}
     * @memberof PatchedSourceStageRequest
     */
    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 PatchedSourceStageRequest
     */
    resumeTimeout?: string;
}

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

export function PatchedSourceStageRequestFromJSON(json: any): PatchedSourceStageRequest {
    return PatchedSourceStageRequestFromJSONTyped(json, false);
}

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

export function PatchedSourceStageRequestToJSON(json: any): PatchedSourceStageRequest {
    return PatchedSourceStageRequestToJSONTyped(json, false);
}

export function PatchedSourceStageRequestToJSONTyped(value?: PatchedSourceStageRequest | 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'],
    };
}

