/* 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.
 */

import type { EnrollmentToken } from "./EnrollmentToken";
import { EnrollmentTokenFromJSON, EnrollmentTokenToJSON } from "./EnrollmentToken";
import type { Pagination } from "./Pagination";
import { PaginationFromJSON, PaginationToJSON } from "./Pagination";

/**
 *
 * @export
 * @interface PaginatedEnrollmentTokenList
 */
export interface PaginatedEnrollmentTokenList {
    /**
     *
     * @type {Pagination}
     * @memberof PaginatedEnrollmentTokenList
     */
    pagination: Pagination;
    /**
     *
     * @type {Array<EnrollmentToken>}
     * @memberof PaginatedEnrollmentTokenList
     */
    results: Array<EnrollmentToken>;
    /**
     *
     * @type {{ [key: string]: any; }}
     * @memberof PaginatedEnrollmentTokenList
     */
    autocomplete: { [key: string]: any };
}

/**
 * Check if a given object implements the PaginatedEnrollmentTokenList interface.
 */
export function instanceOfPaginatedEnrollmentTokenList(
    value: object,
): value is PaginatedEnrollmentTokenList {
    if (!("pagination" in value) || value["pagination"] === undefined) return false;
    if (!("results" in value) || value["results"] === undefined) return false;
    if (!("autocomplete" in value) || value["autocomplete"] === undefined) return false;
    return true;
}

export function PaginatedEnrollmentTokenListFromJSON(json: any): PaginatedEnrollmentTokenList {
    return PaginatedEnrollmentTokenListFromJSONTyped(json, false);
}

export function PaginatedEnrollmentTokenListFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): PaginatedEnrollmentTokenList {
    if (json == null) {
        return json;
    }
    return {
        pagination: PaginationFromJSON(json["pagination"]),
        results: (json["results"] as Array<any>).map(EnrollmentTokenFromJSON),
        autocomplete: json["autocomplete"],
    };
}

export function PaginatedEnrollmentTokenListToJSON(json: any): PaginatedEnrollmentTokenList {
    return PaginatedEnrollmentTokenListToJSONTyped(json, false);
}

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

    return {
        pagination: PaginationToJSON(value["pagination"]),
        results: (value["results"] as Array<any>).map(EnrollmentTokenToJSON),
        autocomplete: value["autocomplete"],
    };
}
