/* 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";
/**
 *
 * @export
 * @interface DtoCreateServerRequest
 */
export interface DtoCreateServerRequest {
  /**
   *
   * @type {string}
   * @memberof DtoCreateServerRequest
   */
  hostname?: string;
  /**
   *
   * @type {string}
   * @memberof DtoCreateServerRequest
   */
  private_ip_address?: string;
  /**
   *
   * @type {string}
   * @memberof DtoCreateServerRequest
   */
  public_ip_address?: string;
  /**
   *
   * @type {string}
   * @memberof DtoCreateServerRequest
   */
  role?: DtoCreateServerRequestRoleEnum;
  /**
   *
   * @type {string}
   * @memberof DtoCreateServerRequest
   */
  ssh_key_id?: string;
  /**
   *
   * @type {string}
   * @memberof DtoCreateServerRequest
   */
  ssh_user?: string;
  /**
   *
   * @type {string}
   * @memberof DtoCreateServerRequest
   */
  status?: DtoCreateServerRequestStatusEnum;
}

/**
 * @export
 */
export const DtoCreateServerRequestRoleEnum = {
  master: "master",
  worker: "worker",
  bastion: "bastion",
} as const;
export type DtoCreateServerRequestRoleEnum =
  (typeof DtoCreateServerRequestRoleEnum)[keyof typeof DtoCreateServerRequestRoleEnum];

/**
 * @export
 */
export const DtoCreateServerRequestStatusEnum = {
  pending: "pending",
  provisioning: "provisioning",
  ready: "ready",
  failed: "failed",
} as const;
export type DtoCreateServerRequestStatusEnum =
  (typeof DtoCreateServerRequestStatusEnum)[keyof typeof DtoCreateServerRequestStatusEnum];

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

export function DtoCreateServerRequestFromJSON(
  json: any,
): DtoCreateServerRequest {
  return DtoCreateServerRequestFromJSONTyped(json, false);
}

export function DtoCreateServerRequestFromJSONTyped(
  json: any,
  ignoreDiscriminator: boolean,
): DtoCreateServerRequest {
  if (json == null) {
    return json;
  }
  return {
    hostname: json["hostname"] == null ? undefined : json["hostname"],
    private_ip_address:
      json["private_ip_address"] == null
        ? undefined
        : json["private_ip_address"],
    public_ip_address:
      json["public_ip_address"] == null ? undefined : json["public_ip_address"],
    role: json["role"] == null ? undefined : json["role"],
    ssh_key_id: json["ssh_key_id"] == null ? undefined : json["ssh_key_id"],
    ssh_user: json["ssh_user"] == null ? undefined : json["ssh_user"],
    status: json["status"] == null ? undefined : json["status"],
  };
}

export function DtoCreateServerRequestToJSON(
  json: any,
): DtoCreateServerRequest {
  return DtoCreateServerRequestToJSONTyped(json, false);
}

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

  return {
    hostname: value["hostname"],
    private_ip_address: value["private_ip_address"],
    public_ip_address: value["public_ip_address"],
    role: value["role"],
    ssh_key_id: value["ssh_key_id"],
    ssh_user: value["ssh_user"],
    status: value["status"],
  };
}
