"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.12.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.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfUser = instanceOfUser;
exports.UserFromJSON = UserFromJSON;
exports.UserFromJSONTyped = UserFromJSONTyped;
exports.UserToJSON = UserToJSON;
exports.UserToJSONTyped = UserToJSONTyped;
const UserTypeEnum_1 = require("./UserTypeEnum");
const PartialGroup_1 = require("./PartialGroup");
/**
 * Check if a given object implements the User interface.
 */
function instanceOfUser(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 (!('dateJoined' in value) || value['dateJoined'] === undefined)
        return false;
    if (!('isSuperuser' in value) || value['isSuperuser'] === undefined)
        return false;
    if (!('groupsObj' in value) || value['groupsObj'] === undefined)
        return false;
    if (!('avatar' in value) || value['avatar'] === undefined)
        return false;
    if (!('uid' in value) || value['uid'] === undefined)
        return false;
    if (!('uuid' in value) || value['uuid'] === undefined)
        return false;
    if (!('passwordChangeDate' in value) || value['passwordChangeDate'] === undefined)
        return false;
    if (!('lastUpdated' in value) || value['lastUpdated'] === undefined)
        return false;
    return true;
}
function UserFromJSON(json) {
    return UserFromJSONTyped(json, false);
}
function UserFromJSONTyped(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'])),
        'dateJoined': (new Date(json['date_joined'])),
        'isSuperuser': json['is_superuser'],
        'groups': json['groups'] == null ? undefined : json['groups'],
        'groupsObj': (json['groups_obj'] == null ? null : json['groups_obj'].map(PartialGroup_1.PartialGroupFromJSON)),
        'email': json['email'] == null ? undefined : json['email'],
        'avatar': json['avatar'],
        'attributes': json['attributes'] == null ? undefined : json['attributes'],
        'uid': json['uid'],
        'path': json['path'] == null ? undefined : json['path'],
        'type': json['type'] == null ? undefined : (0, UserTypeEnum_1.UserTypeEnumFromJSON)(json['type']),
        'uuid': json['uuid'],
        'passwordChangeDate': (new Date(json['password_change_date'])),
        'lastUpdated': (new Date(json['last_updated'])),
    };
}
function UserToJSON(json) {
    return UserToJSONTyped(json, false);
}
function UserToJSONTyped(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(),
        'groups': value['groups'],
        'email': value['email'],
        'attributes': value['attributes'],
        'path': value['path'],
        'type': (0, UserTypeEnum_1.UserTypeEnumToJSON)(value['type']),
    };
}
//# sourceMappingURL=User.js.map