|
| 1 | +/** |
| 2 | + * DocuSign REST API |
| 3 | + * The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. |
| 4 | + * |
| 5 | + * OpenAPI spec version: v2.1 |
| 6 | + |
| 7 | + * |
| 8 | + * NOTE: This class is auto generated. Do not edit the class manually and submit a new issue instead. |
| 9 | + * |
| 10 | + */ |
| 11 | + |
| 12 | +(function(root, factory) { |
| 13 | + if (typeof define === 'function' && define.amd) { |
| 14 | + // AMD. Register as an anonymous module. |
| 15 | + define(['Configuration', 'ApiClient', 'model/ErrorDetails'], factory); |
| 16 | + } else if (typeof module === 'object' && module.exports) { |
| 17 | + // CommonJS-like environments that support module.exports, like Node. |
| 18 | + module.exports = factory(require('../Configuration'), require('../ApiClient'), require('../model/ErrorDetails')); |
| 19 | + } else { |
| 20 | + // Browser globals (root is window) |
| 21 | + if (!root.Docusign) { |
| 22 | + root.Docusign = {}; |
| 23 | + } |
| 24 | + root.Docusign.DataFeedApi = factory(root.Docusign.Configuration, root.Docusign.ApiClient, root.Docusign.ErrorDetails); |
| 25 | + } |
| 26 | +}(this, function(Configuration, ApiClient, ErrorDetails) { |
| 27 | + 'use strict'; |
| 28 | + |
| 29 | + /** |
| 30 | + * DataFeed service. |
| 31 | + * @module api/DataFeedApi |
| 32 | + * @version 3.0.0 |
| 33 | + */ |
| 34 | + |
| 35 | + /** |
| 36 | + * Constructs a new DataFeedApi. |
| 37 | + * @alias module:api/DataFeedApi |
| 38 | + * @class |
| 39 | + * @param {module:ApiClient} apiClient Optional API client implementation to use, |
| 40 | + * default to {@link module:ApiClient#instance} if unspecified. |
| 41 | + */ |
| 42 | + var exports = function(apiClient) { |
| 43 | + this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance; |
| 44 | + |
| 45 | + |
| 46 | + this.setApiClient = function(apiClient) { |
| 47 | + this.apiClient = apiClient; |
| 48 | + }; |
| 49 | + |
| 50 | + this.getApiClient = function() { |
| 51 | + return this.apiClient; |
| 52 | + }; |
| 53 | + |
| 54 | + |
| 55 | + /** |
| 56 | + * (Optional)Callback function to receive the result of the getDataFeedElement operation. If none specified a Promise will be returned. |
| 57 | + * @callback module:api/DataFeedApi~getDataFeedElementCallback |
| 58 | + * @param {String} error Error message, if any. |
| 59 | + * @param data This operation does not return a value. |
| 60 | + * @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data. |
| 61 | + */ |
| 62 | + |
| 63 | + /** |
| 64 | + * Retrieves a Datafeed element by Id. |
| 65 | + * @param {String} accountId The external account number (int) or account ID Guid. |
| 66 | + * @param {String} dataFeedElementId |
| 67 | + * @param {module:api/DataFeedApi~getDataFeedElementCallback} callback The callback function, accepting three arguments: error, data, response |
| 68 | + */ |
| 69 | + this.getDataFeedElement = function(accountId, dataFeedElementId, callback) { |
| 70 | + var postBody = null; |
| 71 | + |
| 72 | + // verify the required parameter 'accountId' is set |
| 73 | + if (accountId == undefined || accountId == null) { |
| 74 | + throw new Error("Missing the required parameter 'accountId' when calling getDataFeedElement"); |
| 75 | + } |
| 76 | + |
| 77 | + // verify the required parameter 'dataFeedElementId' is set |
| 78 | + if (dataFeedElementId == undefined || dataFeedElementId == null) { |
| 79 | + throw new Error("Missing the required parameter 'dataFeedElementId' when calling getDataFeedElement"); |
| 80 | + } |
| 81 | + |
| 82 | + if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){ |
| 83 | + if (typeof optsOrCallback !== 'undefined') { |
| 84 | + optsOrCallback = callback; |
| 85 | + } |
| 86 | + callback = arguments[arguments.length-1]; |
| 87 | + } |
| 88 | + |
| 89 | + var pathParams = { |
| 90 | + 'accountId': accountId, |
| 91 | + 'dataFeedElementId': dataFeedElementId |
| 92 | + }; |
| 93 | + var queryParams = { |
| 94 | + }; |
| 95 | + var headerParams = { |
| 96 | + }; |
| 97 | + var formParams = { |
| 98 | + }; |
| 99 | + |
| 100 | + var authNames = []; |
| 101 | + var contentTypes = []; |
| 102 | + var accepts = ['application/json']; |
| 103 | + var returnType = null; |
| 104 | + |
| 105 | + return this.apiClient.callApi( |
| 106 | + '/v2.1/accounts/{accountId}/data_feeds/data/{dataFeedElementId}', 'GET', |
| 107 | + pathParams, queryParams, headerParams, formParams, postBody, |
| 108 | + authNames, contentTypes, accepts, returnType, callback |
| 109 | + ); |
| 110 | + }; |
| 111 | + }; |
| 112 | + |
| 113 | + return exports; |
| 114 | +})); |
0 commit comments