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

/**
 * RadiusProvider Serializer
 * @export
 * @interface RadiusProvider
 */
export interface RadiusProvider {
    /**
     *
     * @type {number}
     * @memberof RadiusProvider
     */
    readonly pk: number;
    /**
     *
     * @type {string}
     * @memberof RadiusProvider
     */
    name: string;
    /**
     * Flow used for authentication when the associated application is accessed by an un-authenticated user.
     * @type {string}
     * @memberof RadiusProvider
     */
    authenticationFlow?: string | null;
    /**
     * Flow used when authorizing this provider.
     * @type {string}
     * @memberof RadiusProvider
     */
    authorizationFlow: string;
    /**
     * Flow used ending the session from a provider.
     * @type {string}
     * @memberof RadiusProvider
     */
    invalidationFlow: string;
    /**
     *
     * @type {Array<string>}
     * @memberof RadiusProvider
     */
    propertyMappings?: Array<string>;
    /**
     * Get object component so that we know how to edit the object
     * @type {string}
     * @memberof RadiusProvider
     */
    readonly component: string;
    /**
     * Internal application name, used in URLs.
     * @type {string}
     * @memberof RadiusProvider
     */
    readonly assignedApplicationSlug: string | null;
    /**
     * Application's display Name.
     * @type {string}
     * @memberof RadiusProvider
     */
    readonly assignedApplicationName: string | null;
    /**
     * Internal application name, used in URLs.
     * @type {string}
     * @memberof RadiusProvider
     */
    readonly assignedBackchannelApplicationSlug: string | null;
    /**
     * Application's display Name.
     * @type {string}
     * @memberof RadiusProvider
     */
    readonly assignedBackchannelApplicationName: string | null;
    /**
     * Return object's verbose_name
     * @type {string}
     * @memberof RadiusProvider
     */
    readonly verboseName: string;
    /**
     * Return object's plural verbose_name
     * @type {string}
     * @memberof RadiusProvider
     */
    readonly verboseNamePlural: string;
    /**
     * Return internal model name
     * @type {string}
     * @memberof RadiusProvider
     */
    readonly metaModelName: string;
    /**
     * List of CIDRs (comma-separated) that clients can connect from. A more specific CIDR will match before a looser one. Clients connecting from a non-specified CIDR will be dropped.
     * @type {string}
     * @memberof RadiusProvider
     */
    clientNetworks?: string;
    /**
     * Shared secret between clients and server to hash packets.
     * @type {string}
     * @memberof RadiusProvider
     */
    sharedSecret?: string;
    /**
     *
     * @type {Array<string>}
     * @memberof RadiusProvider
     */
    readonly outpostSet: Array<string>;
    /**
     * When enabled, code-based multi-factor authentication can be used by appending a semicolon and the TOTP code to the password. This should only be enabled if all users that will bind to this provider have a TOTP device configured, as otherwise a password may incorrectly be rejected if it contains a semicolon.
     * @type {boolean}
     * @memberof RadiusProvider
     */
    mfaSupport?: boolean;
    /**
     *
     * @type {string}
     * @memberof RadiusProvider
     */
    certificate?: string | null;
}

/**
 * Check if a given object implements the RadiusProvider interface.
 */
export function instanceOfRadiusProvider(value: object): value is RadiusProvider {
    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 (!("invalidationFlow" in value) || value["invalidationFlow"] === 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 RadiusProviderFromJSON(json: any): RadiusProvider {
    return RadiusProviderFromJSONTyped(json, false);
}

export function RadiusProviderFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): RadiusProvider {
    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"],
        invalidationFlow: json["invalidation_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"],
        clientNetworks: json["client_networks"] == null ? undefined : json["client_networks"],
        sharedSecret: json["shared_secret"] == null ? undefined : json["shared_secret"],
        outpostSet: json["outpost_set"],
        mfaSupport: json["mfa_support"] == null ? undefined : json["mfa_support"],
        certificate: json["certificate"] == null ? undefined : json["certificate"],
    };
}

export function RadiusProviderToJSON(json: any): RadiusProvider {
    return RadiusProviderToJSONTyped(json, false);
}

export function RadiusProviderToJSONTyped(
    value?: Omit<
        RadiusProvider,
        | "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"],
        invalidation_flow: value["invalidationFlow"],
        property_mappings: value["propertyMappings"],
        client_networks: value["clientNetworks"],
        shared_secret: value["sharedSecret"],
        mfa_support: value["mfaSupport"],
        certificate: value["certificate"],
    };
}
