Source: model/CreatePreviewEndpointRequest.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 {ForkOf} from './ForkOf';

/**
 * The CreatePreviewEndpointRequest model module.
 * @module model/CreatePreviewEndpointRequest
 */
export class CreatePreviewEndpointRequest {
  /**
   * Constructs a new <code>CreatePreviewEndpointRequest</code>.
   * @alias module:model/CreatePreviewEndpointRequest
   * @class
   * @param routeType {String} RouteType is one of 'static' or 'fork'. If you choose a route of type 'static', this preview endpoint will route traffic to the Host / Port specified. If you choose a route of type 'fork', this preview endpoint will route traffic to a forked entity as specified in forkOf.
   */
  constructor(routeType) {
    this.routeType = routeType;
  }

  /**
   * Constructs a <code>CreatePreviewEndpointRequest</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/CreatePreviewEndpointRequest} obj Optional instance to populate.
   * @return {module:model/CreatePreviewEndpointRequest} The populated <code>CreatePreviewEndpointRequest</code> instance.
   */
  static constructFromObject(data, obj) {
    if (data) {
      obj = obj || new CreatePreviewEndpointRequest();
      if (data.hasOwnProperty('forkOf'))
        obj.forkOf = ForkOf.constructFromObject(data['forkOf']);
      if (data.hasOwnProperty('host'))
        obj.host = ApiClient.convertToType(data['host'], 'String');
      if (data.hasOwnProperty('name'))
        obj.name = ApiClient.convertToType(data['name'], 'String');
      if (data.hasOwnProperty('port'))
        obj.port = ApiClient.convertToType(data['port'], 'Number');
      if (data.hasOwnProperty('protocol'))
        obj.protocol = ApiClient.convertToType(data['protocol'], 'String');
      if (data.hasOwnProperty('routeType'))
        obj.routeType = ApiClient.convertToType(data['routeType'], 'String');
    }
    return obj;
  }
}

/**
 * @member {module:model/ForkOf} forkOf
 */
CreatePreviewEndpointRequest.prototype.forkOf = undefined;

/**
 * Host is the host-name of a service within Kubernetes of the form `service-name.namespace.svc`. Only required when RouteType is 'static'
 * @member {String} host
 */
CreatePreviewEndpointRequest.prototype.host = undefined;

/**
 * Name of this endpoint. If not specified, a name will be generated automatically.
 * @member {String} name
 */
CreatePreviewEndpointRequest.prototype.name = undefined;

/**
 * Port is the port on the above host that the preview will point to. Only required when RouteType is 'static'
 * @member {Number} port
 */
CreatePreviewEndpointRequest.prototype.port = undefined;

/**
 * Protocol of the endpoint that we will be connecting to for this preview URL. One of 'http', 'https', or 'grpc'. If not specified, the default is 'http'.
 * @member {String} protocol
 */
CreatePreviewEndpointRequest.prototype.protocol = undefined;

/**
 * RouteType is one of 'static' or 'fork'. If you choose a route of type 'static', this preview endpoint will route traffic to the Host / Port specified. If you choose a route of type 'fork', this preview endpoint will route traffic to a forked entity as specified in forkOf.
 * @member {String} routeType
 */
CreatePreviewEndpointRequest.prototype.routeType = undefined;