"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.2.0-rc5
 * 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.instanceOfToken = instanceOfToken;
exports.TokenFromJSON = TokenFromJSON;
exports.TokenFromJSONTyped = TokenFromJSONTyped;
exports.TokenToJSON = TokenToJSON;
exports.TokenToJSONTyped = TokenToJSONTyped;
const IntentEnum_1 = require("./IntentEnum");
const User_1 = require("./User");
/**
 * Check if a given object implements the Token interface.
 */
function instanceOfToken(value) {
    if (!('pk' in value) || value['pk'] === undefined)
        return false;
    if (!('identifier' in value) || value['identifier'] === undefined)
        return false;
    if (!('userObj' in value) || value['userObj'] === undefined)
        return false;
    return true;
}
function TokenFromJSON(json) {
    return TokenFromJSONTyped(json, false);
}
function TokenFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        'pk': json['pk'],
        'managed': json['managed'] == null ? undefined : json['managed'],
        'identifier': json['identifier'],
        'intent': json['intent'] == null ? undefined : (0, IntentEnum_1.IntentEnumFromJSON)(json['intent']),
        'user': json['user'] == null ? undefined : json['user'],
        'userObj': (0, User_1.UserFromJSON)(json['user_obj']),
        'description': json['description'] == null ? undefined : json['description'],
        'expires': json['expires'] == null ? undefined : (new Date(json['expires'])),
        'expiring': json['expiring'] == null ? undefined : json['expiring'],
    };
}
function TokenToJSON(json) {
    return TokenToJSONTyped(json, false);
}
function TokenToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    return {
        'managed': value['managed'],
        'identifier': value['identifier'],
        'intent': (0, IntentEnum_1.IntentEnumToJSON)(value['intent']),
        'user': value['user'],
        'description': value['description'],
        'expires': value['expires'] == null ? value['expires'] : value['expires'].toISOString(),
        'expiring': value['expiring'],
    };
}
//# sourceMappingURL=Token.js.map