/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.12.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 { InitialPermissionsModeEnum } from './InitialPermissionsModeEnum';
import {
    InitialPermissionsModeEnumFromJSON,
    InitialPermissionsModeEnumFromJSONTyped,
    InitialPermissionsModeEnumToJSON,
    InitialPermissionsModeEnumToJSONTyped,
} from './InitialPermissionsModeEnum';

/**
 * InitialPermissions serializer
 * @export
 * @interface PatchedInitialPermissionsRequest
 */
export interface PatchedInitialPermissionsRequest {
    /**
     * 
     * @type {string}
     * @memberof PatchedInitialPermissionsRequest
     */
    name?: string;
    /**
     * 
     * @type {InitialPermissionsModeEnum}
     * @memberof PatchedInitialPermissionsRequest
     */
    mode?: InitialPermissionsModeEnum;
    /**
     * 
     * @type {string}
     * @memberof PatchedInitialPermissionsRequest
     */
    role?: string;
    /**
     * 
     * @type {Array<number>}
     * @memberof PatchedInitialPermissionsRequest
     */
    permissions?: Array<number>;
}



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

export function PatchedInitialPermissionsRequestFromJSON(json: any): PatchedInitialPermissionsRequest {
    return PatchedInitialPermissionsRequestFromJSONTyped(json, false);
}

export function PatchedInitialPermissionsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedInitialPermissionsRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'] == null ? undefined : json['name'],
        'mode': json['mode'] == null ? undefined : InitialPermissionsModeEnumFromJSON(json['mode']),
        'role': json['role'] == null ? undefined : json['role'],
        'permissions': json['permissions'] == null ? undefined : json['permissions'],
    };
}

export function PatchedInitialPermissionsRequestToJSON(json: any): PatchedInitialPermissionsRequest {
    return PatchedInitialPermissionsRequestToJSONTyped(json, false);
}

export function PatchedInitialPermissionsRequestToJSONTyped(value?: PatchedInitialPermissionsRequest | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'name': value['name'],
        'mode': InitialPermissionsModeEnumToJSON(value['mode']),
        'role': value['role'],
        'permissions': value['permissions'],
    };
}

