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

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

export function AuthenticatorEmailStageRequestFromJSON(json: any): AuthenticatorEmailStageRequest {
    return AuthenticatorEmailStageRequestFromJSONTyped(json, false);
}

export function AuthenticatorEmailStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthenticatorEmailStageRequest {
    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'],
        '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 AuthenticatorEmailStageRequestToJSON(json: any): AuthenticatorEmailStageRequest {
    return AuthenticatorEmailStageRequestToJSONTyped(json, false);
}

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

