/* 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 ModelsUser
 */
export interface ModelsUser {
  /**
   *
   * @type {string}
   * @memberof ModelsUser
   */
  avatar_url?: string;
  /**
   *
   * @type {Date}
   * @memberof ModelsUser
   */
  created_at?: Date;
  /**
   *
   * @type {string}
   * @memberof ModelsUser
   */
  display_name?: string;
  /**
   * example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
   * @type {string}
   * @memberof ModelsUser
   */
  id?: string;
  /**
   *
   * @type {boolean}
   * @memberof ModelsUser
   */
  is_admin?: boolean;
  /**
   *
   * @type {boolean}
   * @memberof ModelsUser
   */
  is_disabled?: boolean;
  /**
   *
   * @type {string}
   * @memberof ModelsUser
   */
  primary_email?: string;
  /**
   *
   * @type {Date}
   * @memberof ModelsUser
   */
  updated_at?: Date;
}

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

export function ModelsUserFromJSON(json: any): ModelsUser {
  return ModelsUserFromJSONTyped(json, false);
}

export function ModelsUserFromJSONTyped(
  json: any,
  ignoreDiscriminator: boolean,
): ModelsUser {
  if (json == null) {
    return json;
  }
  return {
    avatar_url: json["avatar_url"] == null ? undefined : json["avatar_url"],
    created_at:
      json["created_at"] == null ? undefined : new Date(json["created_at"]),
    display_name:
      json["display_name"] == null ? undefined : json["display_name"],
    id: json["id"] == null ? undefined : json["id"],
    is_admin: json["is_admin"] == null ? undefined : json["is_admin"],
    is_disabled: json["is_disabled"] == null ? undefined : json["is_disabled"],
    primary_email:
      json["primary_email"] == null ? undefined : json["primary_email"],
    updated_at:
      json["updated_at"] == null ? undefined : new Date(json["updated_at"]),
  };
}

export function ModelsUserToJSON(json: any): ModelsUser {
  return ModelsUserToJSONTyped(json, false);
}

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

  return {
    avatar_url: value["avatar_url"],
    created_at:
      value["created_at"] == null
        ? value["created_at"]
        : value["created_at"].toISOString(),
    display_name: value["display_name"],
    id: value["id"],
    is_admin: value["is_admin"],
    is_disabled: value["is_disabled"],
    primary_email: value["primary_email"],
    updated_at:
      value["updated_at"] == null
        ? value["updated_at"]
        : value["updated_at"].toISOString(),
  };
}
