#!/usr/bin/env python
"""
StoreApi.py
Copyright 2015 Reverb Technologies, Inc.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
"""
import sys
import os

from models import *


class StoreApi(object):

    def __init__(self, apiClient):
      self.apiClient = apiClient

    
    
    def getInventory(self, **kwargs):
        """Returns pet inventories by status

        Args:
            
        
        Returns: map(String, int)
        """

        allParams = []

        params = locals()
        for (key, val) in params['kwargs'].iteritems():
            if key not in allParams:
                raise TypeError("Got an unexpected keyword argument '%s' to method getInventory" % key)
            params[key] = val
        del params['kwargs']

        resourcePath = '/store/inventory'
        resourcePath = resourcePath.replace('{format}', 'json')
        method = 'GET'

        queryParams = {}
        headerParams = {}
        formParams = {}
        files = {}
        bodyParam = None

        headerParams['Accept'] = 'application/json,application/xml';
        headerParams['Content-Type'] = '';

        

        

        

        

        

        postData = (formParams if formParams else bodyParam)

        response = self.apiClient.callAPI(resourcePath, method, queryParams,
                                          postData, headerParams, files=files)

        
        if not response:
            return None

        responseObject = self.apiClient.deserialize(response, 'map(String, int)')
        return responseObject
        
        
        
    
    def placeOrder(self, **kwargs):
        """Place an order for a pet

        Args:
            
            body, Order: order placed for purchasing the pet (required)
            
            
        
        Returns: Order
        """

        allParams = ['body']

        params = locals()
        for (key, val) in params['kwargs'].iteritems():
            if key not in allParams:
                raise TypeError("Got an unexpected keyword argument '%s' to method placeOrder" % key)
            params[key] = val
        del params['kwargs']

        resourcePath = '/store/order'
        resourcePath = resourcePath.replace('{format}', 'json')
        method = 'POST'

        queryParams = {}
        headerParams = {}
        formParams = {}
        files = {}
        bodyParam = None

        headerParams['Accept'] = 'application/json,application/xml';
        headerParams['Content-Type'] = '';

        

        

        

        

        
        if ('body' in params):
            bodyParam = params['body']
        

        postData = (formParams if formParams else bodyParam)

        response = self.apiClient.callAPI(resourcePath, method, queryParams,
                                          postData, headerParams, files=files)

        
        if not response:
            return None

        responseObject = self.apiClient.deserialize(response, 'Order')
        return responseObject
        
        
        
    
    def getOrderById(self, **kwargs):
        """Find purchase order by ID

        Args:
            
            orderId, str: ID of pet that needs to be fetched (required)
            
            
        
        Returns: Order
        """

        allParams = ['orderId']

        params = locals()
        for (key, val) in params['kwargs'].iteritems():
            if key not in allParams:
                raise TypeError("Got an unexpected keyword argument '%s' to method getOrderById" % key)
            params[key] = val
        del params['kwargs']

        resourcePath = '/store/order/{orderId}'
        resourcePath = resourcePath.replace('{format}', 'json')
        method = 'GET'

        queryParams = {}
        headerParams = {}
        formParams = {}
        files = {}
        bodyParam = None

        headerParams['Accept'] = 'application/json,application/xml';
        headerParams['Content-Type'] = '';

        

        

        
        if ('orderId' in params):
            replacement = str(self.apiClient.toPathValue(params['orderId']))
            resourcePath = resourcePath.replace('{' + 'orderId' + '}',
                                                replacement)
        

        

        

        postData = (formParams if formParams else bodyParam)

        response = self.apiClient.callAPI(resourcePath, method, queryParams,
                                          postData, headerParams, files=files)

        
        if not response:
            return None

        responseObject = self.apiClient.deserialize(response, 'Order')
        return responseObject
        
        
        
    
    def deleteOrder(self, **kwargs):
        """Delete purchase order by ID

        Args:
            
            orderId, str: ID of the order that needs to be deleted (required)
            
            
        
        Returns: 
        """

        allParams = ['orderId']

        params = locals()
        for (key, val) in params['kwargs'].iteritems():
            if key not in allParams:
                raise TypeError("Got an unexpected keyword argument '%s' to method deleteOrder" % key)
            params[key] = val
        del params['kwargs']

        resourcePath = '/store/order/{orderId}'
        resourcePath = resourcePath.replace('{format}', 'json')
        method = 'DELETE'

        queryParams = {}
        headerParams = {}
        formParams = {}
        files = {}
        bodyParam = None

        headerParams['Accept'] = 'application/json,application/xml';
        headerParams['Content-Type'] = '';

        

        

        
        if ('orderId' in params):
            replacement = str(self.apiClient.toPathValue(params['orderId']))
            resourcePath = resourcePath.replace('{' + 'orderId' + '}',
                                                replacement)
        

        

        

        postData = (formParams if formParams else bodyParam)

        response = self.apiClient.callAPI(resourcePath, method, queryParams,
                                          postData, headerParams, files=files)

        
        
        
    


