docusign-rooms
Version:
DocuSign Node.js API client.
1,051 lines (905 loc) • 60.3 kB
JavaScript
/**
* DocuSign Rooms API - v2
* An API for an integrator to access the features of DocuSign Rooms
*
* OpenAPI spec version: v2
* 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/ApiError', 'model/AssignableRoles', 'model/Document', 'model/FieldData', 'model/FieldDataForUpdate', 'model/FieldSet', 'model/FormForAdd', 'model/Room', 'model/RoomDocument', 'model/RoomDocumentList', 'model/RoomForCreate', 'model/RoomInvite', 'model/RoomInviteResponse', 'model/RoomPicture', 'model/RoomSummaryList', 'model/RoomUser', 'model/RoomUserForUpdate', 'model/RoomUserRemovalDetail', 'model/RoomUsersResult'], 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/ApiError'), require('../model/AssignableRoles'), require('../model/Document'), require('../model/FieldData'), require('../model/FieldDataForUpdate'), require('../model/FieldSet'), require('../model/FormForAdd'), require('../model/Room'), require('../model/RoomDocument'), require('../model/RoomDocumentList'), require('../model/RoomForCreate'), require('../model/RoomInvite'), require('../model/RoomInviteResponse'), require('../model/RoomPicture'), require('../model/RoomSummaryList'), require('../model/RoomUser'), require('../model/RoomUserForUpdate'), require('../model/RoomUserRemovalDetail'), require('../model/RoomUsersResult'));
} else {
// Browser globals (root is window)
if (!root.DocusignRooms) {
root.DocusignRooms = {};
}
root.DocusignRooms.RoomsApi = factory(root.DocusignRooms.Configuration, root.DocusignRooms.ApiClient, root.DocusignRooms.ApiError, root.DocusignRooms.AssignableRoles, root.DocusignRooms.Document, root.DocusignRooms.FieldData, root.DocusignRooms.FieldDataForUpdate, root.DocusignRooms.FieldSet, root.DocusignRooms.FormForAdd, root.DocusignRooms.Room, root.DocusignRooms.RoomDocument, root.DocusignRooms.RoomDocumentList, root.DocusignRooms.RoomForCreate, root.DocusignRooms.RoomInvite, root.DocusignRooms.RoomInviteResponse, root.DocusignRooms.RoomPicture, root.DocusignRooms.RoomSummaryList, root.DocusignRooms.RoomUser, root.DocusignRooms.RoomUserForUpdate, root.DocusignRooms.RoomUserRemovalDetail, root.DocusignRooms.RoomUsersResult);
}
}(this, function(Configuration, ApiClient, ApiError, AssignableRoles, Document, FieldData, FieldDataForUpdate, FieldSet, FormForAdd, Room, RoomDocument, RoomDocumentList, RoomForCreate, RoomInvite, RoomInviteResponse, RoomPicture, RoomSummaryList, RoomUser, RoomUserForUpdate, RoomUserRemovalDetail, RoomUsersResult) {
'use strict';
/**
* Rooms service.
* @module api/RoomsApi
*/
/**
* Constructs a new RoomsApi.
* @alias module:api/RoomsApi
* @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 addDocumentToRoom operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~addDocumentToRoomCallback
* @param {String} error Error message, if any.
* @param {module:model/RoomDocument} 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.
*/
/**
* Add a document to a room.
* Add a document to a room
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Number} roomId The id of the room.
* @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/Document} optsOrCallback.body Document details to be added
* @param {module:api/RoomsApi~addDocumentToRoomCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/RoomDocument}
*/
this.addDocumentToRoom = function(accountId, roomId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['body'];
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling addDocumentToRoom");
}
// verify the required parameter 'roomId' is set
if (roomId === undefined || roomId === null) {
throw new Error("Missing the required parameter 'roomId' when calling addDocumentToRoom");
}
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,
'roomId': roomId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json', 'application/xml', 'text/xml', 'application/_*+xml'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = RoomDocument;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms/{roomId}/documents', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the addDocumentToRoomViaFileUpload operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~addDocumentToRoomViaFileUploadCallback
* @param {String} error Error message, if any.
* @param {module:model/RoomDocument} 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.
*/
/**
* Add a document to a room via file contents upload.
* This method uploads the contents of file as a room document for the room that you specify.
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Number} roomId The id of the room.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {Object} optsOrCallback.file File to be uploaded
* @param {module:api/RoomsApi~addDocumentToRoomViaFileUploadCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/RoomDocument}
*/
this.addDocumentToRoomViaFileUpload = function(accountId, roomId, 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 addDocumentToRoomViaFileUpload");
}
// verify the required parameter 'roomId' is set
if (roomId === undefined || roomId === null) {
throw new Error("Missing the required parameter 'roomId' when calling addDocumentToRoomViaFileUpload");
}
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,
'roomId': roomId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
'file': optsOrCallback['file']
};
var authNames = ['docusignAccessCode'];
var contentTypes = ['multipart/form-data'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = RoomDocument;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms/{roomId}/documents/contents', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the addFormToRoom operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~addFormToRoomCallback
* @param {String} error Error message, if any.
* @param {module:model/RoomDocument} 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 a DocuSign Form to a room
* Adds a form to a room.
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Number} roomId Id of the room to which the DocuSign Form is being added
* @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/FormForAdd} optsOrCallback.body Contains information about the form being added
* @param {module:api/RoomsApi~addFormToRoomCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/RoomDocument}
*/
this.addFormToRoom = function(accountId, roomId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['body'];
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling addFormToRoom");
}
// verify the required parameter 'roomId' is set
if (roomId === undefined || roomId === null) {
throw new Error("Missing the required parameter 'roomId' when calling addFormToRoom");
}
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,
'roomId': roomId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json', 'application/xml', 'text/xml', 'application/_*+xml'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = RoomDocument;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms/{roomId}/forms', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the createRoom operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~createRoomCallback
* @param {String} error Error message, if any.
* @param {module:model/Room} 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 Room
* Creates a new Room
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @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/RoomForCreate} optsOrCallback.body The properties of the new room
* @param {module:api/RoomsApi~createRoomCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Room}
*/
this.createRoom = function(accountId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['body'];
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling createRoom");
}
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 = ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = Room;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the deleteRoom operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~deleteRoomCallback
* @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 room having the given room ID.
* Deletes the room having the given room ID.
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Number} roomId ID of the room to be deleted.
* @param {module:api/RoomsApi~deleteRoomCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.deleteRoom = function(accountId, roomId, 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 deleteRoom");
}
// verify the required parameter 'roomId' is set
if (roomId === undefined || roomId === null) {
throw new Error("Missing the required parameter 'roomId' when calling deleteRoom");
}
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,
'roomId': roomId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = null;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms/{roomId}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the getAssignableRoles operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~getAssignableRolesCallback
* @param {String} error Error message, if any.
* @param {module:model/AssignableRoles} 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.
*/
/**
* Returns the roles for which the calling user, based on their role within the room, can assign to invitees.
* This method returns the room-level roles that the current user can assign to the members that they invite to a room.
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Number} roomId The id of the room.
* @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.assigneeEmail Optional parameter indicating to only return roles (internal/external) assignable to this user.
* @param {String} optsOrCallback.filter A search filter that returns assignable roles by the beginning of the role name.
* @param {Number} optsOrCallback.startPosition The index position within the total result set from which to start returning values. The default value is `0`. (default to 0)
* @param {Number} optsOrCallback.count The number of results to return. This value must be a number between `1` and `100` (default). (default to 100)
* @param {module:api/RoomsApi~getAssignableRolesCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/AssignableRoles}
*/
this.getAssignableRoles = function(accountId, roomId, 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 getAssignableRoles");
}
// verify the required parameter 'roomId' is set
if (roomId === undefined || roomId === null) {
throw new Error("Missing the required parameter 'roomId' when calling getAssignableRoles");
}
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,
'roomId': roomId
};
var queryParams = {
'assigneeEmail': optsOrCallback['assigneeEmail'],
'filter': optsOrCallback['filter'],
'startPosition': optsOrCallback['startPosition'],
'count': optsOrCallback['count']
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = AssignableRoles;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms/{roomId}/assignable_roles', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the getDocuments operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~getDocumentsCallback
* @param {String} error Error message, if any.
* @param {module:model/RoomDocumentList} 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.
*/
/**
* Get documents in the room accessible to the calling user.
* This method returns a list of documents that the current user can access for a specific room.
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Number} roomId The id of the room.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {Number} optsOrCallback.count Number of documents to return. Defaults to the maximum which is 100. (default to 100)
* @param {Number} optsOrCallback.startPosition Position of the first item in the total results. Defaults to 0. (default to 0)
* @param {Boolean} optsOrCallback.requireContentForDynamicDocuments Filter out any isDynamic documents without content. Defaults to false. (default to false)
* @param {Number} optsOrCallback.roomFolderId Filter documents by folderId. Defaults to null, to not filter on folderId.
* @param {String} optsOrCallback.nameFilter Filter documents where Name contains the filter. Defaults to null, to not filter.
* @param {Boolean} optsOrCallback.includeArchived Filter documents to have the same isArchived value as includeArchived. Defaults to true, to include archived documents. (default to true)
* @param {module:api/RoomsApi~getDocumentsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/RoomDocumentList}
*/
this.getDocuments = function(accountId, roomId, 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 getDocuments");
}
// verify the required parameter 'roomId' is set
if (roomId === undefined || roomId === null) {
throw new Error("Missing the required parameter 'roomId' when calling getDocuments");
}
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,
'roomId': roomId
};
var queryParams = {
'count': optsOrCallback['count'],
'startPosition': optsOrCallback['startPosition'],
'requireContentForDynamicDocuments': optsOrCallback['requireContentForDynamicDocuments'],
'roomFolderId': optsOrCallback['roomFolderId'],
'nameFilter': optsOrCallback['nameFilter'],
'includeArchived': optsOrCallback['includeArchived']
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = RoomDocumentList;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms/{roomId}/documents', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the getRoom operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~getRoomCallback
* @param {String} error Error message, if any.
* @param {module:model/Room} 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.
*/
/**
* Gets information about the given room.
* Returns details about the given room
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Number} roomId The id of the room.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {Boolean} optsOrCallback.includeFieldData Indicates if field data (a.k.a., room details) should be included in the response. Defaults to false. (default to false)
* @param {module:api/RoomsApi~getRoomCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Room}
*/
this.getRoom = function(accountId, roomId, 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 getRoom");
}
// verify the required parameter 'roomId' is set
if (roomId === undefined || roomId === null) {
throw new Error("Missing the required parameter 'roomId' when calling getRoom");
}
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,
'roomId': roomId
};
var queryParams = {
'includeFieldData': optsOrCallback['includeFieldData']
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = Room;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms/{roomId}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the getRoomFieldData operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~getRoomFieldDataCallback
* @param {String} error Error message, if any.
* @param {module:model/FieldData} 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.
*/
/**
* Returns the FieldData associated with the provided roomId.
* Returns the field data associated with a room. This is the information that appears on the room's **Details** tab.
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Number} roomId The id of the room.
* @param {module:api/RoomsApi~getRoomFieldDataCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/FieldData}
*/
this.getRoomFieldData = function(accountId, roomId, 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 getRoomFieldData");
}
// verify the required parameter 'roomId' is set
if (roomId === undefined || roomId === null) {
throw new Error("Missing the required parameter 'roomId' when calling getRoomFieldData");
}
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,
'roomId': roomId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = FieldData;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms/{roomId}/field_data', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the getRoomFieldSet operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~getRoomFieldSetCallback
* @param {String} error Error message, if any.
* @param {module:model/FieldSet} 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.
*/
/**
* Gets the field set associated with the room.
* Returns the field set that a room uses.
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Number} roomId The id of the room.
* @param {module:api/RoomsApi~getRoomFieldSetCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/FieldSet}
*/
this.getRoomFieldSet = function(accountId, roomId, 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 getRoomFieldSet");
}
// verify the required parameter 'roomId' is set
if (roomId === undefined || roomId === null) {
throw new Error("Missing the required parameter 'roomId' when calling getRoomFieldSet");
}
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,
'roomId': roomId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = FieldSet;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms/{roomId}/field_set', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the getRoomUsers operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~getRoomUsersCallback
* @param {String} error Error message, if any.
* @param {module:model/RoomUsersResult} 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.
*/
/**
* Retrieves the list of users in the given room.
* This method returns a list of users associated with a room.
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Number} roomId The id of the room.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {Number} optsOrCallback.count Number of room users to return. Defaults to the maximum which is 100. (default to 100)
* @param {Number} optsOrCallback.startPosition Position of the first item in the total results. Defaults to 0. (default to 0)
* @param {String} optsOrCallback.filter Returns room users filtered by Name and Email.
* @param {module:model/String} optsOrCallback.sort Sorts results. Options are FirstNameAsc, FirstNameDesc, LastNameAsc, LastNameDesc, EmailAsc, EmailDesc. Defaults to LastNameDesc
* @param {module:api/RoomsApi~getRoomUsersCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/RoomUsersResult}
*/
this.getRoomUsers = function(accountId, roomId, 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 getRoomUsers");
}
// verify the required parameter 'roomId' is set
if (roomId === undefined || roomId === null) {
throw new Error("Missing the required parameter 'roomId' when calling getRoomUsers");
}
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,
'roomId': roomId
};
var queryParams = {
'count': optsOrCallback['count'],
'startPosition': optsOrCallback['startPosition'],
'filter': optsOrCallback['filter'],
'sort': optsOrCallback['sort']
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = RoomUsersResult;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms/{roomId}/users', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the getRooms operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~getRoomsCallback
* @param {String} error Error message, if any.
* @param {module:model/RoomSummaryList} 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.
*/
/**
* Gets rooms available to the calling user.
* Gets rooms available to the calling user
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Object} optsOrCallback Optional parameters, if you are passing no optional parameters, you can either pass a null or omit this parameter entirely.
* @param {Number} optsOrCallback.count Number of rooms to return. Defaults to the maximum which is 100. (default to 100)
* @param {Number} optsOrCallback.startPosition Position of the first item in the total results. Defaults to 0. (default to 0)
* @param {module:model/String} optsOrCallback.roomStatus Status of the rooms to return. Defaults to \"Active\".
* @param {Number} optsOrCallback.officeId Only return rooms in this office.
* @param {String} optsOrCallback.fieldDataChangedStartDate Fields data changed start datetime in UTC. Valid formats: yyyy-mm-dd hh:mm:ss or yyyy/mm/dd hh:mm:ss -Time is optional and will default to 00:00:00.
* @param {String} optsOrCallback.fieldDataChangedEndDate Fields-data changed end DateTime in UTC. Valid formats: yyyy-mm-dd hh:mm:ss or yyyy/mm/dd hh:mm:ss -Time is optional and will default to 00:00:00.
* @param {String} optsOrCallback.roomClosedStartDate Room closed start datetime in UTC. Valid formats: yyyy-mm-dd hh:mm:ss or yyyy/mm/dd hh:mm:ss -Time is optional and will default to 00:00:00.
* @param {String} optsOrCallback.roomClosedEndDate Room closed end datetime in UTC. Valid formats: yyyy-mm-dd hh:mm:ss or yyyy/mm/dd hh:mm:ss -Time is optional and will default to 00:00:00.
* @param {module:api/RoomsApi~getRoomsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/RoomSummaryList}
*/
this.getRooms = 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 getRooms");
}
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 = {
'count': optsOrCallback['count'],
'startPosition': optsOrCallback['startPosition'],
'roomStatus': optsOrCallback['roomStatus'],
'officeId': optsOrCallback['officeId'],
'fieldDataChangedStartDate': optsOrCallback['fieldDataChangedStartDate'],
'fieldDataChangedEndDate': optsOrCallback['fieldDataChangedEndDate'],
'roomClosedStartDate': optsOrCallback['roomClosedStartDate'],
'roomClosedEndDate': optsOrCallback['roomClosedEndDate']
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = RoomSummaryList;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the inviteUser operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~inviteUserCallback
* @param {String} error Error message, if any.
* @param {module:model/RoomInviteResponse} 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.
*/
/**
* Invites a user to the room by email address.
* This method invites an existing or new member to a specific room.
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Number} roomId The id of the room.
* @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/RoomInvite} optsOrCallback.body Name, Email, Side, Role of the user being invited
* @param {module:api/RoomsApi~inviteUserCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/RoomInviteResponse}
*/
this.inviteUser = function(accountId, roomId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['body'];
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling inviteUser");
}
// verify the required parameter 'roomId' is set
if (roomId === undefined || roomId === null) {
throw new Error("Missing the required parameter 'roomId' when calling inviteUser");
}
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,
'roomId': roomId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json', 'application/xml', 'text/xml', 'application/_*+xml'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = RoomInviteResponse;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms/{roomId}/users', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the putRoomUser operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~putRoomUserCallback
* @param {String} error Error message, if any.
* @param {module:model/RoomUser} 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.
*/
/**
* Updates the specified user's role and transaction side.
* Updates the specified user's role and transaction side.
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Number} roomId The id of the room.
* @param {Number} userId The id of the user to update.
* @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/RoomUserForUpdate} optsOrCallback.body Updated Role and Side of the given user
* @param {module:api/RoomsApi~putRoomUserCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/RoomUser}
*/
this.putRoomUser = function(accountId, roomId, userId, optsOrCallback, callback) {
optsOrCallback = optsOrCallback || {};
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback;
optsOrCallback = {};
}
var postBody = optsOrCallback['body'];
// verify the required parameter 'accountId' is set
if (accountId === undefined || accountId === null) {
throw new Error("Missing the required parameter 'accountId' when calling putRoomUser");
}
// verify the required parameter 'roomId' is set
if (roomId === undefined || roomId === null) {
throw new Error("Missing the required parameter 'roomId' when calling putRoomUser");
}
// verify the required parameter 'userId' is set
if (userId === undefined || userId === null) {
throw new Error("Missing the required parameter 'userId' when calling putRoomUser");
}
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,
'roomId': roomId,
'userId': userId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['docusignAccessCode'];
var contentTypes = ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json', 'application/xml', 'text/xml', 'application/_*+xml'];
var accepts = ['text/plain', 'application/json', 'text/json', 'application/xml', 'text/xml'];
var returnType = RoomUser;
return this.apiClient.callApi(
'/v2/accounts/{accountId}/rooms/{roomId}/users/{userId}', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* (Optional) Callback function to receive the result of the restoreRoomUserAccess operation. If none specified a Promise will be returned.
* @callback module:api/RoomsApi~restoreRoomUserAccessCallback
* @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.
*/
/**
* Restores the specified user's access to the room.
* Restores the specified user's access to the room.
* @param {String} accountId (Required) The globally unique identifier (GUID) for the account.
* @param {Number} roomId The room Id to restore access
* @param {Number} userId The user Id getting restored to the room
* @param {module:api/RoomsApi~restoreRoomUserAccessCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.restoreRoomUserAccess = function(accountId, roomId, userId, 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 restoreRoomUserAccess");
}
// verify the required parameter 'roomId' is set
if (roomId === undefined || roomId === null) {
throw new Error("Missing the required parameter 'roomId' when calling restoreRoomUserAccess");
}
// verify the required parameter 'userId' is set
if (userId === undefined || userId === null) {
throw new Error("Missing the required parameter 'userId' when calling restoreRoomUserAccess");
}
if (typeof callback !== 'function' && arguments.length && typeof arguments[arguments.length-1] === 'function'){
if (typeof optsOrCallback !== 'undefined') {
optsOrCallback = callback;
}
c