/* 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 { UserTypeEnum } from './UserTypeEnum';
import {
    UserTypeEnumFromJSON,
    UserTypeEnumFromJSONTyped,
    UserTypeEnumToJSON,
    UserTypeEnumToJSONTyped,
} from './UserTypeEnum';
import type { FlowSetRequest } from './FlowSetRequest';
import {
    FlowSetRequestFromJSON,
    FlowSetRequestFromJSONTyped,
    FlowSetRequestToJSON,
    FlowSetRequestToJSONTyped,
} from './FlowSetRequest';
import type { UserCreationModeEnum } from './UserCreationModeEnum';
import {
    UserCreationModeEnumFromJSON,
    UserCreationModeEnumFromJSONTyped,
    UserCreationModeEnumToJSON,
    UserCreationModeEnumToJSONTyped,
} from './UserCreationModeEnum';

/**
 * UserWriteStage Serializer
 * @export
 * @interface UserWriteStageRequest
 */
export interface UserWriteStageRequest {
    /**
     * 
     * @type {string}
     * @memberof UserWriteStageRequest
     */
    name: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof UserWriteStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * 
     * @type {UserCreationModeEnum}
     * @memberof UserWriteStageRequest
     */
    userCreationMode?: UserCreationModeEnum;
    /**
     * When set, newly created users are inactive and cannot login.
     * @type {boolean}
     * @memberof UserWriteStageRequest
     */
    createUsersAsInactive?: boolean;
    /**
     * Optionally add newly created users to this group.
     * @type {string}
     * @memberof UserWriteStageRequest
     */
    createUsersGroup?: string | null;
    /**
     * 
     * @type {UserTypeEnum}
     * @memberof UserWriteStageRequest
     */
    userType?: UserTypeEnum;
    /**
     * 
     * @type {string}
     * @memberof UserWriteStageRequest
     */
    userPathTemplate?: string;
}



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

export function UserWriteStageRequestFromJSON(json: any): UserWriteStageRequest {
    return UserWriteStageRequestFromJSONTyped(json, false);
}

export function UserWriteStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserWriteStageRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'],
        'flowSet': json['flow_set'] == null ? undefined : ((json['flow_set'] as Array<any>).map(FlowSetRequestFromJSON)),
        'userCreationMode': json['user_creation_mode'] == null ? undefined : UserCreationModeEnumFromJSON(json['user_creation_mode']),
        'createUsersAsInactive': json['create_users_as_inactive'] == null ? undefined : json['create_users_as_inactive'],
        'createUsersGroup': json['create_users_group'] == null ? undefined : json['create_users_group'],
        'userType': json['user_type'] == null ? undefined : UserTypeEnumFromJSON(json['user_type']),
        'userPathTemplate': json['user_path_template'] == null ? undefined : json['user_path_template'],
    };
}

export function UserWriteStageRequestToJSON(json: any): UserWriteStageRequest {
    return UserWriteStageRequestToJSONTyped(json, false);
}

export function UserWriteStageRequestToJSONTyped(value?: UserWriteStageRequest | 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)),
        'user_creation_mode': UserCreationModeEnumToJSON(value['userCreationMode']),
        'create_users_as_inactive': value['createUsersAsInactive'],
        'create_users_group': value['createUsersGroup'],
        'user_type': UserTypeEnumToJSON(value['userType']),
        'user_path_template': value['userPathTemplate'],
    };
}

