/* 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 RACProviderRequest
 */
export interface RACProviderRequest {
    /**
     *
     * @type {string}
     * @memberof RACProviderRequest
     */
    name: string;
    /**
     * Flow used for authentication when the associated application is accessed by an un-authenticated user.
     * @type {string}
     * @memberof RACProviderRequest
     */
    authenticationFlow?: string | null;
    /**
     * Flow used when authorizing this provider.
     * @type {string}
     * @memberof RACProviderRequest
     */
    authorizationFlow: string;
    /**
     *
     * @type {Array<string>}
     * @memberof RACProviderRequest
     */
    propertyMappings?: Array<string>;
    /**
     *
     * @type {{ [key: string]: any; }}
     * @memberof RACProviderRequest
     */
    settings?: { [key: string]: any };
    /**
     * 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 RACProviderRequest
     */
    connectionExpiry?: string;
    /**
     * When set to true, connection tokens will be deleted upon disconnect.
     * @type {boolean}
     * @memberof RACProviderRequest
     */
    deleteTokenOnDisconnect?: boolean;
}

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

export function RACProviderRequestFromJSON(json: any): RACProviderRequest {
    return RACProviderRequestFromJSONTyped(json, false);
}

export function RACProviderRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): RACProviderRequest {
    if (json == null) {
        return json;
    }
    return {
        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"],
        settings: json["settings"] == null ? undefined : json["settings"],
        connectionExpiry: json["connection_expiry"] == null ? undefined : json["connection_expiry"],
        deleteTokenOnDisconnect:
            json["delete_token_on_disconnect"] == null
                ? undefined
                : json["delete_token_on_disconnect"],
    };
}

export function RACProviderRequestToJSON(json: any): RACProviderRequest {
    return RACProviderRequestToJSONTyped(json, false);
}

export function RACProviderRequestToJSONTyped(
    value?: RACProviderRequest | 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"],
    };
}
