docusign-esign
Version:
Docusign Node.js API client.
1,025 lines (870 loc) • 227 kB
JavaScript
/**
* Docusign eSignature REST API
* The Docusign eSignature REST API provides you with a powerful, convenient, and simple Web services API for interacting with Docusign.
*
* OpenAPI spec version: v2.1
* Contact: devcenter@docusign.com
*
* NOTE: This class is auto generated. Do not edit the class manually and submit a new issue instead.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['Configuration', 'ApiClient', 'model/AccountIdentityVerificationResponse', 'model/AccountInformation', 'model/AccountPasswordRules', 'model/AccountSettingsInformation', 'model/AccountSharedAccess', 'model/AccountSignature', 'model/AccountSignatureDefinition', 'model/AccountSignatureProviders', 'model/AccountSignaturesInformation', 'model/BillingChargeResponse', 'model/Brand', 'model/BrandResources', 'model/BrandResourcesList', 'model/BrandsRequest', 'model/BrandsResponse', 'model/CaptiveRecipientInformation', 'model/ConsumerDisclosure', 'model/CustomField', 'model/CustomFields', 'model/ENoteConfiguration', 'model/EnvelopePurgeConfiguration', 'model/ErrorDetails', 'model/FavoriteTemplatesInfo', 'model/FileTypeList', 'model/NewAccountDefinition', 'model/NewAccountSummary', 'model/NotificationDefaults', 'model/PaymentGatewayAccountsInfo', 'model/PermissionProfile', 'model/PermissionProfileInformation', 'model/ProvisioningInformation', 'model/RecipientNamesResponse', 'model/SupportedLanguages', 'model/TabAccountSettings', 'model/UserAuthorization', 'model/UserAuthorizationCreateRequest', 'model/UserAuthorizationUpdateRequest', 'model/UserAuthorizations', 'model/UserAuthorizationsDeleteRequest', 'model/UserAuthorizationsDeleteResponse', 'model/UserAuthorizationsRequest', 'model/UserAuthorizationsResponse', 'model/UserPasswordRules', 'model/Watermark'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../Configuration'), require('../ApiClient'), require('../model/AccountIdentityVerificationResponse'), require('../model/AccountInformation'), require('../model/AccountPasswordRules'), require('../model/AccountSettingsInformation'), require('../model/AccountSharedAccess'), require('../model/AccountSignature'), require('../model/AccountSignatureDefinition'), require('../model/AccountSignatureProviders'), require('../model/AccountSignaturesInformation'), require('../model/BillingChargeResponse'), require('../model/Brand'), require('../model/BrandResources'), require('../model/BrandResourcesList'), require('../model/BrandsRequest'), require('../model/BrandsResponse'), require('../model/CaptiveRecipientInformation'), require('../model/ConsumerDisclosure'), require('../model/CustomField'), require('../model/CustomFields'), require('../model/ENoteConfiguration'), require('../model/EnvelopePurgeConfiguration'), require('../model/ErrorDetails'), require('../model/FavoriteTemplatesInfo'), require('../model/FileTypeList'), require('../model/NewAccountDefinition'), require('../model/NewAccountSummary'), require('../model/NotificationDefaults'), require('../model/PaymentGatewayAccountsInfo'), require('../model/PermissionProfile'), require('../model/PermissionProfileInformation'), require('../model/ProvisioningInformation'), require('../model/RecipientNamesResponse'), require('../model/SupportedLanguages'), require('../model/TabAccountSettings'), require('../model/UserAuthorization'), require('../model/UserAuthorizationCreateRequest'), require('../model/UserAuthorizationUpdateRequest'), require('../model/UserAuthorizations'), require('../model/UserAuthorizationsDeleteRequest'), require('../model/UserAuthorizationsDeleteResponse'), require('../model/UserAuthorizationsRequest'), require('../model/UserAuthorizationsResponse'), require('../model/UserPasswordRules'), require('../model/Watermark'));
} else {
// Browser globals (root is window)
if (!root.Docusign) {
root.Docusign = {};
}
root.Docusign.AccountsApi = factory(root.Docusign.Configuration, root.Docusign.ApiClient, root.Docusign.AccountIdentityVerificationResponse, root.Docusign.AccountInformation, root.Docusign.AccountPasswordRules, root.Docusign.AccountSettingsInformation, root.Docusign.AccountSharedAccess, root.Docusign.AccountSignature, root.Docusign.AccountSignatureDefinition, root.Docusign.AccountSignatureProviders, root.Docusign.AccountSignaturesInformation, root.Docusign.BillingChargeResponse, root.Docusign.Brand, root.Docusign.BrandResources, root.Docusign.BrandResourcesList, root.Docusign.BrandsRequest, root.Docusign.BrandsResponse, root.Docusign.CaptiveRecipientInformation, root.Docusign.ConsumerDisclosure, root.Docusign.CustomField, root.Docusign.CustomFields, root.Docusign.ENoteConfiguration, root.Docusign.EnvelopePurgeConfiguration, root.Docusign.ErrorDetails, root.Docusign.FavoriteTemplatesInfo, root.Docusign.FileTypeList, root.Docusign.NewAccountDefinition, root.Docusign.NewAccountSummary, root.Docusign.NotificationDefaults, root.Docusign.PaymentGatewayAccountsInfo, root.Docusign.PermissionProfile, root.Docusign.PermissionProfileInformation, root.Docusign.ProvisioningInformation, root.Docusign.RecipientNamesResponse, root.Docusign.SupportedLanguages, root.Docusign.TabAccountSettings, root.Docusign.UserAuthorization, root.Docusign.UserAuthorizationCreateRequest, root.Docusign.UserAuthorizationUpdateRequest, root.Docusign.UserAuthorizations, root.Docusign.UserAuthorizationsDeleteRequest, root.Docusign.UserAuthorizationsDeleteResponse, root.Docusign.UserAuthorizationsRequest, root.Docusign.UserAuthorizationsResponse, root.Docusign.UserPasswordRules, root.Docusign.Watermark);
}
}(this, function(Configuration, ApiClient, AccountIdentityVerificationResponse, AccountInformation, AccountPasswordRules, AccountSettingsInformation, AccountSharedAccess, AccountSignature, AccountSignatureDefinition, AccountSignatureProviders, AccountSignaturesInformation, BillingChargeResponse, Brand, BrandResources, BrandResourcesList, BrandsRequest, BrandsResponse, CaptiveRecipientInformation, ConsumerDisclosure, CustomField, CustomFields, ENoteConfiguration, EnvelopePurgeConfiguration, ErrorDetails, FavoriteTemplatesInfo, FileTypeList, NewAccountDefinition, NewAccountSummary, NotificationDefaults, PaymentGatewayAccountsInfo, PermissionProfile, PermissionProfileInformation, ProvisioningInformation, RecipientNamesResponse, SupportedLanguages, TabAccountSettings, UserAuthorization, UserAuthorizationCreateRequest, UserAuthorizationUpdateRequest, UserAuthorizations, UserAuthorizationsDeleteRequest, UserAuthorizationsDeleteResponse, UserAuthorizationsRequest, UserAuthorizationsResponse, UserPasswordRules, Watermark) {
'use strict';
/**
* Accounts service.
* @module api/AccountsApi
*/
/**
* Constructs a new AccountsApi.
* @alias module:api/AccountsApi
* @class
* @param {module:ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function(apiClient) {
this.apiClient = apiClient || Configuration.default.getDefaultApiClient() || ApiClient.instance;
this.setApiClient = function(apiClient) {
this.apiClient = apiClient;
};
this.getApiClient = function() {
return this.apiClient;
};
/**
* (Optional) Callback function to receive the result of the _delete operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~_deleteCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Deletes the specified account.
* This closes the specified account. You must be an account admin to close your account. Once closed, an account must be reopened by DocuSign.
* @param {String} accountId The external account number (int) or account ID Guid.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {String} optsOrCallback.redactUserData
* @param {module:api/AccountsApi~_deleteCallback} callback The callback function, accepting three arguments: error, data, response
*/
this._delete = function(accountId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = null;
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling _delete");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId
};
var queryParams = {
'redact_user_data': optsOrCallback['redactUserData']
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = null;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the create operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~createCallback
* @param {String} error Error message, if any.
* @param {module:model/NewAccountSummary} data The data returned by the service call.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Creates new accounts.
* Creates new DocuSign service accounts.
This is used to create multiple DocuSign accounts with one call. It uses the same information and formats as the normal a [Accounts:create](accounts_create) call with the information included within a `newAccountRequests` element. A maximum of 100 new accounts can be created at one time.
Note that the structure of the XML request is slightly different than the JSON request, in that the new account information is included in a `newAccountDefinition` property inside the `newAccountRequests` element.
Response
The response returns the new account ID, password and the default user information for each newly created account.
A 201 code is returned if the call succeeded. While the call may have succeed, some of the individual account requests may have failed. In the case of failures to create the account, an `errorDetails` node is added in the response to each specific request that failed.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {String} optsOrCallback.previewBillingPlan When set to **true**, creates the account using a preview billing plan.
* @param {module:model/NewAccountDefinition} optsOrCallback.newAccountDefinition
* @param {module:api/AccountsApi~createCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/NewAccountSummary}
*/
this.create = function(optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['newAccountDefinition'];
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
};
var queryParams = {
'preview_billing_plan': optsOrCallback['previewBillingPlan']
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = NewAccountSummary;
return this.apiClient.callApi(
'/v2.1/accounts', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the createAccountSignatures operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~createAccountSignaturesCallback
* @param {String} error Error message, if any.
* @param {module:model/AccountSignaturesInformation} data The data returned by the service call.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Adds/updates one or more account signatures. This request may include images in multi-part format.
*
* @param {String} accountId The external account number (int) or account ID Guid.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {String} optsOrCallback.decodeOnly
* @param {module:model/AccountSignaturesInformation} optsOrCallback.accountSignaturesInformation
* @param {module:api/AccountsApi~createAccountSignaturesCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/AccountSignaturesInformation}
*/
this.createAccountSignatures = function(accountId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['accountSignaturesInformation'];
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling createAccountSignatures");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId
};
var queryParams = {
'decode_only': optsOrCallback['decodeOnly']
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = AccountSignaturesInformation;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}/signatures', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the createBrand operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~createBrandCallback
* @param {String} error Error message, if any.
* @param {module:model/BrandsResponse} data The data returned by the service call.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Creates one or more brand profile files for the account.
* Creates one or more brand profile files for the account. The Account Branding feature (accountSettings properties `canSelfBrandSend` and `canSelfBrandSig`) must be set to **true** for the account to use this call.
An error is returned if `brandId` property for a brand profile is already set for the account. To upload a new version of an existing brand profile, you must delete the profile and then upload the newer version.
When brand profile files are being uploaded, they must be combined into one zip file and the `Content-Type` must be `application/zip`.
* @param {String} accountId The external account number (int) or account ID GUID.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {module:model/Brand} optsOrCallback.brand
* @param {module:api/AccountsApi~createBrandCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/BrandsResponse}
*/
this.createBrand = function(accountId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['brand'];
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling createBrand");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = BrandsResponse;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}/brands', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the createCustomField operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~createCustomFieldCallback
* @param {String} error Error message, if any.
* @param {module:model/CustomFields} data The data returned by the service call.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Creates an acount custom field.
* This method creates a custom field and makes it available for all new envelopes associated with an account.
* @param {String} accountId The external account number (int) or account ID Guid.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {String} optsOrCallback.applyToTemplates
* @param {module:model/CustomField} optsOrCallback.customField
* @param {module:api/AccountsApi~createCustomFieldCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/CustomFields}
*/
this.createCustomField = function(accountId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['customField'];
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling createCustomField");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId
};
var queryParams = {
'apply_to_templates': optsOrCallback['applyToTemplates']
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = CustomFields;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}/custom_fields', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the createPermissionProfile operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~createPermissionProfileCallback
* @param {String} error Error message, if any.
* @param {module:model/PermissionProfile} data The data returned by the service call.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Creates a new permission profile in the specified account.
* This method creates a new permission profile for an account.
### Related topics
- [How to create a permission profile](/docs/esign-rest-api/how-to/permission-profile-creating/)
* @param {String} accountId The external account number (int) or account ID Guid.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {String} optsOrCallback.include
* @param {module:model/PermissionProfile} optsOrCallback.permissionProfile
* @param {module:api/AccountsApi~createPermissionProfileCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/PermissionProfile}
*/
this.createPermissionProfile = function(accountId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['permissionProfile'];
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling createPermissionProfile");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId
};
var queryParams = {
'include': optsOrCallback['include']
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = PermissionProfile;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}/permission_profiles', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the createUserAuthorization operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~createUserAuthorizationCallback
* @param {String} error Error message, if any.
* @param {module:model/UserAuthorization} data The data returned by the service call.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Creates the user authorization
* @param {String} accountId The external account number (int) or account ID Guid.
* @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {module:model/UserAuthorizationCreateRequest} optsOrCallback.userAuthorizationCreateRequest
* @param {module:api/AccountsApi~createUserAuthorizationCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/UserAuthorization}
*/
this.createUserAuthorization = function(accountId, userId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['userAuthorizationCreateRequest'];
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling createUserAuthorization");
}
// verify the required parameter 'userId' is set
if (userId === undefined || userId === null) {
throw new Error("Missing the required parameter 'userId' when calling createUserAuthorization");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId,
'userId': userId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = UserAuthorization;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}/users/{userId}/authorization', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the createUserAuthorizations operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~createUserAuthorizationsCallback
* @param {String} error Error message, if any.
* @param {module:model/UserAuthorizationsResponse} data The data returned by the service call.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Creates ot updates user authorizations
* @param {String} accountId The external account number (int) or account ID Guid.
* @param {String} userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {module:model/UserAuthorizationsRequest} optsOrCallback.userAuthorizationsRequest
* @param {module:api/AccountsApi~createUserAuthorizationsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/UserAuthorizationsResponse}
*/
this.createUserAuthorizations = function(accountId, userId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['userAuthorizationsRequest'];
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling createUserAuthorizations");
}
// verify the required parameter 'userId' is set
if (userId === undefined || userId === null) {
throw new Error("Missing the required parameter 'userId' when calling createUserAuthorizations");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId,
'userId': userId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = UserAuthorizationsResponse;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}/users/{userId}/authorizations', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the deleteAccountSignature operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~deleteAccountSignatureCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Close the specified signature by Id.
*
* @param {String} accountId The external account number (int) or account ID Guid.
* @param {String} signatureId The ID of the signature being accessed.
* @param {module:api/AccountsApi~deleteAccountSignatureCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.deleteAccountSignature = function(accountId, signatureId, callback) {
var postBody = null;
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling deleteAccountSignature");
}
// verify the required parameter 'signatureId' is set
if (signatureId === undefined || signatureId === null) {
throw new Error("Missing the required parameter 'signatureId' when calling deleteAccountSignature");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId,
'signatureId': signatureId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = null;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}/signatures/{signatureId}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the deleteAccountSignatureImage operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~deleteAccountSignatureImageCallback
* @param {String} error Error message, if any.
* @param {module:model/AccountSignature} data The data returned by the service call.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Deletes a signature, initials, or stamps image.
*
* @param {String} accountId The external account number (int) or account ID Guid.
* @param {String} signatureId The ID of the signature being accessed.
* @param {String} imageType One of **signature_image** or **initials_image**.
* @param {module:api/AccountsApi~deleteAccountSignatureImageCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/AccountSignature}
*/
this.deleteAccountSignatureImage = function(accountId, signatureId, imageType, callback) {
var postBody = null;
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling deleteAccountSignatureImage");
}
// verify the required parameter 'signatureId' is set
if (signatureId === undefined || signatureId === null) {
throw new Error("Missing the required parameter 'signatureId' when calling deleteAccountSignatureImage");
}
// verify the required parameter 'imageType' is set
if (imageType === undefined || imageType === null) {
throw new Error("Missing the required parameter 'imageType' when calling deleteAccountSignatureImage");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId,
'signatureId': signatureId,
'imageType': imageType
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = AccountSignature;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}/signatures/{signatureId}/{imageType}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the deleteBrand operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~deleteBrandCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Removes a brand.
* This method deletes a brand from an account.
**Note:** Branding for either signing or sending must be enabled for the account (`canSelfBrandSend` , `canSelfBrandSign`, or both of these account settings must be **true**).
* @param {String} accountId The external account number (int) or account ID Guid.
* @param {String} brandId The unique identifier of a brand.
* @param {module:api/AccountsApi~deleteBrandCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.deleteBrand = function(accountId, brandId, callback) {
var postBody = null;
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling deleteBrand");
}
// verify the required parameter 'brandId' is set
if (brandId === undefined || brandId === null) {
throw new Error("Missing the required parameter 'brandId' when calling deleteBrand");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId,
'brandId': brandId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = null;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}/brands/{brandId}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the deleteBrandLogoByType operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~deleteBrandLogoByTypeCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Delete one branding logo.
* This method deletes a single logo from an account brand.
**Note:** Branding for either signing or sending must be enabled for the account (`canSelfBrandSend` , `canSelfBrandSign`, or both of these account settings must be **true**).
* @param {String} accountId The external account number (int) or account ID Guid.
* @param {String} brandId The unique identifier of a brand.
* @param {String} logoType One of **Primary**, **Secondary** or **Email**.
* @param {module:api/AccountsApi~deleteBrandLogoByTypeCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.deleteBrandLogoByType = function(accountId, brandId, logoType, callback) {
var postBody = null;
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling deleteBrandLogoByType");
}
// verify the required parameter 'brandId' is set
if (brandId === undefined || brandId === null) {
throw new Error("Missing the required parameter 'brandId' when calling deleteBrandLogoByType");
}
// verify the required parameter 'logoType' is set
if (logoType === undefined || logoType === null) {
throw new Error("Missing the required parameter 'logoType' when calling deleteBrandLogoByType");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId,
'brandId': brandId,
'logoType': logoType
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = null;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}/brands/{brandId}/logos/{logoType}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the deleteBrands operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~deleteBrandsCallback
* @param {String} error Error message, if any.
* @param {module:model/BrandsResponse} data The data returned by the service call.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Deletes one or more brand profiles.
* Deletes one or more brand profiles from an account. The Account Branding feature (accountSettings properties `canSelfBrandSend` and `canSelfBrandSend`) must be set to **true** to use this call.
* @param {String} accountId The external account number (int) or account ID Guid.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {module:model/BrandsRequest} optsOrCallback.brandsRequest
* @param {module:api/AccountsApi~deleteBrandsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/BrandsResponse}
*/
this.deleteBrands = function(accountId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['brandsRequest'];
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling deleteBrands");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = BrandsResponse;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}/brands', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the deleteCaptiveRecipient operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~deleteCaptiveRecipientCallback
* @param {String} error Error message, if any.
* @param {module:model/CaptiveRecipientInformation} data The data returned by the service call.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Deletes the signature for one or more captive recipient records.
* Deletes the signature for one or more captive recipient records; it is primarily used for testing. This provides a way to reset the signature associated with a client user ID so that a new signature can be created the next time the client user ID is used.
* @param {String} accountId The external account number (int) or account ID Guid.
* @param {String} recipientPart
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {module:model/CaptiveRecipientInformation} optsOrCallback.captiveRecipientInformation
* @param {module:api/AccountsApi~deleteCaptiveRecipientCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/CaptiveRecipientInformation}
*/
this.deleteCaptiveRecipient = function(accountId, recipientPart, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['captiveRecipientInformation'];
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling deleteCaptiveRecipient");
}
// verify the required parameter 'recipientPart' is set
if (recipientPart === undefined || recipientPart === null) {
throw new Error("Missing the required parameter 'recipientPart' when calling deleteCaptiveRecipient");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId,
'recipientPart': recipientPart
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = CaptiveRecipientInformation;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}/captive_recipients/{recipientPart}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the deleteCustomField operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~deleteCustomFieldCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} If a callback was specified, the response The complete HTTP response, else a Promise resolving the response Data.
*/
/**
* Delete an existing account custom field.
* This method deletes an existing account custom field.
* @param {String} accountId The external account number (int) or account ID Guid.
* @param {String} customFieldId
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {String} optsOrCallback.applyToTemplates
* @param {module:api/AccountsApi~deleteCustomFieldCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.deleteCustomField = function(accountId, customFieldId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = null;
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling deleteCustomField");
}
// verify the required parameter 'customFieldId' is set
if (customFieldId === undefined || customFieldId === null) {
throw new Error("Missing the required parameter 'customFieldId' when calling deleteCustomField");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
callback = arguments[arguments.length-1];
}
var pathParams = {
'accountId': accountId,
'customFieldId': customFieldId
};
var queryParams = {
'apply_to_templates': optsOrCallback['applyToTemplates']
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = null;
return this.apiClient.callApi(
'/v2.1/accounts/{accountId}/custom_fields/{customFieldId}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the deleteENoteConfiguration operation. If none specified a Promise will be returned.
* @callback module:api/AccountsApi~deleteENoteConfigurationCallback
* @param {String} error Error message, if any.
* @param data This operation does n