/* 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 { ModelEnum } from './ModelEnum';
import {
    ModelEnumFromJSON,
    ModelEnumFromJSONTyped,
    ModelEnumToJSON,
    ModelEnumToJSONTyped,
} from './ModelEnum';

/**
 * Request to assign a new permission
 * @export
 * @interface PermissionAssignRequest
 */
export interface PermissionAssignRequest {
    /**
     * 
     * @type {Array<string>}
     * @memberof PermissionAssignRequest
     */
    permissions: Array<string>;
    /**
     * 
     * @type {ModelEnum}
     * @memberof PermissionAssignRequest
     */
    model?: ModelEnum;
    /**
     * 
     * @type {string}
     * @memberof PermissionAssignRequest
     */
    objectPk?: string;
}



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

export function PermissionAssignRequestFromJSON(json: any): PermissionAssignRequest {
    return PermissionAssignRequestFromJSONTyped(json, false);
}

export function PermissionAssignRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PermissionAssignRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'permissions': json['permissions'],
        'model': json['model'] == null ? undefined : ModelEnumFromJSON(json['model']),
        'objectPk': json['object_pk'] == null ? undefined : json['object_pk'],
    };
}

export function PermissionAssignRequestToJSON(json: any): PermissionAssignRequest {
    return PermissionAssignRequestToJSONTyped(json, false);
}

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

    return {
        
        'permissions': value['permissions'],
        'model': ModelEnumToJSON(value['model']),
        'object_pk': value['objectPk'],
    };
}

