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



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

export function PatchedUserWriteStageRequestFromJSON(json: any): PatchedUserWriteStageRequest {
    return PatchedUserWriteStageRequestFromJSONTyped(json, false);
}

export function PatchedUserWriteStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedUserWriteStageRequest {
    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)),
        '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 PatchedUserWriteStageRequestToJSON(json: any): PatchedUserWriteStageRequest {
    return PatchedUserWriteStageRequestToJSONTyped(json, false);
}

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

