# -*- coding: utf-8 -*-

###############################################################################
#
# AddOrUpdateInventoryItem
# Add or update an individual inventory listing.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo 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.
#
#
###############################################################################

from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution

import json

class AddOrUpdateInventoryItem(Choreography):

    def __init__(self, temboo_session):
        """
        Create a new instance of the AddOrUpdateInventoryItem Choreo. A TembooSession object, containing a valid
        set of Temboo credentials, must be supplied.
        """
        super(AddOrUpdateInventoryItem, self).__init__(temboo_session, '/Library/Amazon/Marketplace/Feeds/AddOrUpdateInventoryItem')


    def new_input_set(self):
        return AddOrUpdateInventoryItemInputSet()

    def _make_result_set(self, result, path):
        return AddOrUpdateInventoryItemResultSet(result, path)

    def _make_execution(self, session, exec_id, path):
        return AddOrUpdateInventoryItemChoreographyExecution(session, exec_id, path)

class AddOrUpdateInventoryItemInputSet(InputSet):
    """
    An InputSet with methods appropriate for specifying the inputs to the AddOrUpdateInventoryItem
    Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
    """
    def set_AWSAccessKeyId(self, value):
        """
        Set the value of the AWSAccessKeyId input for this Choreo. ((required, string) The Access Key ID provided by Amazon Web Services.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('AWSAccessKeyId', value)
    def set_AWSMarketplaceId(self, value):
        """
        Set the value of the AWSMarketplaceId input for this Choreo. ((required, string) The Marketplace ID provided by Amazon Web Services.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('AWSMarketplaceId', value)
    def set_AWSMerchantId(self, value):
        """
        Set the value of the AWSMerchantId input for this Choreo. ((required, string) The Merchant ID provided by Amazon Web Services.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('AWSMerchantId', value)
    def set_AWSSecretKeyId(self, value):
        """
        Set the value of the AWSSecretKeyId input for this Choreo. ((required, string) The Secret Key ID provided by Amazon Web Services.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('AWSSecretKeyId', value)
    def set_Endpoint(self, value):
        """
        Set the value of the Endpoint input for this Choreo. ((conditional, string) The base URL for the MWS endpoint. Defaults to mws.amazonservices.co.uk.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('Endpoint', value)
    def set_ExpeditedShipping(self, value):
        """
        Set the value of the ExpeditedShipping input for this Choreo. ((optional, string) The expedited shipping options that you offer for this item. Valid values: 3 = UK Only; N = None, no express delivery offered.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('ExpeditedShipping', value)
    def set_FulfillmentCenterId(self, value):
        """
        Set the value of the FulfillmentCenterId input for this Choreo. ((conditional, string) For those merchants using Amazon fulfillment services, this designates which fulfillment network will be used. Required when using Amazon fulfillment services. Valid values are: AMAZON_EU, DEFAULT.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('FulfillmentCenterId', value)
    def set_ItemCondition(self, value):
        """
        Set the value of the ItemCondition input for this Choreo. ((conditional, integer) A numerical entry that indicates the condition of the item. Required for new listings. Valid values are: 1-11. See documentation for description of item condition numeric values.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('ItemCondition', value)
    def set_ItemNote(self, value):
        """
        Set the value of the ItemNote input for this Choreo. ((optional, string) A description or note for the item you're adding or updating.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('ItemNote', value)
    def set_MWSAuthToken(self, value):
        """
        Set the value of the MWSAuthToken input for this Choreo. ((optional, string) The Amazon MWS authorization token for the given seller and developer.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('MWSAuthToken', value)
    def set_Price(self, value):
        """
        Set the value of the Price input for this Choreo. ((conditional, decimal) The price at which the merchant offers the product for sale. Required if ProductId is provided.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('Price', value)
    def set_ProductId(self, value):
        """
        Set the value of the ProductId input for this Choreo. ((conditional, string) A standard, alphanumeric string that uniquely identifies the product. This could be a UPC, EAN or ISBN.  This is a required field if product-id-type is provided.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('ProductId', value)
    def set_ProductIdType(self, value):
        """
        Set the value of the ProductIdType input for this Choreo. ((conditional, integer) The type of standard, unique identifier entered in the product-id field. This is a required field if product-id is provided. Valid values are: 1 (ASIN), 2 (ISBN), 3 (UPC), 4  (EAN).)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('ProductIdType', value)
    def set_Quantity(self, value):
        """
        Set the value of the Quantity input for this Choreo. ((conditional, integer) Enter the quantity of the item you are making available for sale. Required for merchant-fulfilled items. Leave blank for amazon-fullfilled items.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('Quantity', value)
    def set_SKU(self, value):
        """
        Set the value of the SKU input for this Choreo. ((required, string) A unique identifier for the product, assigned by the merchant. The SKU must be unique for each product listed.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('SKU', value)
    def set_TimeToWait(self, value):
        """
        Set the value of the TimeToWait input for this Choreo. ((optional, integer) By default, the Choreo will wait for 10 minutes to see if the report is ready for retrieval. Max is 120 minutes.)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('TimeToWait', value)
    def set_WillShipInternationally(self, value):
        """
        Set the value of the WillShipInternationally input for this Choreo. ((optional, integer) Specify your international shipping options. Valid values are: 3 = UK Only; 4 = UK and Europe; 5 = UK, Europe, and North America; 6 = Worldwide)
        """
        super(AddOrUpdateInventoryItemInputSet, self)._set_input('WillShipInternationally', value)

class AddOrUpdateInventoryItemResultSet(ResultSet):
    """
    A ResultSet with methods tailored to the values returned by the AddOrUpdateInventoryItem Choreo.
    The ResultSet object is used to retrieve the results of a Choreo execution.
    """

    def getJSONFromString(self, str):
        return json.loads(str)

    def get_ProcessingStatus(self):
        """
        Retrieve the value for the "ProcessingStatus" output from this Choreo execution. ((string) The processing status of the product submission which is parsed from the Amazon response.)
        """
        return self._output.get('ProcessingStatus', None)
    def get_SubmissionId(self):
        """
        Retrieve the value for the "SubmissionId" output from this Choreo execution. ((integer) The submission id parsed from the Amazon response.)
        """
        return self._output.get('SubmissionId', None)
    def get_SubmissionResult(self):
        """
        Retrieve the value for the "SubmissionResult" output from this Choreo execution. ((string) The submission result returned from Amazon.)
        """
        return self._output.get('SubmissionResult', None)
    def get_Response(self):
        """
        Retrieve the value for the "Response" output from this Choreo execution. ((xml) The response from Amazon after submitting the feed.)
        """
        return self._output.get('Response', None)

class AddOrUpdateInventoryItemChoreographyExecution(ChoreographyExecution):

    def _make_result_set(self, response, path):
        return AddOrUpdateInventoryItemResultSet(response, path)
