"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.8.6
 * 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.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfUserAssignedObjectPermission = instanceOfUserAssignedObjectPermission;
exports.UserAssignedObjectPermissionFromJSON = UserAssignedObjectPermissionFromJSON;
exports.UserAssignedObjectPermissionFromJSONTyped = UserAssignedObjectPermissionFromJSONTyped;
exports.UserAssignedObjectPermissionToJSON = UserAssignedObjectPermissionToJSON;
exports.UserAssignedObjectPermissionToJSONTyped = UserAssignedObjectPermissionToJSONTyped;
const UserObjectPermission_1 = require("./UserObjectPermission");
/**
 * Check if a given object implements the UserAssignedObjectPermission interface.
 */
function instanceOfUserAssignedObjectPermission(value) {
    if (!('pk' in value) || value['pk'] === undefined)
        return false;
    if (!('username' in value) || value['username'] === undefined)
        return false;
    if (!('name' in value) || value['name'] === undefined)
        return false;
    if (!('uid' in value) || value['uid'] === undefined)
        return false;
    if (!('permissions' in value) || value['permissions'] === undefined)
        return false;
    if (!('isSuperuser' in value) || value['isSuperuser'] === undefined)
        return false;
    return true;
}
function UserAssignedObjectPermissionFromJSON(json) {
    return UserAssignedObjectPermissionFromJSONTyped(json, false);
}
function UserAssignedObjectPermissionFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        'pk': json['pk'],
        'username': json['username'],
        'name': json['name'],
        'isActive': json['is_active'] == null ? undefined : json['is_active'],
        'lastLogin': json['last_login'] == null ? undefined : (new Date(json['last_login'])),
        'email': json['email'] == null ? undefined : json['email'],
        'attributes': json['attributes'] == null ? undefined : json['attributes'],
        'uid': json['uid'],
        'permissions': (json['permissions'].map(UserObjectPermission_1.UserObjectPermissionFromJSON)),
        'isSuperuser': json['is_superuser'],
    };
}
function UserAssignedObjectPermissionToJSON(json) {
    return UserAssignedObjectPermissionToJSONTyped(json, false);
}
function UserAssignedObjectPermissionToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    return {
        'username': value['username'],
        'name': value['name'],
        'is_active': value['isActive'],
        'last_login': value['lastLogin'] == null ? value['lastLogin'] : value['lastLogin'].toISOString(),
        'email': value['email'],
        'attributes': value['attributes'],
        'permissions': (value['permissions'].map(UserObjectPermission_1.UserObjectPermissionToJSON)),
        'is_superuser': value['isSuperuser'],
    };
}
//# sourceMappingURL=UserAssignedObjectPermission.js.map