"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.instanceOfExpiringBaseGrantModel = instanceOfExpiringBaseGrantModel;
exports.ExpiringBaseGrantModelFromJSON = ExpiringBaseGrantModelFromJSON;
exports.ExpiringBaseGrantModelFromJSONTyped = ExpiringBaseGrantModelFromJSONTyped;
exports.ExpiringBaseGrantModelToJSON = ExpiringBaseGrantModelToJSON;
exports.ExpiringBaseGrantModelToJSONTyped = ExpiringBaseGrantModelToJSONTyped;
const User_1 = require("./User");
const OAuth2Provider_1 = require("./OAuth2Provider");
/**
 * Check if a given object implements the ExpiringBaseGrantModel interface.
 */
function instanceOfExpiringBaseGrantModel(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;
    return true;
}
function ExpiringBaseGrantModelFromJSON(json) {
    return ExpiringBaseGrantModelFromJSONTyped(json, false);
}
function ExpiringBaseGrantModelFromJSONTyped(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'],
    };
}
function ExpiringBaseGrantModelToJSON(json) {
    return ExpiringBaseGrantModelToJSONTyped(json, false);
}
function ExpiringBaseGrantModelToJSONTyped(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'],
    };
}
//# sourceMappingURL=ExpiringBaseGrantModel.js.map