/* 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 PatchedAuthenticatorSMSStageRequest
 */
export interface PatchedAuthenticatorSMSStageRequest {
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorSMSStageRequest
     */
    name?: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof PatchedAuthenticatorSMSStageRequest
     */
    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 PatchedAuthenticatorSMSStageRequest
     */
    configureFlow?: string | null;
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorSMSStageRequest
     */
    friendlyName?: string | null;
    /**
     * 
     * @type {ProviderEnum}
     * @memberof PatchedAuthenticatorSMSStageRequest
     */
    provider?: ProviderEnum;
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorSMSStageRequest
     */
    fromNumber?: string;
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorSMSStageRequest
     */
    accountSid?: string;
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorSMSStageRequest
     */
    auth?: string;
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorSMSStageRequest
     */
    authPassword?: string;
    /**
     * 
     * @type {AuthTypeEnum}
     * @memberof PatchedAuthenticatorSMSStageRequest
     */
    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 PatchedAuthenticatorSMSStageRequest
     */
    verifyOnly?: boolean;
    /**
     * Optionally modify the payload being sent to custom providers.
     * @type {string}
     * @memberof PatchedAuthenticatorSMSStageRequest
     */
    mapping?: string | null;
}



/**
 * Check if a given object implements the PatchedAuthenticatorSMSStageRequest interface.
 */
export function instanceOfPatchedAuthenticatorSMSStageRequest(value: object): value is PatchedAuthenticatorSMSStageRequest {
    return true;
}

export function PatchedAuthenticatorSMSStageRequestFromJSON(json: any): PatchedAuthenticatorSMSStageRequest {
    return PatchedAuthenticatorSMSStageRequestFromJSONTyped(json, false);
}

export function PatchedAuthenticatorSMSStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedAuthenticatorSMSStageRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'] == null ? undefined : 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': json['provider'] == null ? undefined : ProviderEnumFromJSON(json['provider']),
        'fromNumber': json['from_number'] == null ? undefined : json['from_number'],
        'accountSid': json['account_sid'] == null ? undefined : json['account_sid'],
        'auth': json['auth'] == null ? undefined : 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 PatchedAuthenticatorSMSStageRequestToJSON(json: any): PatchedAuthenticatorSMSStageRequest {
    return PatchedAuthenticatorSMSStageRequestToJSONTyped(json, false);
}

export function PatchedAuthenticatorSMSStageRequestToJSONTyped(value?: PatchedAuthenticatorSMSStageRequest | 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'],
    };
}

