Source: model/UpsertPRWorkspacesRequest.js

/*
 * Signadot API
 * API for Signadot Sandboxes
 *
 * OpenAPI spec version: 1.0
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 *
 * Swagger Codegen version: 2.4.25
 *
 * Do not edit the class manually.
 *
 */

import {ApiClient} from '../ApiClient';
import {CreatePreviewEndpointRequest} from './CreatePreviewEndpointRequest';
import {V1ImageReplacement} from './V1ImageReplacement';

/**
 * The UpsertPRWorkspacesRequest model module.
 * @module model/UpsertPRWorkspacesRequest
 */
export class UpsertPRWorkspacesRequest {
  /**
   * Constructs a new <code>UpsertPRWorkspacesRequest</code>.
   * @alias module:model/UpsertPRWorkspacesRequest
   * @class
   * @param cluster {String} Cluster within which this workspace should be created
   * @param namespace {String} Namespace within which this workspace should be created
   */
  constructor(cluster, namespace) {
    this.cluster = cluster;
    this.namespace = namespace;
  }

  /**
   * Constructs a <code>UpsertPRWorkspacesRequest</code> from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {module:model/UpsertPRWorkspacesRequest} obj Optional instance to populate.
   * @return {module:model/UpsertPRWorkspacesRequest} The populated <code>UpsertPRWorkspacesRequest</code> instance.
   */
  static constructFromObject(data, obj) {
    if (data) {
      obj = obj || new UpsertPRWorkspacesRequest();
      if (data.hasOwnProperty('cluster'))
        obj.cluster = ApiClient.convertToType(data['cluster'], 'String');
      if (data.hasOwnProperty('defaultService'))
        obj.defaultService = ApiClient.convertToType(data['defaultService'], 'String');
      if (data.hasOwnProperty('defaultServicePort'))
        obj.defaultServicePort = ApiClient.convertToType(data['defaultServicePort'], 'Number');
      if (data.hasOwnProperty('description'))
        obj.description = ApiClient.convertToType(data['description'], 'String');
      if (data.hasOwnProperty('endpoints'))
        obj.endpoints = ApiClient.convertToType(data['endpoints'], [CreatePreviewEndpointRequest]);
      if (data.hasOwnProperty('headCommit'))
        obj.headCommit = ApiClient.convertToType(data['headCommit'], 'String');
      if (data.hasOwnProperty('images'))
        obj.images = ApiClient.convertToType(data['images'], [V1ImageReplacement]);
      if (data.hasOwnProperty('name'))
        obj.name = ApiClient.convertToType(data['name'], 'String');
      if (data.hasOwnProperty('namespace'))
        obj.namespace = ApiClient.convertToType(data['namespace'], 'String');
    }
    return obj;
  }
}

/**
 * Cluster within which this workspace should be created
 * @member {String} cluster
 */
UpsertPRWorkspacesRequest.prototype.cluster = undefined;

/**
 * Deprecated. use endpoints instead.
 * @member {String} defaultService
 */
UpsertPRWorkspacesRequest.prototype.defaultService = undefined;

/**
 * Deprecated. use endpoints instead.
 * @member {Number} defaultServicePort
 */
UpsertPRWorkspacesRequest.prototype.defaultServicePort = undefined;

/**
 * Description of the purpose of this workspace.
 * @member {String} description
 */
UpsertPRWorkspacesRequest.prototype.description = undefined;

/**
 * Each endpoint specifies a target service or workload corresponding to which a preview URL will be generated.
 * @member {Array.<module:model/CreatePreviewEndpointRequest>} endpoints
 */
UpsertPRWorkspacesRequest.prototype.endpoints = undefined;

/**
 * HeadCommit is the commit hash of the current HEAD of the PR branch. It is automatically computed if not specified but it is recommended that you specify this.
 * @member {String} headCommit
 */
UpsertPRWorkspacesRequest.prototype.headCommit = undefined;

/**
 * Image replacement rules that are used to create the workspace.
 * @member {Array.<module:model/V1ImageReplacement>} images
 */
UpsertPRWorkspacesRequest.prototype.images = undefined;

/**
 * Human-readable name of this workspace
 * @member {String} name
 */
UpsertPRWorkspacesRequest.prototype.name = undefined;

/**
 * Namespace within which this workspace should be created
 * @member {String} namespace
 */
UpsertPRWorkspacesRequest.prototype.namespace = undefined;