docs: function(apiClient) {
      this.apiClient = apiClient || ApiClient.instance;
  
  
  
      /**
       * Alternate between calls
       * Alternate two calls so that you retrieve a call on hold and place the established call on hold instead. This is a shortcut for doing [/voice/calls/{id}/hold](/reference/workspace/Voice/index.html#hold) and [/voice/calls/{id}/retrieve](/reference/workspace/Voice/index.html#retrieve) separately.
       * @param {String} id The connection ID of the established call that should be placed on hold.
       * @param {module:model/AlternateData} alternateData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.alternateWithHttpInfo = function(id, alternateData) {
        var postBody = alternateData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling alternate");
        }
  
        // verify the required parameter 'alternateData' is set
        if (alternateData === undefined || alternateData === null) {
          throw new Error("Missing the required parameter 'alternateData' when calling alternate");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/alternate', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Alternate between calls
       * Alternate two calls so that you retrieve a call on hold and place the established call on hold instead. This is a shortcut for doing [/voice/calls/{id}/hold](/reference/workspace/Voice/index.html#hold) and [/voice/calls/{id}/retrieve](/reference/workspace/Voice/index.html#retrieve) separately.
       * @param {String} id The connection ID of the established call that should be placed on hold.
       * @param {module:model/AlternateData} alternateData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.alternate = function(id, alternateData) {
        return this.alternateWithHttpInfo(id, alternateData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Answer a call
       * Answer the specified call.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/AnswerData} opts.answerData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.answerWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = opts['answerData'];
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling answer");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/answer', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Answer a call
       * Answer the specified call.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/AnswerData} opts.answerData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.answer = function(id, opts) {
        return this.answerWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Attach user data to a call
       * Attach the provided data to the specified call. This adds the data to the call even if data already exists with the provided keys.
       * @param {String} id The connection ID of the call.
       * @param {module:model/UserDataOperationId} userData The data to attach to the call. This is an array of objects with the properties key, type, and value.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.attachUserDataWithHttpInfo = function(id, userData) {
        var postBody = userData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling attachUserData");
        }
  
        // verify the required parameter 'userData' is set
        if (userData === undefined || userData === null) {
          throw new Error("Missing the required parameter 'userData' when calling attachUserData");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/attach-user-data', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Attach user data to a call
       * Attach the provided data to the specified call. This adds the data to the call even if data already exists with the provided keys.
       * @param {String} id The connection ID of the call.
       * @param {module:model/UserDataOperationId} userData The data to attach to the call. This is an array of objects with the properties key, type, and value.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.attachUserData = function(id, userData) {
        return this.attachUserDataWithHttpInfo(id, userData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Cancel call forwarding
       * Cancel call forwarding for the current agent.
       * @param {Object} opts Optional parameters
       * @param {module:model/CancelForwardBody} opts.cancelForwardBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.cancelForwardWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = opts['cancelForwardBody'];
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/cancel-forward', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Cancel call forwarding
       * Cancel call forwarding for the current agent.
       * @param {Object} opts Optional parameters
       * @param {module:model/CancelForwardBody} opts.cancelForwardBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.cancelForward = function(opts) {
        return this.cancelForwardWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Clear all the parties in the call
       * End the conference call for all parties. This can be performed by any agent participating in the conference.
       * @param {String} id The connection ID of the call to clear.
       * @param {module:model/ClearData} clearData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.clearWithHttpInfo = function(id, clearData) {
        var postBody = clearData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling clear");
        }
  
        // verify the required parameter 'clearData' is set
        if (clearData === undefined || clearData === null) {
          throw new Error("Missing the required parameter 'clearData' when calling clear");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/clear', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Clear all the parties in the call
       * End the conference call for all parties. This can be performed by any agent participating in the conference.
       * @param {String} id The connection ID of the call to clear.
       * @param {module:model/ClearData} clearData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.clear = function(id, clearData) {
        return this.clearWithHttpInfo(id, clearData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Complete a call
       * Complete the specified call by adding information to its user data after it has been released. You should make this request on released calls if you set automatic complete to false in [/activate-channels](/reference/workspace/Session/index.html#activateChannels).
       * @param {String} id The connection ID of the call.
       * @param {module:model/UserData} userData Key/value data to include with the call.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.completeCallWithHttpInfo = function(id, userData) {
        var postBody = userData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling completeCall");
        }
  
        // verify the required parameter 'userData' is set
        if (userData === undefined || userData === null) {
          throw new Error("Missing the required parameter 'userData' when calling completeCall");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/complete', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Complete a call
       * Complete the specified call by adding information to its user data after it has been released. You should make this request on released calls if you set automatic complete to false in [/activate-channels](/reference/workspace/Session/index.html#activateChannels).
       * @param {String} id The connection ID of the call.
       * @param {module:model/UserData} userData Key/value data to include with the call.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.completeCall = function(id, userData) {
        return this.completeCallWithHttpInfo(id, userData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Complete a conference
       * Complete a previously initiated two-step conference identified by the provided IDs. Once completed, the two separate calls are brought together so that all three parties are participating in the same call.
       * @param {String} id The connection ID of the consult call (established).
       * @param {module:model/CompleteConferenceData} completeConferenceData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.completeConferenceWithHttpInfo = function(id, completeConferenceData) {
        var postBody = completeConferenceData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling completeConference");
        }
  
        // verify the required parameter 'completeConferenceData' is set
        if (completeConferenceData === undefined || completeConferenceData === null) {
          throw new Error("Missing the required parameter 'completeConferenceData' when calling completeConference");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/complete-conference', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Complete a conference
       * Complete a previously initiated two-step conference identified by the provided IDs. Once completed, the two separate calls are brought together so that all three parties are participating in the same call.
       * @param {String} id The connection ID of the consult call (established).
       * @param {module:model/CompleteConferenceData} completeConferenceData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.completeConference = function(id, completeConferenceData) {
        return this.completeConferenceWithHttpInfo(id, completeConferenceData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Complete a transfer
       * Complete a previously initiated two-step transfer using the provided IDs.
       * @param {String} id The connection ID of the consult call (established).
       * @param {module:model/CompleteTransferData} completeTransferData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.completeTransferWithHttpInfo = function(id, completeTransferData) {
        var postBody = completeTransferData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling completeTransfer");
        }
  
        // verify the required parameter 'completeTransferData' is set
        if (completeTransferData === undefined || completeTransferData === null) {
          throw new Error("Missing the required parameter 'completeTransferData' when calling completeTransfer");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/complete-transfer', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Complete a transfer
       * Complete a previously initiated two-step transfer using the provided IDs.
       * @param {String} id The connection ID of the consult call (established).
       * @param {module:model/CompleteTransferData} completeTransferData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.completeTransfer = function(id, completeTransferData) {
        return this.completeTransferWithHttpInfo(id, completeTransferData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete a party from a conference call
       * Delete the specified DN from the conference call. This operation can only be performed by the owner of the conference call.
       * @param {String} id The connection ID of the conference call.
       * @param {module:model/DeleteFromConferenceData} deleteFromConferenceData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.deleteFromConferenceWithHttpInfo = function(id, deleteFromConferenceData) {
        var postBody = deleteFromConferenceData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteFromConference");
        }
  
        // verify the required parameter 'deleteFromConferenceData' is set
        if (deleteFromConferenceData === undefined || deleteFromConferenceData === null) {
          throw new Error("Missing the required parameter 'deleteFromConferenceData' when calling deleteFromConference");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/delete-from-conference', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete a party from a conference call
       * Delete the specified DN from the conference call. This operation can only be performed by the owner of the conference call.
       * @param {String} id The connection ID of the conference call.
       * @param {module:model/DeleteFromConferenceData} deleteFromConferenceData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.deleteFromConference = function(id, deleteFromConferenceData) {
        return this.deleteFromConferenceWithHttpInfo(id, deleteFromConferenceData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Remove a key/value pair from user data
       * Delete data with the specified key from the call&#39;s user data.
       * @param {String} id The connection ID of the call.
       * @param {module:model/KeyData} keyData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.deleteUserDataPairWithHttpInfo = function(id, keyData) {
        var postBody = keyData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteUserDataPair");
        }
  
        // verify the required parameter 'keyData' is set
        if (keyData === undefined || keyData === null) {
          throw new Error("Missing the required parameter 'keyData' when calling deleteUserDataPair");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/delete-user-data-pair', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Remove a key/value pair from user data
       * Delete data with the specified key from the call&#39;s user data.
       * @param {String} id The connection ID of the call.
       * @param {module:model/KeyData} keyData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.deleteUserDataPair = function(id, keyData) {
        return this.deleteUserDataPairWithHttpInfo(id, keyData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Forward calls
       * Set call forwarding on the current agent&#39;s DN to the specified destination.
       * @param {module:model/ForwardData} forwardData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.forwardWithHttpInfo = function(forwardData) {
        var postBody = forwardData;
  
        // verify the required parameter 'forwardData' is set
        if (forwardData === undefined || forwardData === null) {
          throw new Error("Missing the required parameter 'forwardData' when calling forward");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/set-forward', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Forward calls
       * Set call forwarding on the current agent&#39;s DN to the specified destination.
       * @param {module:model/ForwardData} forwardData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.forward = function(forwardData) {
        return this.forwardWithHttpInfo(forwardData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all calls
       * Get all active calls for the current agent.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/InlineResponse200} and HTTP response
       */
      this.getCallsWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = InlineResponse200;
  
        return this.apiClient.callApi(
          '/voice/calls', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all calls
       * Get all active calls for the current agent.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/InlineResponse200}
       */
      this.getCalls = function() {
        return this.getCallsWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Place a call on hold
       * Place the specified call on hold.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/HoldData} opts.holdData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.holdWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = opts['holdData'];
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling hold");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/hold', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Place a call on hold
       * Place the specified call on hold.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/HoldData} opts.holdData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.hold = function(id, opts) {
        return this.holdWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Initiate a conference
       * Initiate a two-step conference to the specified destination. This places the existing call on hold and creates a new call in the dialing state (step 1). After initiating the conference you can use [/voice/calls/{id}/complete-conference](/reference/workspace/Voice/index.html#completeConference) to complete the conference and bring all parties into the same call (step 2).
       * @param {String} id The connection ID of the call to start the conference from. This call will be placed on hold.
       * @param {module:model/InitiateConferenceData} initiateConferenceData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.initiateConferenceWithHttpInfo = function(id, initiateConferenceData) {
        var postBody = initiateConferenceData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling initiateConference");
        }
  
        // verify the required parameter 'initiateConferenceData' is set
        if (initiateConferenceData === undefined || initiateConferenceData === null) {
          throw new Error("Missing the required parameter 'initiateConferenceData' when calling initiateConference");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/initiate-conference', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Initiate a conference
       * Initiate a two-step conference to the specified destination. This places the existing call on hold and creates a new call in the dialing state (step 1). After initiating the conference you can use [/voice/calls/{id}/complete-conference](/reference/workspace/Voice/index.html#completeConference) to complete the conference and bring all parties into the same call (step 2).
       * @param {String} id The connection ID of the call to start the conference from. This call will be placed on hold.
       * @param {module:model/InitiateConferenceData} initiateConferenceData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.initiateConference = function(id, initiateConferenceData) {
        return this.initiateConferenceWithHttpInfo(id, initiateConferenceData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Initiate a transfer
       * Initiate a two-step transfer by placing the first call on hold and dialing the destination number (step 1). After initiating the transfer, you can use [/voice/calls/{id}/complete-transfer](/reference/workspace/Voice/index.html#completeTransfer) to complete the transfer (step 2).
       * @param {String} id The connection ID of the call to be transferred. This call will be placed on hold.
       * @param {module:model/InitiateTransferData} initiateTransferData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.initiateTransferWithHttpInfo = function(id, initiateTransferData) {
        var postBody = initiateTransferData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling initiateTransfer");
        }
  
        // verify the required parameter 'initiateTransferData' is set
        if (initiateTransferData === undefined || initiateTransferData === null) {
          throw new Error("Missing the required parameter 'initiateTransferData' when calling initiateTransfer");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/initiate-transfer', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Initiate a transfer
       * Initiate a two-step transfer by placing the first call on hold and dialing the destination number (step 1). After initiating the transfer, you can use [/voice/calls/{id}/complete-transfer](/reference/workspace/Voice/index.html#completeTransfer) to complete the transfer (step 2).
       * @param {String} id The connection ID of the call to be transferred. This call will be placed on hold.
       * @param {module:model/InitiateTransferData} initiateTransferData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.initiateTransfer = function(id, initiateTransferData) {
        return this.initiateTransferWithHttpInfo(id, initiateTransferData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Log in on the voice channel
       * Log in the current agent on the voice channel. When you make this request, Workspace uses the parameters you provided in [/activate-channels](/reference/workspace/Session/index.html#activateChannels). For most applications, you don&#39;t need to worry about logging in the agent on the voice channel because it&#39;s handled by the Workspace API when you call [/activate-channels](/reference/workspace/Session/index.html#activateChannels). However, if you make a [/voice/logout](/reference/workspace/Voice/index.html#logoutVoice) request, you can then use [/voice/login](/reference/workspace/Voice/index.html#loginVoice) to log in the agent on the voice channel. **Note&amp;colon;** This login /logout flow only applies to the voice channel, not to the agent&#39;s session.
       * @param {Object} opts Optional parameters
       * @param {module:model/LoginData} opts.loginData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.loginVoiceWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = opts['loginData'];
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/login', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Log in on the voice channel
       * Log in the current agent on the voice channel. When you make this request, Workspace uses the parameters you provided in [/activate-channels](/reference/workspace/Session/index.html#activateChannels). For most applications, you don&#39;t need to worry about logging in the agent on the voice channel because it&#39;s handled by the Workspace API when you call [/activate-channels](/reference/workspace/Session/index.html#activateChannels). However, if you make a [/voice/logout](/reference/workspace/Voice/index.html#logoutVoice) request, you can then use [/voice/login](/reference/workspace/Voice/index.html#loginVoice) to log in the agent on the voice channel. **Note&amp;colon;** This login /logout flow only applies to the voice channel, not to the agent&#39;s session.
       * @param {Object} opts Optional parameters
       * @param {module:model/LoginData} opts.loginData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.loginVoice = function(opts) {
        return this.loginVoiceWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Log out of the voice channel
       * Log out the current agent on the voice channel. This request is typically paired with [/voice/login](/reference/workspace/Voice/index.html#loginVoice)&amp;mdash;together they let you login/logout an agent on the voice channel without logging out of the entire session.
       * @param {Object} opts Optional parameters
       * @param {module:model/DndOnBody} opts.dndOnBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.logoutVoiceWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = opts['dndOnBody'];
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/logout', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Log out of the voice channel
       * Log out the current agent on the voice channel. This request is typically paired with [/voice/login](/reference/workspace/Voice/index.html#loginVoice)&amp;mdash;together they let you login/logout an agent on the voice channel without logging out of the entire session.
       * @param {Object} opts Optional parameters
       * @param {module:model/DndOnBody} opts.dndOnBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.logoutVoice = function(opts) {
        return this.logoutVoiceWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Make a new call
       * Make a new call to the specified destination.
       * @param {module:model/MakeCallData} makeCallData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.makeCallWithHttpInfo = function(makeCallData) {
        var postBody = makeCallData;
  
        // verify the required parameter 'makeCallData' is set
        if (makeCallData === undefined || makeCallData === null) {
          throw new Error("Missing the required parameter 'makeCallData' when calling makeCall");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/make-call', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Make a new call
       * Make a new call to the specified destination.
       * @param {module:model/MakeCallData} makeCallData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.makeCall = function(makeCallData) {
        return this.makeCallWithHttpInfo(makeCallData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Merge two calls
       * Merge the two specified calls.
       * @param {String} id The connection ID of the first call to be merged.
       * @param {module:model/MergeData} mergeData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.mergeWithHttpInfo = function(id, mergeData) {
        var postBody = mergeData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling merge");
        }
  
        // verify the required parameter 'mergeData' is set
        if (mergeData === undefined || mergeData === null) {
          throw new Error("Missing the required parameter 'mergeData' when calling merge");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/merge', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Merge two calls
       * Merge the two specified calls.
       * @param {String} id The connection ID of the first call to be merged.
       * @param {module:model/MergeData} mergeData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.merge = function(id, mergeData) {
        return this.mergeWithHttpInfo(id, mergeData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Pause recording on a call
       * Pause recording on the specified call.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/PauseRecordingBody} opts.pauseRecordingBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.pauseRecordingWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = opts['pauseRecordingBody'];
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling pauseRecording");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/pause-recording', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Pause recording on a call
       * Pause recording on the specified call.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/PauseRecordingBody} opts.pauseRecordingBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.pauseRecording = function(id, opts) {
        return this.pauseRecordingWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Reconnect a call
       * Reconnect the specified call. This releases the established call and retrieves the held call in one step. This is a quick way to to do [/voice/calls/{id}/release](/reference/workspace/Voice/index.html#release) and [/voice/calls/{id}/retrieve](/reference/workspace/Voice/index.html#retrieve).
       * @param {String} id The connection ID of the established call (will be released).
       * @param {module:model/ReconnectData} reconnectData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.reconnectWithHttpInfo = function(id, reconnectData) {
        var postBody = reconnectData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling reconnect");
        }
  
        // verify the required parameter 'reconnectData' is set
        if (reconnectData === undefined || reconnectData === null) {
          throw new Error("Missing the required parameter 'reconnectData' when calling reconnect");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/reconnect', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Reconnect a call
       * Reconnect the specified call. This releases the established call and retrieves the held call in one step. This is a quick way to to do [/voice/calls/{id}/release](/reference/workspace/Voice/index.html#release) and [/voice/calls/{id}/retrieve](/reference/workspace/Voice/index.html#retrieve).
       * @param {String} id The connection ID of the established call (will be released).
       * @param {module:model/ReconnectData} reconnectData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.reconnect = function(id, reconnectData) {
        return this.reconnectWithHttpInfo(id, reconnectData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Redirect a call
       * Redirect a call to the specified destination.
       * @param {String} id The connection ID of the current call to redirect.
       * @param {module:model/RedirectData} redirectData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.redirectWithHttpInfo = function(id, redirectData) {
        var postBody = redirectData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling redirect");
        }
  
        // verify the required parameter 'redirectData' is set
        if (redirectData === undefined || redirectData === null) {
          throw new Error("Missing the required parameter 'redirectData' when calling redirect");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/redirect', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Redirect a call
       * Redirect a call to the specified destination.
       * @param {String} id The connection ID of the current call to redirect.
       * @param {module:model/RedirectData} redirectData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.redirect = function(id, redirectData) {
        return this.redirectWithHttpInfo(id, redirectData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Release a call
       * Release the specified call.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/ReleaseData} opts.releaseData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.releaseWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = opts['releaseData'];
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling release");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/release', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Release a call
       * Release the specified call.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/ReleaseData} opts.releaseData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.release = function(id, opts) {
        return this.releaseWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Resume recording a call
       * Resume recording the specified call.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/ResumeRecordingBody} opts.resumeRecordingBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.resumeRecordingWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = opts['resumeRecordingBody'];
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling resumeRecording");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/resume-recording', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Resume recording a call
       * Resume recording the specified call.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/ResumeRecordingBody} opts.resumeRecordingBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.resumeRecording = function(id, opts) {
        return this.resumeRecordingWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Retrieve a call from hold
       * Retrieve the specified call from hold.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/RetrieveData} opts.retrieveData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.retrieveWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = opts['retrieveData'];
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling retrieve");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/retrieve', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Retrieve a call from hold
       * Retrieve the specified call from hold.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/RetrieveData} opts.retrieveData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.retrieve = function(id, opts) {
        return this.retrieveWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Send digits as DTMF
       * Send DTMF digits to the specified call. You can send DTMF digits individually with multiple requests or together with multiple digits in one request.
       * @param {String} id The connection ID of the call.
       * @param {module:model/SendDTMFData} sendDTMFData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.sendDTMFWithHttpInfo = function(id, sendDTMFData) {
        var postBody = sendDTMFData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling sendDTMF");
        }
  
        // verify the required parameter 'sendDTMFData' is set
        if (sendDTMFData === undefined || sendDTMFData === null) {
          throw new Error("Missing the required parameter 'sendDTMFData' when calling sendDTMF");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/send-dtmf', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Send digits as DTMF
       * Send DTMF digits to the specified call. You can send DTMF digits individually with multiple requests or together with multiple digits in one request.
       * @param {String} id The connection ID of the call.
       * @param {module:model/SendDTMFData} sendDTMFData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.sendDTMF = function(id, sendDTMFData) {
        return this.sendDTMFWithHttpInfo(id, sendDTMFData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Send a userEvent event to T-Server
       * Send EventUserEvent to T-Server with the provided attached data. For details about EventUserEvent, refer to the [*Genesys Events and Models Reference Manual*](https://docs.genesys.com/Documentation/System).
       * @param {module:model/SendUserEventData} userEventData The data to send. This is an array of objects with the properties key, type, and value.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.sendUserEventWithHttpInfo = function(userEventData) {
        var postBody = userEventData;
  
        // verify the required parameter 'userEventData' is set
        if (userEventData === undefined || userEventData === null) {
          throw new Error("Missing the required parameter 'userEventData' when calling sendUserEvent");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/send-user-event', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Send a userEvent event to T-Server
       * Send EventUserEvent to T-Server with the provided attached data. For details about EventUserEvent, refer to the [*Genesys Events and Models Reference Manual*](https://docs.genesys.com/Documentation/System).
       * @param {module:model/SendUserEventData} userEventData The data to send. This is an array of objects with the properties key, type, and value.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.sendUserEvent = function(userEventData) {
        return this.sendUserEventWithHttpInfo(userEventData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Set the agent state to Not Ready
       * Set the current agent&#39;s state to Not Ready on the voice channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/NotReadyData} opts.notReadyData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.setAgentStateNotReadyWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = opts['notReadyData'];
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/not-ready', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Set the agent state to Not Ready
       * Set the current agent&#39;s state to Not Ready on the voice channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/NotReadyData} opts.notReadyData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.setAgentStateNotReady = function(opts) {
        return this.setAgentStateNotReadyWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Set the agent state to Ready
       * Set the current agent&#39;s state to Ready on the voice channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/ReadyData} opts.readyData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.setAgentStateReadyWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = opts['readyData'];
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/ready', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Set the agent state to Ready
       * Set the current agent&#39;s state to Ready on the voice channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/ReadyData} opts.readyData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.setAgentStateReady = function(opts) {
        return this.setAgentStateReadyWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Turn off Do Not Disturb
       * Turn off Do Not Disturb for the current agent on the voice channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/DndOffBody} opts.dndOffBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.setDNDOffWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = opts['dndOffBody'];
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/dnd-off', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Turn off Do Not Disturb
       * Turn off Do Not Disturb for the current agent on the voice channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/DndOffBody} opts.dndOffBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.setDNDOff = function(opts) {
        return this.setDNDOffWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Set the agent state to Do Not Disturb
       * Set the current agent&#39;s state to Do Not Disturb on the voice channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/DndOnBody1} opts.dndOnBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.setDNDOnWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = opts['dndOnBody'];
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/dnd-on', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Set the agent state to Do Not Disturb
       * Set the current agent&#39;s state to Do Not Disturb on the voice channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/DndOnBody1} opts.dndOnBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.setDNDOn = function(opts) {
        return this.setDNDOnWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Set the focus time of call
       * Set the focus time to the specified call.
       * @param {String} id The connection ID of the call.
       * @param {module:model/SetFocusTimeData} setFocusTimeData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.setFocusTimeCallWithHttpInfo = function(id, setFocusTimeData) {
        var postBody = setFocusTimeData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling setFocusTimeCall");
        }
  
        // verify the required parameter 'setFocusTimeData' is set
        if (setFocusTimeData === undefined || setFocusTimeData === null) {
          throw new Error("Missing the required parameter 'setFocusTimeData' when calling setFocusTimeCall");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/set-focus-time', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Set the focus time of call
       * Set the focus time to the specified call.
       * @param {String} id The connection ID of the call.
       * @param {module:model/SetFocusTimeData} setFocusTimeData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.setFocusTimeCall = function(id, setFocusTimeData) {
        return this.setFocusTimeCallWithHttpInfo(id, setFocusTimeData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Create a conference in a single step
       * Perform a single-step conference to the specified destination. This adds the destination to the existing call, creating a conference if necessary.
       * @param {String} id The connection ID of the call to conference.
       * @param {module:model/SingleStepConferenceData} singleStepConferenceData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.singleStepConferenceWithHttpInfo = function(id, singleStepConferenceData) {
        var postBody = singleStepConferenceData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling singleStepConference");
        }
  
        // verify the required parameter 'singleStepConferenceData' is set
        if (singleStepConferenceData === undefined || singleStepConferenceData === null) {
          throw new Error("Missing the required parameter 'singleStepConferenceData' when calling singleStepConference");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/single-step-conference', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Create a conference in a single step
       * Perform a single-step conference to the specified destination. This adds the destination to the existing call, creating a conference if necessary.
       * @param {String} id The connection ID of the call to conference.
       * @param {module:model/SingleStepConferenceData} singleStepConferenceData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.singleStepConference = function(id, singleStepConferenceData) {
        return this.singleStepConferenceWithHttpInfo(id, singleStepConferenceData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Transfer a call in a single step
       * Perform a single-step transfer to the specified destination.
       * @param {String} id The connection ID of the call to transfer.
       * @param {module:model/SingleStepTransferData} singleStepTransferData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.singleStepTransferWithHttpInfo = function(id, singleStepTransferData) {
        var postBody = singleStepTransferData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling singleStepTransfer");
        }
  
        // verify the required parameter 'singleStepTransferData' is set
        if (singleStepTransferData === undefined || singleStepTransferData === null) {
          throw new Error("Missing the required parameter 'singleStepTransferData' when calling singleStepTransfer");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/single-step-transfer', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Transfer a call in a single step
       * Perform a single-step transfer to the specified destination.
       * @param {String} id The connection ID of the call to transfer.
       * @param {module:model/SingleStepTransferData} singleStepTransferData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.singleStepTransfer = function(id, singleStepTransferData) {
        return this.singleStepTransferWithHttpInfo(id, singleStepTransferData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Start monitoring an agent
       * Start supervisor monitoring of an agent. Use the parameters to specify how the monitoring should behave. Once you&#39;ve enabled monitoring, you can change the monitoring mode using [/voice/calls/{id}/switch-to-listen-in (Mute)](/reference/workspace/Voice/index.html#switchToListenIn), [/voice/calls/{id}/switch-to-coaching (Coach)](/reference/workspace/Voice/index.html#switchToCoaching), and [/voice/calls/{id}/switch-to-barge-in (Connect)](/reference/workspace/Voice/index.html#switchToBargeIn).
       * @param {module:model/StartMonitoringData} startMonitoringData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.startMonitoringWithHttpInfo = function(startMonitoringData) {
        var postBody = startMonitoringData;
  
        // verify the required parameter 'startMonitoringData' is set
        if (startMonitoringData === undefined || startMonitoringData === null) {
          throw new Error("Missing the required parameter 'startMonitoringData' when calling startMonitoring");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/start-monitoring', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Start monitoring an agent
       * Start supervisor monitoring of an agent. Use the parameters to specify how the monitoring should behave. Once you&#39;ve enabled monitoring, you can change the monitoring mode using [/voice/calls/{id}/switch-to-listen-in (Mute)](/reference/workspace/Voice/index.html#switchToListenIn), [/voice/calls/{id}/switch-to-coaching (Coach)](/reference/workspace/Voice/index.html#switchToCoaching), and [/voice/calls/{id}/switch-to-barge-in (Connect)](/reference/workspace/Voice/index.html#switchToBargeIn).
       * @param {module:model/StartMonitoringData} startMonitoringData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.startMonitoring = function(startMonitoringData) {
        return this.startMonitoringWithHttpInfo(startMonitoringData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Start recording a call
       * Start recording the specified call. Recording stops when the call is completed or you send [/voice/calls/{id}/stop-recording](/reference/workspace/Voice/index.html#stopRecording) on either the call or the DN.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/StartRecordingBody} opts.startRecordingBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.startRecordingWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = opts['startRecordingBody'];
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling startRecording");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/start-recording', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Start recording a call
       * Start recording the specified call. Recording stops when the call is completed or you send [/voice/calls/{id}/stop-recording](/reference/workspace/Voice/index.html#stopRecording) on either the call or the DN.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/StartRecordingBody} opts.startRecordingBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.startRecording = function(id, opts) {
        return this.startRecordingWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Stop monitoring an agent
       * Stop monitoring an agent.
       * @param {module:model/StopMonitoringData} stopMonitoringData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.stopMonitoringWithHttpInfo = function(stopMonitoringData) {
        var postBody = stopMonitoringData;
  
        // verify the required parameter 'stopMonitoringData' is set
        if (stopMonitoringData === undefined || stopMonitoringData === null) {
          throw new Error("Missing the required parameter 'stopMonitoringData' when calling stopMonitoring");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/stop-monitoring', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Stop monitoring an agent
       * Stop monitoring an agent.
       * @param {module:model/StopMonitoringData} stopMonitoringData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.stopMonitoring = function(stopMonitoringData) {
        return this.stopMonitoringWithHttpInfo(stopMonitoringData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Stop recording a call
       * Stop recording the specified call.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/StopRecordingBody} opts.stopRecordingBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.stopRecordingWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = opts['stopRecordingBody'];
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling stopRecording");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/stop-recording', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Stop recording a call
       * Stop recording the specified call.
       * @param {String} id The connection ID of the call.
       * @param {Object} opts Optional parameters
       * @param {module:model/StopRecordingBody} opts.stopRecordingBody Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.stopRecording = function(id, opts) {
        return this.stopRecordingWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Switch to barge-in
       * Switch to the barge-in monitoring mode. If the agent is currently on a call and T-Server is configured to allow barge-in, the supervisor is immediately added to the call. Both the monitored agent and the customer are able to hear and speak with the supervisor. If the target agent is not on a call at the time of the request, the supervisor is brought into the call when the agent receives a new call.
       * @param {String} id The connection ID of the call being monitored.
       * @param {Object} opts Optional parameters
       * @param {module:model/MonitoringScopeData} opts.monitoringScopeData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.switchToBargeInWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = opts['monitoringScopeData'];
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling switchToBargeIn");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/switch-to-barge-in', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Switch to barge-in
       * Switch to the barge-in monitoring mode. If the agent is currently on a call and T-Server is configured to allow barge-in, the supervisor is immediately added to the call. Both the monitored agent and the customer are able to hear and speak with the supervisor. If the target agent is not on a call at the time of the request, the supervisor is brought into the call when the agent receives a new call.
       * @param {String} id The connection ID of the call being monitored.
       * @param {Object} opts Optional parameters
       * @param {module:model/MonitoringScopeData} opts.monitoringScopeData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.switchToBargeIn = function(id, opts) {
        return this.switchToBargeInWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Switch to coach
       * Switch to the coach monitoring mode. When coaching is enabled and the agent receives a call, the supervisor is brought into the call. Only the agent can hear the supervisor.
       * @param {String} id The connection ID of the call being monitored.
       * @param {Object} opts Optional parameters
       * @param {module:model/MonitoringScopeData} opts.monitoringScopeData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.switchToCoachingWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = opts['monitoringScopeData'];
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling switchToCoaching");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/switch-to-coaching', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Switch to coach
       * Switch to the coach monitoring mode. When coaching is enabled and the agent receives a call, the supervisor is brought into the call. Only the agent can hear the supervisor.
       * @param {String} id The connection ID of the call being monitored.
       * @param {Object} opts Optional parameters
       * @param {module:model/MonitoringScopeData} opts.monitoringScopeData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.switchToCoaching = function(id, opts) {
        return this.switchToCoachingWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Switch to listen in
       * Switch to the listen in monitoring mode. When listen in is enabled and the agent receives a call, the supervisor is able to listen to the agent and the customer, but they can&#39;t hear the supervisor.
       * @param {String} id The connection ID of the call being monitored.
       * @param {Object} opts Optional parameters
       * @param {module:model/MonitoringScopeData} opts.monitoringScopeData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.switchToListenInWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = opts['monitoringScopeData'];
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling switchToListenIn");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/switch-to-listen-in', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Switch to listen in
       * Switch to the listen in monitoring mode. When listen in is enabled and the agent receives a call, the supervisor is able to listen to the agent and the customer, but they can&#39;t hear the supervisor.
       * @param {String} id The connection ID of the call being monitored.
       * @param {Object} opts Optional parameters
       * @param {module:model/MonitoringScopeData} opts.monitoringScopeData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.switchToListenIn = function(id, opts) {
        return this.switchToListenInWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Update user data for a call
       * Update call data with the provided key/value pairs. This replaces any existing key/value pairs with the same keys.
       * @param {String} id The connection ID of the call.
       * @param {module:model/UserDataOperationId} userData The data to update. This is an array of objects with the properties key, type, and value.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.updateUserDataWithHttpInfo = function(id, userData) {
        var postBody = userData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling updateUserData");
        }
  
        // verify the required parameter 'userData' is set
        if (userData === undefined || userData === null) {
          throw new Error("Missing the required parameter 'userData' when calling updateUserData");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/voice/calls/{id}/update-user-data', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Update user data for a call
       * Update call data with the provided key/value pairs. This replaces any existing key/value pairs with the same keys.
       * @param {String} id The connection ID of the call.
       * @param {module:model/UserDataOperationId} userData The data to update. This is an array of objects with the properties key, type, and value.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.updateUserData = function(id, userData) {
        return this.updateUserDataWithHttpInfo(id, userData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
    }