text: /**
   * TextMagic API
   * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
   *
   * OpenAPI spec version: 2
   *
   * NOTE: This class is auto generated by the swagger code generator program.
   * https://github.com/swagger-api/swagger-codegen.git
   *
   * Swagger Codegen version: 2.4.8
   *
   * Do not edit the class manually.
   *
   */
  
  (function(root, factory) {
    if (typeof define === 'function' && define.amd) {
      // AMD. Register as an anonymous module.
      define(['ApiClient', 'model/AssignContactsToListInputObject', 'model/BadRequestResponse', 'model/BlockContactInputObject', 'model/BulkSession', 'model/BuyDedicatedNumberInputObject', 'model/Chat', 'model/CheckPhoneVerificationCodeInputObject', 'model/ClearAndAssignContactsToListInputObject', 'model/CloseChatsBulkInputObject', 'model/Contact', 'model/ContactNote', 'model/CreateContactInputObject', 'model/CreateContactNoteInputObject', 'model/CreateCustomFieldInputObject', 'model/CreateListInputObject', 'model/CreateTemplateInputObject', 'model/DeleteChatMessagesBulkInputObject', 'model/DeleteChatsBulkInputObject', 'model/DeleteContacsFromListObject', 'model/DeleteContactNotesBulkInputObject', 'model/DeleteContactsByIdsInputObject', 'model/DeleteInboundMessagesBulkInputObject', 'model/DeleteListContactsBulkInputObject', 'model/DeleteListsBulkInputObject', 'model/DeleteMessageSessionsBulkInputObject', 'model/DeleteOutboundMessagesBulkInputObject', 'model/DeleteScheduledMessagesBulkInputObject', 'model/DeleteTemplatesBulkInputObject', 'model/DoCarrierLookupResponse', 'model/DoEmailLookupResponse', 'model/GetAllBulkSessionsPaginatedResponse', 'model/GetAllChatsPaginatedResponse', 'model/GetAllInboundMessagesPaginatedResponse', 'model/GetAllMessageSessionsPaginatedResponse', 'model/GetAllOutboundMessagesPaginatedResponse', 'model/GetAllScheduledMessagesPaginatedResponse', 'model/GetAllTemplatesPaginatedResponse', 'model/GetAvailableDedicatedNumbersResponse', 'model/GetAvailableSenderSettingOptionsResponse', 'model/GetBalanceNotificationOptionsResponse', 'model/GetBalanceNotificationSettingsResponse', 'model/GetBlockedContactsPaginatedResponse', 'model/GetCallbackSettingsResponse', 'model/GetChatMessagesPaginatedResponse', 'model/GetContactImportSessionProgressResponse', 'model/GetContactNotesPaginatedResponse', 'model/GetContactsAutocompleteResponse', 'model/GetContactsByListIdPaginatedResponse', 'model/GetContactsPaginatedResponse', 'model/GetCountriesResponse', 'model/GetCustomFieldsPaginatedResponse', 'model/GetFavouritesPaginatedResponse', 'model/GetInboundMessagesNotificationSettingsResponse', 'model/GetInvoicesPaginatedResponse', 'model/GetListContactsIdsResponse', 'model/GetListsOfContactPaginatedResponse', 'model/GetListsPaginatedResponse', 'model/GetMessagePreviewResponse', 'model/GetMessagePriceResponse', 'model/GetMessageSessionStatResponse', 'model/GetMessagesBySessionIdPaginatedResponse', 'model/GetMessagingCountersResponse', 'model/GetMessagingStatResponse', 'model/GetOutboundMessagesHistoryPaginatedResponse', 'model/GetSenderIdsPaginatedResponse', 'model/GetSenderSettingsResponse', 'model/GetSpendingStatPaginatedResponse', 'model/GetSubaccountsWithTokensInputObject', 'model/GetSubaccountsWithTokensResponse', 'model/GetTimezonesResponse', 'model/GetUnreadMessagesTotalResponse', 'model/GetUnsubscribersPaginatedResponse', 'model/GetUserDedicatedNumbersPaginatedResponse', 'model/InviteSubaccountInputObject', 'model/MarkChatsReadBulkInputObject', 'model/MarkChatsUnreadBulkInputObject', 'model/MessageIn', 'model/MessageOut', 'model/MessageSession', 'model/MessageTemplate', 'model/MessagesIcs', 'model/MuteChatInputObject', 'model/MuteChatsBulkInputObject', 'model/NotFoundResponse', 'model/PingResponse', 'model/ReopenChatsBulkInputObject', 'model/RequestNewSubaccountTokenInputObject', 'model/RequestSenderIdInputObject', 'model/ResourceLinkResponse', 'model/SearchChatsByIdsPaginatedResponse', 'model/SearchChatsByReceipentPaginatedResponse', 'model/SearchChatsPaginatedResponse', 'model/SearchContactsPaginatedResponse', 'model/SearchInboundMessagesPaginatedResponse', 'model/SearchListsPaginatedResponse', 'model/SearchOutboundMessagesPaginatedResponse', 'model/SearchScheduledMessagesPaginatedResponse', 'model/SearchTemplatesPaginatedResponse', 'model/SendMessageInputObject', 'model/SendMessageResponse', 'model/SendPhoneVerificationCodeInputObject', 'model/SendPhoneVerificationCodeResponse', 'model/SenderId', 'model/SetChatStatusInputObject', 'model/UnauthorizedResponse', 'model/UnblockContactInputObject', 'model/UnblockContactsBulkInputObject', 'model/UnmuteChatsBulkInputObject', 'model/UnsubscribeContactInputObject', 'model/UnsubscribedContact', 'model/UpdateBalanceNotificationSettingsInputObject', 'model/UpdateCallbackSettingsInputObject', 'model/UpdateChatDesktopNotificationSettingsInputObject', 'model/UpdateContactInputObject', 'model/UpdateContactNoteInputObject', 'model/UpdateCurrentUserInputObject', 'model/UpdateCurrentUserResponse', 'model/UpdateCustomFieldInputObject', 'model/UpdateCustomFieldValueInputObject', 'model/UpdateInboundMessagesNotificationSettingsInputObject', 'model/UpdateListObject', 'model/UpdateSenderSettingInputObject', 'model/UpdateTemplateInputObject', 'model/UploadMessageAttachmentResponse', 'model/User', 'model/UserCustomField', 'model/UsersInbound'], factory);
    } else if (typeof module === 'object' && module.exports) {
      // CommonJS-like environments that support module.exports, like Node.
      module.exports = factory(require('../ApiClient'), require('../model/AssignContactsToListInputObject'), require('../model/BadRequestResponse'), require('../model/BlockContactInputObject'), require('../model/BulkSession'), require('../model/BuyDedicatedNumberInputObject'), require('../model/Chat'), require('../model/CheckPhoneVerificationCodeInputObject'), require('../model/ClearAndAssignContactsToListInputObject'), require('../model/CloseChatsBulkInputObject'), require('../model/Contact'), require('../model/ContactNote'), require('../model/CreateContactInputObject'), require('../model/CreateContactNoteInputObject'), require('../model/CreateCustomFieldInputObject'), require('../model/CreateListInputObject'), require('../model/CreateTemplateInputObject'), require('../model/DeleteChatMessagesBulkInputObject'), require('../model/DeleteChatsBulkInputObject'), require('../model/DeleteContacsFromListObject'), require('../model/DeleteContactNotesBulkInputObject'), require('../model/DeleteContactsByIdsInputObject'), require('../model/DeleteInboundMessagesBulkInputObject'), require('../model/DeleteListContactsBulkInputObject'), require('../model/DeleteListsBulkInputObject'), require('../model/DeleteMessageSessionsBulkInputObject'), require('../model/DeleteOutboundMessagesBulkInputObject'), require('../model/DeleteScheduledMessagesBulkInputObject'), require('../model/DeleteTemplatesBulkInputObject'), require('../model/DoCarrierLookupResponse'), require('../model/DoEmailLookupResponse'), require('../model/GetAllBulkSessionsPaginatedResponse'), require('../model/GetAllChatsPaginatedResponse'), require('../model/GetAllInboundMessagesPaginatedResponse'), require('../model/GetAllMessageSessionsPaginatedResponse'), require('../model/GetAllOutboundMessagesPaginatedResponse'), require('../model/GetAllScheduledMessagesPaginatedResponse'), require('../model/GetAllTemplatesPaginatedResponse'), require('../model/GetAvailableDedicatedNumbersResponse'), require('../model/GetAvailableSenderSettingOptionsResponse'), require('../model/GetBalanceNotificationOptionsResponse'), require('../model/GetBalanceNotificationSettingsResponse'), require('../model/GetBlockedContactsPaginatedResponse'), require('../model/GetCallbackSettingsResponse'), require('../model/GetChatMessagesPaginatedResponse'), require('../model/GetContactImportSessionProgressResponse'), require('../model/GetContactNotesPaginatedResponse'), require('../model/GetContactsAutocompleteResponse'), require('../model/GetContactsByListIdPaginatedResponse'), require('../model/GetContactsPaginatedResponse'), require('../model/GetCountriesResponse'), require('../model/GetCustomFieldsPaginatedResponse'), require('../model/GetFavouritesPaginatedResponse'), require('../model/GetInboundMessagesNotificationSettingsResponse'), require('../model/GetInvoicesPaginatedResponse'), require('../model/GetListContactsIdsResponse'), require('../model/GetListsOfContactPaginatedResponse'), require('../model/GetListsPaginatedResponse'), require('../model/GetMessagePreviewResponse'), require('../model/GetMessagePriceResponse'), require('../model/GetMessageSessionStatResponse'), require('../model/GetMessagesBySessionIdPaginatedResponse'), require('../model/GetMessagingCountersResponse'), require('../model/GetMessagingStatResponse'), require('../model/GetOutboundMessagesHistoryPaginatedResponse'), require('../model/GetSenderIdsPaginatedResponse'), require('../model/GetSenderSettingsResponse'), require('../model/GetSpendingStatPaginatedResponse'), require('../model/GetSubaccountsWithTokensInputObject'), require('../model/GetSubaccountsWithTokensResponse'), require('../model/GetTimezonesResponse'), require('../model/GetUnreadMessagesTotalResponse'), require('../model/GetUnsubscribersPaginatedResponse'), require('../model/GetUserDedicatedNumbersPaginatedResponse'), require('../model/InviteSubaccountInputObject'), require('../model/MarkChatsReadBulkInputObject'), require('../model/MarkChatsUnreadBulkInputObject'), require('../model/MessageIn'), require('../model/MessageOut'), require('../model/MessageSession'), require('../model/MessageTemplate'), require('../model/MessagesIcs'), require('../model/MuteChatInputObject'), require('../model/MuteChatsBulkInputObject'), require('../model/NotFoundResponse'), require('../model/PingResponse'), require('../model/ReopenChatsBulkInputObject'), require('../model/RequestNewSubaccountTokenInputObject'), require('../model/RequestSenderIdInputObject'), require('../model/ResourceLinkResponse'), require('../model/SearchChatsByIdsPaginatedResponse'), require('../model/SearchChatsByReceipentPaginatedResponse'), require('../model/SearchChatsPaginatedResponse'), require('../model/SearchContactsPaginatedResponse'), require('../model/SearchInboundMessagesPaginatedResponse'), require('../model/SearchListsPaginatedResponse'), require('../model/SearchOutboundMessagesPaginatedResponse'), require('../model/SearchScheduledMessagesPaginatedResponse'), require('../model/SearchTemplatesPaginatedResponse'), require('../model/SendMessageInputObject'), require('../model/SendMessageResponse'), require('../model/SendPhoneVerificationCodeInputObject'), require('../model/SendPhoneVerificationCodeResponse'), require('../model/SenderId'), require('../model/SetChatStatusInputObject'), require('../model/UnauthorizedResponse'), require('../model/UnblockContactInputObject'), require('../model/UnblockContactsBulkInputObject'), require('../model/UnmuteChatsBulkInputObject'), require('../model/UnsubscribeContactInputObject'), require('../model/UnsubscribedContact'), require('../model/UpdateBalanceNotificationSettingsInputObject'), require('../model/UpdateCallbackSettingsInputObject'), require('../model/UpdateChatDesktopNotificationSettingsInputObject'), require('../model/UpdateContactInputObject'), require('../model/UpdateContactNoteInputObject'), require('../model/UpdateCurrentUserInputObject'), require('../model/UpdateCurrentUserResponse'), require('../model/UpdateCustomFieldInputObject'), require('../model/UpdateCustomFieldValueInputObject'), require('../model/UpdateInboundMessagesNotificationSettingsInputObject'), require('../model/UpdateListObject'), require('../model/UpdateSenderSettingInputObject'), require('../model/UpdateTemplateInputObject'), require('../model/UploadMessageAttachmentResponse'), require('../model/User'), require('../model/UserCustomField'), require('../model/UsersInbound'));
    } else {
      // Browser globals (root is window)
      if (!root.TextmagicClient) {
        root.TextmagicClient = {};
      }
      root.TextmagicClient.TextMagicApi = factory(root.TextmagicClient.ApiClient, root.TextmagicClient.AssignContactsToListInputObject, root.TextmagicClient.BadRequestResponse, root.TextmagicClient.BlockContactInputObject, root.TextmagicClient.BulkSession, root.TextmagicClient.BuyDedicatedNumberInputObject, root.TextmagicClient.Chat, root.TextmagicClient.CheckPhoneVerificationCodeInputObject, root.TextmagicClient.ClearAndAssignContactsToListInputObject, root.TextmagicClient.CloseChatsBulkInputObject, root.TextmagicClient.Contact, root.TextmagicClient.ContactNote, root.TextmagicClient.CreateContactInputObject, root.TextmagicClient.CreateContactNoteInputObject, root.TextmagicClient.CreateCustomFieldInputObject, root.TextmagicClient.CreateListInputObject, root.TextmagicClient.CreateTemplateInputObject, root.TextmagicClient.DeleteChatMessagesBulkInputObject, root.TextmagicClient.DeleteChatsBulkInputObject, root.TextmagicClient.DeleteContacsFromListObject, root.TextmagicClient.DeleteContactNotesBulkInputObject, root.TextmagicClient.DeleteContactsByIdsInputObject, root.TextmagicClient.DeleteInboundMessagesBulkInputObject, root.TextmagicClient.DeleteListContactsBulkInputObject, root.TextmagicClient.DeleteListsBulkInputObject, root.TextmagicClient.DeleteMessageSessionsBulkInputObject, root.TextmagicClient.DeleteOutboundMessagesBulkInputObject, root.TextmagicClient.DeleteScheduledMessagesBulkInputObject, root.TextmagicClient.DeleteTemplatesBulkInputObject, root.TextmagicClient.DoCarrierLookupResponse, root.TextmagicClient.DoEmailLookupResponse, root.TextmagicClient.GetAllBulkSessionsPaginatedResponse, root.TextmagicClient.GetAllChatsPaginatedResponse, root.TextmagicClient.GetAllInboundMessagesPaginatedResponse, root.TextmagicClient.GetAllMessageSessionsPaginatedResponse, root.TextmagicClient.GetAllOutboundMessagesPaginatedResponse, root.TextmagicClient.GetAllScheduledMessagesPaginatedResponse, root.TextmagicClient.GetAllTemplatesPaginatedResponse, root.TextmagicClient.GetAvailableDedicatedNumbersResponse, root.TextmagicClient.GetAvailableSenderSettingOptionsResponse, root.TextmagicClient.GetBalanceNotificationOptionsResponse, root.TextmagicClient.GetBalanceNotificationSettingsResponse, root.TextmagicClient.GetBlockedContactsPaginatedResponse, root.TextmagicClient.GetCallbackSettingsResponse, root.TextmagicClient.GetChatMessagesPaginatedResponse, root.TextmagicClient.GetContactImportSessionProgressResponse, root.TextmagicClient.GetContactNotesPaginatedResponse, root.TextmagicClient.GetContactsAutocompleteResponse, root.TextmagicClient.GetContactsByListIdPaginatedResponse, root.TextmagicClient.GetContactsPaginatedResponse, root.TextmagicClient.GetCountriesResponse, root.TextmagicClient.GetCustomFieldsPaginatedResponse, root.TextmagicClient.GetFavouritesPaginatedResponse, root.TextmagicClient.GetInboundMessagesNotificationSettingsResponse, root.TextmagicClient.GetInvoicesPaginatedResponse, root.TextmagicClient.GetListContactsIdsResponse, root.TextmagicClient.GetListsOfContactPaginatedResponse, root.TextmagicClient.GetListsPaginatedResponse, root.TextmagicClient.GetMessagePreviewResponse, root.TextmagicClient.GetMessagePriceResponse, root.TextmagicClient.GetMessageSessionStatResponse, root.TextmagicClient.GetMessagesBySessionIdPaginatedResponse, root.TextmagicClient.GetMessagingCountersResponse, root.TextmagicClient.GetMessagingStatResponse, root.TextmagicClient.GetOutboundMessagesHistoryPaginatedResponse, root.TextmagicClient.GetSenderIdsPaginatedResponse, root.TextmagicClient.GetSenderSettingsResponse, root.TextmagicClient.GetSpendingStatPaginatedResponse, root.TextmagicClient.GetSubaccountsWithTokensInputObject, root.TextmagicClient.GetSubaccountsWithTokensResponse, root.TextmagicClient.GetTimezonesResponse, root.TextmagicClient.GetUnreadMessagesTotalResponse, root.TextmagicClient.GetUnsubscribersPaginatedResponse, root.TextmagicClient.GetUserDedicatedNumbersPaginatedResponse, root.TextmagicClient.InviteSubaccountInputObject, root.TextmagicClient.MarkChatsReadBulkInputObject, root.TextmagicClient.MarkChatsUnreadBulkInputObject, root.TextmagicClient.MessageIn, root.TextmagicClient.MessageOut, root.TextmagicClient.MessageSession, root.TextmagicClient.MessageTemplate, root.TextmagicClient.MessagesIcs, root.TextmagicClient.MuteChatInputObject, root.TextmagicClient.MuteChatsBulkInputObject, root.TextmagicClient.NotFoundResponse, root.TextmagicClient.PingResponse, root.TextmagicClient.ReopenChatsBulkInputObject, root.TextmagicClient.RequestNewSubaccountTokenInputObject, root.TextmagicClient.RequestSenderIdInputObject, root.TextmagicClient.ResourceLinkResponse, root.TextmagicClient.SearchChatsByIdsPaginatedResponse, root.TextmagicClient.SearchChatsByReceipentPaginatedResponse, root.TextmagicClient.SearchChatsPaginatedResponse, root.TextmagicClient.SearchContactsPaginatedResponse, root.TextmagicClient.SearchInboundMessagesPaginatedResponse, root.TextmagicClient.SearchListsPaginatedResponse, root.TextmagicClient.SearchOutboundMessagesPaginatedResponse, root.TextmagicClient.SearchScheduledMessagesPaginatedResponse, root.TextmagicClient.SearchTemplatesPaginatedResponse, root.TextmagicClient.SendMessageInputObject, root.TextmagicClient.SendMessageResponse, root.TextmagicClient.SendPhoneVerificationCodeInputObject, root.TextmagicClient.SendPhoneVerificationCodeResponse, root.TextmagicClient.SenderId, root.TextmagicClient.SetChatStatusInputObject, root.TextmagicClient.UnauthorizedResponse, root.TextmagicClient.UnblockContactInputObject, root.TextmagicClient.UnblockContactsBulkInputObject, root.TextmagicClient.UnmuteChatsBulkInputObject, root.TextmagicClient.UnsubscribeContactInputObject, root.TextmagicClient.UnsubscribedContact, root.TextmagicClient.UpdateBalanceNotificationSettingsInputObject, root.TextmagicClient.UpdateCallbackSettingsInputObject, root.TextmagicClient.UpdateChatDesktopNotificationSettingsInputObject, root.TextmagicClient.UpdateContactInputObject, root.TextmagicClient.UpdateContactNoteInputObject, root.TextmagicClient.UpdateCurrentUserInputObject, root.TextmagicClient.UpdateCurrentUserResponse, root.TextmagicClient.UpdateCustomFieldInputObject, root.TextmagicClient.UpdateCustomFieldValueInputObject, root.TextmagicClient.UpdateInboundMessagesNotificationSettingsInputObject, root.TextmagicClient.UpdateListObject, root.TextmagicClient.UpdateSenderSettingInputObject, root.TextmagicClient.UpdateTemplateInputObject, root.TextmagicClient.UploadMessageAttachmentResponse, root.TextmagicClient.User, root.TextmagicClient.UserCustomField, root.TextmagicClient.UsersInbound);
    }
  }(this, function(ApiClient, AssignContactsToListInputObject, BadRequestResponse, BlockContactInputObject, BulkSession, BuyDedicatedNumberInputObject, Chat, CheckPhoneVerificationCodeInputObject, ClearAndAssignContactsToListInputObject, CloseChatsBulkInputObject, Contact, ContactNote, CreateContactInputObject, CreateContactNoteInputObject, CreateCustomFieldInputObject, CreateListInputObject, CreateTemplateInputObject, DeleteChatMessagesBulkInputObject, DeleteChatsBulkInputObject, DeleteContacsFromListObject, DeleteContactNotesBulkInputObject, DeleteContactsByIdsInputObject, DeleteInboundMessagesBulkInputObject, DeleteListContactsBulkInputObject, DeleteListsBulkInputObject, DeleteMessageSessionsBulkInputObject, DeleteOutboundMessagesBulkInputObject, DeleteScheduledMessagesBulkInputObject, DeleteTemplatesBulkInputObject, DoCarrierLookupResponse, DoEmailLookupResponse, GetAllBulkSessionsPaginatedResponse, GetAllChatsPaginatedResponse, GetAllInboundMessagesPaginatedResponse, GetAllMessageSessionsPaginatedResponse, GetAllOutboundMessagesPaginatedResponse, GetAllScheduledMessagesPaginatedResponse, GetAllTemplatesPaginatedResponse, GetAvailableDedicatedNumbersResponse, GetAvailableSenderSettingOptionsResponse, GetBalanceNotificationOptionsResponse, GetBalanceNotificationSettingsResponse, GetBlockedContactsPaginatedResponse, GetCallbackSettingsResponse, GetChatMessagesPaginatedResponse, GetContactImportSessionProgressResponse, GetContactNotesPaginatedResponse, GetContactsAutocompleteResponse, GetContactsByListIdPaginatedResponse, GetContactsPaginatedResponse, GetCountriesResponse, GetCustomFieldsPaginatedResponse, GetFavouritesPaginatedResponse, GetInboundMessagesNotificationSettingsResponse, GetInvoicesPaginatedResponse, GetListContactsIdsResponse, GetListsOfContactPaginatedResponse, GetListsPaginatedResponse, GetMessagePreviewResponse, GetMessagePriceResponse, GetMessageSessionStatResponse, GetMessagesBySessionIdPaginatedResponse, GetMessagingCountersResponse, GetMessagingStatResponse, GetOutboundMessagesHistoryPaginatedResponse, GetSenderIdsPaginatedResponse, GetSenderSettingsResponse, GetSpendingStatPaginatedResponse, GetSubaccountsWithTokensInputObject, GetSubaccountsWithTokensResponse, GetTimezonesResponse, GetUnreadMessagesTotalResponse, GetUnsubscribersPaginatedResponse, GetUserDedicatedNumbersPaginatedResponse, InviteSubaccountInputObject, MarkChatsReadBulkInputObject, MarkChatsUnreadBulkInputObject, MessageIn, MessageOut, MessageSession, MessageTemplate, MessagesIcs, MuteChatInputObject, MuteChatsBulkInputObject, NotFoundResponse, PingResponse, ReopenChatsBulkInputObject, RequestNewSubaccountTokenInputObject, RequestSenderIdInputObject, ResourceLinkResponse, SearchChatsByIdsPaginatedResponse, SearchChatsByReceipentPaginatedResponse, SearchChatsPaginatedResponse, SearchContactsPaginatedResponse, SearchInboundMessagesPaginatedResponse, SearchListsPaginatedResponse, SearchOutboundMessagesPaginatedResponse, SearchScheduledMessagesPaginatedResponse, SearchTemplatesPaginatedResponse, SendMessageInputObject, SendMessageResponse, SendPhoneVerificationCodeInputObject, SendPhoneVerificationCodeResponse, SenderId, SetChatStatusInputObject, UnauthorizedResponse, UnblockContactInputObject, UnblockContactsBulkInputObject, UnmuteChatsBulkInputObject, UnsubscribeContactInputObject, UnsubscribedContact, UpdateBalanceNotificationSettingsInputObject, UpdateCallbackSettingsInputObject, UpdateChatDesktopNotificationSettingsInputObject, UpdateContactInputObject, UpdateContactNoteInputObject, UpdateCurrentUserInputObject, UpdateCurrentUserResponse, UpdateCustomFieldInputObject, UpdateCustomFieldValueInputObject, UpdateInboundMessagesNotificationSettingsInputObject, UpdateListObject, UpdateSenderSettingInputObject, UpdateTemplateInputObject, UploadMessageAttachmentResponse, User, UserCustomField, UsersInbound) {
    'use strict';
  
    /**
     * TextMagic service.
     * @module api/TextMagicApi
     * @version 2.0.650
     */
  
    /**
     * Constructs a new TextMagicApi. 
     * @alias module:api/TextMagicApi
     * @class
     * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
     * default to {@link module:ApiClient#instance} if unspecified.
     */
    var exports = function(apiClient) {
      this.apiClient = apiClient || ApiClient.instance;
  
  
  
      /**
       * Assign contacts to a list
       * &gt; Unlike all other PUT requests, this command does not need old contact IDs to be submitted. For example, if you have a list with contacts 150, 151 and 152 and you want to add contact ID 153, you only need to submit 153 as a parameter of PUT /api/v2/lists/{id}/contacts. 
       * @param {module:model/AssignContactsToListInputObject} assignContactsToListInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.assignContactsToListWithHttpInfo = function(assignContactsToListInputObject, id) {
        var postBody = assignContactsToListInputObject;
  
        // verify the required parameter 'assignContactsToListInputObject' is set
        if (assignContactsToListInputObject === undefined || assignContactsToListInputObject === null) {
          throw new Error("Missing the required parameter 'assignContactsToListInputObject' when calling assignContactsToList");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling assignContactsToList");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/lists/{id}/contacts', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Assign contacts to a list
       * &gt; Unlike all other PUT requests, this command does not need old contact IDs to be submitted. For example, if you have a list with contacts 150, 151 and 152 and you want to add contact ID 153, you only need to submit 153 as a parameter of PUT /api/v2/lists/{id}/contacts. 
       * @param {module:model/AssignContactsToListInputObject} assignContactsToListInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.assignContactsToList = function(assignContactsToListInputObject, id) {
        return this.assignContactsToListWithHttpInfo(assignContactsToListInputObject, id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Block contact by phone number
       * Block contact from inbound and outbound communication by phone number.
       * @param {module:model/BlockContactInputObject} blockContactInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.blockContactWithHttpInfo = function(blockContactInputObject) {
        var postBody = blockContactInputObject;
  
        // verify the required parameter 'blockContactInputObject' is set
        if (blockContactInputObject === undefined || blockContactInputObject === null) {
          throw new Error("Missing the required parameter 'blockContactInputObject' when calling blockContact");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/block', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Block contact by phone number
       * Block contact from inbound and outbound communication by phone number.
       * @param {module:model/BlockContactInputObject} blockContactInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.blockContact = function(blockContactInputObject) {
        return this.blockContactWithHttpInfo(blockContactInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Buy a dedicated number
       * To buy a dedicated number, you first need to find an available number matching your criteria using the &#x60;/api/v2/numbers/available&#x60; command described above.
       * @param {module:model/BuyDedicatedNumberInputObject} buyDedicatedNumberInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.buyDedicatedNumberWithHttpInfo = function(buyDedicatedNumberInputObject) {
        var postBody = buyDedicatedNumberInputObject;
  
        // verify the required parameter 'buyDedicatedNumberInputObject' is set
        if (buyDedicatedNumberInputObject === undefined || buyDedicatedNumberInputObject === null) {
          throw new Error("Missing the required parameter 'buyDedicatedNumberInputObject' when calling buyDedicatedNumber");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/numbers', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Buy a dedicated number
       * To buy a dedicated number, you first need to find an available number matching your criteria using the &#x60;/api/v2/numbers/available&#x60; command described above.
       * @param {module:model/BuyDedicatedNumberInputObject} buyDedicatedNumberInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.buyDedicatedNumber = function(buyDedicatedNumberInputObject) {
        return this.buyDedicatedNumberWithHttpInfo(buyDedicatedNumberInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Cancel verification process
       * You can cancel the verification not earlier than 30 seconds after the initial request.
       * @param {String} verifyId the verifyId that you received in Step 1.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.cancelVerificationWithHttpInfo = function(verifyId) {
        var postBody = null;
  
        // verify the required parameter 'verifyId' is set
        if (verifyId === undefined || verifyId === null) {
          throw new Error("Missing the required parameter 'verifyId' when calling cancelVerification");
        }
  
  
        var pathParams = {
          'verifyId': verifyId
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/verify/{verifyId}', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Cancel verification process
       * You can cancel the verification not earlier than 30 seconds after the initial request.
       * @param {String} verifyId the verifyId that you received in Step 1.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.cancelVerification = function(verifyId) {
        return this.cancelVerificationWithHttpInfo(verifyId)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Step 2: Check the verification code 
       * Check received code from user with the code which was actually sent.
       * @param {module:model/CheckPhoneVerificationCodeInputObject} checkPhoneVerificationCodeInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.checkPhoneVerificationCodeTFAWithHttpInfo = function(checkPhoneVerificationCodeInputObject) {
        var postBody = checkPhoneVerificationCodeInputObject;
  
        // verify the required parameter 'checkPhoneVerificationCodeInputObject' is set
        if (checkPhoneVerificationCodeInputObject === undefined || checkPhoneVerificationCodeInputObject === null) {
          throw new Error("Missing the required parameter 'checkPhoneVerificationCodeInputObject' when calling checkPhoneVerificationCodeTFA");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/verify', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Step 2: Check the verification code 
       * Check received code from user with the code which was actually sent.
       * @param {module:model/CheckPhoneVerificationCodeInputObject} checkPhoneVerificationCodeInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.checkPhoneVerificationCodeTFA = function(checkPhoneVerificationCodeInputObject) {
        return this.checkPhoneVerificationCodeTFAWithHttpInfo(checkPhoneVerificationCodeInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Reset list members to the specified contacts
       * 
       * @param {module:model/ClearAndAssignContactsToListInputObject} clearAndAssignContactsToListInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.clearAndAssignContactsToListWithHttpInfo = function(clearAndAssignContactsToListInputObject, id) {
        var postBody = clearAndAssignContactsToListInputObject;
  
        // verify the required parameter 'clearAndAssignContactsToListInputObject' is set
        if (clearAndAssignContactsToListInputObject === undefined || clearAndAssignContactsToListInputObject === null) {
          throw new Error("Missing the required parameter 'clearAndAssignContactsToListInputObject' when calling clearAndAssignContactsToList");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling clearAndAssignContactsToList");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/lists/{id}/contacts', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Reset list members to the specified contacts
       * 
       * @param {module:model/ClearAndAssignContactsToListInputObject} clearAndAssignContactsToListInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.clearAndAssignContactsToList = function(clearAndAssignContactsToListInputObject, id) {
        return this.clearAndAssignContactsToListWithHttpInfo(clearAndAssignContactsToListInputObject, id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Close chats (bulk)
       * Close chats by chat ids or close all chats
       * @param {module:model/CloseChatsBulkInputObject} closeChatsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.closeChatsBulkWithHttpInfo = function(closeChatsBulkInputObject) {
        var postBody = closeChatsBulkInputObject;
  
        // verify the required parameter 'closeChatsBulkInputObject' is set
        if (closeChatsBulkInputObject === undefined || closeChatsBulkInputObject === null) {
          throw new Error("Missing the required parameter 'closeChatsBulkInputObject' when calling closeChatsBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/chats/close/bulk', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Close chats (bulk)
       * Close chats by chat ids or close all chats
       * @param {module:model/CloseChatsBulkInputObject} closeChatsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.closeChatsBulk = function(closeChatsBulkInputObject) {
        return this.closeChatsBulkWithHttpInfo(closeChatsBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Close read chats
       * Close all chats that have no unread messages.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.closeReadChatsWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/chats/close/read', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Close read chats
       * Close all chats that have no unread messages.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.closeReadChats = function() {
        return this.closeReadChatsWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Close sub-account
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.closeSubaccountWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling closeSubaccount");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/subaccounts/{id}', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Close sub-account
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.closeSubaccount = function(id) {
        return this.closeSubaccountWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Add a new contact
       * 
       * @param {module:model/CreateContactInputObject} createContactInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.createContactWithHttpInfo = function(createContactInputObject) {
        var postBody = createContactInputObject;
  
        // verify the required parameter 'createContactInputObject' is set
        if (createContactInputObject === undefined || createContactInputObject === null) {
          throw new Error("Missing the required parameter 'createContactInputObject' when calling createContact");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/normalized', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Add a new contact
       * 
       * @param {module:model/CreateContactInputObject} createContactInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.createContact = function(createContactInputObject) {
        return this.createContactWithHttpInfo(createContactInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Create a new contact note
       * 
       * @param {module:model/CreateContactNoteInputObject} createContactNoteInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.createContactNoteWithHttpInfo = function(createContactNoteInputObject, id) {
        var postBody = createContactNoteInputObject;
  
        // verify the required parameter 'createContactNoteInputObject' is set
        if (createContactNoteInputObject === undefined || createContactNoteInputObject === null) {
          throw new Error("Missing the required parameter 'createContactNoteInputObject' when calling createContactNote");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling createContactNote");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/{id}/notes', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Create a new contact note
       * 
       * @param {module:model/CreateContactNoteInputObject} createContactNoteInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.createContactNote = function(createContactNoteInputObject, id) {
        return this.createContactNoteWithHttpInfo(createContactNoteInputObject, id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Add a new custom field
       * 
       * @param {module:model/CreateCustomFieldInputObject} createCustomFieldInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.createCustomFieldWithHttpInfo = function(createCustomFieldInputObject) {
        var postBody = createCustomFieldInputObject;
  
        // verify the required parameter 'createCustomFieldInputObject' is set
        if (createCustomFieldInputObject === undefined || createCustomFieldInputObject === null) {
          throw new Error("Missing the required parameter 'createCustomFieldInputObject' when calling createCustomField");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/customfields', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Add a new custom field
       * 
       * @param {module:model/CreateCustomFieldInputObject} createCustomFieldInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.createCustomField = function(createCustomFieldInputObject) {
        return this.createCustomFieldWithHttpInfo(createCustomFieldInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Create a new list
       * 
       * @param {module:model/CreateListInputObject} createListInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.createListWithHttpInfo = function(createListInputObject) {
        var postBody = createListInputObject;
  
        // verify the required parameter 'createListInputObject' is set
        if (createListInputObject === undefined || createListInputObject === null) {
          throw new Error("Missing the required parameter 'createListInputObject' when calling createList");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/lists', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Create a new list
       * 
       * @param {module:model/CreateListInputObject} createListInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.createList = function(createListInputObject) {
        return this.createListWithHttpInfo(createListInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Create a template
       * There are times when creating a new template makes sense (such as when targeting specific clients or improving your business strategies).  You can create new SMS templates for marketing purposes or SMS templates for business campaigns. 
       * @param {module:model/CreateTemplateInputObject} createTemplateInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.createTemplateWithHttpInfo = function(createTemplateInputObject) {
        var postBody = createTemplateInputObject;
  
        // verify the required parameter 'createTemplateInputObject' is set
        if (createTemplateInputObject === undefined || createTemplateInputObject === null) {
          throw new Error("Missing the required parameter 'createTemplateInputObject' when calling createTemplate");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/templates', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Create a template
       * There are times when creating a new template makes sense (such as when targeting specific clients or improving your business strategies).  You can create new SMS templates for marketing purposes or SMS templates for business campaigns. 
       * @param {module:model/CreateTemplateInputObject} createTemplateInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.createTemplate = function(createTemplateInputObject) {
        return this.createTemplateWithHttpInfo(createTemplateInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete contacts (bulk)
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteAllContactsWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/contact/all', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete contacts (bulk)
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteAllContacts = function() {
        return this.deleteAllContactsWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete all messages
       * Delete all messages.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteAllOutboundMessagesWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/message/all', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete all messages
       * Delete all messages.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteAllOutboundMessages = function() {
        return this.deleteAllOutboundMessagesWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete an avatar
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteAvatarWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/user/avatar', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete an avatar
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteAvatar = function() {
        return this.deleteAvatarWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete chat messages by ID(s)
       * Delete messages from chat by given messages ID(s).
       * @param {module:model/DeleteChatMessagesBulkInputObject} deleteChatMessagesBulkInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteChatMessagesWithHttpInfo = function(deleteChatMessagesBulkInputObject, id) {
        var postBody = deleteChatMessagesBulkInputObject;
  
        // verify the required parameter 'deleteChatMessagesBulkInputObject' is set
        if (deleteChatMessagesBulkInputObject === undefined || deleteChatMessagesBulkInputObject === null) {
          throw new Error("Missing the required parameter 'deleteChatMessagesBulkInputObject' when calling deleteChatMessages");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteChatMessages");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/chats/{id}/messages/delete', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete chat messages by ID(s)
       * Delete messages from chat by given messages ID(s).
       * @param {module:model/DeleteChatMessagesBulkInputObject} deleteChatMessagesBulkInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteChatMessages = function(deleteChatMessagesBulkInputObject, id) {
        return this.deleteChatMessagesWithHttpInfo(deleteChatMessagesBulkInputObject, id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete chats (bulk)
       * Delete chats by given ID(s) or delete all chats.
       * @param {module:model/DeleteChatsBulkInputObject} deleteChatsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteChatsBulkWithHttpInfo = function(deleteChatsBulkInputObject) {
        var postBody = deleteChatsBulkInputObject;
  
        // verify the required parameter 'deleteChatsBulkInputObject' is set
        if (deleteChatsBulkInputObject === undefined || deleteChatsBulkInputObject === null) {
          throw new Error("Missing the required parameter 'deleteChatsBulkInputObject' when calling deleteChatsBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/chats/delete', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete chats (bulk)
       * Delete chats by given ID(s) or delete all chats.
       * @param {module:model/DeleteChatsBulkInputObject} deleteChatsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteChatsBulk = function(deleteChatsBulkInputObject) {
        return this.deleteChatsBulkWithHttpInfo(deleteChatsBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete a contact
       * &gt; This command removes your contact completely. If it was assigned or saved to a shared list, it will disappear from there too. If you only need to remove a contact from selected lists, instead use the Contact assignment command in the Lists section rather than deleting the contact. 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteContactWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteContact");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/{id}', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete a contact
       * &gt; This command removes your contact completely. If it was assigned or saved to a shared list, it will disappear from there too. If you only need to remove a contact from selected lists, instead use the Contact assignment command in the Lists section rather than deleting the contact. 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteContact = function(id) {
        return this.deleteContactWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete an avatar
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteContactAvatarWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteContactAvatar");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/{id}/avatar', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete an avatar
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteContactAvatar = function(id) {
        return this.deleteContactAvatarWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete a contact note
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteContactNoteWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteContactNote");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/notes/{id}', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete a contact note
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteContactNote = function(id) {
        return this.deleteContactNoteWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete contact notes (bulk)
       * 
       * @param {Number} id 
       * @param {module:model/DeleteContactNotesBulkInputObject} deleteContactNotesBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteContactNotesBulkWithHttpInfo = function(id, deleteContactNotesBulkInputObject) {
        var postBody = deleteContactNotesBulkInputObject;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteContactNotesBulk");
        }
  
        // verify the required parameter 'deleteContactNotesBulkInputObject' is set
        if (deleteContactNotesBulkInputObject === undefined || deleteContactNotesBulkInputObject === null) {
          throw new Error("Missing the required parameter 'deleteContactNotesBulkInputObject' when calling deleteContactNotesBulk");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/{id}/notes/delete', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete contact notes (bulk)
       * 
       * @param {Number} id 
       * @param {module:model/DeleteContactNotesBulkInputObject} deleteContactNotesBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteContactNotesBulk = function(id, deleteContactNotesBulkInputObject) {
        return this.deleteContactNotesBulkWithHttpInfo(id, deleteContactNotesBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete contacts by IDs (bulk)
       * 
       * @param {module:model/DeleteContactsByIdsInputObject} deleteContactsByIdsInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteContactsByIdsWithHttpInfo = function(deleteContactsByIdsInputObject) {
        var postBody = deleteContactsByIdsInputObject;
  
        // verify the required parameter 'deleteContactsByIdsInputObject' is set
        if (deleteContactsByIdsInputObject === undefined || deleteContactsByIdsInputObject === null) {
          throw new Error("Missing the required parameter 'deleteContactsByIdsInputObject' when calling deleteContactsByIds");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/delete', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete contacts by IDs (bulk)
       * 
       * @param {module:model/DeleteContactsByIdsInputObject} deleteContactsByIdsInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteContactsByIds = function(deleteContactsByIdsInputObject) {
        return this.deleteContactsByIdsWithHttpInfo(deleteContactsByIdsInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Unassign contacts from a list
       * &gt; When you remove contacts from a specific list, they will be deleted permanently, unless they are first saved in another list. 
       * @param {module:model/DeleteContacsFromListObject} deleteContacsFromListObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteContactsFromListWithHttpInfo = function(deleteContacsFromListObject, id) {
        var postBody = deleteContacsFromListObject;
  
        // verify the required parameter 'deleteContacsFromListObject' is set
        if (deleteContacsFromListObject === undefined || deleteContacsFromListObject === null) {
          throw new Error("Missing the required parameter 'deleteContacsFromListObject' when calling deleteContactsFromList");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteContactsFromList");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/lists/{id}/contacts', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Unassign contacts from a list
       * &gt; When you remove contacts from a specific list, they will be deleted permanently, unless they are first saved in another list. 
       * @param {module:model/DeleteContacsFromListObject} deleteContacsFromListObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteContactsFromList = function(deleteContacsFromListObject, id) {
        return this.deleteContactsFromListWithHttpInfo(deleteContacsFromListObject, id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete a custom field
       * &gt; When a custom field is deleted, all the information that was added to contacts under this custom field will also be lost. 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteCustomFieldWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteCustomField");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/customfields/{id}', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete a custom field
       * &gt; When a custom field is deleted, all the information that was added to contacts under this custom field will also be lost. 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteCustomField = function(id) {
        return this.deleteCustomFieldWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Cancel dedicated number subscription
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteDedicatedNumberWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteDedicatedNumber");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/numbers/{id}', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Cancel dedicated number subscription
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteDedicatedNumber = function(id) {
        return this.deleteDedicatedNumberWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete a single inbound message
       * &gt; Note, deleted inbound message will disappear from TextMagic Online, chats, and any other place they are referenced.  So, be careful! 
       * @param {Number} id The unique numeric ID for the inbound message.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteInboundMessageWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteInboundMessage");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/replies/{id}', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete a single inbound message
       * &gt; Note, deleted inbound message will disappear from TextMagic Online, chats, and any other place they are referenced.  So, be careful! 
       * @param {Number} id The unique numeric ID for the inbound message.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteInboundMessage = function(id) {
        return this.deleteInboundMessageWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete inbound messages (bulk)
       * &gt; Note, deleted inbound message will disappear from TextMagic Online, chats, and any other place they are referenced.  So, be careful! 
       * @param {module:model/DeleteInboundMessagesBulkInputObject} deleteInboundMessagesBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteInboundMessagesBulkWithHttpInfo = function(deleteInboundMessagesBulkInputObject) {
        var postBody = deleteInboundMessagesBulkInputObject;
  
        // verify the required parameter 'deleteInboundMessagesBulkInputObject' is set
        if (deleteInboundMessagesBulkInputObject === undefined || deleteInboundMessagesBulkInputObject === null) {
          throw new Error("Missing the required parameter 'deleteInboundMessagesBulkInputObject' when calling deleteInboundMessagesBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/replies/delete', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete inbound messages (bulk)
       * &gt; Note, deleted inbound message will disappear from TextMagic Online, chats, and any other place they are referenced.  So, be careful! 
       * @param {module:model/DeleteInboundMessagesBulkInputObject} deleteInboundMessagesBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteInboundMessagesBulk = function(deleteInboundMessagesBulkInputObject) {
        return this.deleteInboundMessagesBulkWithHttpInfo(deleteInboundMessagesBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete a list
       * This command has no parameters. If successful, this command will return the standard delete response (204 No Content), otherwise a standard error response will be returned.  When you delete a list, the contacts in it are deleted as well unless they were saved in other list.
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteListWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteList");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/lists/{id}', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete a list
       * This command has no parameters. If successful, this command will return the standard delete response (204 No Content), otherwise a standard error response will be returned.  When you delete a list, the contacts in it are deleted as well unless they were saved in other list.
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteList = function(id) {
        return this.deleteListWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete an avatar for the list
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteListAvatarWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteListAvatar");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/lists/{id}/avatar', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete an avatar for the list
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteListAvatar = function(id) {
        return this.deleteListAvatarWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete contacts from list (bulk)
       * 
       * @param {module:model/DeleteListContactsBulkInputObject} deleteListContactsBulkInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteListContactsBulkWithHttpInfo = function(deleteListContactsBulkInputObject, id) {
        var postBody = deleteListContactsBulkInputObject;
  
        // verify the required parameter 'deleteListContactsBulkInputObject' is set
        if (deleteListContactsBulkInputObject === undefined || deleteListContactsBulkInputObject === null) {
          throw new Error("Missing the required parameter 'deleteListContactsBulkInputObject' when calling deleteListContactsBulk");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteListContactsBulk");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/lists/{id}/contacts/delete', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete contacts from list (bulk)
       * 
       * @param {module:model/DeleteListContactsBulkInputObject} deleteListContactsBulkInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteListContactsBulk = function(deleteListContactsBulkInputObject, id) {
        return this.deleteListContactsBulkWithHttpInfo(deleteListContactsBulkInputObject, id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete lists (bulk)
       * 
       * @param {module:model/DeleteListsBulkInputObject} deleteListsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteListsBulkWithHttpInfo = function(deleteListsBulkInputObject) {
        var postBody = deleteListsBulkInputObject;
  
        // verify the required parameter 'deleteListsBulkInputObject' is set
        if (deleteListsBulkInputObject === undefined || deleteListsBulkInputObject === null) {
          throw new Error("Missing the required parameter 'deleteListsBulkInputObject' when calling deleteListsBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/lists/delete', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete lists (bulk)
       * 
       * @param {module:model/DeleteListsBulkInputObject} deleteListsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteListsBulk = function(deleteListsBulkInputObject) {
        return this.deleteListsBulkWithHttpInfo(deleteListsBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete a session
       * Delete a message session, together with all nested messages. &gt; You will not be refunded for any deleted sent sessions. 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteMessageSessionWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteMessageSession");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/sessions/{id}', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete a session
       * Delete a message session, together with all nested messages. &gt; You will not be refunded for any deleted sent sessions. 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteMessageSession = function(id) {
        return this.deleteMessageSessionWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete sessions (bulk)
       * Delete messages sessions, together with all nested messages, by given ID(s) or delete all messages sessions.
       * @param {module:model/DeleteMessageSessionsBulkInputObject} deleteMessageSessionsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteMessageSessionsBulkWithHttpInfo = function(deleteMessageSessionsBulkInputObject) {
        var postBody = deleteMessageSessionsBulkInputObject;
  
        // verify the required parameter 'deleteMessageSessionsBulkInputObject' is set
        if (deleteMessageSessionsBulkInputObject === undefined || deleteMessageSessionsBulkInputObject === null) {
          throw new Error("Missing the required parameter 'deleteMessageSessionsBulkInputObject' when calling deleteMessageSessionsBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/sessions/delete', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete sessions (bulk)
       * Delete messages sessions, together with all nested messages, by given ID(s) or delete all messages sessions.
       * @param {module:model/DeleteMessageSessionsBulkInputObject} deleteMessageSessionsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteMessageSessionsBulk = function(deleteMessageSessionsBulkInputObject) {
        return this.deleteMessageSessionsBulkWithHttpInfo(deleteMessageSessionsBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete message
       * Delete a single message.
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteOutboundMessageWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteOutboundMessage");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/messages/{id}', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete message
       * Delete a single message.
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteOutboundMessage = function(id) {
        return this.deleteOutboundMessageWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete messages (bulk)
       * Delete outbound messages by given ID(s) or delete all outbound messages.
       * @param {module:model/DeleteOutboundMessagesBulkInputObject} deleteOutboundMessagesBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteOutboundMessagesBulkWithHttpInfo = function(deleteOutboundMessagesBulkInputObject) {
        var postBody = deleteOutboundMessagesBulkInputObject;
  
        // verify the required parameter 'deleteOutboundMessagesBulkInputObject' is set
        if (deleteOutboundMessagesBulkInputObject === undefined || deleteOutboundMessagesBulkInputObject === null) {
          throw new Error("Missing the required parameter 'deleteOutboundMessagesBulkInputObject' when calling deleteOutboundMessagesBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/messages/delete', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete messages (bulk)
       * Delete outbound messages by given ID(s) or delete all outbound messages.
       * @param {module:model/DeleteOutboundMessagesBulkInputObject} deleteOutboundMessagesBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteOutboundMessagesBulk = function(deleteOutboundMessagesBulkInputObject) {
        return this.deleteOutboundMessagesBulkWithHttpInfo(deleteOutboundMessagesBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete a single scheduled message
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteScheduledMessageWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteScheduledMessage");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/schedules/{id}', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete a single scheduled message
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteScheduledMessage = function(id) {
        return this.deleteScheduledMessageWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete scheduled messages (bulk)
       * 
       * @param {module:model/DeleteScheduledMessagesBulkInputObject} deleteScheduledMessagesBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteScheduledMessagesBulkWithHttpInfo = function(deleteScheduledMessagesBulkInputObject) {
        var postBody = deleteScheduledMessagesBulkInputObject;
  
        // verify the required parameter 'deleteScheduledMessagesBulkInputObject' is set
        if (deleteScheduledMessagesBulkInputObject === undefined || deleteScheduledMessagesBulkInputObject === null) {
          throw new Error("Missing the required parameter 'deleteScheduledMessagesBulkInputObject' when calling deleteScheduledMessagesBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/schedules/delete', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete scheduled messages (bulk)
       * 
       * @param {module:model/DeleteScheduledMessagesBulkInputObject} deleteScheduledMessagesBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteScheduledMessagesBulk = function(deleteScheduledMessagesBulkInputObject) {
        return this.deleteScheduledMessagesBulkWithHttpInfo(deleteScheduledMessagesBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete a Sender ID
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteSenderIdWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteSenderId");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/senderids/{id}', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete a Sender ID
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteSenderId = function(id) {
        return this.deleteSenderIdWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete a template
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteTemplateWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling deleteTemplate");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/templates/{id}', 'DELETE',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete a template
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteTemplate = function(id) {
        return this.deleteTemplateWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Delete templates (bulk)
       * Delete template by given ID(s) or delete all templates.
       * @param {module:model/DeleteTemplatesBulkInputObject} deleteTemplatesBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.deleteTemplatesBulkWithHttpInfo = function(deleteTemplatesBulkInputObject) {
        var postBody = deleteTemplatesBulkInputObject;
  
        // verify the required parameter 'deleteTemplatesBulkInputObject' is set
        if (deleteTemplatesBulkInputObject === undefined || deleteTemplatesBulkInputObject === null) {
          throw new Error("Missing the required parameter 'deleteTemplatesBulkInputObject' when calling deleteTemplatesBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/templates/delete', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Delete templates (bulk)
       * Delete template by given ID(s) or delete all templates.
       * @param {module:model/DeleteTemplatesBulkInputObject} deleteTemplatesBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.deleteTemplatesBulk = function(deleteTemplatesBulkInputObject) {
        return this.deleteTemplatesBulkWithHttpInfo(deleteTemplatesBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Carrier Lookup
       * This API call allows you to retrieve additional information about a phone number: region-specific phone number formatting, carrier, phone type (landline/mobile) and country information.  &gt; Numbers can be checked one by one. You cannot check multiple numbers in one request.   
       * @param {String} phone Phone number in [E.164 format](https://en.wikipedia.org/wiki/E.164) or in [National format](https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers). 
       * @param {Object} opts Optional parameters
       * @param {String} opts.country This option must be specified only if the phone number in a **[National format](https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers)**. 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DoCarrierLookupResponse} and HTTP response
       */
      this.doCarrierLookupWithHttpInfo = function(phone, opts) {
        opts = opts || {};
        var postBody = null;
  
        // verify the required parameter 'phone' is set
        if (phone === undefined || phone === null) {
          throw new Error("Missing the required parameter 'phone' when calling doCarrierLookup");
        }
  
  
        var pathParams = {
          'phone': phone
        };
        var queryParams = {
          'country': opts['country'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = DoCarrierLookupResponse;
  
        return this.apiClient.callApi(
          '/api/v2/lookups/{phone}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Carrier Lookup
       * This API call allows you to retrieve additional information about a phone number: region-specific phone number formatting, carrier, phone type (landline/mobile) and country information.  &gt; Numbers can be checked one by one. You cannot check multiple numbers in one request.   
       * @param {String} phone Phone number in [E.164 format](https://en.wikipedia.org/wiki/E.164) or in [National format](https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers). 
       * @param {Object} opts Optional parameters
       * @param {String} opts.country This option must be specified only if the phone number in a **[National format](https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers)**. 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DoCarrierLookupResponse}
       */
      this.doCarrierLookup = function(phone, opts) {
        return this.doCarrierLookupWithHttpInfo(phone, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Email Lookup
       * To get more details about an email address or to check if it is a valid email, you can use the Email Lookup command. To upload and check emails in bulk, please use our [Web app](https://my.textmagic.com/online/email-lookup/).  This API call allows you to retrieve additional information about an email address, such as mailbox detection, syntax checks, DNS validation, deliverability status, and many more helpful values (see the table below).  &gt; Emails must be checked one by one. You cannot check multiple emails in one request. To upload and check emails in bulk, please use our [Web app](https://my.textmagic.com/online/email-lookup/).
       * @param {String} email Email address.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DoEmailLookupResponse} and HTTP response
       */
      this.doEmailLookupWithHttpInfo = function(email) {
        var postBody = null;
  
        // verify the required parameter 'email' is set
        if (email === undefined || email === null) {
          throw new Error("Missing the required parameter 'email' when calling doEmailLookup");
        }
  
  
        var pathParams = {
          'email': email
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = DoEmailLookupResponse;
  
        return this.apiClient.callApi(
          '/api/v2/email-lookups/{email}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Email Lookup
       * To get more details about an email address or to check if it is a valid email, you can use the Email Lookup command. To upload and check emails in bulk, please use our [Web app](https://my.textmagic.com/online/email-lookup/).  This API call allows you to retrieve additional information about an email address, such as mailbox detection, syntax checks, DNS validation, deliverability status, and many more helpful values (see the table below).  &gt; Emails must be checked one by one. You cannot check multiple emails in one request. To upload and check emails in bulk, please use our [Web app](https://my.textmagic.com/online/email-lookup/).
       * @param {String} email Email address.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DoEmailLookupResponse}
       */
      this.doEmailLookup = function(email) {
        return this.doEmailLookupWithHttpInfo(email)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all bulk sessions
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetAllBulkSessionsPaginatedResponse} and HTTP response
       */
      this.getAllBulkSessionsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetAllBulkSessionsPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/bulks', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all bulk sessions
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetAllBulkSessionsPaginatedResponse}
       */
      this.getAllBulkSessions = function(opts) {
        return this.getAllBulkSessionsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all chats
       * 
       * @param {Object} opts Optional parameters
       * @param {module:model/String} opts.status Fetch only (a)ctive, (c)losed or (d)eleted chats
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {Number} opts.voice Fetch results with voice calls (default to 0)
       * @param {Number} opts.flat Should additional contact info be included (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetAllChatsPaginatedResponse} and HTTP response
       */
      this.getAllChatsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'status': opts['status'],
          'page': opts['page'],
          'limit': opts['limit'],
          'orderBy': opts['orderBy'],
          'voice': opts['voice'],
          'flat': opts['flat'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetAllChatsPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/chats', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all chats
       * 
       * @param {Object} opts Optional parameters
       * @param {module:model/String} opts.status Fetch only (a)ctive, (c)losed or (d)eleted chats
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {Number} opts.voice Fetch results with voice calls (default to 0)
       * @param {Number} opts.flat Should additional contact info be included (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetAllChatsPaginatedResponse}
       */
      this.getAllChats = function(opts) {
        return this.getAllChatsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all inbound messages
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetAllInboundMessagesPaginatedResponse} and HTTP response
       */
      this.getAllInboundMessagesWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'orderBy': opts['orderBy'],
          'direction': opts['direction'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetAllInboundMessagesPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/replies', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all inbound messages
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetAllInboundMessagesPaginatedResponse}
       */
      this.getAllInboundMessages = function(opts) {
        return this.getAllInboundMessagesWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all sessions
       * Get all message sending sessions. &gt; This list contains all of your sessions, including those which were sent but not via API 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetAllMessageSessionsPaginatedResponse} and HTTP response
       */
      this.getAllMessageSessionsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetAllMessageSessionsPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/sessions', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all sessions
       * Get all message sending sessions. &gt; This list contains all of your sessions, including those which were sent but not via API 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetAllMessageSessionsPaginatedResponse}
       */
      this.getAllMessageSessions = function(opts) {
        return this.getAllMessageSessionsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all messages
       * Get all user oubound messages.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.lastId Filter results by ID, selecting all values lesser than the specified ID. Note that \\&#39;page\\&#39; parameter is ignored when \\&#39;lastId\\&#39; is specified
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetAllOutboundMessagesPaginatedResponse} and HTTP response
       */
      this.getAllOutboundMessagesWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'lastId': opts['lastId'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetAllOutboundMessagesPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/messages', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all messages
       * Get all user oubound messages.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.lastId Filter results by ID, selecting all values lesser than the specified ID. Note that \\&#39;page\\&#39; parameter is ignored when \\&#39;lastId\\&#39; is specified
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetAllOutboundMessagesPaginatedResponse}
       */
      this.getAllOutboundMessages = function(opts) {
        return this.getAllOutboundMessagesWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all scheduled messages
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {module:model/String} opts.status Fetch schedules with the specific status: a - actual, c - completed, x - all (default to x)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetAllScheduledMessagesPaginatedResponse} and HTTP response
       */
      this.getAllScheduledMessagesWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'status': opts['status'],
          'orderBy': opts['orderBy'],
          'direction': opts['direction'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetAllScheduledMessagesPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/schedules', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all scheduled messages
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {module:model/String} opts.status Fetch schedules with the specific status: a - actual, c - completed, x - all (default to x)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetAllScheduledMessagesPaginatedResponse}
       */
      this.getAllScheduledMessages = function(opts) {
        return this.getAllScheduledMessagesWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all templates
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page.
       * @param {Number} opts.limit The number of results per page.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetAllTemplatesPaginatedResponse} and HTTP response
       */
      this.getAllTemplatesWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetAllTemplatesPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/templates', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all templates
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page.
       * @param {Number} opts.limit The number of results per page.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetAllTemplatesPaginatedResponse}
       */
      this.getAllTemplates = function(opts) {
        return this.getAllTemplatesWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Find dedicated numbers available for purchase
       * 
       * @param {String} country Two-letter dedicated number country ISO code.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.prefix Desired number prefix. Should include country code (i.e. 447 for UK phone number format). Leave blank to get all the available numbers for the specified country.
       * @param {Number} opts.tollfree Should we show only tollfree numbers (tollfree available only for US). (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetAvailableDedicatedNumbersResponse} and HTTP response
       */
      this.getAvailableDedicatedNumbersWithHttpInfo = function(country, opts) {
        opts = opts || {};
        var postBody = null;
  
        // verify the required parameter 'country' is set
        if (country === undefined || country === null) {
          throw new Error("Missing the required parameter 'country' when calling getAvailableDedicatedNumbers");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
          'prefix': opts['prefix'],
          'tollfree': opts['tollfree'],
          'country': country,
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetAvailableDedicatedNumbersResponse;
  
        return this.apiClient.callApi(
          '/api/v2/numbers/available', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Find dedicated numbers available for purchase
       * 
       * @param {String} country Two-letter dedicated number country ISO code.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.prefix Desired number prefix. Should include country code (i.e. 447 for UK phone number format). Leave blank to get all the available numbers for the specified country.
       * @param {Number} opts.tollfree Should we show only tollfree numbers (tollfree available only for US). (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetAvailableDedicatedNumbersResponse}
       */
      this.getAvailableDedicatedNumbers = function(country, opts) {
        return this.getAvailableDedicatedNumbersWithHttpInfo(country, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get available sender settings
       * Get all available sender setting options which could be used in \&quot;from\&quot; parameter of POST messages method.
       * @param {Object} opts Optional parameters
       * @param {String} opts.country Two-letter ISO country ID. If not specified, it returns all the available sender settings.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetAvailableSenderSettingOptionsResponse} and HTTP response
       */
      this.getAvailableSenderSettingOptionsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'country': opts['country'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetAvailableSenderSettingOptionsResponse;
  
        return this.apiClient.callApi(
          '/api/v2/sources', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get available sender settings
       * Get all available sender setting options which could be used in \&quot;from\&quot; parameter of POST messages method.
       * @param {Object} opts Optional parameters
       * @param {String} opts.country Two-letter ISO country ID. If not specified, it returns all the available sender settings.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetAvailableSenderSettingOptionsResponse}
       */
      this.getAvailableSenderSettingOptions = function(opts) {
        return this.getAvailableSenderSettingOptionsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Returns the list of available balance options which can be used as a bound to determine when to send email to user with low balance notification. See https://my.textmagic.com/online/account/notifications/balance
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetBalanceNotificationOptionsResponse} and HTTP response
       */
      this.getBalanceNotificationOptionsWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetBalanceNotificationOptionsResponse;
  
        return this.apiClient.callApi(
          '/api/v2/user/notification/balance/bundles', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Returns the list of available balance options which can be used as a bound to determine when to send email to user with low balance notification. See https://my.textmagic.com/online/account/notifications/balance
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetBalanceNotificationOptionsResponse}
       */
      this.getBalanceNotificationOptions = function() {
        return this.getBalanceNotificationOptionsWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get balance notification settings
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetBalanceNotificationSettingsResponse} and HTTP response
       */
      this.getBalanceNotificationSettingsWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetBalanceNotificationSettingsResponse;
  
        return this.apiClient.callApi(
          '/api/v2/user/notification/balance', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get balance notification settings
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetBalanceNotificationSettingsResponse}
       */
      this.getBalanceNotificationSettings = function() {
        return this.getBalanceNotificationSettingsWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get blocked contacts
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.query Find blocked contacts by specified search query
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetBlockedContactsPaginatedResponse} and HTTP response
       */
      this.getBlockedContactsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'query': opts['query'],
          'orderBy': opts['orderBy'],
          'direction': opts['direction'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetBlockedContactsPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/block/list', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get blocked contacts
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.query Find blocked contacts by specified search query
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetBlockedContactsPaginatedResponse}
       */
      this.getBlockedContacts = function(opts) {
        return this.getBlockedContactsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get bulk session status
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BulkSession} and HTTP response
       */
      this.getBulkSessionWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getBulkSession");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = BulkSession;
  
        return this.apiClient.callApi(
          '/api/v2/bulks/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get bulk session status
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BulkSession}
       */
      this.getBulkSession = function(id) {
        return this.getBulkSessionWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Fetch callback URL settings
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetCallbackSettingsResponse} and HTTP response
       */
      this.getCallbackSettingsWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetCallbackSettingsResponse;
  
        return this.apiClient.callApi(
          '/api/v2/callback/settings', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Fetch callback URL settings
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetCallbackSettingsResponse}
       */
      this.getCallbackSettings = function() {
        return this.getCallbackSettingsWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get a single chat
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Chat} and HTTP response
       */
      this.getChatWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getChat");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = Chat;
  
        return this.apiClient.callApi(
          '/api/v2/chats/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get a single chat
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Chat}
       */
      this.getChat = function(id) {
        return this.getChatWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Find chats by phone
       * 
       * @param {String} phone 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.upsert Create a new chat if not found (default to 0)
       * @param {Number} opts.reopen Reopen chat if found or do not change status (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Chat} and HTTP response
       */
      this.getChatByPhoneWithHttpInfo = function(phone, opts) {
        opts = opts || {};
        var postBody = null;
  
        // verify the required parameter 'phone' is set
        if (phone === undefined || phone === null) {
          throw new Error("Missing the required parameter 'phone' when calling getChatByPhone");
        }
  
  
        var pathParams = {
          'phone': phone
        };
        var queryParams = {
          'upsert': opts['upsert'],
          'reopen': opts['reopen'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = Chat;
  
        return this.apiClient.callApi(
          '/api/v2/chats/{phone}/by/phone', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Find chats by phone
       * 
       * @param {String} phone 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.upsert Create a new chat if not found (default to 0)
       * @param {Number} opts.reopen Reopen chat if found or do not change status (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Chat}
       */
      this.getChatByPhone = function(phone, opts) {
        return this.getChatByPhoneWithHttpInfo(phone, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get chat messages
       * 
       * @param {Number} id 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.query Find messages by specified search query
       * @param {Number} opts.start Return messages since specified timestamp only
       * @param {Number} opts.end Return messages up to specified timestamp only
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @param {Number} opts.voice Fetch results with voice calls (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetChatMessagesPaginatedResponse} and HTTP response
       */
      this.getChatMessagesWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getChatMessages");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'query': opts['query'],
          'start': opts['start'],
          'end': opts['end'],
          'direction': opts['direction'],
          'voice': opts['voice'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetChatMessagesPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/chats/{id}/message', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get chat messages
       * 
       * @param {Number} id 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.query Find messages by specified search query
       * @param {Number} opts.start Return messages since specified timestamp only
       * @param {Number} opts.end Return messages up to specified timestamp only
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @param {Number} opts.voice Fetch results with voice calls (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetChatMessagesPaginatedResponse}
       */
      this.getChatMessages = function(id, opts) {
        return this.getChatMessagesWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get the details of a specific contact
       * 
       * @param {Number} id The contact id
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Contact} and HTTP response
       */
      this.getContactWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getContact");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = Contact;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get the details of a specific contact
       * 
       * @param {Number} id The contact id
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Contact}
       */
      this.getContact = function(id) {
        return this.getContactWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get the details of a specific contact by phone number
       * 
       * @param {String} phone 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Contact} and HTTP response
       */
      this.getContactByPhoneWithHttpInfo = function(phone) {
        var postBody = null;
  
        // verify the required parameter 'phone' is set
        if (phone === undefined || phone === null) {
          throw new Error("Missing the required parameter 'phone' when calling getContactByPhone");
        }
  
  
        var pathParams = {
          'phone': phone
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = Contact;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/phone/{phone}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get the details of a specific contact by phone number
       * 
       * @param {String} phone 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Contact}
       */
      this.getContactByPhone = function(phone) {
        return this.getContactByPhoneWithHttpInfo(phone)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Check is that phone number blocked
       * 
       * @param {String} phone Phone number to check
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Contact} and HTTP response
       */
      this.getContactIfBlockedWithHttpInfo = function(phone) {
        var postBody = null;
  
        // verify the required parameter 'phone' is set
        if (phone === undefined || phone === null) {
          throw new Error("Missing the required parameter 'phone' when calling getContactIfBlocked");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
          'phone': phone,
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = Contact;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/block/phone', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Check is that phone number blocked
       * 
       * @param {String} phone Phone number to check
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Contact}
       */
      this.getContactIfBlocked = function(phone) {
        return this.getContactIfBlockedWithHttpInfo(phone)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Check import progress
       * Get contact import session progress.
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetContactImportSessionProgressResponse} and HTTP response
       */
      this.getContactImportSessionProgressWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getContactImportSessionProgress");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetContactImportSessionProgressResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/import/progress/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Check import progress
       * Get contact import session progress.
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetContactImportSessionProgressResponse}
       */
      this.getContactImportSessionProgress = function(id) {
        return this.getContactImportSessionProgressWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get a contact note
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ContactNote} and HTTP response
       */
      this.getContactNoteWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getContactNote");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ContactNote;
  
        return this.apiClient.callApi(
          '/api/v2/notes/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get a contact note
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ContactNote}
       */
      this.getContactNote = function(id) {
        return this.getContactNoteWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Fetch notes assigned to the given contact.
       * 
       * @param {Number} id 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetContactNotesPaginatedResponse} and HTTP response
       */
      this.getContactNotesWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getContactNotes");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetContactNotesPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/{id}/notes', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Fetch notes assigned to the given contact.
       * 
       * @param {Number} id 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetContactNotesPaginatedResponse}
       */
      this.getContactNotes = function(id, opts) {
        return this.getContactNotesWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all contacts
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.shared Should shared contacts to be included (default to 0)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetContactsPaginatedResponse} and HTTP response
       */
      this.getContactsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'shared': opts['shared'],
          'orderBy': opts['orderBy'],
          'direction': opts['direction'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetContactsPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all contacts
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.shared Should shared contacts to be included (default to 0)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetContactsPaginatedResponse}
       */
      this.getContacts = function(opts) {
        return this.getContactsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get contacts autocomplete suggestions
       * Get contacts autocomplete suggestions by given search term
       * @param {String} query Find recipients by specified search query
       * @param {Object} opts Optional parameters
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.lists Should lists be returned or not (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetContactsAutocompleteResponse} and HTTP response
       */
      this.getContactsAutocompleteWithHttpInfo = function(query, opts) {
        opts = opts || {};
        var postBody = null;
  
        // verify the required parameter 'query' is set
        if (query === undefined || query === null) {
          throw new Error("Missing the required parameter 'query' when calling getContactsAutocomplete");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
          'limit': opts['limit'],
          'query': query,
          'lists': opts['lists'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetContactsAutocompleteResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/autocomplete', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get contacts autocomplete suggestions
       * Get contacts autocomplete suggestions by given search term
       * @param {String} query Find recipients by specified search query
       * @param {Object} opts Optional parameters
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.lists Should lists be returned or not (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetContactsAutocompleteResponse}
       */
      this.getContactsAutocomplete = function(query, opts) {
        return this.getContactsAutocompleteWithHttpInfo(query, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all contacts in a list
       * A useful synonym for \&quot;contacts/search\&quot; command with provided \&quot;listId\&quot; parameter.
       * @param {Number} id Given group Id.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetContactsByListIdPaginatedResponse} and HTTP response
       */
      this.getContactsByListIdWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getContactsByListId");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'orderBy': opts['orderBy'],
          'direction': opts['direction'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetContactsByListIdPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/lists/{id}/contacts', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all contacts in a list
       * A useful synonym for \&quot;contacts/search\&quot; command with provided \&quot;listId\&quot; parameter.
       * @param {Number} id Given group Id.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetContactsByListIdPaginatedResponse}
       */
      this.getContactsByListId = function(id, opts) {
        return this.getContactsByListIdWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get countries
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetCountriesResponse} and HTTP response
       */
      this.getCountriesWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetCountriesResponse;
  
        return this.apiClient.callApi(
          '/api/v2/countries', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get countries
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetCountriesResponse}
       */
      this.getCountries = function() {
        return this.getCountriesWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get current account information
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/User} and HTTP response
       */
      this.getCurrentUserWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = User;
  
        return this.apiClient.callApi(
          '/api/v2/user', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get current account information
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/User}
       */
      this.getCurrentUser = function() {
        return this.getCurrentUserWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get the details of a specific custom field
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UserCustomField} and HTTP response
       */
      this.getCustomFieldWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getCustomField");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = UserCustomField;
  
        return this.apiClient.callApi(
          '/api/v2/customfields/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get the details of a specific custom field
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UserCustomField}
       */
      this.getCustomField = function(id) {
        return this.getCustomFieldWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all custom fields
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetCustomFieldsPaginatedResponse} and HTTP response
       */
      this.getCustomFieldsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetCustomFieldsPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/customfields', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all custom fields
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetCustomFieldsPaginatedResponse}
       */
      this.getCustomFields = function(opts) {
        return this.getCustomFieldsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get the details of a specific dedicated number
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UsersInbound} and HTTP response
       */
      this.getDedicatedNumberWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getDedicatedNumber");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = UsersInbound;
  
        return this.apiClient.callApi(
          '/api/v2/numbers/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get the details of a specific dedicated number
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UsersInbound}
       */
      this.getDedicatedNumber = function(id) {
        return this.getDedicatedNumberWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get favorite contacts and lists
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.query Find contacts or lists by specified search query
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetFavouritesPaginatedResponse} and HTTP response
       */
      this.getFavouritesWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'query': opts['query'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetFavouritesPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/favorite', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get favorite contacts and lists
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.query Find contacts or lists by specified search query
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetFavouritesPaginatedResponse}
       */
      this.getFavourites = function(opts) {
        return this.getFavouritesWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get a single inbound message
       * 
       * @param {Number} id The unique numeric ID for the inbound message.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/MessageIn} and HTTP response
       */
      this.getInboundMessageWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getInboundMessage");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = MessageIn;
  
        return this.apiClient.callApi(
          '/api/v2/replies/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get a single inbound message
       * 
       * @param {Number} id The unique numeric ID for the inbound message.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/MessageIn}
       */
      this.getInboundMessage = function(id) {
        return this.getInboundMessageWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get inbound messages notification settings
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetInboundMessagesNotificationSettingsResponse} and HTTP response
       */
      this.getInboundMessagesNotificationSettingsWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetInboundMessagesNotificationSettingsResponse;
  
        return this.apiClient.callApi(
          '/api/v2/user/notification/inbound', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get inbound messages notification settings
       * 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetInboundMessagesNotificationSettingsResponse}
       */
      this.getInboundMessagesNotificationSettings = function() {
        return this.getInboundMessagesNotificationSettingsWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all invoices
       * With the TextMagic API, you can check the invoices and transactions for your account.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetInvoicesPaginatedResponse} and HTTP response
       */
      this.getInvoicesWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetInvoicesPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/invoices', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all invoices
       * With the TextMagic API, you can check the invoices and transactions for your account.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetInvoicesPaginatedResponse}
       */
      this.getInvoices = function(opts) {
        return this.getInvoicesWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get the details of a specific list
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array} and HTTP response
       */
      this.getListWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getList");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = Array;
  
        return this.apiClient.callApi(
          '/api/v2/lists/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get the details of a specific list
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array}
       */
      this.getList = function(id) {
        return this.getListWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all contacts IDs in a list
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetListContactsIdsResponse} and HTTP response
       */
      this.getListContactsIdsWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getListContactsIds");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetListContactsIdsResponse;
  
        return this.apiClient.callApi(
          '/api/v2/lists/{id}/contacts/ids', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all contacts IDs in a list
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetListContactsIdsResponse}
       */
      this.getListContactsIds = function(id) {
        return this.getListContactsIdsWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all lists
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page The current fetched page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @param {Number} opts.favoriteOnly Return only favorite lists (default to 0)
       * @param {Number} opts.onlyMine Return only current user lists (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetListsPaginatedResponse} and HTTP response
       */
      this.getListsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'orderBy': opts['orderBy'],
          'direction': opts['direction'],
          'favoriteOnly': opts['favoriteOnly'],
          'onlyMine': opts['onlyMine'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetListsPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/lists', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all lists
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page The current fetched page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @param {Number} opts.favoriteOnly Return only favorite lists (default to 0)
       * @param {Number} opts.onlyMine Return only current user lists (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetListsPaginatedResponse}
       */
      this.getLists = function(opts) {
        return this.getListsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get contact&#39;s lists
       * Get all the lists in which the contact is included
       * @param {Number} id 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetListsOfContactPaginatedResponse} and HTTP response
       */
      this.getListsOfContactWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getListsOfContact");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetListsOfContactPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/{id}/lists', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get contact&#39;s lists
       * Get all the lists in which the contact is included
       * @param {Number} id 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetListsOfContactPaginatedResponse}
       */
      this.getListsOfContact = function(id, opts) {
        return this.getListsOfContactWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Preview message
       * Get messages preview (with tags merged) up to 100 messages per session.
       * @param {Object} opts Optional parameters
       * @param {String} opts.text Message text. Required if **template_id** is not set.
       * @param {Number} opts.templateId Template used instead of message text. Required if **text** is not set.
       * @param {Number} opts.sendingTime DEPRECATED, consider using sendingDateTime and sendingTimezone parameters instead: Optional (required with rrule set). Message sending time in unix timestamp format. Default is now.
       * @param {String} opts.sendingDateTime Sending time in Y-m-d H:i:s format (e.g. 2016-05-27 13:02:33). This time is relative to sendingTimezone.
       * @param {String} opts.sendingTimezone ID or ISO-name of timezone used for sending when sendingDateTime parameter is set. E.g. if you specify sendingDateTime &#x3D; \\\&quot;2016-05-27 13:02:33\\\&quot; and sendingTimezone &#x3D; \\\&quot;America/Buenos_Aires\\\&quot;, your message will be sent at May 27, 2016 13:02:33 Buenos Aires time, or 16:02:33 UTC. Default is account timezone.
       * @param {String} opts.contacts Comma separated array of contact resources id message will be sent to.
       * @param {String} opts.lists Comma separated array of list resources id message will be sent to.
       * @param {String} opts.phones Comma separated array of E.164 phone numbers message will be sent to.
       * @param {Number} opts.cutExtra Should sending method cut extra characters which not fit supplied partsCount or return 400 Bad request response instead. (default to 0)
       * @param {Number} opts.partsCount Maximum message parts count (TextMagic allows sending 1 to 6 message parts). (default to 6)
       * @param {Number} opts.referenceId Custom message reference id which can be used in your application infrastructure.
       * @param {String} opts.from One of allowed Sender ID (phone number or alphanumeric sender ID). If specified Sender ID is not allowed for some destinations, a fallback default Sender ID will be used to ensure delivery. See [Get timezones](http://docs.textmagictesting.com/#tag/Sender-IDs).
       * @param {String} opts.rule iCal RRULE parameter to create recurrent scheduled messages. When used, sendingTime is mandatory as start point of sending. See https://www.textmagic.com/free-tools/rrule-generator for format details.
       * @param {Number} opts.createChat Should sending method try to create new Chat(if not exist) with specified recipients. (default to 0)
       * @param {Number} opts.tts Send Text to Speech message. (default to 0)
       * @param {Number} opts.local Treat phone numbers passed in \\&#39;phones\\&#39; field as local. (default to 0)
       * @param {String} opts.localCountry 2-letter ISO country code for local phone numbers, used when \\&#39;local\\&#39; is set to true. Default is account country.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetMessagePreviewResponse} and HTTP response
       */
      this.getMessagePreviewWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'text': opts['text'],
          'templateId': opts['templateId'],
          'sendingTime': opts['sendingTime'],
          'sendingDateTime': opts['sendingDateTime'],
          'sendingTimezone': opts['sendingTimezone'],
          'contacts': opts['contacts'],
          'lists': opts['lists'],
          'phones': opts['phones'],
          'cutExtra': opts['cutExtra'],
          'partsCount': opts['partsCount'],
          'referenceId': opts['referenceId'],
          'from': opts['from'],
          'rule': opts['rule'],
          'createChat': opts['createChat'],
          'tts': opts['tts'],
          'local': opts['local'],
          'localCountry': opts['localCountry'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetMessagePreviewResponse;
  
        return this.apiClient.callApi(
          '/api/v2/messages/preview', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Preview message
       * Get messages preview (with tags merged) up to 100 messages per session.
       * @param {Object} opts Optional parameters
       * @param {String} opts.text Message text. Required if **template_id** is not set.
       * @param {Number} opts.templateId Template used instead of message text. Required if **text** is not set.
       * @param {Number} opts.sendingTime DEPRECATED, consider using sendingDateTime and sendingTimezone parameters instead: Optional (required with rrule set). Message sending time in unix timestamp format. Default is now.
       * @param {String} opts.sendingDateTime Sending time in Y-m-d H:i:s format (e.g. 2016-05-27 13:02:33). This time is relative to sendingTimezone.
       * @param {String} opts.sendingTimezone ID or ISO-name of timezone used for sending when sendingDateTime parameter is set. E.g. if you specify sendingDateTime &#x3D; \\\&quot;2016-05-27 13:02:33\\\&quot; and sendingTimezone &#x3D; \\\&quot;America/Buenos_Aires\\\&quot;, your message will be sent at May 27, 2016 13:02:33 Buenos Aires time, or 16:02:33 UTC. Default is account timezone.
       * @param {String} opts.contacts Comma separated array of contact resources id message will be sent to.
       * @param {String} opts.lists Comma separated array of list resources id message will be sent to.
       * @param {String} opts.phones Comma separated array of E.164 phone numbers message will be sent to.
       * @param {Number} opts.cutExtra Should sending method cut extra characters which not fit supplied partsCount or return 400 Bad request response instead. (default to 0)
       * @param {Number} opts.partsCount Maximum message parts count (TextMagic allows sending 1 to 6 message parts). (default to 6)
       * @param {Number} opts.referenceId Custom message reference id which can be used in your application infrastructure.
       * @param {String} opts.from One of allowed Sender ID (phone number or alphanumeric sender ID). If specified Sender ID is not allowed for some destinations, a fallback default Sender ID will be used to ensure delivery. See [Get timezones](http://docs.textmagictesting.com/#tag/Sender-IDs).
       * @param {String} opts.rule iCal RRULE parameter to create recurrent scheduled messages. When used, sendingTime is mandatory as start point of sending. See https://www.textmagic.com/free-tools/rrule-generator for format details.
       * @param {Number} opts.createChat Should sending method try to create new Chat(if not exist) with specified recipients. (default to 0)
       * @param {Number} opts.tts Send Text to Speech message. (default to 0)
       * @param {Number} opts.local Treat phone numbers passed in \\&#39;phones\\&#39; field as local. (default to 0)
       * @param {String} opts.localCountry 2-letter ISO country code for local phone numbers, used when \\&#39;local\\&#39; is set to true. Default is account country.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetMessagePreviewResponse}
       */
      this.getMessagePreview = function(opts) {
        return this.getMessagePreviewWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Check message price
       * Check pricing for a new outbound message.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.includeBlocked Should we show pricing for the blocked contacts. (default to 0)
       * @param {String} opts.text Message text. Required if **template_id** is not set.
       * @param {Number} opts.templateId Template used instead of message text. Required if **text** is not set.
       * @param {Number} opts.sendingTime DEPRECATED, consider using sendingDateTime and sendingTimezone parameters instead: Optional (required with rrule set). Message sending time in unix timestamp format. Default is now.
       * @param {String} opts.sendingDateTime Sending time in Y-m-d H:i:s format (e.g. 2016-05-27 13:02:33). This time is relative to sendingTimezone.
       * @param {String} opts.sendingTimezone ID or ISO-name of timezone used for sending when sendingDateTime parameter is set. E.g. if you specify sendingDateTime &#x3D; \\\&quot;2016-05-27 13:02:33\\\&quot; and sendingTimezone &#x3D; \\\&quot;America/Buenos_Aires\\\&quot;, your message will be sent at May 27, 2016 13:02:33 Buenos Aires time, or 16:02:33 UTC. Default is account timezone.
       * @param {String} opts.contacts Comma separated array of contact resources id message will be sent to.
       * @param {String} opts.lists Comma separated array of list resources id message will be sent to.
       * @param {String} opts.phones Comma separated array of E.164 phone numbers message will be sent to.
       * @param {Number} opts.cutExtra Should sending method cut extra characters which not fit supplied partsCount or return 400 Bad request response instead. (default to 0)
       * @param {Number} opts.partsCount Maximum message parts count (TextMagic allows sending 1 to 6 message parts). (default to 6)
       * @param {Number} opts.referenceId Custom message reference id which can be used in your application infrastructure.
       * @param {String} opts.from One of allowed Sender ID (phone number or alphanumeric sender ID). If specified Sender ID is not allowed for some destinations, a fallback default Sender ID will be used to ensure delivery. See [Get timezones](http://docs.textmagictesting.com/#tag/Sender-IDs).
       * @param {String} opts.rule iCal RRULE parameter to create recurrent scheduled messages. When used, sendingTime is mandatory as start point of sending. See https://www.textmagic.com/free-tools/rrule-generator for format details.
       * @param {Number} opts.createChat Should sending method try to create new Chat(if not exist) with specified recipients. (default to 0)
       * @param {Number} opts.tts Send Text to Speech message. (default to 0)
       * @param {Number} opts.local Treat phone numbers passed in \\&#39;phones\\&#39; field as local. (default to 0)
       * @param {String} opts.localCountry 2-letter ISO country code for local phone numbers, used when \\&#39;local\\&#39; is set to true. Default is account country.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetMessagePriceResponse} and HTTP response
       */
      this.getMessagePriceWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'includeBlocked': opts['includeBlocked'],
          'text': opts['text'],
          'templateId': opts['templateId'],
          'sendingTime': opts['sendingTime'],
          'sendingDateTime': opts['sendingDateTime'],
          'sendingTimezone': opts['sendingTimezone'],
          'contacts': opts['contacts'],
          'lists': opts['lists'],
          'phones': opts['phones'],
          'cutExtra': opts['cutExtra'],
          'partsCount': opts['partsCount'],
          'referenceId': opts['referenceId'],
          'from': opts['from'],
          'rule': opts['rule'],
          'createChat': opts['createChat'],
          'tts': opts['tts'],
          'local': opts['local'],
          'localCountry': opts['localCountry'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetMessagePriceResponse;
  
        return this.apiClient.callApi(
          '/api/v2/messages/price/normalized', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Check message price
       * Check pricing for a new outbound message.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.includeBlocked Should we show pricing for the blocked contacts. (default to 0)
       * @param {String} opts.text Message text. Required if **template_id** is not set.
       * @param {Number} opts.templateId Template used instead of message text. Required if **text** is not set.
       * @param {Number} opts.sendingTime DEPRECATED, consider using sendingDateTime and sendingTimezone parameters instead: Optional (required with rrule set). Message sending time in unix timestamp format. Default is now.
       * @param {String} opts.sendingDateTime Sending time in Y-m-d H:i:s format (e.g. 2016-05-27 13:02:33). This time is relative to sendingTimezone.
       * @param {String} opts.sendingTimezone ID or ISO-name of timezone used for sending when sendingDateTime parameter is set. E.g. if you specify sendingDateTime &#x3D; \\\&quot;2016-05-27 13:02:33\\\&quot; and sendingTimezone &#x3D; \\\&quot;America/Buenos_Aires\\\&quot;, your message will be sent at May 27, 2016 13:02:33 Buenos Aires time, or 16:02:33 UTC. Default is account timezone.
       * @param {String} opts.contacts Comma separated array of contact resources id message will be sent to.
       * @param {String} opts.lists Comma separated array of list resources id message will be sent to.
       * @param {String} opts.phones Comma separated array of E.164 phone numbers message will be sent to.
       * @param {Number} opts.cutExtra Should sending method cut extra characters which not fit supplied partsCount or return 400 Bad request response instead. (default to 0)
       * @param {Number} opts.partsCount Maximum message parts count (TextMagic allows sending 1 to 6 message parts). (default to 6)
       * @param {Number} opts.referenceId Custom message reference id which can be used in your application infrastructure.
       * @param {String} opts.from One of allowed Sender ID (phone number or alphanumeric sender ID). If specified Sender ID is not allowed for some destinations, a fallback default Sender ID will be used to ensure delivery. See [Get timezones](http://docs.textmagictesting.com/#tag/Sender-IDs).
       * @param {String} opts.rule iCal RRULE parameter to create recurrent scheduled messages. When used, sendingTime is mandatory as start point of sending. See https://www.textmagic.com/free-tools/rrule-generator for format details.
       * @param {Number} opts.createChat Should sending method try to create new Chat(if not exist) with specified recipients. (default to 0)
       * @param {Number} opts.tts Send Text to Speech message. (default to 0)
       * @param {Number} opts.local Treat phone numbers passed in \\&#39;phones\\&#39; field as local. (default to 0)
       * @param {String} opts.localCountry 2-letter ISO country code for local phone numbers, used when \\&#39;local\\&#39; is set to true. Default is account country.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetMessagePriceResponse}
       */
      this.getMessagePrice = function(opts) {
        return this.getMessagePriceWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get a session details
       * Get a specific session’s details
       * @param {Number} id a session ID
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/MessageSession} and HTTP response
       */
      this.getMessageSessionWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getMessageSession");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = MessageSession;
  
        return this.apiClient.callApi(
          '/api/v2/sessions/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get a session details
       * Get a specific session’s details
       * @param {Number} id a session ID
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/MessageSession}
       */
      this.getMessageSession = function(id) {
        return this.getMessageSessionWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get a session statistics
       * 
       * @param {Number} id 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.includeDeleted Search also in deleted messages (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetMessageSessionStatResponse} and HTTP response
       */
      this.getMessageSessionStatWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getMessageSessionStat");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
          'includeDeleted': opts['includeDeleted'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetMessageSessionStatResponse;
  
        return this.apiClient.callApi(
          '/api/v2/sessions/{id}/stat', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get a session statistics
       * 
       * @param {Number} id 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.includeDeleted Search also in deleted messages (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetMessageSessionStatResponse}
       */
      this.getMessageSessionStat = function(id, opts) {
        return this.getMessageSessionStatWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get a session messages
       * A useful synonym for \&quot;messages/search\&quot; command with provided \&quot;sessionId\&quot; parameter.
       * @param {Number} id 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {module:model/String} opts.statuses Find messages by status
       * @param {Number} opts.includeDeleted Search also in deleted messages (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetMessagesBySessionIdPaginatedResponse} and HTTP response
       */
      this.getMessagesBySessionIdWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getMessagesBySessionId");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'statuses': opts['statuses'],
          'includeDeleted': opts['includeDeleted'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetMessagesBySessionIdPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/sessions/{id}/messages', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get a session messages
       * A useful synonym for \&quot;messages/search\&quot; command with provided \&quot;sessionId\&quot; parameter.
       * @param {Number} id 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {module:model/String} opts.statuses Find messages by status
       * @param {Number} opts.includeDeleted Search also in deleted messages (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetMessagesBySessionIdPaginatedResponse}
       */
      this.getMessagesBySessionId = function(id, opts) {
        return this.getMessagesBySessionIdWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get sent/received messages counters values
       * Get total contacts, sent messages and received messages counters values.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetMessagingCountersResponse} and HTTP response
       */
      this.getMessagingCountersWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetMessagingCountersResponse;
  
        return this.apiClient.callApi(
          '/api/v2/stats/messaging/data', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get sent/received messages counters values
       * Get total contacts, sent messages and received messages counters values.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetMessagingCountersResponse}
       */
      this.getMessagingCounters = function() {
        return this.getMessagingCountersWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get messaging statistics
       * 
       * @param {Object} opts Optional parameters
       * @param {module:model/String} opts.by *   **off** to get total values per specified time interval *   **day** to show values grouped by day *   **month** to show values grouped by month *   **year** to show values grouped by year  (default to off)
       * @param {Number} opts.start Time period start in [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) format. The default is 7 days prior. 
       * @param {Number} opts.end Time period start in [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) format. The default is today. 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetMessagingStatResponse} and HTTP response
       */
      this.getMessagingStatWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'by': opts['by'],
          'start': opts['start'],
          'end': opts['end'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetMessagingStatResponse;
  
        return this.apiClient.callApi(
          '/api/v2/stats/messaging', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get messaging statistics
       * 
       * @param {Object} opts Optional parameters
       * @param {module:model/String} opts.by *   **off** to get total values per specified time interval *   **day** to show values grouped by day *   **month** to show values grouped by month *   **year** to show values grouped by year  (default to off)
       * @param {Number} opts.start Time period start in [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) format. The default is 7 days prior. 
       * @param {Number} opts.end Time period start in [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) format. The default is today. 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetMessagingStatResponse}
       */
      this.getMessagingStat = function(opts) {
        return this.getMessagingStatWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get a single message
       * Get a single outgoing message.
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/MessageOut} and HTTP response
       */
      this.getOutboundMessageWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getOutboundMessage");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = MessageOut;
  
        return this.apiClient.callApi(
          '/api/v2/messages/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get a single message
       * Get a single outgoing message.
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/MessageOut}
       */
      this.getOutboundMessage = function(id) {
        return this.getOutboundMessageWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get history
       * Get outbound messages history.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.lastId Filter results by ID, selecting all values lesser than the specified ID.
       * @param {String} opts.query Find message by specified search query
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetOutboundMessagesHistoryPaginatedResponse} and HTTP response
       */
      this.getOutboundMessagesHistoryWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'limit': opts['limit'],
          'lastId': opts['lastId'],
          'query': opts['query'],
          'orderBy': opts['orderBy'],
          'direction': opts['direction'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetOutboundMessagesHistoryPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/history', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get history
       * Get outbound messages history.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.lastId Filter results by ID, selecting all values lesser than the specified ID.
       * @param {String} opts.query Find message by specified search query
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetOutboundMessagesHistoryPaginatedResponse}
       */
      this.getOutboundMessagesHistory = function(opts) {
        return this.getOutboundMessagesHistoryWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get a single scheduled message
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/MessagesIcs} and HTTP response
       */
      this.getScheduledMessageWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getScheduledMessage");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = MessagesIcs;
  
        return this.apiClient.callApi(
          '/api/v2/schedules/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get a single scheduled message
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/MessagesIcs}
       */
      this.getScheduledMessage = function(id) {
        return this.getScheduledMessageWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get the details of a specific Sender ID
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SenderId} and HTTP response
       */
      this.getSenderIdWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getSenderId");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = SenderId;
  
        return this.apiClient.callApi(
          '/api/v2/senderids/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get the details of a specific Sender ID
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SenderId}
       */
      this.getSenderId = function(id) {
        return this.getSenderIdWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all your approved Sender IDs
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetSenderIdsPaginatedResponse} and HTTP response
       */
      this.getSenderIdsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetSenderIdsPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/senderids', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all your approved Sender IDs
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetSenderIdsPaginatedResponse}
       */
      this.getSenderIds = function(opts) {
        return this.getSenderIdsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get current sender settings
       * 
       * @param {Object} opts Optional parameters
       * @param {String} opts.country Return sender settings enabled for sending to specified country. Two upper case characters
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetSenderSettingsResponse} and HTTP response
       */
      this.getSenderSettingsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'country': opts['country'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetSenderSettingsResponse;
  
        return this.apiClient.callApi(
          '/api/v2/sender/settings/normalized', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get current sender settings
       * 
       * @param {Object} opts Optional parameters
       * @param {String} opts.country Return sender settings enabled for sending to specified country. Two upper case characters
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetSenderSettingsResponse}
       */
      this.getSenderSettings = function(opts) {
        return this.getSenderSettingsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get spending statistics
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.start Time period start in [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) format. The default is 7 days prior. 
       * @param {String} opts.end Time period start in [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) format. The default is today. 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetSpendingStatPaginatedResponse} and HTTP response
       */
      this.getSpendingStatWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'start': opts['start'],
          'end': opts['end'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetSpendingStatPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/stats/spending', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get spending statistics
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.start Time period start in [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) format. The default is 7 days prior. 
       * @param {String} opts.end Time period start in [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) format. The default is today. 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetSpendingStatPaginatedResponse}
       */
      this.getSpendingStat = function(opts) {
        return this.getSpendingStatWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get sub-account information
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/User} and HTTP response
       */
      this.getSubaccountWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getSubaccount");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = User;
  
        return this.apiClient.callApi(
          '/api/v2/subaccounts/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get sub-account information
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/User}
       */
      this.getSubaccount = function(id) {
        return this.getSubaccountWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get sub-accounts list
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/User} and HTTP response
       */
      this.getSubaccountsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = User;
  
        return this.apiClient.callApi(
          '/api/v2/subaccounts', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get sub-accounts list
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/User}
       */
      this.getSubaccounts = function(opts) {
        return this.getSubaccountsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all sub-accounts with their REST API tokens associated with app name
       * Get all sub-accounts with their REST API tokens associated with specified app name. When more than one token related to app name, last key will be returned.
       * @param {module:model/GetSubaccountsWithTokensInputObject} getSubaccountsWithTokensInputObject 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetSubaccountsWithTokensResponse} and HTTP response
       */
      this.getSubaccountsWithTokensWithHttpInfo = function(getSubaccountsWithTokensInputObject, opts) {
        opts = opts || {};
        var postBody = getSubaccountsWithTokensInputObject;
  
        // verify the required parameter 'getSubaccountsWithTokensInputObject' is set
        if (getSubaccountsWithTokensInputObject === undefined || getSubaccountsWithTokensInputObject === null) {
          throw new Error("Missing the required parameter 'getSubaccountsWithTokensInputObject' when calling getSubaccountsWithTokens");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetSubaccountsWithTokensResponse;
  
        return this.apiClient.callApi(
          '/api/v2/subaccounts/tokens/list', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all sub-accounts with their REST API tokens associated with app name
       * Get all sub-accounts with their REST API tokens associated with specified app name. When more than one token related to app name, last key will be returned.
       * @param {module:model/GetSubaccountsWithTokensInputObject} getSubaccountsWithTokensInputObject 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetSubaccountsWithTokensResponse}
       */
      this.getSubaccountsWithTokens = function(getSubaccountsWithTokensInputObject, opts) {
        return this.getSubaccountsWithTokensWithHttpInfo(getSubaccountsWithTokensInputObject, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get a template details
       * Get a single template.
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/MessageTemplate} and HTTP response
       */
      this.getTemplateWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getTemplate");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = MessageTemplate;
  
        return this.apiClient.callApi(
          '/api/v2/templates/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get a template details
       * Get a single template.
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/MessageTemplate}
       */
      this.getTemplate = function(id) {
        return this.getTemplateWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get timezones
       * Return all available timezone IDs
       * @param {Object} opts Optional parameters
       * @param {Number} opts.full Return full info about timezones in array (0 or 1). Default is 0 (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetTimezonesResponse} and HTTP response
       */
      this.getTimezonesWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'full': opts['full'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetTimezonesResponse;
  
        return this.apiClient.callApi(
          '/api/v2/timezones', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get timezones
       * Return all available timezone IDs
       * @param {Object} opts Optional parameters
       * @param {Number} opts.full Return full info about timezones in array (0 or 1). Default is 0 (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetTimezonesResponse}
       */
      this.getTimezones = function(opts) {
        return this.getTimezonesWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get unread messages number
       * Get total amount of unread messages in the current user chats.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetUnreadMessagesTotalResponse} and HTTP response
       */
      this.getUnreadMessagesTotalWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetUnreadMessagesTotalResponse;
  
        return this.apiClient.callApi(
          '/api/v2/chats/unread/count', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get unread messages number
       * Get total amount of unread messages in the current user chats.
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetUnreadMessagesTotalResponse}
       */
      this.getUnreadMessagesTotal = function() {
        return this.getUnreadMessagesTotalWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get the details of a specific unsubscribed contact
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UnsubscribedContact} and HTTP response
       */
      this.getUnsubscribedContactWithHttpInfo = function(id) {
        var postBody = null;
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling getUnsubscribedContact");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = UnsubscribedContact;
  
        return this.apiClient.callApi(
          '/api/v2/unsubscribers/{id}', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get the details of a specific unsubscribed contact
       * 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UnsubscribedContact}
       */
      this.getUnsubscribedContact = function(id) {
        return this.getUnsubscribedContactWithHttpInfo(id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all unsubscribed contacts
       * When one of your message recipients sends a request with one of the [STOP-words](https://www.textmagic.com/sms-stop-command/), they will be immediately opted-out of your send lists and their contact status will change to an unsubscribed contact. To retrieve information on all contacts who have unsubscribed, use: 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetUnsubscribersPaginatedResponse} and HTTP response
       */
      this.getUnsubscribersWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetUnsubscribersPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/unsubscribers', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all unsubscribed contacts
       * When one of your message recipients sends a request with one of the [STOP-words](https://www.textmagic.com/sms-stop-command/), they will be immediately opted-out of your send lists and their contact status will change to an unsubscribed contact. To retrieve information on all contacts who have unsubscribed, use: 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetUnsubscribersPaginatedResponse}
       */
      this.getUnsubscribers = function(opts) {
        return this.getUnsubscribersWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Get all your dedicated numbers
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.surveyId Fetch only that numbers which are ready for the survey
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetUserDedicatedNumbersPaginatedResponse} and HTTP response
       */
      this.getUserDedicatedNumbersWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'surveyId': opts['surveyId'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = GetUserDedicatedNumbersPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/numbers', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Get all your dedicated numbers
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.surveyId Fetch only that numbers which are ready for the survey
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetUserDedicatedNumbersPaginatedResponse}
       */
      this.getUserDedicatedNumbers = function(opts) {
        return this.getUserDedicatedNumbersWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Import contacts
       * Import contacts from the CSV, XLS or XLSX file.
       * @param {File} file File containing contacts in csv or xls(x) formats
       * @param {String} column Import file column mapping. String must contain substrings of mapping in format &#x60;columnNumber:field&#x60; glued by &#x60;;&#x60;. For example: &#x60;0:firstName;1:lastName;3:phone;4:email&#x60; where value before &#x60;:&#x60; is a number of column in file, value after &#x60;:&#x60; is a field of newly created contact or ID of custom field. Numbers of columns begins from zero. Allowed built-in contact fields: &#x60;firstName&#x60;, &#x60;lastName&#x60;, &#x60;phone&#x60;, &#x60;email&#x60;. Existing of &#x60;phone&#x60; mapping is required. 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.listId List ID contacts will be imported to. Ignored if &#x60;listName&#x60; is specified. 
       * @param {String} opts.listName List name. This list will be created during import. If such name is already taken, an ordinal (1, 2, ...) will be added to the end. Ignored if &#x60;listId&#x60; is specified. 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.importContactsWithHttpInfo = function(file, column, opts) {
        opts = opts || {};
        var postBody = null;
  
        // verify the required parameter 'file' is set
        if (file === undefined || file === null) {
          throw new Error("Missing the required parameter 'file' when calling importContacts");
        }
  
        // verify the required parameter 'column' is set
        if (column === undefined || column === null) {
          throw new Error("Missing the required parameter 'column' when calling importContacts");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
          'column': column,
          'listId': opts['listId'],
          'listName': opts['listName'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
          'file': file
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['multipart/form-data'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/import/normalized', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Import contacts
       * Import contacts from the CSV, XLS or XLSX file.
       * @param {File} file File containing contacts in csv or xls(x) formats
       * @param {String} column Import file column mapping. String must contain substrings of mapping in format &#x60;columnNumber:field&#x60; glued by &#x60;;&#x60;. For example: &#x60;0:firstName;1:lastName;3:phone;4:email&#x60; where value before &#x60;:&#x60; is a number of column in file, value after &#x60;:&#x60; is a field of newly created contact or ID of custom field. Numbers of columns begins from zero. Allowed built-in contact fields: &#x60;firstName&#x60;, &#x60;lastName&#x60;, &#x60;phone&#x60;, &#x60;email&#x60;. Existing of &#x60;phone&#x60; mapping is required. 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.listId List ID contacts will be imported to. Ignored if &#x60;listName&#x60; is specified. 
       * @param {String} opts.listName List name. This list will be created during import. If such name is already taken, an ordinal (1, 2, ...) will be added to the end. Ignored if &#x60;listId&#x60; is specified. 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.importContacts = function(file, column, opts) {
        return this.importContactsWithHttpInfo(file, column, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Invite a new sub-account
       * 
       * @param {module:model/InviteSubaccountInputObject} inviteSubaccountInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.inviteSubaccountWithHttpInfo = function(inviteSubaccountInputObject) {
        var postBody = inviteSubaccountInputObject;
  
        // verify the required parameter 'inviteSubaccountInputObject' is set
        if (inviteSubaccountInputObject === undefined || inviteSubaccountInputObject === null) {
          throw new Error("Missing the required parameter 'inviteSubaccountInputObject' when calling inviteSubaccount");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/subaccounts', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Invite a new sub-account
       * 
       * @param {module:model/InviteSubaccountInputObject} inviteSubaccountInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.inviteSubaccount = function(inviteSubaccountInputObject) {
        return this.inviteSubaccountWithHttpInfo(inviteSubaccountInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Mark chats as read (bulk)
       * Mark several chats as read by chat ids or mark all chats as read
       * @param {module:model/MarkChatsReadBulkInputObject} markChatsReadBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.markChatsReadBulkWithHttpInfo = function(markChatsReadBulkInputObject) {
        var postBody = markChatsReadBulkInputObject;
  
        // verify the required parameter 'markChatsReadBulkInputObject' is set
        if (markChatsReadBulkInputObject === undefined || markChatsReadBulkInputObject === null) {
          throw new Error("Missing the required parameter 'markChatsReadBulkInputObject' when calling markChatsReadBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/chats/read/bulk', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Mark chats as read (bulk)
       * Mark several chats as read by chat ids or mark all chats as read
       * @param {module:model/MarkChatsReadBulkInputObject} markChatsReadBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.markChatsReadBulk = function(markChatsReadBulkInputObject) {
        return this.markChatsReadBulkWithHttpInfo(markChatsReadBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Mark chats as unread (bulk)
       * Mark several chats as UNread by chat ids or mark all chats as UNread
       * @param {module:model/MarkChatsUnreadBulkInputObject} markChatsUnreadBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.markChatsUnreadBulkWithHttpInfo = function(markChatsUnreadBulkInputObject) {
        var postBody = markChatsUnreadBulkInputObject;
  
        // verify the required parameter 'markChatsUnreadBulkInputObject' is set
        if (markChatsUnreadBulkInputObject === undefined || markChatsUnreadBulkInputObject === null) {
          throw new Error("Missing the required parameter 'markChatsUnreadBulkInputObject' when calling markChatsUnreadBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/chats/unread/bulk', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Mark chats as unread (bulk)
       * Mark several chats as UNread by chat ids or mark all chats as UNread
       * @param {module:model/MarkChatsUnreadBulkInputObject} markChatsUnreadBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.markChatsUnreadBulk = function(markChatsUnreadBulkInputObject) {
        return this.markChatsUnreadBulkWithHttpInfo(markChatsUnreadBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Mute chat sounds
       * 
       * @param {module:model/MuteChatInputObject} muteChatInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.muteChatWithHttpInfo = function(muteChatInputObject) {
        var postBody = muteChatInputObject;
  
        // verify the required parameter 'muteChatInputObject' is set
        if (muteChatInputObject === undefined || muteChatInputObject === null) {
          throw new Error("Missing the required parameter 'muteChatInputObject' when calling muteChat");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/chats/mute', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Mute chat sounds
       * 
       * @param {module:model/MuteChatInputObject} muteChatInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.muteChat = function(muteChatInputObject) {
        return this.muteChatWithHttpInfo(muteChatInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Mute chats (bulk)
       * Mute several chats by chat ids or mute all chats
       * @param {module:model/MuteChatsBulkInputObject} muteChatsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.muteChatsBulkWithHttpInfo = function(muteChatsBulkInputObject) {
        var postBody = muteChatsBulkInputObject;
  
        // verify the required parameter 'muteChatsBulkInputObject' is set
        if (muteChatsBulkInputObject === undefined || muteChatsBulkInputObject === null) {
          throw new Error("Missing the required parameter 'muteChatsBulkInputObject' when calling muteChatsBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/chats/mute/bulk', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Mute chats (bulk)
       * Mute several chats by chat ids or mute all chats
       * @param {module:model/MuteChatsBulkInputObject} muteChatsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.muteChatsBulk = function(muteChatsBulkInputObject) {
        return this.muteChatsBulkWithHttpInfo(muteChatsBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Ping
       * Make a simple ping request
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/PingResponse} and HTTP response
       */
      this.pingWithHttpInfo = function() {
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = PingResponse;
  
        return this.apiClient.callApi(
          '/api/v2/ping', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Ping
       * Make a simple ping request
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/PingResponse}
       */
      this.ping = function() {
        return this.pingWithHttpInfo()
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Reopen chats (bulk)
       * Reopen chats by chat ids or reopen all chats
       * @param {module:model/ReopenChatsBulkInputObject} reopenChatsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.reopenChatsBulkWithHttpInfo = function(reopenChatsBulkInputObject) {
        var postBody = reopenChatsBulkInputObject;
  
        // verify the required parameter 'reopenChatsBulkInputObject' is set
        if (reopenChatsBulkInputObject === undefined || reopenChatsBulkInputObject === null) {
          throw new Error("Missing the required parameter 'reopenChatsBulkInputObject' when calling reopenChatsBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/chats/reopen/bulk', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Reopen chats (bulk)
       * Reopen chats by chat ids or reopen all chats
       * @param {module:model/ReopenChatsBulkInputObject} reopenChatsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.reopenChatsBulk = function(reopenChatsBulkInputObject) {
        return this.reopenChatsBulkWithHttpInfo(reopenChatsBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Request a new REST API token for sub-account
       * Returning user object, key and app name.
       * @param {module:model/RequestNewSubaccountTokenInputObject} requestNewSubaccountTokenInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/User} and HTTP response
       */
      this.requestNewSubaccountTokenWithHttpInfo = function(requestNewSubaccountTokenInputObject) {
        var postBody = requestNewSubaccountTokenInputObject;
  
        // verify the required parameter 'requestNewSubaccountTokenInputObject' is set
        if (requestNewSubaccountTokenInputObject === undefined || requestNewSubaccountTokenInputObject === null) {
          throw new Error("Missing the required parameter 'requestNewSubaccountTokenInputObject' when calling requestNewSubaccountToken");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = User;
  
        return this.apiClient.callApi(
          '/api/v2/subaccounts/tokens', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Request a new REST API token for sub-account
       * Returning user object, key and app name.
       * @param {module:model/RequestNewSubaccountTokenInputObject} requestNewSubaccountTokenInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/User}
       */
      this.requestNewSubaccountToken = function(requestNewSubaccountTokenInputObject) {
        return this.requestNewSubaccountTokenWithHttpInfo(requestNewSubaccountTokenInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Apply for a new Sender ID
       * &gt; Sender IDs are shared between all of your sub-accounts.
       * @param {module:model/RequestSenderIdInputObject} requestSenderIdInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.requestSenderIdWithHttpInfo = function(requestSenderIdInputObject) {
        var postBody = requestSenderIdInputObject;
  
        // verify the required parameter 'requestSenderIdInputObject' is set
        if (requestSenderIdInputObject === undefined || requestSenderIdInputObject === null) {
          throw new Error("Missing the required parameter 'requestSenderIdInputObject' when calling requestSenderId");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/senderids', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Apply for a new Sender ID
       * &gt; Sender IDs are shared between all of your sub-accounts.
       * @param {module:model/RequestSenderIdInputObject} requestSenderIdInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.requestSenderId = function(requestSenderIdInputObject) {
        return this.requestSenderIdWithHttpInfo(requestSenderIdInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Find chats by message text
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.query Find chats by specified search query
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SearchChatsPaginatedResponse} and HTTP response
       */
      this.searchChatsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'query': opts['query'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = SearchChatsPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/chats/search', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Find chats by message text
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.query Find chats by specified search query
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SearchChatsPaginatedResponse}
       */
      this.searchChats = function(opts) {
        return this.searchChatsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Find chats (bulk)
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.ids Find chats by ID(s)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SearchChatsByIdsPaginatedResponse} and HTTP response
       */
      this.searchChatsByIdsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'ids': opts['ids'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = SearchChatsByIdsPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/chats/search/ids', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Find chats (bulk)
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.ids Find chats by ID(s)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SearchChatsByIdsPaginatedResponse}
       */
      this.searchChatsByIds = function(opts) {
        return this.searchChatsByIdsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Find chats by recipient
       * Find chats by recipient (contact, list name or phone number).
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.query Find chats by specified search query
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SearchChatsByReceipentPaginatedResponse} and HTTP response
       */
      this.searchChatsByReceipentWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'query': opts['query'],
          'orderBy': opts['orderBy'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = SearchChatsByReceipentPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/chats/search/recipients', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Find chats by recipient
       * Find chats by recipient (contact, list name or phone number).
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.query Find chats by specified search query
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SearchChatsByReceipentPaginatedResponse}
       */
      this.searchChatsByReceipent = function(opts) {
        return this.searchChatsByReceipentWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Find contacts by given criteria
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.shared Should shared contacts to be included (default to 0)
       * @param {String} opts.ids Find contact by ID(s)
       * @param {Number} opts.listId Find contact by List ID
       * @param {Number} opts.includeBlocked Should blocked contacts to be included
       * @param {String} opts.query Find contacts by specified search query
       * @param {Number} opts.local Treat phone number passed in &#39;query&#39; field as local. Default is 0 (default to 0)
       * @param {String} opts.country 2-letter ISO country code for local phone numbers, used when &#39;local&#39; is set to true. Default is account country
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SearchContactsPaginatedResponse} and HTTP response
       */
      this.searchContactsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'shared': opts['shared'],
          'ids': opts['ids'],
          'listId': opts['listId'],
          'includeBlocked': opts['includeBlocked'],
          'query': opts['query'],
          'local': opts['local'],
          'country': opts['country'],
          'orderBy': opts['orderBy'],
          'direction': opts['direction'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = SearchContactsPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/search', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Find contacts by given criteria
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.shared Should shared contacts to be included (default to 0)
       * @param {String} opts.ids Find contact by ID(s)
       * @param {Number} opts.listId Find contact by List ID
       * @param {Number} opts.includeBlocked Should blocked contacts to be included
       * @param {String} opts.query Find contacts by specified search query
       * @param {Number} opts.local Treat phone number passed in &#39;query&#39; field as local. Default is 0 (default to 0)
       * @param {String} opts.country 2-letter ISO country code for local phone numbers, used when &#39;local&#39; is set to true. Default is account country
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SearchContactsPaginatedResponse}
       */
      this.searchContacts = function(opts) {
        return this.searchContactsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Find inbound messages
       * Find inbound messages by given parameters.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.ids Find message by ID(s)
       * @param {String} opts.query Find recipients by specified search query
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @param {Number} opts.expand Expand by adding firstName, lastName and contactId (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SearchInboundMessagesPaginatedResponse} and HTTP response
       */
      this.searchInboundMessagesWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'ids': opts['ids'],
          'query': opts['query'],
          'orderBy': opts['orderBy'],
          'direction': opts['direction'],
          'expand': opts['expand'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = SearchInboundMessagesPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/replies/search', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Find inbound messages
       * Find inbound messages by given parameters.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.ids Find message by ID(s)
       * @param {String} opts.query Find recipients by specified search query
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @param {Number} opts.expand Expand by adding firstName, lastName and contactId (default to 0)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SearchInboundMessagesPaginatedResponse}
       */
      this.searchInboundMessages = function(opts) {
        return this.searchInboundMessagesWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Find lists by given criteria
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.ids Find lists by ID(s)
       * @param {String} opts.query Find lists by specified search query
       * @param {Number} opts.onlyMine Return only current user lists (default to 0)
       * @param {Number} opts.onlyDefault Return only default lists (default to 0)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SearchListsPaginatedResponse} and HTTP response
       */
      this.searchListsWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'ids': opts['ids'],
          'query': opts['query'],
          'onlyMine': opts['onlyMine'],
          'onlyDefault': opts['onlyDefault'],
          'orderBy': opts['orderBy'],
          'direction': opts['direction'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = SearchListsPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/lists/search', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Find lists by given criteria
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.ids Find lists by ID(s)
       * @param {String} opts.query Find lists by specified search query
       * @param {Number} opts.onlyMine Return only current user lists (default to 0)
       * @param {Number} opts.onlyDefault Return only default lists (default to 0)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SearchListsPaginatedResponse}
       */
      this.searchLists = function(opts) {
        return this.searchListsWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Find messages
       * Find outbound messages by given parameters.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.lastId Filter results by ID, selecting all values lesser than the specified ID. Note that \\&#39;page\\&#39; parameter is ignored when \\&#39;lastId\\&#39; is specified
       * @param {String} opts.ids Find message by ID(s)
       * @param {Number} opts.sessionId Find messages by session ID
       * @param {module:model/String} opts.statuses Find messages by status
       * @param {Number} opts.includeDeleted Search also in deleted messages (default to 0)
       * @param {String} opts.query Find messages by specified search query
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SearchOutboundMessagesPaginatedResponse} and HTTP response
       */
      this.searchOutboundMessagesWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'lastId': opts['lastId'],
          'ids': opts['ids'],
          'sessionId': opts['sessionId'],
          'statuses': opts['statuses'],
          'includeDeleted': opts['includeDeleted'],
          'query': opts['query'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = SearchOutboundMessagesPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/messages/search', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Find messages
       * Find outbound messages by given parameters.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {Number} opts.lastId Filter results by ID, selecting all values lesser than the specified ID. Note that \\&#39;page\\&#39; parameter is ignored when \\&#39;lastId\\&#39; is specified
       * @param {String} opts.ids Find message by ID(s)
       * @param {Number} opts.sessionId Find messages by session ID
       * @param {module:model/String} opts.statuses Find messages by status
       * @param {Number} opts.includeDeleted Search also in deleted messages (default to 0)
       * @param {String} opts.query Find messages by specified search query
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SearchOutboundMessagesPaginatedResponse}
       */
      this.searchOutboundMessages = function(opts) {
        return this.searchOutboundMessagesWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Find scheduled messages
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.query Find messages by specified search query
       * @param {String} opts.ids Find schedules by ID(s)
       * @param {module:model/String} opts.status Fetch schedules with the specific status: a - actual, c - completed, x - all (default to x)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SearchScheduledMessagesPaginatedResponse} and HTTP response
       */
      this.searchScheduledMessagesWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'query': opts['query'],
          'ids': opts['ids'],
          'status': opts['status'],
          'orderBy': opts['orderBy'],
          'direction': opts['direction'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = SearchScheduledMessagesPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/schedules/search', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Find scheduled messages
       * 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.query Find messages by specified search query
       * @param {String} opts.ids Find schedules by ID(s)
       * @param {module:model/String} opts.status Fetch schedules with the specific status: a - actual, c - completed, x - all (default to x)
       * @param {module:model/String} opts.orderBy Order results by some field. Default is id (default to id)
       * @param {module:model/String} opts.direction Order direction. Default is desc (default to desc)
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SearchScheduledMessagesPaginatedResponse}
       */
      this.searchScheduledMessages = function(opts) {
        return this.searchScheduledMessagesWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Find templates by criteria
       * Find user templates by given parameters.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.ids Find template by ID(s)
       * @param {String} opts.name Find template by name
       * @param {String} opts.content Find template by content
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SearchTemplatesPaginatedResponse} and HTTP response
       */
      this.searchTemplatesWithHttpInfo = function(opts) {
        opts = opts || {};
        var postBody = null;
  
  
        var pathParams = {
        };
        var queryParams = {
          'page': opts['page'],
          'limit': opts['limit'],
          'ids': opts['ids'],
          'name': opts['name'],
          'content': opts['content'],
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = SearchTemplatesPaginatedResponse;
  
        return this.apiClient.callApi(
          '/api/v2/templates/search', 'GET',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Find templates by criteria
       * Find user templates by given parameters.
       * @param {Object} opts Optional parameters
       * @param {Number} opts.page Fetch specified results page. (default to 1)
       * @param {Number} opts.limit The number of results per page. (default to 10)
       * @param {String} opts.ids Find template by ID(s)
       * @param {String} opts.name Find template by name
       * @param {String} opts.content Find template by content
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SearchTemplatesPaginatedResponse}
       */
      this.searchTemplates = function(opts) {
        return this.searchTemplatesWithHttpInfo(opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Send message
       * The main entrypoint to send messages. See examples above for the reference.
       * @param {module:model/SendMessageInputObject} sendMessageInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SendMessageResponse} and HTTP response
       */
      this.sendMessageWithHttpInfo = function(sendMessageInputObject) {
        var postBody = sendMessageInputObject;
  
        // verify the required parameter 'sendMessageInputObject' is set
        if (sendMessageInputObject === undefined || sendMessageInputObject === null) {
          throw new Error("Missing the required parameter 'sendMessageInputObject' when calling sendMessage");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = SendMessageResponse;
  
        return this.apiClient.callApi(
          '/api/v2/messages', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Send message
       * The main entrypoint to send messages. See examples above for the reference.
       * @param {module:model/SendMessageInputObject} sendMessageInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SendMessageResponse}
       */
      this.sendMessage = function(sendMessageInputObject) {
        return this.sendMessageWithHttpInfo(sendMessageInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Step 1: Send a verification code 
       * Sends verification code to specified phone number.
       * @param {module:model/SendPhoneVerificationCodeInputObject} sendPhoneVerificationCodeInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SendPhoneVerificationCodeResponse} and HTTP response
       */
      this.sendPhoneVerificationCodeTFAWithHttpInfo = function(sendPhoneVerificationCodeInputObject) {
        var postBody = sendPhoneVerificationCodeInputObject;
  
        // verify the required parameter 'sendPhoneVerificationCodeInputObject' is set
        if (sendPhoneVerificationCodeInputObject === undefined || sendPhoneVerificationCodeInputObject === null) {
          throw new Error("Missing the required parameter 'sendPhoneVerificationCodeInputObject' when calling sendPhoneVerificationCodeTFA");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = SendPhoneVerificationCodeResponse;
  
        return this.apiClient.callApi(
          '/api/v2/verify', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Step 1: Send a verification code 
       * Sends verification code to specified phone number.
       * @param {module:model/SendPhoneVerificationCodeInputObject} sendPhoneVerificationCodeInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SendPhoneVerificationCodeResponse}
       */
      this.sendPhoneVerificationCodeTFA = function(sendPhoneVerificationCodeInputObject) {
        return this.sendPhoneVerificationCodeTFAWithHttpInfo(sendPhoneVerificationCodeInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Change chat status
       * Set status of the chat given by ID.
       * @param {module:model/SetChatStatusInputObject} setChatStatusInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.setChatStatusWithHttpInfo = function(setChatStatusInputObject) {
        var postBody = setChatStatusInputObject;
  
        // verify the required parameter 'setChatStatusInputObject' is set
        if (setChatStatusInputObject === undefined || setChatStatusInputObject === null) {
          throw new Error("Missing the required parameter 'setChatStatusInputObject' when calling setChatStatus");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/chats/status', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Change chat status
       * Set status of the chat given by ID.
       * @param {module:model/SetChatStatusInputObject} setChatStatusInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.setChatStatus = function(setChatStatusInputObject) {
        return this.setChatStatusWithHttpInfo(setChatStatusInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Unblock contact by phone number.
       * 
       * @param {module:model/UnblockContactInputObject} unblockContactInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.unblockContactWithHttpInfo = function(unblockContactInputObject) {
        var postBody = unblockContactInputObject;
  
        // verify the required parameter 'unblockContactInputObject' is set
        if (unblockContactInputObject === undefined || unblockContactInputObject === null) {
          throw new Error("Missing the required parameter 'unblockContactInputObject' when calling unblockContact");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/unblock', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Unblock contact by phone number.
       * 
       * @param {module:model/UnblockContactInputObject} unblockContactInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.unblockContact = function(unblockContactInputObject) {
        return this.unblockContactWithHttpInfo(unblockContactInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Unblock contacts (bulk)
       * Unblock several contacts by blocked contact ids or unblock all contacts
       * @param {module:model/UnblockContactsBulkInputObject} unblockContactsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.unblockContactsBulkWithHttpInfo = function(unblockContactsBulkInputObject) {
        var postBody = unblockContactsBulkInputObject;
  
        // verify the required parameter 'unblockContactsBulkInputObject' is set
        if (unblockContactsBulkInputObject === undefined || unblockContactsBulkInputObject === null) {
          throw new Error("Missing the required parameter 'unblockContactsBulkInputObject' when calling unblockContactsBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/unblock/bulk', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Unblock contacts (bulk)
       * Unblock several contacts by blocked contact ids or unblock all contacts
       * @param {module:model/UnblockContactsBulkInputObject} unblockContactsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.unblockContactsBulk = function(unblockContactsBulkInputObject) {
        return this.unblockContactsBulkWithHttpInfo(unblockContactsBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Unmute chats (bulk)
       * Unmute several chats by chat ids or unmute all chats
       * @param {module:model/UnmuteChatsBulkInputObject} unmuteChatsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.unmuteChatsBulkWithHttpInfo = function(unmuteChatsBulkInputObject) {
        var postBody = unmuteChatsBulkInputObject;
  
        // verify the required parameter 'unmuteChatsBulkInputObject' is set
        if (unmuteChatsBulkInputObject === undefined || unmuteChatsBulkInputObject === null) {
          throw new Error("Missing the required parameter 'unmuteChatsBulkInputObject' when calling unmuteChatsBulk");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/chats/unmute/bulk', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Unmute chats (bulk)
       * Unmute several chats by chat ids or unmute all chats
       * @param {module:model/UnmuteChatsBulkInputObject} unmuteChatsBulkInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.unmuteChatsBulk = function(unmuteChatsBulkInputObject) {
        return this.unmuteChatsBulkWithHttpInfo(unmuteChatsBulkInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Manually unsubscribe a contact
       * &gt; Please note, if you unsubscribe a contact, this action cannot be reversed. 
       * @param {module:model/UnsubscribeContactInputObject} unsubscribeContactInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.unsubscribeContactWithHttpInfo = function(unsubscribeContactInputObject) {
        var postBody = unsubscribeContactInputObject;
  
        // verify the required parameter 'unsubscribeContactInputObject' is set
        if (unsubscribeContactInputObject === undefined || unsubscribeContactInputObject === null) {
          throw new Error("Missing the required parameter 'unsubscribeContactInputObject' when calling unsubscribeContact");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/unsubscribers', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Manually unsubscribe a contact
       * &gt; Please note, if you unsubscribe a contact, this action cannot be reversed. 
       * @param {module:model/UnsubscribeContactInputObject} unsubscribeContactInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.unsubscribeContact = function(unsubscribeContactInputObject) {
        return this.unsubscribeContactWithHttpInfo(unsubscribeContactInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Update balance notification settings
       * 
       * @param {module:model/UpdateBalanceNotificationSettingsInputObject} updateBalanceNotificationSettingsInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.updateBalanceNotificationSettingsWithHttpInfo = function(updateBalanceNotificationSettingsInputObject) {
        var postBody = updateBalanceNotificationSettingsInputObject;
  
        // verify the required parameter 'updateBalanceNotificationSettingsInputObject' is set
        if (updateBalanceNotificationSettingsInputObject === undefined || updateBalanceNotificationSettingsInputObject === null) {
          throw new Error("Missing the required parameter 'updateBalanceNotificationSettingsInputObject' when calling updateBalanceNotificationSettings");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/user/notification/balance', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Update balance notification settings
       * 
       * @param {module:model/UpdateBalanceNotificationSettingsInputObject} updateBalanceNotificationSettingsInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.updateBalanceNotificationSettings = function(updateBalanceNotificationSettingsInputObject) {
        return this.updateBalanceNotificationSettingsWithHttpInfo(updateBalanceNotificationSettingsInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Update callback URL settings
       * 
       * @param {module:model/UpdateCallbackSettingsInputObject} updateCallbackSettingsInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.updateCallbackSettingsWithHttpInfo = function(updateCallbackSettingsInputObject) {
        var postBody = updateCallbackSettingsInputObject;
  
        // verify the required parameter 'updateCallbackSettingsInputObject' is set
        if (updateCallbackSettingsInputObject === undefined || updateCallbackSettingsInputObject === null) {
          throw new Error("Missing the required parameter 'updateCallbackSettingsInputObject' when calling updateCallbackSettings");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/callback/settings', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Update callback URL settings
       * 
       * @param {module:model/UpdateCallbackSettingsInputObject} updateCallbackSettingsInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.updateCallbackSettings = function(updateCallbackSettingsInputObject) {
        return this.updateCallbackSettingsWithHttpInfo(updateCallbackSettingsInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Update chat desktop notification settings
       * 
       * @param {module:model/UpdateChatDesktopNotificationSettingsInputObject} updateChatDesktopNotificationSettingsInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.updateChatDesktopNotificationSettingsWithHttpInfo = function(updateChatDesktopNotificationSettingsInputObject) {
        var postBody = updateChatDesktopNotificationSettingsInputObject;
  
        // verify the required parameter 'updateChatDesktopNotificationSettingsInputObject' is set
        if (updateChatDesktopNotificationSettingsInputObject === undefined || updateChatDesktopNotificationSettingsInputObject === null) {
          throw new Error("Missing the required parameter 'updateChatDesktopNotificationSettingsInputObject' when calling updateChatDesktopNotificationSettings");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/user/desktop/notification', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Update chat desktop notification settings
       * 
       * @param {module:model/UpdateChatDesktopNotificationSettingsInputObject} updateChatDesktopNotificationSettingsInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.updateChatDesktopNotificationSettings = function(updateChatDesktopNotificationSettingsInputObject) {
        return this.updateChatDesktopNotificationSettingsWithHttpInfo(updateChatDesktopNotificationSettingsInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Edit a contact
       * 
       * @param {module:model/UpdateContactInputObject} updateContactInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.updateContactWithHttpInfo = function(updateContactInputObject, id) {
        var postBody = updateContactInputObject;
  
        // verify the required parameter 'updateContactInputObject' is set
        if (updateContactInputObject === undefined || updateContactInputObject === null) {
          throw new Error("Missing the required parameter 'updateContactInputObject' when calling updateContact");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling updateContact");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/{id}/normalized', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Edit a contact
       * 
       * @param {module:model/UpdateContactInputObject} updateContactInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.updateContact = function(updateContactInputObject, id) {
        return this.updateContactWithHttpInfo(updateContactInputObject, id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Update a contact note
       * 
       * @param {module:model/UpdateContactNoteInputObject} updateContactNoteInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.updateContactNoteWithHttpInfo = function(updateContactNoteInputObject, id) {
        var postBody = updateContactNoteInputObject;
  
        // verify the required parameter 'updateContactNoteInputObject' is set
        if (updateContactNoteInputObject === undefined || updateContactNoteInputObject === null) {
          throw new Error("Missing the required parameter 'updateContactNoteInputObject' when calling updateContactNote");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling updateContactNote");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/notes/{id}', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Update a contact note
       * 
       * @param {module:model/UpdateContactNoteInputObject} updateContactNoteInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.updateContactNote = function(updateContactNoteInputObject, id) {
        return this.updateContactNoteWithHttpInfo(updateContactNoteInputObject, id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Edit current account info
       * 
       * @param {module:model/UpdateCurrentUserInputObject} updateCurrentUserInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UpdateCurrentUserResponse} and HTTP response
       */
      this.updateCurrentUserWithHttpInfo = function(updateCurrentUserInputObject) {
        var postBody = updateCurrentUserInputObject;
  
        // verify the required parameter 'updateCurrentUserInputObject' is set
        if (updateCurrentUserInputObject === undefined || updateCurrentUserInputObject === null) {
          throw new Error("Missing the required parameter 'updateCurrentUserInputObject' when calling updateCurrentUser");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = UpdateCurrentUserResponse;
  
        return this.apiClient.callApi(
          '/api/v2/user', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Edit current account info
       * 
       * @param {module:model/UpdateCurrentUserInputObject} updateCurrentUserInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UpdateCurrentUserResponse}
       */
      this.updateCurrentUser = function(updateCurrentUserInputObject) {
        return this.updateCurrentUserWithHttpInfo(updateCurrentUserInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Edit a custom field
       * 
       * @param {module:model/UpdateCustomFieldInputObject} updateCustomFieldInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.updateCustomFieldWithHttpInfo = function(updateCustomFieldInputObject, id) {
        var postBody = updateCustomFieldInputObject;
  
        // verify the required parameter 'updateCustomFieldInputObject' is set
        if (updateCustomFieldInputObject === undefined || updateCustomFieldInputObject === null) {
          throw new Error("Missing the required parameter 'updateCustomFieldInputObject' when calling updateCustomField");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling updateCustomField");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/customfields/{id}', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Edit a custom field
       * 
       * @param {module:model/UpdateCustomFieldInputObject} updateCustomFieldInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.updateCustomField = function(updateCustomFieldInputObject, id) {
        return this.updateCustomFieldWithHttpInfo(updateCustomFieldInputObject, id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Edit the custom field value of a specified contact
       * 
       * @param {module:model/UpdateCustomFieldValueInputObject} updateCustomFieldValueInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.updateCustomFieldValueWithHttpInfo = function(updateCustomFieldValueInputObject, id) {
        var postBody = updateCustomFieldValueInputObject;
  
        // verify the required parameter 'updateCustomFieldValueInputObject' is set
        if (updateCustomFieldValueInputObject === undefined || updateCustomFieldValueInputObject === null) {
          throw new Error("Missing the required parameter 'updateCustomFieldValueInputObject' when calling updateCustomFieldValue");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling updateCustomFieldValue");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/customfields/{id}/update', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Edit the custom field value of a specified contact
       * 
       * @param {module:model/UpdateCustomFieldValueInputObject} updateCustomFieldValueInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.updateCustomFieldValue = function(updateCustomFieldValueInputObject, id) {
        return this.updateCustomFieldValueWithHttpInfo(updateCustomFieldValueInputObject, id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Update inbound messages notification settings
       * 
       * @param {module:model/UpdateInboundMessagesNotificationSettingsInputObject} updateInboundMessagesNotificationSettingsInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.updateInboundMessagesNotificationSettingsWithHttpInfo = function(updateInboundMessagesNotificationSettingsInputObject) {
        var postBody = updateInboundMessagesNotificationSettingsInputObject;
  
        // verify the required parameter 'updateInboundMessagesNotificationSettingsInputObject' is set
        if (updateInboundMessagesNotificationSettingsInputObject === undefined || updateInboundMessagesNotificationSettingsInputObject === null) {
          throw new Error("Missing the required parameter 'updateInboundMessagesNotificationSettingsInputObject' when calling updateInboundMessagesNotificationSettings");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/user/notification/inbound', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Update inbound messages notification settings
       * 
       * @param {module:model/UpdateInboundMessagesNotificationSettingsInputObject} updateInboundMessagesNotificationSettingsInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.updateInboundMessagesNotificationSettings = function(updateInboundMessagesNotificationSettingsInputObject) {
        return this.updateInboundMessagesNotificationSettingsWithHttpInfo(updateInboundMessagesNotificationSettingsInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Edit a list
       * 
       * @param {Number} id 
       * @param {Object} opts Optional parameters
       * @param {module:model/UpdateListObject} opts.updateListObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.updateListWithHttpInfo = function(id, opts) {
        opts = opts || {};
        var postBody = opts['updateListObject'];
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling updateList");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/lists/{id}', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Edit a list
       * 
       * @param {Number} id 
       * @param {Object} opts Optional parameters
       * @param {module:model/UpdateListObject} opts.updateListObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.updateList = function(id, opts) {
        return this.updateListWithHttpInfo(id, opts)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Change sender settings
       * 
       * @param {module:model/UpdateSenderSettingInputObject} updateSenderSettingInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.updateSenderSettingWithHttpInfo = function(updateSenderSettingInputObject) {
        var postBody = updateSenderSettingInputObject;
  
        // verify the required parameter 'updateSenderSettingInputObject' is set
        if (updateSenderSettingInputObject === undefined || updateSenderSettingInputObject === null) {
          throw new Error("Missing the required parameter 'updateSenderSettingInputObject' when calling updateSenderSetting");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = [];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/sender/settings', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Change sender settings
       * 
       * @param {module:model/UpdateSenderSettingInputObject} updateSenderSettingInputObject 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.updateSenderSetting = function(updateSenderSettingInputObject) {
        return this.updateSenderSettingWithHttpInfo(updateSenderSettingInputObject)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Update a template
       * 
       * @param {module:model/UpdateTemplateInputObject} updateTemplateInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.updateTemplateWithHttpInfo = function(updateTemplateInputObject, id) {
        var postBody = updateTemplateInputObject;
  
        // verify the required parameter 'updateTemplateInputObject' is set
        if (updateTemplateInputObject === undefined || updateTemplateInputObject === null) {
          throw new Error("Missing the required parameter 'updateTemplateInputObject' when calling updateTemplate");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling updateTemplate");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['application/json'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/templates/{id}', 'PUT',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Update a template
       * 
       * @param {module:model/UpdateTemplateInputObject} updateTemplateInputObject 
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.updateTemplate = function(updateTemplateInputObject, id) {
        return this.updateTemplateWithHttpInfo(updateTemplateInputObject, id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Upload an avatar
       * 
       * @param {File} image User avatar. Should be PNG or JPG file not more than 10 MB
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
       */
      this.uploadAvatarWithHttpInfo = function(image) {
        var postBody = null;
  
        // verify the required parameter 'image' is set
        if (image === undefined || image === null) {
          throw new Error("Missing the required parameter 'image' when calling uploadAvatar");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
          'image': image
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['multipart/form-data'];
        var accepts = ['application/json'];
        var returnType = null;
  
        return this.apiClient.callApi(
          '/api/v2/user/avatar', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Upload an avatar
       * 
       * @param {File} image User avatar. Should be PNG or JPG file not more than 10 MB
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}
       */
      this.uploadAvatar = function(image) {
        return this.uploadAvatarWithHttpInfo(image)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Upload an avatar
       * 
       * @param {File} image Contact avatar. Should be PNG or JPG file not more than 10 MB
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.uploadContactAvatarWithHttpInfo = function(image, id) {
        var postBody = null;
  
        // verify the required parameter 'image' is set
        if (image === undefined || image === null) {
          throw new Error("Missing the required parameter 'image' when calling uploadContactAvatar");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling uploadContactAvatar");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
          'image': image
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['multipart/form-data'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/contacts/{id}/avatar', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Upload an avatar
       * 
       * @param {File} image Contact avatar. Should be PNG or JPG file not more than 10 MB
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.uploadContactAvatar = function(image, id) {
        return this.uploadContactAvatarWithHttpInfo(image, id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Add an avatar for the list
       * 
       * @param {File} image List avatar. Should be PNG or JPG file not more than 10 MB
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ResourceLinkResponse} and HTTP response
       */
      this.uploadListAvatarWithHttpInfo = function(image, id) {
        var postBody = null;
  
        // verify the required parameter 'image' is set
        if (image === undefined || image === null) {
          throw new Error("Missing the required parameter 'image' when calling uploadListAvatar");
        }
  
        // verify the required parameter 'id' is set
        if (id === undefined || id === null) {
          throw new Error("Missing the required parameter 'id' when calling uploadListAvatar");
        }
  
  
        var pathParams = {
          'id': id
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
          'image': image
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['multipart/form-data'];
        var accepts = ['application/json'];
        var returnType = ResourceLinkResponse;
  
        return this.apiClient.callApi(
          '/api/v2/lists/{id}/avatar', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Add an avatar for the list
       * 
       * @param {File} image List avatar. Should be PNG or JPG file not more than 10 MB
       * @param {Number} id 
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ResourceLinkResponse}
       */
      this.uploadListAvatar = function(image, id) {
        return this.uploadListAvatarWithHttpInfo(image, id)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
  
  
      /**
       * Upload message attachment
       * Upload a new file to insert it as a link.
       * @param {File} file Attachment. Supports .jpg, .gif, .png, .pdf, .txt, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx &amp; .vcf file formats
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UploadMessageAttachmentResponse} and HTTP response
       */
      this.uploadMessageAttachmentWithHttpInfo = function(file) {
        var postBody = null;
  
        // verify the required parameter 'file' is set
        if (file === undefined || file === null) {
          throw new Error("Missing the required parameter 'file' when calling uploadMessageAttachment");
        }
  
  
        var pathParams = {
        };
        var queryParams = {
        };
        var collectionQueryParams = {
        };
        var headerParams = {
        };
        var formParams = {
          'file': file
        };
  
        var authNames = ['BasicAuth'];
        var contentTypes = ['multipart/form-data'];
        var accepts = ['application/json'];
        var returnType = UploadMessageAttachmentResponse;
  
        return this.apiClient.callApi(
          '/api/v2/messages/attachment', 'POST',
          pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType
        );
      }
  
      /**
       * Upload message attachment
       * Upload a new file to insert it as a link.
       * @param {File} file Attachment. Supports .jpg, .gif, .png, .pdf, .txt, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx &amp; .vcf file formats
       * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UploadMessageAttachmentResponse}
       */
      this.uploadMessageAttachment = function(file) {
        return this.uploadMessageAttachmentWithHttpInfo(file)
          .then(function(response_and_data) {
            return response_and_data.data;
          });
      }
    };
  
    return exports;
  }));
  