/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.12.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';

/**
 * PromptStage Serializer
 * @export
 * @interface PromptStageRequest
 */
export interface PromptStageRequest {
    /**
     * 
     * @type {string}
     * @memberof PromptStageRequest
     */
    name: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof PromptStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * 
     * @type {Array<string>}
     * @memberof PromptStageRequest
     */
    fields: Array<string>;
    /**
     * 
     * @type {Array<string>}
     * @memberof PromptStageRequest
     */
    validationPolicies?: Array<string>;
}

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

export function PromptStageRequestFromJSON(json: any): PromptStageRequest {
    return PromptStageRequestFromJSONTyped(json, false);
}

export function PromptStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PromptStageRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'],
        'flowSet': json['flow_set'] == null ? undefined : ((json['flow_set'] as Array<any>).map(FlowSetRequestFromJSON)),
        'fields': json['fields'],
        'validationPolicies': json['validation_policies'] == null ? undefined : json['validation_policies'],
    };
}

export function PromptStageRequestToJSON(json: any): PromptStageRequest {
    return PromptStageRequestToJSONTyped(json, false);
}

export function PromptStageRequestToJSONTyped(value?: PromptStageRequest | 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)),
        'fields': value['fields'],
        'validation_policies': value['validationPolicies'],
    };
}

