/* 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.
 */

/**
 * RACProvider Serializer
 * @export
 * @interface RACProvider
 */
export interface RACProvider {
    /**
     *
     * @type {number}
     * @memberof RACProvider
     */
    readonly pk: number;
    /**
     *
     * @type {string}
     * @memberof RACProvider
     */
    name: string;
    /**
     * Flow used for authentication when the associated application is accessed by an un-authenticated user.
     * @type {string}
     * @memberof RACProvider
     */
    authenticationFlow?: string | null;
    /**
     * Flow used when authorizing this provider.
     * @type {string}
     * @memberof RACProvider
     */
    authorizationFlow: string;
    /**
     *
     * @type {Array<string>}
     * @memberof RACProvider
     */
    propertyMappings?: Array<string>;
    /**
     * Get object component so that we know how to edit the object
     * @type {string}
     * @memberof RACProvider
     */
    readonly component: string;
    /**
     * Internal application name, used in URLs.
     * @type {string}
     * @memberof RACProvider
     */
    readonly assignedApplicationSlug: string | null;
    /**
     * Application's display Name.
     * @type {string}
     * @memberof RACProvider
     */
    readonly assignedApplicationName: string | null;
    /**
     * Internal application name, used in URLs.
     * @type {string}
     * @memberof RACProvider
     */
    readonly assignedBackchannelApplicationSlug: string | null;
    /**
     * Application's display Name.
     * @type {string}
     * @memberof RACProvider
     */
    readonly assignedBackchannelApplicationName: string | null;
    /**
     * Return object's verbose_name
     * @type {string}
     * @memberof RACProvider
     */
    readonly verboseName: string;
    /**
     * Return object's plural verbose_name
     * @type {string}
     * @memberof RACProvider
     */
    readonly verboseNamePlural: string;
    /**
     * Return internal model name
     * @type {string}
     * @memberof RACProvider
     */
    readonly metaModelName: string;
    /**
     *
     * @type {{ [key: string]: any; }}
     * @memberof RACProvider
     */
    settings?: { [key: string]: any };
    /**
     *
     * @type {Array<string>}
     * @memberof RACProvider
     */
    readonly outpostSet: Array<string>;
    /**
     * Determines how long a session lasts. Default of 0 means that the sessions lasts until the browser is closed. (Format: hours=-1;minutes=-2;seconds=-3)
     * @type {string}
     * @memberof RACProvider
     */
    connectionExpiry?: string;
    /**
     * When set to true, connection tokens will be deleted upon disconnect.
     * @type {boolean}
     * @memberof RACProvider
     */
    deleteTokenOnDisconnect?: boolean;
}

/**
 * Check if a given object implements the RACProvider interface.
 */
export function instanceOfRACProvider(value: object): value is RACProvider {
    if (!("pk" in value) || value["pk"] === undefined) return false;
    if (!("name" in value) || value["name"] === undefined) return false;
    if (!("authorizationFlow" in value) || value["authorizationFlow"] === undefined) return false;
    if (!("component" in value) || value["component"] === undefined) return false;
    if (!("assignedApplicationSlug" in value) || value["assignedApplicationSlug"] === undefined)
        return false;
    if (!("assignedApplicationName" in value) || value["assignedApplicationName"] === undefined)
        return false;
    if (
        !("assignedBackchannelApplicationSlug" in value) ||
        value["assignedBackchannelApplicationSlug"] === undefined
    )
        return false;
    if (
        !("assignedBackchannelApplicationName" in value) ||
        value["assignedBackchannelApplicationName"] === 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 (!("outpostSet" in value) || value["outpostSet"] === undefined) return false;
    return true;
}

export function RACProviderFromJSON(json: any): RACProvider {
    return RACProviderFromJSONTyped(json, false);
}

export function RACProviderFromJSONTyped(json: any, ignoreDiscriminator: boolean): RACProvider {
    if (json == null) {
        return json;
    }
    return {
        pk: json["pk"],
        name: json["name"],
        authenticationFlow:
            json["authentication_flow"] == null ? undefined : json["authentication_flow"],
        authorizationFlow: json["authorization_flow"],
        propertyMappings: json["property_mappings"] == null ? undefined : json["property_mappings"],
        component: json["component"],
        assignedApplicationSlug: json["assigned_application_slug"],
        assignedApplicationName: json["assigned_application_name"],
        assignedBackchannelApplicationSlug: json["assigned_backchannel_application_slug"],
        assignedBackchannelApplicationName: json["assigned_backchannel_application_name"],
        verboseName: json["verbose_name"],
        verboseNamePlural: json["verbose_name_plural"],
        metaModelName: json["meta_model_name"],
        settings: json["settings"] == null ? undefined : json["settings"],
        outpostSet: json["outpost_set"],
        connectionExpiry: json["connection_expiry"] == null ? undefined : json["connection_expiry"],
        deleteTokenOnDisconnect:
            json["delete_token_on_disconnect"] == null
                ? undefined
                : json["delete_token_on_disconnect"],
    };
}

export function RACProviderToJSON(json: any): RACProvider {
    return RACProviderToJSONTyped(json, false);
}

export function RACProviderToJSONTyped(
    value?: Omit<
        RACProvider,
        | "pk"
        | "component"
        | "assigned_application_slug"
        | "assigned_application_name"
        | "assigned_backchannel_application_slug"
        | "assigned_backchannel_application_name"
        | "verbose_name"
        | "verbose_name_plural"
        | "meta_model_name"
        | "outpost_set"
    > | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        name: value["name"],
        authentication_flow: value["authenticationFlow"],
        authorization_flow: value["authorizationFlow"],
        property_mappings: value["propertyMappings"],
        settings: value["settings"],
        connection_expiry: value["connectionExpiry"],
        delete_token_on_disconnect: value["deleteTokenOnDisconnect"],
    };
}
