/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.5.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.
 */

/**
 * Role-bound object level permission
 * @export
 * @interface RoleModelPermission
 */
export interface RoleModelPermission {
    /**
     *
     * @type {number}
     * @memberof RoleModelPermission
     */
    readonly id: number;
    /**
     *
     * @type {string}
     * @memberof RoleModelPermission
     */
    readonly codename: string;
    /**
     *
     * @type {string}
     * @memberof RoleModelPermission
     */
    readonly model: string;
    /**
     *
     * @type {string}
     * @memberof RoleModelPermission
     */
    readonly appLabel: string;
    /**
     *
     * @type {string}
     * @memberof RoleModelPermission
     */
    readonly name: string;
}

/**
 * Check if a given object implements the RoleModelPermission interface.
 */
export function instanceOfRoleModelPermission(value: object): value is RoleModelPermission {
    if (!("id" in value) || value["id"] === undefined) return false;
    if (!("codename" in value) || value["codename"] === undefined) return false;
    if (!("model" in value) || value["model"] === undefined) return false;
    if (!("appLabel" in value) || value["appLabel"] === undefined) return false;
    if (!("name" in value) || value["name"] === undefined) return false;
    return true;
}

export function RoleModelPermissionFromJSON(json: any): RoleModelPermission {
    return RoleModelPermissionFromJSONTyped(json, false);
}

export function RoleModelPermissionFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): RoleModelPermission {
    if (json == null) {
        return json;
    }
    return {
        id: json["id"],
        codename: json["codename"],
        model: json["model"],
        appLabel: json["app_label"],
        name: json["name"],
    };
}

export function RoleModelPermissionToJSON(json: any): RoleModelPermission {
    return RoleModelPermissionToJSONTyped(json, false);
}

export function RoleModelPermissionToJSONTyped(
    value?: Omit<RoleModelPermission, "id" | "codename" | "model" | "app_label" | "name"> | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {};
}
