/* 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 { FlowSetRequest } from './FlowSetRequest';
import {
    FlowSetRequestFromJSON,
    FlowSetRequestFromJSONTyped,
    FlowSetRequestToJSON,
    FlowSetRequestToJSONTyped,
} from './FlowSetRequest';

/**
 * AuthenticatorEmailStage Serializer
 * @export
 * @interface PatchedAuthenticatorEmailStageRequest
 */
export interface PatchedAuthenticatorEmailStageRequest {
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    name?: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    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 PatchedAuthenticatorEmailStageRequest
     */
    configureFlow?: string | null;
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    friendlyName?: string | null;
    /**
     * When enabled, global Email connection settings will be used and connection settings below will be ignored.
     * @type {boolean}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    useGlobalSettings?: boolean;
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    host?: string;
    /**
     * 
     * @type {number}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    port?: number;
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    username?: string;
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    password?: string;
    /**
     * 
     * @type {boolean}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    useTls?: boolean;
    /**
     * 
     * @type {boolean}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    useSsl?: boolean;
    /**
     * 
     * @type {number}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    timeout?: number;
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    fromAddress?: string;
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    subject?: string;
    /**
     * Time the token sent is valid (Format: hours=3,minutes=17,seconds=300).
     * @type {string}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    tokenExpiry?: string;
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorEmailStageRequest
     */
    template?: string;
}

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

export function PatchedAuthenticatorEmailStageRequestFromJSON(json: any): PatchedAuthenticatorEmailStageRequest {
    return PatchedAuthenticatorEmailStageRequestFromJSONTyped(json, false);
}

export function PatchedAuthenticatorEmailStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedAuthenticatorEmailStageRequest {
    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'],
        'useGlobalSettings': json['use_global_settings'] == null ? undefined : json['use_global_settings'],
        'host': json['host'] == null ? undefined : json['host'],
        'port': json['port'] == null ? undefined : json['port'],
        'username': json['username'] == null ? undefined : json['username'],
        'password': json['password'] == null ? undefined : json['password'],
        'useTls': json['use_tls'] == null ? undefined : json['use_tls'],
        'useSsl': json['use_ssl'] == null ? undefined : json['use_ssl'],
        'timeout': json['timeout'] == null ? undefined : json['timeout'],
        'fromAddress': json['from_address'] == null ? undefined : json['from_address'],
        'subject': json['subject'] == null ? undefined : json['subject'],
        'tokenExpiry': json['token_expiry'] == null ? undefined : json['token_expiry'],
        'template': json['template'] == null ? undefined : json['template'],
    };
}

export function PatchedAuthenticatorEmailStageRequestToJSON(json: any): PatchedAuthenticatorEmailStageRequest {
    return PatchedAuthenticatorEmailStageRequestToJSONTyped(json, false);
}

export function PatchedAuthenticatorEmailStageRequestToJSONTyped(value?: PatchedAuthenticatorEmailStageRequest | 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'],
        'use_global_settings': value['useGlobalSettings'],
        'host': value['host'],
        'port': value['port'],
        'username': value['username'],
        'password': value['password'],
        'use_tls': value['useTls'],
        'use_ssl': value['useSsl'],
        'timeout': value['timeout'],
        'from_address': value['fromAddress'],
        'subject': value['subject'],
        'token_expiry': value['tokenExpiry'],
        'template': value['template'],
    };
}

