text: "use strict";
  
  /* global dw empty */
  var ObjectSerializer = require("../serializers/ObjectSerializer");
  // @ts-ignore
  var ClientError = require("../models/ClientError");
  // @ts-ignore
  var RestCurrency = require("../models/RestCurrency");
  // @ts-ignore
  var ServerError = require("../models/ServerError");
  var CurrencyService = /** @class */ (function () {
      function CurrencyService(httpService) {
          this.basePath = "https://app-wallee.com:443/api";
          this.defaultHeaders = {};
          this._useQuerystring = false;
          this.httpService = {};
          this.httpService = httpService;
      }
      /**
      * This operation returns all currencies.
      * @summary All
      * @param {*} [options] Override http request options.
      * @return {  Array<RestCurrency>  }
      */
      CurrencyService.prototype.all = function (options) {
          if (options === void 0) { options = {}; }
          var localVarQueryParameters = {};
          var localVarHeaderParams = {};
          var localVarFormParams = {};
          for (var optionsHeadersKey in options.headers) {
              if (options.headers.hasOwnProperty(optionsHeadersKey)) {
                  localVarHeaderParams[optionsHeadersKey] = options.headers[optionsHeadersKey];
              }
          }
          var localVarUseFormData = false;
          var localVarRequestOptions = {
              method: "GET",
              queryString: localVarQueryParameters,
              headers: localVarHeaderParams,
              useQuerystring: this._useQuerystring,
              url: this.basePath,
              path: "/currency/all",
              contentType: "application/json",
              form: {},
              formData: {}
          };
          if (Object.keys(localVarFormParams).length) {
              if (localVarUseFormData) {
                  localVarRequestOptions.formData = localVarFormParams;
              }
              else {
                  localVarRequestOptions.form = localVarFormParams;
              }
          }
          // dw.net.HTTPClient
          var response = this.httpService.callApi(localVarRequestOptions);
          if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
              var body = response.text;
              if (ObjectSerializer.primitives.indexOf("Array<RestCurrency>".toLowerCase()) !== -1) {
                  return body;
              }
              try {
                  body = JSON.parse(body);
                  body = ObjectSerializer.deserialize(body, "Array<RestCurrency>");
              }
              catch (e) {
                  dw.system.Logger.error("wallee > CurrencyService > all > unable to parse JSON > " + JSON.stringify({ message: e.message, fileName: e.fileName, lineNumber: e.lineNumber }));
              }
              return body;
          }
          else {
              var error = {
                  type: "Unknown",
                  date: (new Date()).toUTCString(),
                  statusCode: response.statusCode,
                  statusMessage: response.statusMessage,
                  errorText: response.errorText
              };
              if (response.statusCode && response.statusCode >= 400 && response.statusCode <= 499) {
                  error.type = "ClientError";
              }
              else if (response.statusCode && response.statusCode >= 500 && response.statusCode <= 599) {
                  error.type = "ServerError";
              }
              throw new Error("wallee > CurrencyService > all > " + error.type + " > " + JSON.stringify(error));
          }
      };
      return CurrencyService;
  }());
  exports.CurrencyService = CurrencyService;
  module.exports = CurrencyService;
  