/* tslint:disable */
/* eslint-disable */
/**
 * OmsorgCore.Api
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0
 * 
 *
 * 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 { PermissionDto } from './PermissionDto';
import {
    PermissionDtoFromJSON,
    PermissionDtoFromJSONTyped,
    PermissionDtoToJSON,
    PermissionDtoToJSONTyped,
} from './PermissionDto';

/**
 * 
 * @export
 * @interface RolePermissionsResponse
 */
export interface RolePermissionsResponse {
    /**
     * 
     * @type {string}
     * @memberof RolePermissionsResponse
     */
    id?: string;
    /**
     * 
     * @type {string}
     * @memberof RolePermissionsResponse
     */
    name?: string | null;
    /**
     * 
     * @type {Array<PermissionDto>}
     * @memberof RolePermissionsResponse
     */
    permissions?: Array<PermissionDto> | null;
}

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

export function RolePermissionsResponseFromJSON(json: any): RolePermissionsResponse {
    return RolePermissionsResponseFromJSONTyped(json, false);
}

export function RolePermissionsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RolePermissionsResponse {
    if (json == null) {
        return json;
    }
    return {
        
        'id': json['id'] == null ? undefined : json['id'],
        'name': json['name'] == null ? undefined : json['name'],
        'permissions': json['permissions'] == null ? undefined : ((json['permissions'] as Array<any>).map(PermissionDtoFromJSON)),
    };
}

export function RolePermissionsResponseToJSON(json: any): RolePermissionsResponse {
    return RolePermissionsResponseToJSONTyped(json, false);
}

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

    return {
        
        'id': value['id'],
        'name': value['name'],
        'permissions': value['permissions'] == null ? undefined : ((value['permissions'] as Array<any>).map(PermissionDtoToJSON)),
    };
}

