All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Javascript-Apollo.api.mustache Maven / Gradle / Ivy

There is a newer version: 7.6.0
Show newest version
{{>licenseInfo}}

{{=< >=}}

import ApiClient from "../ApiClient";
<#imports>import <&import> from '../<#modelPackage><&modelPackage>/';


<#emitJSDoc>/**
*  service.
* @module <#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/
* @version <&projectVersion>
*/
export default class <&classname> extends ApiClient {

    <#emitJSDoc>/**
    * Constructs a new <&classname>. <#description>
    * 
    * @alias module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/
    * @class
    */
    constructor(baseURL = '<&basePath>') {
      super(baseURL);
    }

<#operations><#operation><#emitJSDoc>
    /**<#summary>
     * <&summary><#notes>
     * <¬es><#allParams><#required>
     * @param {<&vendorExtensions.x-jsdoc-type>} <¶mName> <&description><#hasOptionalParams>
     * @param {Object} opts Optional parameters<#allParams><^required>
     * @param {<&vendorExtensions.x-jsdoc-type>} opts.<¶mName> <&description><#defaultValue> (default to <&.>)
     * @param requestInit Dynamic configuration. @see {@link https://github.com/apollographql/apollo-server/pull/1277}
     <=| |=>* @return {Promise|#returnType|<|&vendorExtensions.x-jsdoc-type|>|/returnType|}|=< >=|
     */
    async () {
      <#vendorExtensions.x-codegen-has-optional-params>
      opts = opts || {};
      
      let postBody = <#bodyParam><#required><^required>opts['']<^bodyParam>null;
<#allParams>
<#required>
      // verify the required parameter '' is set
      if ( === undefined ||  === null) {
        throw new Error("Missing the required parameter '' when calling ");
      }



      let pathParams = {<#pathParams>
        '': <#required><^required>opts['']<^-last>,
      };
      let queryParams = {<#queryParams>
        '': <#collectionFormat>this.buildCollectionParam(<#required><^required>opts[''], '')<^collectionFormat><#required><^required>opts['']<^-last>,
      };
      let headerParams = {
        'User-Agent': '<#httpUserAgent><.><^httpUserAgent>OpenAPI-Generator/<&projectVersion>/Javascript',<#headerParams>
        '': <#required><^required>opts['']<^-last>,
      };
      let formParams = {<#formParams>
        '': <#collectionFormat>this.buildCollectionParam(<#required><^required>opts[''], '')<^collectionFormat><#required><^required>opts['']<^-last>,
      };

      let authNames = [<#authMethods>''<^-last>, ];
      let contentTypes = [<#consumes>'<& mediaType>'<^-last>, ];
      let accepts = [<#produces>'<& mediaType>'<^-last>, ];
      let returnType = <#vendorExtensions.x-return-type><&vendorExtensions.x-return-type><^vendorExtensions.x-return-type>null;
      <#servers.0>
      let basePaths = [<#servers>''<^-last>, ];
      let basePath = basePaths[0]; // by default use the first one in "servers" defined in OpenAPI
      if (typeof opts['_base_path_index'] !== 'undefined') {
        if (opts['_base_path_index']  >= basePaths.length || opts['_base_path_index'] <  0) {
          throw new Error("Invalid index " + opts['_base_path_index'] + " when selecting the host settings. Must be less than " + basePaths.length);
        }
        basePath = basePaths[opts['_base_path_index']];
      }

      

      return this.callApi(
        '<&path>', '',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, requestInit
      );
    }


}
<={{ }}=>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy