/**
 * @fileoverview AUTOMATICALLY GENERATED service for API.Client.StoreApi.
 * Do not edit this file by hand or your changes will be lost next time it is
 * generated.
 *
 * This is a sample server Petstore server.  You can find out more about Swagger at &lt;a href=\&quot;http://swagger.io\&quot;&gt;http://swagger.io&lt;/a&gt; or on irc.freenode.net, #swagger.  For this sample, you can use the api key \&quot;special-key\&quot; to test the authorization filters
 * Version: 1.0.0
 * Generated at: 2016-02-02T00:45:38.616-07:00
 * Generated by: class io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen
 */
/**
 * @license Apache 2.0
 * http://www.apache.org/licenses/LICENSE-2.0.html
 */

goog.provide('API.Client.StoreApi');

goog.require('API.Client.Order');

/**
 * @constructor
 * @param {!angular.$http} $http
 * @param {!Object} $httpParamSerializer
 * @param {!angular.$injector} $injector
 * @struct
 */
API.Client.StoreApi = function($http, $httpParamSerializer, $injector) {
  /** @private {!string} */
  this.basePath_ = $injector.has('StoreApiBasePath') ?
                   /** @type {!string} */ ($injector.get('StoreApiBasePath')) :
                   'http://petstore.swagger.io/v2';

  /** @private {!Object<string, string>} */
  this.defaultHeaders_ = $injector.has('StoreApiDefaultHeaders') ?
                   /** @type {!Object<string, string>} */ (
                       $injector.get('StoreApiDefaultHeaders')) :
                   {};

  /** @private {!angular.$http} */
  this.http_ = $http;

  /** @private {!Object} */
  this.httpParamSerializer_ = $injector.get('$httpParamSerializer');
}
API.Client.StoreApi.$inject = ['$http', '$httpParamSerializer', '$injector'];

/**
 * Returns pet inventories by status
 * Returns a map of status codes to quantities
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!Object<!string, number>>}
 */
API.Client.StoreApi.prototype.getInventory = function(opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/store/inventory';

  /** @type {!Object} */
  var queryParameters = {};

  /** @type {!Object} */
  var headerParams = angular.extend({}, this.defaultHeaders);
  /** @type {!Object} */
  var httpRequestParams = {
    method: 'GET',
    url: path,
    json: true,
    
    
    params: queryParameters,
    headers: headerParams
  };

  if (opt_extraHttpRequestParams) {
    httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
  }

  return this.http_(httpRequestParams);
}

/**
 * Place an order for a pet
 * 
 * @param {!Order=} opt_body order placed for purchasing the pet
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!API.Client.Order>}
 */
API.Client.StoreApi.prototype.placeOrder = function(opt_body, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/store/order';

  /** @type {!Object} */
  var queryParameters = {};

  /** @type {!Object} */
  var headerParams = angular.extend({}, this.defaultHeaders);
  /** @type {!Object} */
  var httpRequestParams = {
    method: 'POST',
    url: path,
    json: true,
    data: opt_body,
    
    
    params: queryParameters,
    headers: headerParams
  };

  if (opt_extraHttpRequestParams) {
    httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
  }

  return this.http_(httpRequestParams);
}

/**
 * Find purchase order by ID
 * For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
 * @param {!string} orderId ID of pet that needs to be fetched
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise<!API.Client.Order>}
 */
API.Client.StoreApi.prototype.getOrderById = function(orderId, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/store/order/{orderId}'
      .replace('{' + 'orderId' + '}', String(orderId));

  /** @type {!Object} */
  var queryParameters = {};

  /** @type {!Object} */
  var headerParams = angular.extend({}, this.defaultHeaders);
  // verify required parameter 'orderId' is set
  if (!orderId) {
    throw new Error('Missing required parameter orderId when calling getOrderById');
  }
  /** @type {!Object} */
  var httpRequestParams = {
    method: 'GET',
    url: path,
    json: true,
    
    
    params: queryParameters,
    headers: headerParams
  };

  if (opt_extraHttpRequestParams) {
    httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
  }

  return this.http_(httpRequestParams);
}

/**
 * Delete purchase order by ID
 * For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
 * @param {!string} orderId ID of the order that needs to be deleted
 * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send.
 * @return {!angular.$q.Promise}
 */
API.Client.StoreApi.prototype.deleteOrder = function(orderId, opt_extraHttpRequestParams) {
  /** @const {string} */
  var path = this.basePath_ + '/store/order/{orderId}'
      .replace('{' + 'orderId' + '}', String(orderId));

  /** @type {!Object} */
  var queryParameters = {};

  /** @type {!Object} */
  var headerParams = angular.extend({}, this.defaultHeaders);
  // verify required parameter 'orderId' is set
  if (!orderId) {
    throw new Error('Missing required parameter orderId when calling deleteOrder');
  }
  /** @type {!Object} */
  var httpRequestParams = {
    method: 'DELETE',
    url: path,
    json: true,
    
    
    params: queryParameters,
    headers: headerParams
  };

  if (opt_extraHttpRequestParams) {
    httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams);
  }

  return this.http_(httpRequestParams);
}
