text: /**
   * Mail Baby API
   * This is an API defintion for accesssing the Mail.Baby mail service.
   *
   * The version of the OpenAPI document: 1.0.0
   * Contact: detain@interserver.net
   *
   * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
   * https://openapi-generator.tech
   * Do not edit the class manually.
   *
   */
  
  
  import ApiClient from "../ApiClient";
  import GenericResponse from '../model/GenericResponse';
  import InlineResponse401 from '../model/InlineResponse401';
  import MailLog from '../model/MailLog';
  import MailOrder from '../model/MailOrder';
  import SendMailAdv from '../model/SendMailAdv';
  
  /**
  * Default service.
  * @module api/DefaultApi
  * @version 1.0.0
  */
  export default class DefaultApi {
  
      /**
      * Constructs a new DefaultApi. 
      * @alias module:api/DefaultApi
      * @class
      * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
      * default to {@link module:ApiClient#instance} if unspecified.
      */
      constructor(apiClient) {
          this.apiClient = apiClient || ApiClient.instance;
      }
  
  
      /**
       * Callback function to receive the result of the getMailOrders operation.
       * @callback module:api/DefaultApi~getMailOrdersCallback
       * @param {String} error Error message, if any.
       * @param {Array.<module:model/MailOrder>} data The data returned by the service call.
       * @param {String} response The complete HTTP response.
       */
  
      /**
       * displays a list of mail service orders
       * @param {module:api/DefaultApi~getMailOrdersCallback} callback The callback function, accepting three arguments: error, data, response
       * data is of type: {@link Array.<module:model/MailOrder>}
       */
      getMailOrders(callback) {
        let postBody = null;
  
        let pathParams = {
        };
        let queryParams = {
        };
        let headerParams = {
        };
        let formParams = {
        };
  
        let authNames = ['apiKeyAuth'];
        let contentTypes = [];
        let accepts = ['application/json', 'application/xml', 'text/plain'];
        let returnType = [MailOrder];
        return this.apiClient.callApi(
          '/mail', 'GET',
          pathParams, queryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType, null, callback
        );
      }
  
      /**
       * Callback function to receive the result of the pingServer operation.
       * @callback module:api/DefaultApi~pingServerCallback
       * @param {String} error Error message, if any.
       * @param data This operation does not return a value.
       * @param {String} response The complete HTTP response.
       */
  
      /**
       * Checks if the server is running
       * @param {module:api/DefaultApi~pingServerCallback} callback The callback function, accepting three arguments: error, data, response
       */
      pingServer(callback) {
        let postBody = null;
  
        let pathParams = {
        };
        let queryParams = {
        };
        let headerParams = {
        };
        let formParams = {
        };
  
        let authNames = [];
        let contentTypes = [];
        let accepts = [];
        let returnType = null;
        return this.apiClient.callApi(
          '/ping', 'GET',
          pathParams, queryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType, null, callback
        );
      }
  
      /**
       * Callback function to receive the result of the placeMailOrder operation.
       * @callback module:api/DefaultApi~placeMailOrderCallback
       * @param {String} error Error message, if any.
       * @param data This operation does not return a value.
       * @param {String} response The complete HTTP response.
       */
  
      /**
       * places a mail order
       * Adds an item to the system
       * @param {Object} opts Optional parameters
       * @param {module:model/MailOrder} opts.mailOrder Inventory item to add
       * @param {module:api/DefaultApi~placeMailOrderCallback} callback The callback function, accepting three arguments: error, data, response
       */
      placeMailOrder(opts, callback) {
        opts = opts || {};
        let postBody = opts['mailOrder'];
  
        let pathParams = {
        };
        let queryParams = {
        };
        let headerParams = {
        };
        let formParams = {
        };
  
        let authNames = ['apiKeyAuth'];
        let contentTypes = ['application/json'];
        let accepts = ['application/json'];
        let returnType = null;
        return this.apiClient.callApi(
          '/mail/order', 'POST',
          pathParams, queryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType, null, callback
        );
      }
  
      /**
       * Callback function to receive the result of the sendAdvMail operation.
       * @callback module:api/DefaultApi~sendAdvMailCallback
       * @param {String} error Error message, if any.
       * @param {module:model/GenericResponse} data The data returned by the service call.
       * @param {String} response The complete HTTP response.
       */
  
      /**
       * Sends an Email with Advanced Options
       * Sends An email through one of your mail orders allowing additional options such as file attachments, cc, bcc, etc.
       * @param {module:model/SendMailAdv} sendMailAdv 
       * @param {module:api/DefaultApi~sendAdvMailCallback} callback The callback function, accepting three arguments: error, data, response
       * data is of type: {@link module:model/GenericResponse}
       */
      sendAdvMail(sendMailAdv, callback) {
        let postBody = sendMailAdv;
        // verify the required parameter 'sendMailAdv' is set
        if (sendMailAdv === undefined || sendMailAdv === null) {
          throw new Error("Missing the required parameter 'sendMailAdv' when calling sendAdvMail");
        }
  
        let pathParams = {
        };
        let queryParams = {
        };
        let headerParams = {
        };
        let formParams = {
        };
  
        let authNames = ['apiKeyAuth'];
        let contentTypes = ['application/json', 'application/x-www-form-urlencoded'];
        let accepts = ['application/json'];
        let returnType = GenericResponse;
        return this.apiClient.callApi(
          '/mail/advsend', 'POST',
          pathParams, queryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType, null, callback
        );
      }
  
      /**
       * Callback function to receive the result of the sendMail operation.
       * @callback module:api/DefaultApi~sendMailCallback
       * @param {String} error Error message, if any.
       * @param {module:model/GenericResponse} data The data returned by the service call.
       * @param {String} response The complete HTTP response.
       */
  
      /**
       * Sends an Email
       * Sends An email through one of your mail orders.
       * @param {String} to The Contact whom is the primary recipient of this email.
       * @param {String} from The contact whom is the this email is from.
       * @param {String} subject The subject or title of the email
       * @param {String} body The main email contents.
       * @param {module:api/DefaultApi~sendMailCallback} callback The callback function, accepting three arguments: error, data, response
       * data is of type: {@link module:model/GenericResponse}
       */
      sendMail(to, from, subject, body, callback) {
        let postBody = null;
        // verify the required parameter 'to' is set
        if (to === undefined || to === null) {
          throw new Error("Missing the required parameter 'to' when calling sendMail");
        }
        // verify the required parameter 'from' is set
        if (from === undefined || from === null) {
          throw new Error("Missing the required parameter 'from' when calling sendMail");
        }
        // verify the required parameter 'subject' is set
        if (subject === undefined || subject === null) {
          throw new Error("Missing the required parameter 'subject' when calling sendMail");
        }
        // verify the required parameter 'body' is set
        if (body === undefined || body === null) {
          throw new Error("Missing the required parameter 'body' when calling sendMail");
        }
  
        let pathParams = {
        };
        let queryParams = {
        };
        let headerParams = {
        };
        let formParams = {
          'to': to,
          'from': from,
          'subject': subject,
          'body': body
        };
  
        let authNames = ['apiKeyAuth'];
        let contentTypes = ['application/x-www-form-urlencoded', 'application/json'];
        let accepts = ['application/json'];
        let returnType = GenericResponse;
        return this.apiClient.callApi(
          '/mail/send', 'POST',
          pathParams, queryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType, null, callback
        );
      }
  
      /**
       * Callback function to receive the result of the validateMailOrder operation.
       * @callback module:api/DefaultApi~validateMailOrderCallback
       * @param {String} error Error message, if any.
       * @param data This operation does not return a value.
       * @param {String} response The complete HTTP response.
       */
  
      /**
       * validatess order details before placing an order
       * @param {module:api/DefaultApi~validateMailOrderCallback} callback The callback function, accepting three arguments: error, data, response
       */
      validateMailOrder(callback) {
        let postBody = null;
  
        let pathParams = {
        };
        let queryParams = {
        };
        let headerParams = {
        };
        let formParams = {
        };
  
        let authNames = ['apiKeyAuth'];
        let contentTypes = [];
        let accepts = ['application/json'];
        let returnType = null;
        return this.apiClient.callApi(
          '/mail/order', 'GET',
          pathParams, queryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType, null, callback
        );
      }
  
      /**
       * Callback function to receive the result of the viewMailLog operation.
       * @callback module:api/DefaultApi~viewMailLogCallback
       * @param {String} error Error message, if any.
       * @param {Array.<module:model/MailLog>} data The data returned by the service call.
       * @param {String} response The complete HTTP response.
       */
  
      /**
       * displays the mail log
       * By passing in the appropriate options, you can search for available inventory in the system 
       * @param {Object} opts Optional parameters
       * @param {Number} opts.id The ID of your mail order this will be sent through.
       * @param {String} opts.searchString pass an optional search string for looking up inventory
       * @param {Number} opts.skip number of records to skip for pagination
       * @param {Number} opts.limit maximum number of records to return
       * @param {module:api/DefaultApi~viewMailLogCallback} callback The callback function, accepting three arguments: error, data, response
       * data is of type: {@link Array.<module:model/MailLog>}
       */
      viewMailLog(opts, callback) {
        opts = opts || {};
        let postBody = null;
  
        let pathParams = {
        };
        let queryParams = {
          'id': opts['id'],
          'searchString': opts['searchString'],
          'skip': opts['skip'],
          'limit': opts['limit']
        };
        let headerParams = {
        };
        let formParams = {
        };
  
        let authNames = ['apiKeyAuth'];
        let contentTypes = [];
        let accepts = ['application/json'];
        let returnType = [MailLog];
        return this.apiClient.callApi(
          '/mail/log', 'GET',
          pathParams, queryParams, headerParams, formParams, postBody,
          authNames, contentTypes, accepts, returnType, null, callback
        );
      }
  
  
  }
  