/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.5.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 type { Connector } from "./Connector";
import { ConnectorFromJSON } from "./Connector";
import type { FlowSet } from "./FlowSet";
import { FlowSetFromJSON } from "./FlowSet";
import type { StageModeEnum } from "./StageModeEnum";
import { StageModeEnumFromJSON, StageModeEnumToJSON } from "./StageModeEnum";

/**
 * EndpointStage Serializer
 * @export
 * @interface EndpointStage
 */
export interface EndpointStage {
    /**
     *
     * @type {string}
     * @memberof EndpointStage
     */
    readonly pk: string;
    /**
     *
     * @type {string}
     * @memberof EndpointStage
     */
    name: string;
    /**
     * Get object type so that we know how to edit the object
     * @type {string}
     * @memberof EndpointStage
     */
    readonly component: string;
    /**
     * Return object's verbose_name
     * @type {string}
     * @memberof EndpointStage
     */
    readonly verboseName: string;
    /**
     * Return object's plural verbose_name
     * @type {string}
     * @memberof EndpointStage
     */
    readonly verboseNamePlural: string;
    /**
     * Return internal model name
     * @type {string}
     * @memberof EndpointStage
     */
    readonly metaModelName: string;
    /**
     *
     * @type {Array<FlowSet>}
     * @memberof EndpointStage
     */
    readonly flowSet: Array<FlowSet>;
    /**
     *
     * @type {string}
     * @memberof EndpointStage
     */
    connector: string;
    /**
     *
     * @type {Connector}
     * @memberof EndpointStage
     */
    readonly connectorObj: Connector;
    /**
     *
     * @type {StageModeEnum}
     * @memberof EndpointStage
     */
    mode?: StageModeEnum;
}

/**
 * Check if a given object implements the EndpointStage interface.
 */
export function instanceOfEndpointStage(value: object): value is EndpointStage {
    if (!("pk" in value) || value["pk"] === undefined) return false;
    if (!("name" in value) || value["name"] === undefined) return false;
    if (!("component" in value) || value["component"] === undefined) return false;
    if (!("verboseName" in value) || value["verboseName"] === undefined) return false;
    if (!("verboseNamePlural" in value) || value["verboseNamePlural"] === undefined) return false;
    if (!("metaModelName" in value) || value["metaModelName"] === undefined) return false;
    if (!("flowSet" in value) || value["flowSet"] === undefined) return false;
    if (!("connector" in value) || value["connector"] === undefined) return false;
    if (!("connectorObj" in value) || value["connectorObj"] === undefined) return false;
    return true;
}

export function EndpointStageFromJSON(json: any): EndpointStage {
    return EndpointStageFromJSONTyped(json, false);
}

export function EndpointStageFromJSONTyped(json: any, ignoreDiscriminator: boolean): EndpointStage {
    if (json == null) {
        return json;
    }
    return {
        pk: json["pk"],
        name: json["name"],
        component: json["component"],
        verboseName: json["verbose_name"],
        verboseNamePlural: json["verbose_name_plural"],
        metaModelName: json["meta_model_name"],
        flowSet: (json["flow_set"] as Array<any>).map(FlowSetFromJSON),
        connector: json["connector"],
        connectorObj: ConnectorFromJSON(json["connector_obj"]),
        mode: json["mode"] == null ? undefined : StageModeEnumFromJSON(json["mode"]),
    };
}

export function EndpointStageToJSON(json: any): EndpointStage {
    return EndpointStageToJSONTyped(json, false);
}

export function EndpointStageToJSONTyped(
    value?: Omit<
        EndpointStage,
        | "pk"
        | "component"
        | "verbose_name"
        | "verbose_name_plural"
        | "meta_model_name"
        | "flow_set"
        | "connector_obj"
    > | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        name: value["name"],
        connector: value["connector"],
        mode: StageModeEnumToJSON(value["mode"]),
    };
}
