docs: function(apiClient) {
      this.apiClient = apiClient || ApiClient.instance;
  
  
  
      /**
       * Accept an incoming interaction
       * Accept the specified interaction.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction to accept.
       * @param {Object} opts Optional parameters
       * @param {module:model/AcceptData6} opts.acceptData 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.acceptWithHttpInfo = function(mediatype, id, opts) {
        opts = opts || {};
        var postBody = opts['acceptData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling accept");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling accept");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/accept', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Accept an incoming interaction
       * Accept the specified interaction.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction to accept.
       * @param {Object} opts Optional parameters
       * @param {module:model/AcceptData6} opts.acceptData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.accept = function(mediatype, id, opts) {
        return this.acceptWithHttpInfo(mediatype, id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Add an attachment to the open-media interaction
       * Add an attachment to the interaction specified in the id path parameter
       * @param {String} mediatype media-type of interaction to add attachment
       * @param {String} id id of interaction
       * @param {Object} opts Optional parameters
       * @param {File} opts.attachment The file to upload.
       * @param {String} opts.operationId operationId associated to the request
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.addAttachmentWithHttpInfo = function(mediatype, id, opts) {
        opts = opts || {};
        var postBody = null;
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling addAttachment");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling addAttachment");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
          'attachment': opts['attachment'],
          'operationId': opts['operationId']
        };
  
        var authNames = [];
        var contentTypes = ['multipart/form-data'];
        var accepts = ['application/json'];
        var returnType = ApiSuccessResponse;
  
        return this.apiClient.callApi(
          '/media/{mediatype}/interactions/{id}/add-attachment', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Add an attachment to the open-media interaction
       * Add an attachment to the interaction specified in the id path parameter
       * @param {String} mediatype media-type of interaction to add attachment
       * @param {String} id id of interaction
       * @param {Object} opts Optional parameters
       * @param {File} opts.attachment The file to upload.
       * @param {String} opts.operationId operationId associated to the request
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.addAttachment = function(mediatype, id, opts) {
        return this.addAttachmentWithHttpInfo(mediatype, id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Create the interaction in UCS database
       * Create the interaction in UCS database
       * @param {String} mediatype media-type of interaction
       * @param {String} id id of the interaction
       * @param {Object} opts Optional parameters
       * @param {module:model/AddContentData} opts.addContentData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.addContentWithHttpInfo = function(mediatype, id, opts) {
        opts = opts || {};
        var postBody = opts['addContentData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling addContent");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling addContent");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/add-content', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Create the interaction in UCS database
       * Create the interaction in UCS database
       * @param {String} mediatype media-type of interaction
       * @param {String} id id of the interaction
       * @param {Object} opts Optional parameters
       * @param {module:model/AddContentData} opts.addContentData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.addContent = function(mediatype, id, opts) {
        return this.addContentWithHttpInfo(mediatype, id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Add an attachment to the open-media interaction
       * Add an attachment to the interaction specified in the id path parameter
       * @param {String} mediatype media-type of interaction to add attachment
       * @param {String} id id of interaction
       * @param {module:model/AddDocumentData} addDocumentData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.addDocumentWithHttpInfo = function(mediatype, id, addDocumentData) {
        var postBody = addDocumentData;
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling addDocument");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling addDocument");
        }
  
        // verify the required parameter 'addDocumentData' is set
        if (addDocumentData === undefined || addDocumentData === null) {
          throw new Error("Missing the required parameter 'addDocumentData' when calling addDocument");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/add-document', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Add an attachment to the open-media interaction
       * Add an attachment to the interaction specified in the id path parameter
       * @param {String} mediatype media-type of interaction to add attachment
       * @param {String} id id of interaction
       * @param {module:model/AddDocumentData} addDocumentData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.addDocument = function(mediatype, id, addDocumentData) {
        return this.addDocumentWithHttpInfo(mediatype, id, addDocumentData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Assign the contact to the open interaction
       * Assign the contact to the open interaction specified in the contactId path parameter
       * @param {String} mediatype media-type of interaction
       * @param {String} id id of interaction
       * @param {String} contactId id of contact
       * @param {Object} opts Optional parameters
       * @param {module:model/AssignContactData} opts.assignContactData 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.assignContactWithHttpInfo = function(mediatype, id, contactId, opts) {
        opts = opts || {};
        var postBody = opts['assignContactData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling assignContact");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling assignContact");
        }
  
        // verify the required parameter 'contactId' is set
        if (contactId === undefined || contactId === null) {
          throw new Error("Missing the required parameter 'contactId' when calling assignContact");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          'id': id,
          'contactId': contactId
        };
        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(
          '/media/{mediatype}/interactions/{id}/assign-contact/{contactId}', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Assign the contact to the open interaction
       * Assign the contact to the open interaction specified in the contactId path parameter
       * @param {String} mediatype media-type of interaction
       * @param {String} id id of interaction
       * @param {String} contactId id of contact
       * @param {Object} opts Optional parameters
       * @param {module:model/AssignContactData} opts.assignContactData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.assignContact = function(mediatype, id, contactId, opts) {
        return this.assignContactWithHttpInfo(mediatype, id, contactId, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Put the interaction chat on hold
       * Put the interaction chat on hold.
       * @param {String} id The ID of the interaction.
       * @param {module:model/PutOnHoldData} putOnHoldData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.asyncPutOnHoldWithHttpInfo = function(id, putOnHoldData) {
        var postBody = putOnHoldData;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling asyncPutOnHold");
        }
  
        // verify the required parameter 'putOnHoldData' is set
        if (putOnHoldData === undefined || putOnHoldData === null) {
          throw new Error("Missing the required parameter 'putOnHoldData' when calling asyncPutOnHold");
        }
  
  
        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(
          '/media/chat/interactions/{id}/put-on-hold', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Put the interaction chat on hold
       * Put the interaction chat on hold.
       * @param {String} id The ID of the interaction.
       * @param {module:model/PutOnHoldData} putOnHoldData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.asyncPutOnHold = function(id, putOnHoldData) {
        return this.asyncPutOnHoldWithHttpInfo(id, putOnHoldData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Attach user data to an interaction
       * Attach the provided data to the specified interaction.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @param {module:model/UserDataOperationId} userData The data to attach to the interaction. 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.attachMediaUserDataWithHttpInfo = function(mediatype, id, userData) {
        var postBody = userData;
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling attachMediaUserData");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling attachMediaUserData");
        }
  
        // verify the required parameter 'userData' is set
        if (userData === undefined || userData === null) {
          throw new Error("Missing the required parameter 'userData' when calling attachMediaUserData");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/attach-user-data', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Attach user data to an interaction
       * Attach the provided data to the specified interaction.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @param {module:model/UserDataOperationId} userData The data to attach to the interaction. 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.attachMediaUserData = function(mediatype, id, userData) {
        return this.attachMediaUserDataWithHttpInfo(mediatype, id, userData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get the attachment of the interaction
       * Get the attachment of the interaction specified in the documentId path parameter
       * @param {String} mediatype media-type of interaction
       * @param {String} id id of interaction
       * @param {String} documentId id of document to get
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link 'String'} and HTTP response
       */
      this.attachmentsWithHttpInfo = function(mediatype, id, documentId) {
        var postBody = null;
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling attachments");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling attachments");
        }
  
        // verify the required parameter 'documentId' is set
        if (documentId === undefined || documentId === null) {
          throw new Error("Missing the required parameter 'documentId' when calling attachments");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          'id': id,
          'documentId': documentId
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = [];
        var contentTypes = ['application/json'];
        var accepts = ['application/octet-stream'];
        var returnType = 'String';
  
        return this.apiClient.callApi(
          '/media/{mediatype}/interactions/{id}/attachments/{documentId}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get the attachment of the interaction
       * Get the attachment of the interaction specified in the documentId path parameter
       * @param {String} mediatype media-type of interaction
       * @param {String} id id of interaction
       * @param {String} documentId id of document to get
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link 'String'}
       */
      this.attachments = function(mediatype, id, documentId) {
        return this.attachmentsWithHttpInfo(mediatype, id, documentId)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Complete an interaction
       * Marks the specified interaction as complete.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction to complete.
       * @param {Object} opts Optional parameters
       * @param {module:model/CompleteData} opts.completeData 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.completeWithHttpInfo = function(mediatype, id, opts) {
        opts = opts || {};
        var postBody = opts['completeData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling complete");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling complete");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/complete', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Complete an interaction
       * Marks the specified interaction as complete.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction to complete.
       * @param {Object} opts Optional parameters
       * @param {module:model/CompleteData} opts.completeData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.complete = function(mediatype, id, opts) {
        return this.completeWithHttpInfo(mediatype, id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Create open media interaction
       * Create a new open media interaction
       * @param {String} mediatype The media channel.
       * @param {module:model/CreateData1} createData 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.createOpenMediaWithHttpInfo = function(mediatype, createData) {
        var postBody = createData;
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling createOpenMedia");
        }
  
        // verify the required parameter 'createData' is set
        if (createData === undefined || createData === null) {
          throw new Error("Missing the required parameter 'createData' when calling createOpenMedia");
        }
  
  
        var pathParams = {
          'mediatype': mediatype
        };
        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(
          '/media/{mediatype}/interactions/create', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Create open media interaction
       * Create a new open media interaction
       * @param {String} mediatype The media channel.
       * @param {module:model/CreateData1} createData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.createOpenMedia = function(mediatype, createData) {
        return this.createOpenMediaWithHttpInfo(mediatype, createData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Remove key/value pairs from user data
       * Delete data with the specified keys from the interaction&#39;s user data.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @param {module:model/UserData1} userData The keys of the data to remove.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.deleteMediaUserDataWithHttpInfo = function(mediatype, id, userData) {
        var postBody = userData;
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling deleteMediaUserData");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteMediaUserData");
        }
  
        // verify the required parameter 'userData' is set
        if (userData === undefined || userData === null) {
          throw new Error("Missing the required parameter 'userData' when calling deleteMediaUserData");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/delete-user-data', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Remove key/value pairs from user data
       * Delete data with the specified keys from the interaction&#39;s user data.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @param {module:model/UserData1} userData The keys of the data to remove.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.deleteMediaUserData = function(mediatype, id, userData) {
        return this.deleteMediaUserDataWithHttpInfo(mediatype, id, userData)
          .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 all media channels.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaDndOffData} opts.mediaDndOffData 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.dndOffWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = opts['mediaDndOffData'];
  
  
        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(
          '/media/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 all media channels.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaDndOffData} opts.mediaDndOffData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.dndOff = function(opts) {
        return this.dndOffWithHttpInfo(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 all media channels.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaDndOnData} opts.mediaDndOnData 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.dndOnWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = opts['mediaDndOnData'];
  
  
        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(
          '/media/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 all media channels.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaDndOnData} opts.mediaDndOnData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.dndOn = function(opts) {
        return this.dndOnWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get the UCS content of the interaction
       * Get the UCS content of the interaction
       * @param {String} mediatype media-type of interaction
       * @param {String} id id of the interaction
       * @param {Object} opts Optional parameters
       * @param {module:model/GetContentData} opts.getContentData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.getContentMediaWithHttpInfo = function(mediatype, id, opts) {
        opts = opts || {};
        var postBody = opts['getContentData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling getContentMedia");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getContentMedia");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/get-content', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get the UCS content of the interaction
       * Get the UCS content of the interaction
       * @param {String} mediatype media-type of interaction
       * @param {String} id id of the interaction
       * @param {Object} opts Optional parameters
       * @param {module:model/GetContentData} opts.getContentData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.getContentMedia = function(mediatype, id, opts) {
        return this.getContentMediaWithHttpInfo(mediatype, id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Log out of all media channels
       * Log out the current agent on all media channels. You can make a [/media/{mediatype}/ready](/reference/workspace/Media/index.html#readyAgentState) or [/media/{mediatype}/not-ready](/reference/workspace/Media/index.html#notReadyAgentState) request to log in to the media channel again.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaLogoutData} opts.mediaLogoutData 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.logoutAgentStateWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = opts['mediaLogoutData'];
  
  
        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(
          '/media/logout', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Log out of all media channels
       * Log out the current agent on all media channels. You can make a [/media/{mediatype}/ready](/reference/workspace/Media/index.html#readyAgentState) or [/media/{mediatype}/not-ready](/reference/workspace/Media/index.html#notReadyAgentState) request to log in to the media channel again.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaLogoutData} opts.mediaLogoutData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.logoutAgentState = function(opts) {
        return this.logoutAgentStateWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Start monitoring an agent
       * Start supervisor monitoring of an agent on the specified media channel. When a monitored agent accepts a chat, the supervisor also receives the chat and all related notifications. If the agent is currently in a chat, the supervisor is added to the agent&#39;s next chat. The supervisor can&#39;t send messages in this mode and only another supervisor can see that the monitoring supervisor joined the chat. If the monitored agent leaves the chat but another agent is still present, the supervisor continues monitoring the chat until it&#39;s completed or placed in a queue. Once you&#39;ve enabled monitoring, you can change the monitoring mode using [/media/{mediatype}/interactions/{id}/switch-to-barge-in](/reference/workspace/Media/index.html#mediaSwicthToBargeIn), [/media/{mediatype}/interactions/{id}/switch-to-coach](/reference/workspace/Media/index.html#mediaSwicthToCoach), and [/media/{mediatype}/interactions/{id}/switch-to-monitor](/reference/workspace/Media/index.html#mediaSwicthToMonitor).
       * @param {String} mediatype The media channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaStartMonitoringData} opts.mediaStartMonitoringData 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.mediaStartMonitoringWithHttpInfo = function(mediatype, opts) {
        opts = opts || {};
        var postBody = opts['mediaStartMonitoringData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling mediaStartMonitoring");
        }
  
  
        var pathParams = {
          'mediatype': mediatype
        };
        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(
          '/media/{mediatype}/start-monitoring', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Start monitoring an agent
       * Start supervisor monitoring of an agent on the specified media channel. When a monitored agent accepts a chat, the supervisor also receives the chat and all related notifications. If the agent is currently in a chat, the supervisor is added to the agent&#39;s next chat. The supervisor can&#39;t send messages in this mode and only another supervisor can see that the monitoring supervisor joined the chat. If the monitored agent leaves the chat but another agent is still present, the supervisor continues monitoring the chat until it&#39;s completed or placed in a queue. Once you&#39;ve enabled monitoring, you can change the monitoring mode using [/media/{mediatype}/interactions/{id}/switch-to-barge-in](/reference/workspace/Media/index.html#mediaSwicthToBargeIn), [/media/{mediatype}/interactions/{id}/switch-to-coach](/reference/workspace/Media/index.html#mediaSwicthToCoach), and [/media/{mediatype}/interactions/{id}/switch-to-monitor](/reference/workspace/Media/index.html#mediaSwicthToMonitor).
       * @param {String} mediatype The media channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaStartMonitoringData} opts.mediaStartMonitoringData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.mediaStartMonitoring = function(mediatype, opts) {
        return this.mediaStartMonitoringWithHttpInfo(mediatype, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Stop monitoring an agent
       * Stop supervisor monitoring of an agent on the specified media channel.
       * @param {String} mediatype The media channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaStopMonitoringData} opts.mediaStopMonitoringData 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.mediaStopMonitoringWithHttpInfo = function(mediatype, opts) {
        opts = opts || {};
        var postBody = opts['mediaStopMonitoringData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling mediaStopMonitoring");
        }
  
  
        var pathParams = {
          'mediatype': mediatype
        };
        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(
          '/media/{mediatype}/stop-monitoring', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Stop monitoring an agent
       * Stop supervisor monitoring of an agent on the specified media channel.
       * @param {String} mediatype The media channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaStopMonitoringData} opts.mediaStopMonitoringData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.mediaStopMonitoring = function(mediatype, opts) {
        return this.mediaStopMonitoringWithHttpInfo(mediatype, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Switch to barge-in
       * Switch to the barge-in monitoring mode for the specified chat. Both the agent and the customer can see the supervisor&#39;s messages.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the chat interaction.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaSwicthToCoachData} opts.mediaSwicthToCoachData 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.mediaSwicthToBargeInWithHttpInfo = function(mediatype, id, opts) {
        opts = opts || {};
        var postBody = opts['mediaSwicthToCoachData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling mediaSwicthToBargeIn");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling mediaSwicthToBargeIn");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{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 for the specified chat. Both the agent and the customer can see the supervisor&#39;s messages.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the chat interaction.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaSwicthToCoachData} opts.mediaSwicthToCoachData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.mediaSwicthToBargeIn = function(mediatype, id, opts) {
        return this.mediaSwicthToBargeInWithHttpInfo(mediatype, id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Switch to coach
       * Switch to the coach monitoring mode for the specified chat. Only the agent can see the supervisor&#39;s messages.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the chat interaction.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaSwicthToCoachData1} opts.mediaSwicthToCoachData 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.mediaSwicthToCoachWithHttpInfo = function(mediatype, id, opts) {
        opts = opts || {};
        var postBody = opts['mediaSwicthToCoachData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling mediaSwicthToCoach");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling mediaSwicthToCoach");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/switch-to-coach', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Switch to coach
       * Switch to the coach monitoring mode for the specified chat. Only the agent can see the supervisor&#39;s messages.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the chat interaction.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaSwicthToCoachData1} opts.mediaSwicthToCoachData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.mediaSwicthToCoach = function(mediatype, id, opts) {
        return this.mediaSwicthToCoachWithHttpInfo(mediatype, id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Switch to monitor
       * Switch to the monitor mode for the specified chat. The supervisor can&#39;t send messages in this mode and only another supervisor can see that the monitoring supervisor joined the chat.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the chat interaction.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaSwicthToCoachData2} opts.mediaSwicthToCoachData 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.mediaSwicthToMonitorWithHttpInfo = function(mediatype, id, opts) {
        opts = opts || {};
        var postBody = opts['mediaSwicthToCoachData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling mediaSwicthToMonitor");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling mediaSwicthToMonitor");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/switch-to-monitor', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Switch to monitor
       * Switch to the monitor mode for the specified chat. The supervisor can&#39;t send messages in this mode and only another supervisor can see that the monitoring supervisor joined the chat.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the chat interaction.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaSwicthToCoachData2} opts.mediaSwicthToCoachData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.mediaSwicthToMonitor = function(mediatype, id, opts) {
        return this.mediaSwicthToMonitorWithHttpInfo(mediatype, id, opts)
          .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 all media channels.
       * @param {module:model/NotReadyForAgentData} notReadyForAgentData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.notReadyAgentStateWithHttpInfo = function(notReadyForAgentData) {
        var postBody = notReadyForAgentData;
  
        // verify the required parameter 'notReadyForAgentData' is set
        if (notReadyForAgentData === undefined || notReadyForAgentData === null) {
          throw new Error("Missing the required parameter 'notReadyForAgentData' when calling notReadyAgentState");
        }
  
  
        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(
          '/media/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 all media channels.
       * @param {module:model/NotReadyForAgentData} notReadyForAgentData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.notReadyAgentState = function(notReadyForAgentData) {
        return this.notReadyAgentStateWithHttpInfo(notReadyForAgentData)
          .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 specified media channel.
       * @param {String} mediatype The media channel.
       * @param {module:model/NotReadyForMediaData} notReadyForMediaData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.notReadyForMediaWithHttpInfo = function(mediatype, notReadyForMediaData) {
        var postBody = notReadyForMediaData;
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling notReadyForMedia");
        }
  
        // verify the required parameter 'notReadyForMediaData' is set
        if (notReadyForMediaData === undefined || notReadyForMediaData === null) {
          throw new Error("Missing the required parameter 'notReadyForMediaData' when calling notReadyForMedia");
        }
  
  
        var pathParams = {
          'mediatype': mediatype
        };
        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(
          '/media/{mediatype}/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 specified media channel.
       * @param {String} mediatype The media channel.
       * @param {module:model/NotReadyForMediaData} notReadyForMediaData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.notReadyForMedia = function(mediatype, notReadyForMediaData) {
        return this.notReadyForMediaWithHttpInfo(mediatype, notReadyForMediaData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Place an interaction in a queue
       * Place the interaction in the specified queue.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @param {module:model/PlaceInQueueData} placeInQueueData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.placeInQueueWithHttpInfo = function(mediatype, id, placeInQueueData) {
        var postBody = placeInQueueData;
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling placeInQueue");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling placeInQueue");
        }
  
        // verify the required parameter 'placeInQueueData' is set
        if (placeInQueueData === undefined || placeInQueueData === null) {
          throw new Error("Missing the required parameter 'placeInQueueData' when calling placeInQueue");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/place-in-queue', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Place an interaction in a queue
       * Place the interaction in the specified queue.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @param {module:model/PlaceInQueueData} placeInQueueData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.placeInQueue = function(mediatype, id, placeInQueueData) {
        return this.placeInQueueWithHttpInfo(mediatype, id, placeInQueueData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Pull an Interaction from a Workbin
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @param {Object} opts Optional parameters
       * @param {module:model/PullInteractionFromWorkbinData} opts.pullInteractionFromWorkbinData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.pullInteractionFromWorkbinWithHttpInfo = function(mediatype, id, opts) {
        opts = opts || {};
        var postBody = opts['pullInteractionFromWorkbinData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling pullInteractionFromWorkbin");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling pullInteractionFromWorkbin");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/pull', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Pull an Interaction from a Workbin
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @param {Object} opts Optional parameters
       * @param {module:model/PullInteractionFromWorkbinData} opts.pullInteractionFromWorkbinData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.pullInteractionFromWorkbin = function(mediatype, id, opts) {
        return this.pullInteractionFromWorkbinWithHttpInfo(mediatype, id, 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 all media channels.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaReadyData} opts.mediaReadyData 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.readyAgentStateWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = opts['mediaReadyData'];
  
  
        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(
          '/media/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 all media channels.
       * @param {Object} opts Optional parameters
       * @param {module:model/MediaReadyData} opts.mediaReadyData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.readyAgentState = function(opts) {
        return this.readyAgentStateWithHttpInfo(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 specified media channel.
       * @param {String} mediatype The media channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/ReadyForMediaData} opts.readyForMediaData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.readyForMediaWithHttpInfo = function(mediatype, opts) {
        opts = opts || {};
        var postBody = opts['readyForMediaData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling readyForMedia");
        }
  
  
        var pathParams = {
          'mediatype': mediatype
        };
        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(
          '/media/{mediatype}/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 specified media channel.
       * @param {String} mediatype The media channel.
       * @param {Object} opts Optional parameters
       * @param {module:model/ReadyForMediaData} opts.readyForMediaData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.readyForMedia = function(mediatype, opts) {
        return this.readyForMediaWithHttpInfo(mediatype, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Reject an incoming interaction
       * Reject the specified interaction.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction to reject.
       * @param {Object} opts Optional parameters
       * @param {module:model/RejectData} opts.rejectData 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.rejectWithHttpInfo = function(mediatype, id, opts) {
        opts = opts || {};
        var postBody = opts['rejectData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling reject");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling reject");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/reject', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Reject an incoming interaction
       * Reject the specified interaction.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction to reject.
       * @param {Object} opts Optional parameters
       * @param {module:model/RejectData} opts.rejectData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.reject = function(mediatype, id, opts) {
        return this.rejectWithHttpInfo(mediatype, id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Remove the attachment of the open-media interaction
       * Remove the attachment of the interaction specified in the documentId path parameter
       * @param {String} mediatype media-type of interaction to remove attachment
       * @param {String} id id of interaction
       * @param {String} documentId id of document to remove
       * @param {Object} opts Optional parameters
       * @param {module:model/RemoveAttachmentData} opts.removeAttachmentData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.removeAttachmentWithHttpInfo = function(mediatype, id, documentId, opts) {
        opts = opts || {};
        var postBody = opts['removeAttachmentData'];
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling removeAttachment");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling removeAttachment");
        }
  
        // verify the required parameter 'documentId' is set
        if (documentId === undefined || documentId === null) {
          throw new Error("Missing the required parameter 'documentId' when calling removeAttachment");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          'id': id,
          'documentId': documentId
        };
        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(
          '/media/{mediatype}/interactions/{id}/remove-attachment/{documentId}', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Remove the attachment of the open-media interaction
       * Remove the attachment of the interaction specified in the documentId path parameter
       * @param {String} mediatype media-type of interaction to remove attachment
       * @param {String} id id of interaction
       * @param {String} documentId id of document to remove
       * @param {Object} opts Optional parameters
       * @param {module:model/RemoveAttachmentData} opts.removeAttachmentData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.removeAttachment = function(mediatype, id, documentId, opts) {
        return this.removeAttachmentWithHttpInfo(mediatype, id, documentId, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Log out of a media channel
       * Log out the current agent on the specified media channels. You can make a [/media/{mediatype}/ready](/reference/workspace/Media/index.html#readyAgentState) or [/media/{mediatype}/not-ready](/reference/workspace/Media/index.html#notReadyAgentState) request to log in to the media channel again.
       * @param {String} mediatype The media channel.
       * @param {module:model/LogoutMediaData} logoutMediaData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.removeMediaWithHttpInfo = function(mediatype, logoutMediaData) {
        var postBody = logoutMediaData;
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling removeMedia");
        }
  
        // verify the required parameter 'logoutMediaData' is set
        if (logoutMediaData === undefined || logoutMediaData === null) {
          throw new Error("Missing the required parameter 'logoutMediaData' when calling removeMedia");
        }
  
  
        var pathParams = {
          'mediatype': mediatype
        };
        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(
          '/media/{mediatype}/logout', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Log out of a media channel
       * Log out the current agent on the specified media channels. You can make a [/media/{mediatype}/ready](/reference/workspace/Media/index.html#readyAgentState) or [/media/{mediatype}/not-ready](/reference/workspace/Media/index.html#notReadyAgentState) request to log in to the media channel again.
       * @param {String} mediatype The media channel.
       * @param {module:model/LogoutMediaData} logoutMediaData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.removeMedia = function(mediatype, logoutMediaData) {
        return this.removeMediaWithHttpInfo(mediatype, logoutMediaData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Set a comment
       * Set a comment on the specified interaction. If a comment already exists, it&#39;s overridden.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @param {module:model/AddCommentData} addCommentData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.setCommentWithHttpInfo = function(mediatype, id, addCommentData) {
        var postBody = addCommentData;
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling setComment");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling setComment");
        }
  
        // verify the required parameter 'addCommentData' is set
        if (addCommentData === undefined || addCommentData === null) {
          throw new Error("Missing the required parameter 'addCommentData' when calling setComment");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/set-comment', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Set a comment
       * Set a comment on the specified interaction. If a comment already exists, it&#39;s overridden.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @param {module:model/AddCommentData} addCommentData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.setComment = function(mediatype, id, addCommentData) {
        return this.setCommentWithHttpInfo(mediatype, id, addCommentData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Set the focus time of interaction
       * Set the focus time to the specified interaction.
       * @param {String} mediatype media-type of interaction
       * @param {String} id id of interaction
       * @param {module:model/SetFocusTimeData1} 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.setFocusTimeMediaWithHttpInfo = function(mediatype, id, setFocusTimeData) {
        var postBody = setFocusTimeData;
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling setFocusTimeMedia");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling setFocusTimeMedia");
        }
  
        // verify the required parameter 'setFocusTimeData' is set
        if (setFocusTimeData === undefined || setFocusTimeData === null) {
          throw new Error("Missing the required parameter 'setFocusTimeData' when calling setFocusTimeMedia");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/set-focus-time', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Set the focus time of interaction
       * Set the focus time to the specified interaction.
       * @param {String} mediatype media-type of interaction
       * @param {String} id id of interaction
       * @param {module:model/SetFocusTimeData1} setFocusTimeData Request parameters.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.setFocusTimeMedia = function(mediatype, id, setFocusTimeData) {
        return this.setFocusTimeMediaWithHttpInfo(mediatype, id, setFocusTimeData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Transfer an interaction
       * Transfer the interaction to the specified agent.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @param {module:model/TransferData} transferData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiSuccessResponse} and HTTP response
       */
      this.transferAgentWithHttpInfo = function(mediatype, id, transferData) {
        var postBody = transferData;
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling transferAgent");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling transferAgent");
        }
  
        // verify the required parameter 'transferData' is set
        if (transferData === undefined || transferData === null) {
          throw new Error("Missing the required parameter 'transferData' when calling transferAgent");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/transfer-agent', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Transfer an interaction
       * Transfer the interaction to the specified agent.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @param {module:model/TransferData} transferData 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiSuccessResponse}
       */
      this.transferAgent = function(mediatype, id, transferData) {
        return this.transferAgentWithHttpInfo(mediatype, id, transferData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Update user data for an interaction
       * Update the interaction with the provided key/value pairs. This replaces any existing key/value pairs with the same keys.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @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.updateMediaUserDataWithHttpInfo = function(mediatype, id, userData) {
        var postBody = userData;
  
        // verify the required parameter 'mediatype' is set
        if (mediatype === undefined || mediatype === null) {
          throw new Error("Missing the required parameter 'mediatype' when calling updateMediaUserData");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling updateMediaUserData");
        }
  
        // verify the required parameter 'userData' is set
        if (userData === undefined || userData === null) {
          throw new Error("Missing the required parameter 'userData' when calling updateMediaUserData");
        }
  
  
        var pathParams = {
          'mediatype': mediatype,
          '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(
          '/media/{mediatype}/interactions/{id}/update-user-data', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Update user data for an interaction
       * Update the interaction with the provided key/value pairs. This replaces any existing key/value pairs with the same keys.
       * @param {String} mediatype The media channel.
       * @param {String} id The ID of the interaction.
       * @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.updateMediaUserData = function(mediatype, id, userData) {
        return this.updateMediaUserDataWithHttpInfo(mediatype, id, userData)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
    }