/* 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 { RoleObjectPermission } from './RoleObjectPermission';
import {
    RoleObjectPermissionFromJSON,
    RoleObjectPermissionFromJSONTyped,
    RoleObjectPermissionToJSON,
    RoleObjectPermissionToJSONTyped,
} from './RoleObjectPermission';

/**
 * Roles assigned object permission serializer
 * @export
 * @interface RoleAssignedObjectPermission
 */
export interface RoleAssignedObjectPermission {
    /**
     * 
     * @type {string}
     * @memberof RoleAssignedObjectPermission
     */
    readonly rolePk: string;
    /**
     * 
     * @type {string}
     * @memberof RoleAssignedObjectPermission
     */
    readonly name: string;
    /**
     * 
     * @type {Array<RoleObjectPermission>}
     * @memberof RoleAssignedObjectPermission
     */
    permissions: Array<RoleObjectPermission>;
}

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

export function RoleAssignedObjectPermissionFromJSON(json: any): RoleAssignedObjectPermission {
    return RoleAssignedObjectPermissionFromJSONTyped(json, false);
}

export function RoleAssignedObjectPermissionFromJSONTyped(json: any, ignoreDiscriminator: boolean): RoleAssignedObjectPermission {
    if (json == null) {
        return json;
    }
    return {
        
        'rolePk': json['role_pk'],
        'name': json['name'],
        'permissions': ((json['permissions'] as Array<any>).map(RoleObjectPermissionFromJSON)),
    };
}

export function RoleAssignedObjectPermissionToJSON(json: any): RoleAssignedObjectPermission {
    return RoleAssignedObjectPermissionToJSONTyped(json, false);
}

export function RoleAssignedObjectPermissionToJSONTyped(value?: Omit<RoleAssignedObjectPermission, 'role_pk'|'name'> | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'permissions': ((value['permissions'] as Array<any>).map(RoleObjectPermissionToJSON)),
    };
}

