"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.2.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.instanceOfTokenModel = instanceOfTokenModel;
exports.TokenModelFromJSON = TokenModelFromJSON;
exports.TokenModelFromJSONTyped = TokenModelFromJSONTyped;
exports.TokenModelToJSON = TokenModelToJSON;
exports.TokenModelToJSONTyped = TokenModelToJSONTyped;
const User_1 = require("./User");
const OAuth2Provider_1 = require("./OAuth2Provider");
/**
 * Check if a given object implements the TokenModel interface.
 */
function instanceOfTokenModel(value) {
    if (!('pk' in value) || value['pk'] === undefined)
        return false;
    if (!('provider' in value) || value['provider'] === undefined)
        return false;
    if (!('user' in value) || value['user'] === undefined)
        return false;
    if (!('isExpired' in value) || value['isExpired'] === undefined)
        return false;
    if (!('scope' in value) || value['scope'] === undefined)
        return false;
    if (!('idToken' in value) || value['idToken'] === undefined)
        return false;
    return true;
}
function TokenModelFromJSON(json) {
    return TokenModelFromJSONTyped(json, false);
}
function TokenModelFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        'pk': json['pk'],
        'provider': (0, OAuth2Provider_1.OAuth2ProviderFromJSON)(json['provider']),
        'user': (0, User_1.UserFromJSON)(json['user']),
        'isExpired': json['is_expired'],
        'expires': json['expires'] == null ? undefined : (new Date(json['expires'])),
        'scope': json['scope'],
        'idToken': json['id_token'],
        'revoked': json['revoked'] == null ? undefined : json['revoked'],
    };
}
function TokenModelToJSON(json) {
    return TokenModelToJSONTyped(json, false);
}
function TokenModelToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    return {
        'provider': (0, OAuth2Provider_1.OAuth2ProviderToJSON)(value['provider']),
        'user': (0, User_1.UserToJSON)(value['user']),
        'expires': value['expires'] == null ? value['expires'] : value['expires'].toISOString(),
        'scope': value['scope'],
        'revoked': value['revoked'],
    };
}
//# sourceMappingURL=TokenModel.js.map