/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.5.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.
 */

/**
 * Base serializer class which doesn't implement create/update methods
 * @export
 * @interface AgentTokenResponse
 */
export interface AgentTokenResponse {
    /**
     *
     * @type {string}
     * @memberof AgentTokenResponse
     */
    token: string;
    /**
     *
     * @type {number}
     * @memberof AgentTokenResponse
     */
    expiresIn?: number;
}

/**
 * Check if a given object implements the AgentTokenResponse interface.
 */
export function instanceOfAgentTokenResponse(value: object): value is AgentTokenResponse {
    if (!("token" in value) || value["token"] === undefined) return false;
    return true;
}

export function AgentTokenResponseFromJSON(json: any): AgentTokenResponse {
    return AgentTokenResponseFromJSONTyped(json, false);
}

export function AgentTokenResponseFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): AgentTokenResponse {
    if (json == null) {
        return json;
    }
    return {
        token: json["token"],
        expiresIn: json["expires_in"] == null ? undefined : json["expires_in"],
    };
}

export function AgentTokenResponseToJSON(json: any): AgentTokenResponse {
    return AgentTokenResponseToJSONTyped(json, false);
}

export function AgentTokenResponseToJSONTyped(
    value?: AgentTokenResponse | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        token: value["token"],
        expires_in: value["expiresIn"],
    };
}
