/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.6.4
 * 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';

/**
 * EmailStage Serializer
 * @export
 * @interface PatchedEmailStageRequest
 */
export interface PatchedEmailStageRequest {
    /**
     * 
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    name?: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof PatchedEmailStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * When enabled, global Email connection settings will be used and connection settings below will be ignored.
     * @type {boolean}
     * @memberof PatchedEmailStageRequest
     */
    useGlobalSettings?: boolean;
    /**
     * 
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    host?: string;
    /**
     * 
     * @type {number}
     * @memberof PatchedEmailStageRequest
     */
    port?: number;
    /**
     * 
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    username?: string;
    /**
     * 
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    password?: string;
    /**
     * 
     * @type {boolean}
     * @memberof PatchedEmailStageRequest
     */
    useTls?: boolean;
    /**
     * 
     * @type {boolean}
     * @memberof PatchedEmailStageRequest
     */
    useSsl?: boolean;
    /**
     * 
     * @type {number}
     * @memberof PatchedEmailStageRequest
     */
    timeout?: number;
    /**
     * 
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    fromAddress?: string;
    /**
     * Time the token sent is valid (Format: hours=3,minutes=17,seconds=300).
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    tokenExpiry?: string;
    /**
     * 
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    subject?: string;
    /**
     * 
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    template?: string;
    /**
     * Activate users upon completion of stage.
     * @type {boolean}
     * @memberof PatchedEmailStageRequest
     */
    activateUserOnSuccess?: boolean;
}

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

export function PatchedEmailStageRequestFromJSON(json: any): PatchedEmailStageRequest {
    return PatchedEmailStageRequestFromJSONTyped(json, false);
}

export function PatchedEmailStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedEmailStageRequest {
    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)),
        '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'],
        'tokenExpiry': json['token_expiry'] == null ? undefined : json['token_expiry'],
        'subject': json['subject'] == null ? undefined : json['subject'],
        'template': json['template'] == null ? undefined : json['template'],
        'activateUserOnSuccess': json['activate_user_on_success'] == null ? undefined : json['activate_user_on_success'],
    };
}

export function PatchedEmailStageRequestToJSON(json: any): PatchedEmailStageRequest {
    return PatchedEmailStageRequestToJSONTyped(json, false);
}

export function PatchedEmailStageRequestToJSONTyped(value?: PatchedEmailStageRequest | 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)),
        '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'],
        'token_expiry': value['tokenExpiry'],
        'subject': value['subject'],
        'template': value['template'],
        'activate_user_on_success': value['activateUserOnSuccess'],
    };
}

