/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.10.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 { mapValues } from '../runtime';
import type { ProviderEnum } from './ProviderEnum';
import {
    ProviderEnumFromJSON,
    ProviderEnumFromJSONTyped,
    ProviderEnumToJSON,
    ProviderEnumToJSONTyped,
} from './ProviderEnum';
import type { FlowSetRequest } from './FlowSetRequest';
import {
    FlowSetRequestFromJSON,
    FlowSetRequestFromJSONTyped,
    FlowSetRequestToJSON,
    FlowSetRequestToJSONTyped,
} from './FlowSetRequest';
import type { AuthTypeEnum } from './AuthTypeEnum';
import {
    AuthTypeEnumFromJSON,
    AuthTypeEnumFromJSONTyped,
    AuthTypeEnumToJSON,
    AuthTypeEnumToJSONTyped,
} from './AuthTypeEnum';

/**
 * AuthenticatorSMSStage Serializer
 * @export
 * @interface AuthenticatorSMSStageRequest
 */
export interface AuthenticatorSMSStageRequest {
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorSMSStageRequest
     */
    name: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof AuthenticatorSMSStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage.
     * @type {string}
     * @memberof AuthenticatorSMSStageRequest
     */
    configureFlow?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorSMSStageRequest
     */
    friendlyName?: string | null;
    /**
     * 
     * @type {ProviderEnum}
     * @memberof AuthenticatorSMSStageRequest
     */
    provider: ProviderEnum;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorSMSStageRequest
     */
    fromNumber: string;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorSMSStageRequest
     */
    accountSid: string;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorSMSStageRequest
     */
    auth: string;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorSMSStageRequest
     */
    authPassword?: string;
    /**
     * 
     * @type {AuthTypeEnum}
     * @memberof AuthenticatorSMSStageRequest
     */
    authType?: AuthTypeEnum;
    /**
     * When enabled, the Phone number is only used during enrollment to verify the users authenticity. Only a hash of the phone number is saved to ensure it is not reused in the future.
     * @type {boolean}
     * @memberof AuthenticatorSMSStageRequest
     */
    verifyOnly?: boolean;
    /**
     * Optionally modify the payload being sent to custom providers.
     * @type {string}
     * @memberof AuthenticatorSMSStageRequest
     */
    mapping?: string | null;
}



/**
 * Check if a given object implements the AuthenticatorSMSStageRequest interface.
 */
export function instanceOfAuthenticatorSMSStageRequest(value: object): value is AuthenticatorSMSStageRequest {
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('provider' in value) || value['provider'] === undefined) return false;
    if (!('fromNumber' in value) || value['fromNumber'] === undefined) return false;
    if (!('accountSid' in value) || value['accountSid'] === undefined) return false;
    if (!('auth' in value) || value['auth'] === undefined) return false;
    return true;
}

export function AuthenticatorSMSStageRequestFromJSON(json: any): AuthenticatorSMSStageRequest {
    return AuthenticatorSMSStageRequestFromJSONTyped(json, false);
}

export function AuthenticatorSMSStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthenticatorSMSStageRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'],
        'flowSet': json['flow_set'] == null ? undefined : ((json['flow_set'] as Array<any>).map(FlowSetRequestFromJSON)),
        'configureFlow': json['configure_flow'] == null ? undefined : json['configure_flow'],
        'friendlyName': json['friendly_name'] == null ? undefined : json['friendly_name'],
        'provider': ProviderEnumFromJSON(json['provider']),
        'fromNumber': json['from_number'],
        'accountSid': json['account_sid'],
        'auth': json['auth'],
        'authPassword': json['auth_password'] == null ? undefined : json['auth_password'],
        'authType': json['auth_type'] == null ? undefined : AuthTypeEnumFromJSON(json['auth_type']),
        'verifyOnly': json['verify_only'] == null ? undefined : json['verify_only'],
        'mapping': json['mapping'] == null ? undefined : json['mapping'],
    };
}

export function AuthenticatorSMSStageRequestToJSON(json: any): AuthenticatorSMSStageRequest {
    return AuthenticatorSMSStageRequestToJSONTyped(json, false);
}

export function AuthenticatorSMSStageRequestToJSONTyped(value?: AuthenticatorSMSStageRequest | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'name': value['name'],
        'flow_set': value['flowSet'] == null ? undefined : ((value['flowSet'] as Array<any>).map(FlowSetRequestToJSON)),
        'configure_flow': value['configureFlow'],
        'friendly_name': value['friendlyName'],
        'provider': ProviderEnumToJSON(value['provider']),
        'from_number': value['fromNumber'],
        'account_sid': value['accountSid'],
        'auth': value['auth'],
        'auth_password': value['authPassword'],
        'auth_type': AuthTypeEnumToJSON(value['authType']),
        'verify_only': value['verifyOnly'],
        'mapping': value['mapping'],
    };
}

