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



    /**
     * Finds a code
     * Finds a code
     * @param {String} codeId Id of the code
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Code}
     */
    this.findCode = function(codeId) {
      var postBody = null;

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


      var pathParams = {
        'codeId': codeId
      };
      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 = Code;

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


    /**
     * Lists codes
     * Lists codes
     * @param {Object} opts Optional parameters
     * @param {Array.<String>} opts.types Filter results by types
     * @param {String} opts.search Search codes by free-text query
     * @param {String} opts.sortBy define order (NATURAL or SCORE). Default is SCORE
     * @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/Code>}
     */
    this.listCodes = function(opts) {
      opts = opts || {};
      var postBody = null;


      var pathParams = {
      };
      var queryParams = {
        'types': this.apiClient.buildCollectionParam(opts['types'], 'csv'),
        '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 = [Code];

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



    /**
     * Finds a code
     * Finds a code
     * @param {String} codeId Id of the code
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Code}
     */
    this.findCode = function(codeId) {
      var postBody = null;

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


      var pathParams = {
        'codeId': codeId
      };
      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 = Code;

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


    /**
     * Lists codes
     * Lists codes
     * @param {Object} opts Optional parameters
     * @param {Array.<String>} opts.types Filter results by types
     * @param {String} opts.search Search codes by free-text query
     * @param {String} opts.sortBy define order (NATURAL or SCORE). Default is SCORE
     * @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/Code>}
     */
    this.listCodes = function(opts) {
      opts = opts || {};
      var postBody = null;


      var pathParams = {
      };
      var queryParams = {
        'types': this.apiClient.buildCollectionParam(opts['types'], 'csv'),
        '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 = [Code];

      return this.apiClient.callApi(
        '/codes', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType
      );
    }
  }
function ( apiClient ) { this . apiClient = apiClient || ApiClient . instance ; /**
     * Finds a code
     * Finds a code
     * @param {String} codeId Id of the code
     * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Code}
     */ this . findCode = function ( codeId ) { var postBody = null ; // verify the required parameter 'codeId' is set if ( codeId == undefined || codeId == null ) { throw "Missing the required parameter 'codeId' when calling findCode" ; } var pathParams = { 'codeId' : codeId } ; 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 = Code ; return this . apiClient . callApi ( '/codes/{codeId}' , 'GET' , pathParams , queryParams , headerParams , formParams , postBody , authNames , contentTypes , accepts , returnType ) ; } /**
     * Lists codes
     * Lists codes
     * @param {Object} opts Optional parameters
     * @param {Array.<String>} opts.types Filter results by types
     * @param {String} opts.search Search codes by free-text query
     * @param {String} opts.sortBy define order (NATURAL or SCORE). Default is SCORE
     * @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/Code>}
     */ this . listCodes = function ( opts ) { opts = opts || { } ; var postBody = null ; var pathParams = { } ; var queryParams = { 'types' : this . apiClient . buildCollectionParam ( opts [ 'types' ] , 'csv' ) , '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 = [ Code ] ; return this . apiClient . callApi ( '/codes' , 'GET' , pathParams , queryParams , headerParams , formParams , postBody , authNames , contentTypes , accepts , returnType ) ; } }
Codes service.
@module api/CodesApi
@version 0.0.139
 
Constructs a new CodesApi.
@alias module:api/CodesApi
@class
@param {module:ApiClient} apiClient Optional API client implementation to use,
default to {@link module:ApiClient#instance} if unspecified.
Codes service .