/* 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 RadiusProviderRequest
 */
export interface RadiusProviderRequest {
    /**
     *
     * @type {string}
     * @memberof RadiusProviderRequest
     */
    name: string;
    /**
     * Flow used for authentication when the associated application is accessed by an un-authenticated user.
     * @type {string}
     * @memberof RadiusProviderRequest
     */
    authenticationFlow?: string | null;
    /**
     * Flow used when authorizing this provider.
     * @type {string}
     * @memberof RadiusProviderRequest
     */
    authorizationFlow: string;
    /**
     * Flow used ending the session from a provider.
     * @type {string}
     * @memberof RadiusProviderRequest
     */
    invalidationFlow: string;
    /**
     *
     * @type {Array<string>}
     * @memberof RadiusProviderRequest
     */
    propertyMappings?: Array<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 RadiusProviderRequest
     */
    clientNetworks?: string;
    /**
     * Shared secret between clients and server to hash packets.
     * @type {string}
     * @memberof RadiusProviderRequest
     */
    sharedSecret?: 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 RadiusProviderRequest
     */
    mfaSupport?: boolean;
    /**
     *
     * @type {string}
     * @memberof RadiusProviderRequest
     */
    certificate?: string | null;
}

/**
 * Check if a given object implements the RadiusProviderRequest interface.
 */
export function instanceOfRadiusProviderRequest(value: object): value is RadiusProviderRequest {
    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;
    return true;
}

export function RadiusProviderRequestFromJSON(json: any): RadiusProviderRequest {
    return RadiusProviderRequestFromJSONTyped(json, false);
}

export function RadiusProviderRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): RadiusProviderRequest {
    if (json == null) {
        return json;
    }
    return {
        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"],
        clientNetworks: json["client_networks"] == null ? undefined : json["client_networks"],
        sharedSecret: json["shared_secret"] == null ? undefined : json["shared_secret"],
        mfaSupport: json["mfa_support"] == null ? undefined : json["mfa_support"],
        certificate: json["certificate"] == null ? undefined : json["certificate"],
    };
}

export function RadiusProviderRequestToJSON(json: any): RadiusProviderRequest {
    return RadiusProviderRequestToJSONTyped(json, false);
}

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