/* 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 { Provider } from "./Provider";
import { ProviderFromJSON } from "./Provider";
import type { Token } from "./Token";
import { TokenFromJSON } from "./Token";

/**
 * SSFProvider Serializer
 * @export
 * @interface SSFProvider
 */
export interface SSFProvider {
    /**
     *
     * @type {number}
     * @memberof SSFProvider
     */
    readonly pk: number;
    /**
     *
     * @type {string}
     * @memberof SSFProvider
     */
    name: string;
    /**
     * Get object component so that we know how to edit the object
     * @type {string}
     * @memberof SSFProvider
     */
    readonly component: string;
    /**
     * Return object's verbose_name
     * @type {string}
     * @memberof SSFProvider
     */
    readonly verboseName: string;
    /**
     * Return object's plural verbose_name
     * @type {string}
     * @memberof SSFProvider
     */
    readonly verboseNamePlural: string;
    /**
     * Return internal model name
     * @type {string}
     * @memberof SSFProvider
     */
    readonly metaModelName: string;
    /**
     * Key used to sign the SSF Events.
     * @type {string}
     * @memberof SSFProvider
     */
    signingKey: string;
    /**
     *
     * @type {Token}
     * @memberof SSFProvider
     */
    readonly tokenObj: Token;
    /**
     *
     * @type {Array<number>}
     * @memberof SSFProvider
     */
    oidcAuthProviders?: Array<number>;
    /**
     *
     * @type {Array<Provider>}
     * @memberof SSFProvider
     */
    readonly oidcAuthProvidersObj: Array<Provider>;
    /**
     *
     * @type {string}
     * @memberof SSFProvider
     */
    readonly ssfUrl: string | null;
    /**
     *
     * @type {string}
     * @memberof SSFProvider
     */
    eventRetention?: string;
    /**
     *
     * @type {boolean}
     * @memberof SSFProvider
     */
    pushVerifyCertificates?: boolean;
}

/**
 * Check if a given object implements the SSFProvider interface.
 */
export function instanceOfSSFProvider(value: object): value is SSFProvider {
    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 (!("signingKey" in value) || value["signingKey"] === undefined) return false;
    if (!("tokenObj" in value) || value["tokenObj"] === undefined) return false;
    if (!("oidcAuthProvidersObj" in value) || value["oidcAuthProvidersObj"] === undefined)
        return false;
    if (!("ssfUrl" in value) || value["ssfUrl"] === undefined) return false;
    return true;
}

export function SSFProviderFromJSON(json: any): SSFProvider {
    return SSFProviderFromJSONTyped(json, false);
}

export function SSFProviderFromJSONTyped(json: any, ignoreDiscriminator: boolean): SSFProvider {
    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"],
        signingKey: json["signing_key"],
        tokenObj: TokenFromJSON(json["token_obj"]),
        oidcAuthProviders:
            json["oidc_auth_providers"] == null ? undefined : json["oidc_auth_providers"],
        oidcAuthProvidersObj: (json["oidc_auth_providers_obj"] as Array<any>).map(ProviderFromJSON),
        ssfUrl: json["ssf_url"],
        eventRetention: json["event_retention"] == null ? undefined : json["event_retention"],
        pushVerifyCertificates:
            json["push_verify_certificates"] == null ? undefined : json["push_verify_certificates"],
    };
}

export function SSFProviderToJSON(json: any): SSFProvider {
    return SSFProviderToJSONTyped(json, false);
}

export function SSFProviderToJSONTyped(
    value?: Omit<
        SSFProvider,
        | "pk"
        | "component"
        | "verbose_name"
        | "verbose_name_plural"
        | "meta_model_name"
        | "token_obj"
        | "oidc_auth_providers_obj"
        | "ssf_url"
    > | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        name: value["name"],
        signing_key: value["signingKey"],
        oidc_auth_providers: value["oidcAuthProviders"],
        event_retention: value["eventRetention"],
        push_verify_certificates: value["pushVerifyCertificates"],
    };
}
