javascript-generated/src/api/PhoneServiceChannelsApi.js
function(apiClient) {
    this.apiClient = apiClient || ApiClient.instance;



    /**
     * Finds a phone service channel by id
     * Finds a phone service channel by id
     * @param {String} phoneServiceChannelId Phone service channel id
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PhoneServiceChannel}
     */
    this.findPhoneServiceChannel = function(phoneServiceChannelId) {
      var postBody = null;

      // verify the required parameter 'phoneServiceChannelId' is set
      if (phoneServiceChannelId == undefined || phoneServiceChannelId == null) {
        throw "Missing the required parameter 'phoneServiceChannelId' when calling findPhoneServiceChannel";
      }


      var pathParams = {
        'phoneServiceChannelId': phoneServiceChannelId
      };
      var queryParams = {
      };
      var headerParams = {
      };
      var formParams = {
      };

      var authNames = ['basicAuth'];
      var contentTypes = ['application/json;charset=utf-8'];
      var accepts = ['application/json;charset=utf-8'];
      var returnType = PhoneServiceChannel;

      return this.apiClient.callApi(
        '/phoneServiceChannels/{phoneServiceChannelId}', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType
      );
    }


    /**
     * Lists phone service channels
     * Lists phone service channels
     * @param {Object} opts Optional parameters
     * @param {String} opts.organizationId Organization id
     * @param {String} opts.search Search channels by free-text query
     * @param {String} opts.sortBy define order (NATURAL or SCORE). Default is NATURAL
     * @param {String} opts.sortDir ASC or DESC. Default is ASC
     * @param {Integer} opts.firstResult First result
     * @param {Integer} opts.maxResults Max results
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/PhoneServiceChannel>}
     */
    this.listPhoneServiceChannels = function(opts) {
      opts = opts || {};
      var postBody = null;


      var pathParams = {
      };
      var queryParams = {
        'organizationId': opts['organizationId'],
        'search': opts['search'],
        'sortBy': opts['sortBy'],
        'sortDir': opts['sortDir'],
        'firstResult': opts['firstResult'],
        'maxResults': opts['maxResults']
      };
      var headerParams = {
      };
      var formParams = {
      };

      var authNames = ['basicAuth'];
      var contentTypes = ['application/json;charset=utf-8'];
      var accepts = ['application/json;charset=utf-8'];
      var returnType = [PhoneServiceChannel];

      return this.apiClient.callApi(
        '/phoneServiceChannels', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType
      );
    }


    /**
     * Updates a channel
     * Updates a service channel
     * @param {String} phoneServiceChannelId phone channel id
     * @param {module:model/PhoneServiceChannel} payload New phone service data
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PhoneServiceChannel}
     */
    this.updatePhoneServiceChannel = function(phoneServiceChannelId, payload) {
      var postBody = payload;

      // verify the required parameter 'phoneServiceChannelId' is set
      if (phoneServiceChannelId == undefined || phoneServiceChannelId == null) {
        throw "Missing the required parameter 'phoneServiceChannelId' when calling updatePhoneServiceChannel";
      }

      // verify the required parameter 'payload' is set
      if (payload == undefined || payload == null) {
        throw "Missing the required parameter 'payload' when calling updatePhoneServiceChannel";
      }


      var pathParams = {
        'phoneServiceChannelId': phoneServiceChannelId
      };
      var queryParams = {
      };
      var headerParams = {
      };
      var formParams = {
      };

      var authNames = ['basicAuth'];
      var contentTypes = ['application/json;charset=utf-8'];
      var accepts = ['application/json;charset=utf-8'];
      var returnType = PhoneServiceChannel;

      return this.apiClient.callApi(
        '/phoneServiceChannels/{phoneServiceChannelId}', 'PUT',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType
      );
    }
  }
function(apiClient) {
    this.apiClient = apiClient || ApiClient.instance;



    /**
     * Finds a phone service channel by id
     * Finds a phone service channel by id
     * @param {String} phoneServiceChannelId Phone service channel id
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PhoneServiceChannel}
     */
    this.findPhoneServiceChannel = function(phoneServiceChannelId) {
      var postBody = null;

      // verify the required parameter 'phoneServiceChannelId' is set
      if (phoneServiceChannelId == undefined || phoneServiceChannelId == null) {
        throw "Missing the required parameter 'phoneServiceChannelId' when calling findPhoneServiceChannel";
      }


      var pathParams = {
        'phoneServiceChannelId': phoneServiceChannelId
      };
      var queryParams = {
      };
      var headerParams = {
      };
      var formParams = {
      };

      var authNames = ['basicAuth'];
      var contentTypes = ['application/json;charset=utf-8'];
      var accepts = ['application/json;charset=utf-8'];
      var returnType = PhoneServiceChannel;

      return this.apiClient.callApi(
        '/phoneServiceChannels/{phoneServiceChannelId}', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType
      );
    }


    /**
     * Lists phone service channels
     * Lists phone service channels
     * @param {Object} opts Optional parameters
     * @param {String} opts.organizationId Organization id
     * @param {String} opts.search Search channels by free-text query
     * @param {String} opts.sortBy define order (NATURAL or SCORE). Default is NATURAL
     * @param {String} opts.sortDir ASC or DESC. Default is ASC
     * @param {Integer} opts.firstResult First result
     * @param {Integer} opts.maxResults Max results
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/PhoneServiceChannel>}
     */
    this.listPhoneServiceChannels = function(opts) {
      opts = opts || {};
      var postBody = null;


      var pathParams = {
      };
      var queryParams = {
        'organizationId': opts['organizationId'],
        'search': opts['search'],
        'sortBy': opts['sortBy'],
        'sortDir': opts['sortDir'],
        'firstResult': opts['firstResult'],
        'maxResults': opts['maxResults']
      };
      var headerParams = {
      };
      var formParams = {
      };

      var authNames = ['basicAuth'];
      var contentTypes = ['application/json;charset=utf-8'];
      var accepts = ['application/json;charset=utf-8'];
      var returnType = [PhoneServiceChannel];

      return this.apiClient.callApi(
        '/phoneServiceChannels', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType
      );
    }


    /**
     * Updates a channel
     * Updates a service channel
     * @param {String} phoneServiceChannelId phone channel id
     * @param {module:model/PhoneServiceChannel} payload New phone service data
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PhoneServiceChannel}
     */
    this.updatePhoneServiceChannel = function(phoneServiceChannelId, payload) {
      var postBody = payload;

      // verify the required parameter 'phoneServiceChannelId' is set
      if (phoneServiceChannelId == undefined || phoneServiceChannelId == null) {
        throw "Missing the required parameter 'phoneServiceChannelId' when calling updatePhoneServiceChannel";
      }

      // verify the required parameter 'payload' is set
      if (payload == undefined || payload == null) {
        throw "Missing the required parameter 'payload' when calling updatePhoneServiceChannel";
      }


      var pathParams = {
        'phoneServiceChannelId': phoneServiceChannelId
      };
      var queryParams = {
      };
      var headerParams = {
      };
      var formParams = {
      };

      var authNames = ['basicAuth'];
      var contentTypes = ['application/json;charset=utf-8'];
      var accepts = ['application/json;charset=utf-8'];
      var returnType = PhoneServiceChannel;

      return this.apiClient.callApi(
        '/phoneServiceChannels/{phoneServiceChannelId}', 'PUT',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType
      );
    }
  }
function ( apiClient ) { this . apiClient = apiClient || ApiClient . instance ; /**
     * Finds a phone service channel by id
     * Finds a phone service channel by id
     * @param {String} phoneServiceChannelId Phone service channel id
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PhoneServiceChannel}
     */ this . findPhoneServiceChannel = function ( phoneServiceChannelId ) { var postBody = null ; // verify the required parameter 'phoneServiceChannelId' is set if ( phoneServiceChannelId == undefined || phoneServiceChannelId == null ) { throw "Missing the required parameter 'phoneServiceChannelId' when calling findPhoneServiceChannel" ; } var pathParams = { 'phoneServiceChannelId' : phoneServiceChannelId } ; var queryParams = { } ; var headerParams = { } ; var formParams = { } ; var authNames = [ 'basicAuth' ] ; var contentTypes = [ 'application/json;charset=utf-8' ] ; var accepts = [ 'application/json;charset=utf-8' ] ; var returnType = PhoneServiceChannel ; return this . apiClient . callApi ( '/phoneServiceChannels/{phoneServiceChannelId}' , 'GET' , pathParams , queryParams , headerParams , formParams , postBody , authNames , contentTypes , accepts , returnType ) ; } /**
     * Lists phone service channels
     * Lists phone service channels
     * @param {Object} opts Optional parameters
     * @param {String} opts.organizationId Organization id
     * @param {String} opts.search Search channels by free-text query
     * @param {String} opts.sortBy define order (NATURAL or SCORE). Default is NATURAL
     * @param {String} opts.sortDir ASC or DESC. Default is ASC
     * @param {Integer} opts.firstResult First result
     * @param {Integer} opts.maxResults Max results
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/PhoneServiceChannel>}
     */ this . listPhoneServiceChannels = function ( opts ) { opts = opts || { } ; var postBody = null ; var pathParams = { } ; var queryParams = { 'organizationId' : opts [ 'organizationId' ] , 'search' : opts [ 'search' ] , 'sortBy' : opts [ 'sortBy' ] , 'sortDir' : opts [ 'sortDir' ] , 'firstResult' : opts [ 'firstResult' ] , 'maxResults' : opts [ 'maxResults' ] } ; var headerParams = { } ; var formParams = { } ; var authNames = [ 'basicAuth' ] ; var contentTypes = [ 'application/json;charset=utf-8' ] ; var accepts = [ 'application/json;charset=utf-8' ] ; var returnType = [ PhoneServiceChannel ] ; return this . apiClient . callApi ( '/phoneServiceChannels' , 'GET' , pathParams , queryParams , headerParams , formParams , postBody , authNames , contentTypes , accepts , returnType ) ; } /**
     * Updates a channel
     * Updates a service channel
     * @param {String} phoneServiceChannelId phone channel id
     * @param {module:model/PhoneServiceChannel} payload New phone service data
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PhoneServiceChannel}
     */ this . updatePhoneServiceChannel = function ( phoneServiceChannelId , payload ) { var postBody = payload ; // verify the required parameter 'phoneServiceChannelId' is set if ( phoneServiceChannelId == undefined || phoneServiceChannelId == null ) { throw "Missing the required parameter 'phoneServiceChannelId' when calling updatePhoneServiceChannel" ; } // verify the required parameter 'payload' is set if ( payload == undefined || payload == null ) { throw "Missing the required parameter 'payload' when calling updatePhoneServiceChannel" ; } var pathParams = { 'phoneServiceChannelId' : phoneServiceChannelId } ; var queryParams = { } ; var headerParams = { } ; var formParams = { } ; var authNames = [ 'basicAuth' ] ; var contentTypes = [ 'application/json;charset=utf-8' ] ; var accepts = [ 'application/json;charset=utf-8' ] ; var returnType = PhoneServiceChannel ; return this . apiClient . callApi ( '/phoneServiceChannels/{phoneServiceChannelId}' , 'PUT' , pathParams , queryParams , headerParams , formParams , postBody , authNames , contentTypes , accepts , returnType ) ; } }
PhoneServiceChannels service.
@module api/PhoneServiceChannelsApi
@version 0.0.139
 
Constructs a new PhoneServiceChannelsApi.
@alias module:api/PhoneServiceChannelsApi
@class
@param {module:ApiClient} apiClient Optional API client implementation to use,
default to {@link module:ApiClient#instance} if unspecified.
PhoneServiceChannels service .