/* tslint:disable */
/* eslint-disable */
/**
 * AutoGlue API
 * API for managing K3s clusters across cloud providers
 *
 * The version of the OpenAPI document: dev
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { mapValues } from "../runtime";
import type { DtoJob } from "./DtoJob";
import {
  DtoJobFromJSON,
  DtoJobFromJSONTyped,
  DtoJobToJSON,
  DtoJobToJSONTyped,
} from "./DtoJob";

/**
 *
 * @export
 * @interface DtoPageJob
 */
export interface DtoPageJob {
  /**
   *
   * @type {Array<DtoJob>}
   * @memberof DtoPageJob
   */
  items?: Array<DtoJob>;
  /**
   *
   * @type {number}
   * @memberof DtoPageJob
   */
  page?: number;
  /**
   *
   * @type {number}
   * @memberof DtoPageJob
   */
  page_size?: number;
  /**
   *
   * @type {number}
   * @memberof DtoPageJob
   */
  total?: number;
}

/**
 * Check if a given object implements the DtoPageJob interface.
 */
export function instanceOfDtoPageJob(value: object): value is DtoPageJob {
  return true;
}

export function DtoPageJobFromJSON(json: any): DtoPageJob {
  return DtoPageJobFromJSONTyped(json, false);
}

export function DtoPageJobFromJSONTyped(
  json: any,
  ignoreDiscriminator: boolean,
): DtoPageJob {
  if (json == null) {
    return json;
  }
  return {
    items:
      json["items"] == null
        ? undefined
        : (json["items"] as Array<any>).map(DtoJobFromJSON),
    page: json["page"] == null ? undefined : json["page"],
    page_size: json["page_size"] == null ? undefined : json["page_size"],
    total: json["total"] == null ? undefined : json["total"],
  };
}

export function DtoPageJobToJSON(json: any): DtoPageJob {
  return DtoPageJobToJSONTyped(json, false);
}

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

  return {
    items:
      value["items"] == null
        ? undefined
        : (value["items"] as Array<any>).map(DtoJobToJSON),
    page: value["page"],
    page_size: value["page_size"],
    total: value["total"],
  };
}
