amazon-mws 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/README.markdown +31 -0
- data/Rakefile +14 -0
- data/VERSION +1 -0
- data/amazon-mws.gemspec +164 -0
- data/examples/xml/cancel_feed_submissions.xml +16 -0
- data/examples/xml/cancel_report_requests.xml +18 -0
- data/examples/xml/error.xml +10 -0
- data/examples/xml/get_feed_submission_count.xml +10 -0
- data/examples/xml/get_feed_submission_list.xml +16 -0
- data/examples/xml/get_feed_submission_list_by_next_token.xml +16 -0
- data/examples/xml/get_feed_submission_result.xml +30 -0
- data/examples/xml/get_report_count.xml +9 -0
- data/examples/xml/get_report_list.xml +17 -0
- data/examples/xml/get_report_request_count.xml +8 -0
- data/examples/xml/get_report_request_list.xml +120 -0
- data/examples/xml/get_report_request_list_by_next_token.xml +20 -0
- data/examples/xml/get_report_schedule_count.xml +10 -0
- data/examples/xml/get_report_schedule_list.xml +15 -0
- data/examples/xml/get_report_schedule_list_by_next_token.xml +15 -0
- data/examples/xml/manage_report_schedule.xml +14 -0
- data/examples/xml/request_report.xml +17 -0
- data/examples/xml/submit_feed.xml +14 -0
- data/examples/xml/update_report_acknowledgements.xml +18 -0
- data/examples/xsd/Inventory.xsd +49 -0
- data/examples/xsd/Item.xsd +285 -0
- data/examples/xsd/Listings.xsd +32 -0
- data/examples/xsd/OrderAcknowledgement.xsd +55 -0
- data/examples/xsd/OrderAdjustment.xsd +94 -0
- data/examples/xsd/OrderFulfillment.xsd +57 -0
- data/examples/xsd/Override.xsd +48 -0
- data/examples/xsd/Price.xsd +59 -0
- data/examples/xsd/ProcessingReport.xsd +87 -0
- data/examples/xsd/Product.xsd +220 -0
- data/examples/xsd/Product/AutoAccessory.xsd +807 -0
- data/examples/xsd/Product/Beauty.xsd +114 -0
- data/examples/xsd/Product/CE.xsd +544 -0
- data/examples/xsd/Product/CameraPhoto.xsd +2410 -0
- data/examples/xsd/Product/FoodAndBeverages.xsd +270 -0
- data/examples/xsd/Product/Gourmet.xsd +85 -0
- data/examples/xsd/Product/Health.xsd +189 -0
- data/examples/xsd/Product/Home.xsd +654 -0
- data/examples/xsd/Product/Jewelry.xsd +603 -0
- data/examples/xsd/Product/Miscellaneous.xsd +157 -0
- data/examples/xsd/Product/MusicalInstruments.xsd +853 -0
- data/examples/xsd/Product/Office.xsd +550 -0
- data/examples/xsd/Product/PetSupplies.xsd +40 -0
- data/examples/xsd/Product/ProductClothing.xsd +197 -0
- data/examples/xsd/Product/SWVG.xsd +238 -0
- data/examples/xsd/Product/Sports.xsd +308 -0
- data/examples/xsd/Product/TiresAndWheels.xsd +159 -0
- data/examples/xsd/Product/Tools.xsd +66 -0
- data/examples/xsd/Product/ToysBaby.xsd +241 -0
- data/examples/xsd/Product/Wireless.xsd +77 -0
- data/examples/xsd/ProductImage.xsd +39 -0
- data/examples/xsd/Relationship.xsd +47 -0
- data/examples/xsd/SettlementReport.xsd +158 -0
- data/examples/xsd/amzn-base.xsd +1601 -0
- data/examples/xsd/amzn-envelope.xsd +98 -0
- data/examples/xsd/amzn-header.xsd +45 -0
- data/lib/amazon/mws.rb +86 -0
- data/lib/amazon/mws/authentication.rb +9 -0
- data/lib/amazon/mws/authentication/query_string.rb +28 -0
- data/lib/amazon/mws/authentication/signature.rb +43 -0
- data/lib/amazon/mws/base.rb +61 -0
- data/lib/amazon/mws/connection.rb +99 -0
- data/lib/amazon/mws/connection/management.rb +94 -0
- data/lib/amazon/mws/connection/request_builder.rb +67 -0
- data/lib/amazon/mws/exceptions.rb +80 -0
- data/lib/amazon/mws/feed.rb +223 -0
- data/lib/amazon/mws/feed_builder.rb +67 -0
- data/lib/amazon/mws/feed_enumerations.rb +46 -0
- data/lib/amazon/mws/feed_submission.rb +14 -0
- data/lib/amazon/mws/lib/extensions.rb +162 -0
- data/lib/amazon/mws/lib/memoizable.rb +10 -0
- data/lib/amazon/mws/orders.rb +9 -0
- data/lib/amazon/mws/report.rb +310 -0
- data/lib/amazon/mws/report_enumerations.rb +44 -0
- data/lib/amazon/mws/report_info.rb +16 -0
- data/lib/amazon/mws/report_request.rb +19 -0
- data/lib/amazon/mws/report_schedule.rb +13 -0
- data/lib/amazon/mws/response.rb +32 -0
- data/lib/amazon/mws/response/cancel_feed_submissions_response.rb +14 -0
- data/lib/amazon/mws/response/cancel_report_requests_response.rb +14 -0
- data/lib/amazon/mws/response/get_feed_submission_count_response.rb +13 -0
- data/lib/amazon/mws/response/get_feed_submission_list_by_next_token_response.rb +15 -0
- data/lib/amazon/mws/response/get_feed_submission_list_response.rb +15 -0
- data/lib/amazon/mws/response/get_feed_submission_result_response.rb +54 -0
- data/lib/amazon/mws/response/get_report_count_response.rb +13 -0
- data/lib/amazon/mws/response/get_report_list_response.rb +15 -0
- data/lib/amazon/mws/response/get_report_request_count_response.rb +13 -0
- data/lib/amazon/mws/response/get_report_request_list_by_next_token_response.rb +15 -0
- data/lib/amazon/mws/response/get_report_request_list_response.rb +15 -0
- data/lib/amazon/mws/response/get_report_schedule_count_response.rb +13 -0
- data/lib/amazon/mws/response/get_report_schedule_list_by_next_token_response.rb +15 -0
- data/lib/amazon/mws/response/get_report_schedule_list_response.rb +15 -0
- data/lib/amazon/mws/response/manage_report_schedule_response.rb +14 -0
- data/lib/amazon/mws/response/request_report_response.rb +14 -0
- data/lib/amazon/mws/response/response_error.rb +15 -0
- data/lib/amazon/mws/response/submit_feed_response.rb +13 -0
- data/lib/amazon/mws/response/update_reports_acknowledgements_response.rb +14 -0
- data/lib/amazon/mws/version.rb +12 -0
- data/pkg/amazon-mws-0.1.0.gem +0 -0
- data/test/authentication_test.rb +15 -0
- data/test/connection_test.rb +5 -0
- data/test/feed_builder_test.rb +15 -0
- data/test/feed_submission_test.rb +32 -0
- data/test/feed_test.rb +64 -0
- data/test/query_string_test.rb +21 -0
- data/test/report_test.rb +29 -0
- data/test/request_test.rb +18 -0
- data/test/response_test.rb +197 -0
- data/test/signature_test.rb +30 -0
- data/test/test_config.yml +5 -0
- data/test/test_helper.rb +22 -0
- metadata +179 -0
@@ -0,0 +1,94 @@
|
|
1
|
+
class Amazon::MWS::Connection
|
2
|
+
|
3
|
+
module Management #:nodoc:
|
4
|
+
def self.included(base)
|
5
|
+
base.cattr_accessor :connections
|
6
|
+
base.connections = {}
|
7
|
+
base.extend ClassMethods
|
8
|
+
end
|
9
|
+
|
10
|
+
# Manage the creation and destruction of connections for Amazon::MWS::Base and its subclasses. Connections are
|
11
|
+
# created with establish_connection!.
|
12
|
+
module ClassMethods
|
13
|
+
# Creates a new connection with which to make requests to the S3 servers for the calling class.
|
14
|
+
#
|
15
|
+
# Amazon::MWS::Base.establish_connection!(
|
16
|
+
# :access_key_id => '...',
|
17
|
+
# :secret_access_key => '...',
|
18
|
+
# :merchant_id => '...',
|
19
|
+
# :marketplace_id => '...'
|
20
|
+
# )
|
21
|
+
#
|
22
|
+
# == Required arguments
|
23
|
+
#
|
24
|
+
# * <tt>:access_key_id</tt> - The access key id for your S3 account. Provided by Amazon.
|
25
|
+
# * <tt>:secret_access_key</tt> - The secret access key for your S3 account. Provided by Amazon.
|
26
|
+
# * <tt>:merchant_id</tt>
|
27
|
+
# * <tt>:marketplace_id</tt>
|
28
|
+
#
|
29
|
+
# If any of these required arguments is missing, a MissingAccessKey exception will be raised.
|
30
|
+
#
|
31
|
+
# == Optional arguments
|
32
|
+
#
|
33
|
+
# * <tt>:server</tt> - The server to make requests to. You can use this to specify your bucket in the subdomain,
|
34
|
+
# or your own domain's cname if you are using virtual hosted buckets. Defaults to <tt>mws.amazonaws.com</tt>.
|
35
|
+
# will be implicitly set to 443, unless specified otherwise. Defaults to false.
|
36
|
+
# * <tt>:persistent</tt> - Whether to use a persistent connection to the server. Having this on provides around a two fold
|
37
|
+
# performance increase but for long running processes some firewalls may find the long lived connection suspicious and close the connection.
|
38
|
+
# If you run into connection errors, try setting <tt>:persistent</tt> to false. Defaults to false.
|
39
|
+
#
|
40
|
+
def establish_connection!(options = {})
|
41
|
+
# After you've already established the default connection, just specify
|
42
|
+
# the difference for subsequent connections
|
43
|
+
#options = default_connection.options.merge(options) if connected?
|
44
|
+
connections[connection_name] = Amazon::MWS::Connection.connect(options)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Returns the connection for the current class, or Base's default connection if the current class does not
|
48
|
+
# have its own connection.
|
49
|
+
#
|
50
|
+
# If not connection has been established yet, NoConnectionEstablished will be raised.
|
51
|
+
def connection
|
52
|
+
if connected?
|
53
|
+
connections[connection_name] || default_connection
|
54
|
+
else
|
55
|
+
raise Amazon::MWS::NoConnectionEstablished.new
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Returns true if a connection has been made yet.
|
60
|
+
def connected?
|
61
|
+
!connections.empty?
|
62
|
+
end
|
63
|
+
|
64
|
+
# Removes the connection for the current class. If there is no connection for the current class, the default
|
65
|
+
# connection will be removed.
|
66
|
+
def disconnect(name = connection_name)
|
67
|
+
name = default_connection unless connections.has_key?(name)
|
68
|
+
connection = connections[name]
|
69
|
+
connection.http.finish if connection.persistent?
|
70
|
+
connections.delete(name)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Clears *all* connections, from all classes, with prejudice.
|
74
|
+
def disconnect!
|
75
|
+
connections.each_key {|connection| disconnect(connection)}
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
def connection_name
|
80
|
+
name
|
81
|
+
end
|
82
|
+
|
83
|
+
def default_connection_name
|
84
|
+
'Amazon::MWS::Base'
|
85
|
+
end
|
86
|
+
|
87
|
+
def default_connection
|
88
|
+
connections[default_connection_name]
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
end
|
94
|
+
|
@@ -0,0 +1,67 @@
|
|
1
|
+
class Amazon::MWS::Connection
|
2
|
+
class RequestBuilder
|
3
|
+
attr_accessor :request
|
4
|
+
|
5
|
+
def initialize(verb, path, body = nil)
|
6
|
+
# Create the request object
|
7
|
+
@request = request_method(verb).new(path)
|
8
|
+
process_body(body)
|
9
|
+
end
|
10
|
+
|
11
|
+
def request_method(verb)
|
12
|
+
Net::HTTP.const_get(verb.to_s.capitalize)
|
13
|
+
end
|
14
|
+
|
15
|
+
def process_body(body)
|
16
|
+
@request.content_length = 0 and return self if body.nil?
|
17
|
+
|
18
|
+
if body.respond_to?(:read)
|
19
|
+
@request.body_stream = body
|
20
|
+
else
|
21
|
+
@request.body = body
|
22
|
+
end
|
23
|
+
|
24
|
+
@request.content_length = body.respond_to?(:lstat) ? body.stat.size : body.size
|
25
|
+
return self
|
26
|
+
end
|
27
|
+
|
28
|
+
# For the SubmitFeed (p. 41) function, we require that you pass the Content-MD5 HTTP header,
|
29
|
+
# which contains the MD5 hash of the HTTP entity body (see Section 14.15 of RFC 2616, the HTTP/1.1
|
30
|
+
# specification), so we can check if the feed we stored for processing is bit for bit identical with what you
|
31
|
+
# sent, protecting you from corrupted descriptive or pricing product data appearing on Amazon.com.
|
32
|
+
#
|
33
|
+
def add_host
|
34
|
+
@request['Host'] = Amazon::MWS::DEFAULT_HOST
|
35
|
+
return self
|
36
|
+
end
|
37
|
+
|
38
|
+
def add_user_agent
|
39
|
+
@request['User-Agent'] = "Amazon::MWS/#{Amazon::MWS::Version} (Language=Ruby)"
|
40
|
+
return self
|
41
|
+
end
|
42
|
+
|
43
|
+
def add_content_type
|
44
|
+
# nothing happening yet
|
45
|
+
return self
|
46
|
+
end
|
47
|
+
|
48
|
+
def add_content_md5(body = "")
|
49
|
+
@request['Content-MD5'] = Base64.encode64(create_md5(body))
|
50
|
+
return self # chainable
|
51
|
+
end
|
52
|
+
|
53
|
+
# think about chaining this with process_body
|
54
|
+
def create_md5(body)
|
55
|
+
md5 = Digest::MD5.new
|
56
|
+
|
57
|
+
# stream from file or in memory?
|
58
|
+
if body.respond_to?(:read)
|
59
|
+
digest = body.each { |line| md5.update(line) }
|
60
|
+
else
|
61
|
+
digest = md5.update(body)
|
62
|
+
end
|
63
|
+
|
64
|
+
return digest.hexdigest
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
module Amazon
|
2
|
+
module MWS
|
3
|
+
|
4
|
+
# Abstract super class of all Amazon::MWS exceptions
|
5
|
+
class MWSException < StandardError
|
6
|
+
end
|
7
|
+
|
8
|
+
# Abstract super class for all invalid options.
|
9
|
+
class InvalidOption < MWSException
|
10
|
+
end
|
11
|
+
|
12
|
+
class InvalidMessageType < MWSException
|
13
|
+
end
|
14
|
+
|
15
|
+
class InvalidReportType < MWSException
|
16
|
+
end
|
17
|
+
|
18
|
+
class InvalidSchedule < MWSException
|
19
|
+
end
|
20
|
+
|
21
|
+
class MissingConnectionOptions < MWSException
|
22
|
+
end
|
23
|
+
|
24
|
+
# All responses with a code between 300 and 599 that contain an <Error></Error> body are wrapped in an
|
25
|
+
# ErrorResponse which contains an Error object. This Error class generates a custom exception with the name
|
26
|
+
# of the xml Error and its message. All such runtime generated exception classes descend from ResponseError
|
27
|
+
# and contain the ErrorResponse object so that all code that makes a request can rescue ResponseError and get
|
28
|
+
# access to the ErrorResponse.
|
29
|
+
# class ResponseError < MWSException
|
30
|
+
# def initialize(formatted_response)
|
31
|
+
# instance_eval(<<-EVAL, __FILE__, __LINE__)
|
32
|
+
# def request_id
|
33
|
+
# '#{formatted_response["RequestID"]}'
|
34
|
+
# end
|
35
|
+
# EVAL
|
36
|
+
#
|
37
|
+
# formatted_response["Error"].each do |key, value|
|
38
|
+
# instance_eval(<<-EVAL, __FILE__, __LINE__)
|
39
|
+
# def #{key.underscore}
|
40
|
+
# '#{value}'
|
41
|
+
# end
|
42
|
+
# EVAL
|
43
|
+
# end
|
44
|
+
# end
|
45
|
+
# end
|
46
|
+
|
47
|
+
class RequestTimeout < ResponseError
|
48
|
+
end
|
49
|
+
|
50
|
+
# Most ResponseError's are created just time on a need to have basis, but we explicitly define the
|
51
|
+
# InternalError exception because we want to explicitly rescue InternalError in some cases.
|
52
|
+
class InternalError < ResponseError
|
53
|
+
end
|
54
|
+
|
55
|
+
# Raised if an unrecognized option is passed when establishing a connection.
|
56
|
+
class InvalidConnectionOption < InvalidOption
|
57
|
+
def initialize(invalid_options)
|
58
|
+
message = "The following connection options are invalid: #{invalid_options.join(', ')}. " +
|
59
|
+
"The valid connection options are: #{Connection::Options::VALID_OPTIONS.join(', ')}."
|
60
|
+
super(message)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Raised if either the access key id or secret access key arguments are missing when establishing a connection.
|
65
|
+
class MissingAccessKey < InvalidOption
|
66
|
+
def initialize(missing_keys)
|
67
|
+
key_list = missing_keys.map {|key| key.to_s}.join(' and the ')
|
68
|
+
super("You did not provide both required access keys. Please provide the #{key_list}.")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# Raised if a request is attempted before any connections have been established.
|
73
|
+
class NoConnectionEstablished < MWSException
|
74
|
+
def initialize
|
75
|
+
super("\nPlease use Amazon::MWS::Base.establish_connection! before making API calls.")
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,223 @@
|
|
1
|
+
module Amazon
|
2
|
+
module MWS
|
3
|
+
|
4
|
+
module Feed
|
5
|
+
include Enumerations
|
6
|
+
# class << self
|
7
|
+
# The SubmitFeed operation uploads a file for processing together with
|
8
|
+
# the necessary metadata to process the file.
|
9
|
+
|
10
|
+
# Amazon MWS limits calls to 1,000 total calls per hour per seller
|
11
|
+
# account. For best performance, you should limit your calls to
|
12
|
+
# SubmitFeed to no more than three feeds per hour per seller account,
|
13
|
+
# although you can successfully call SubmitFeed up to 30 times per
|
14
|
+
# hour. Feed size is limited to 2,147,483,647 bytes (2^32 -1) per
|
15
|
+
# feed.
|
16
|
+
|
17
|
+
def submit_feed(feed_type, message_type, message = {})
|
18
|
+
message_type= message_type.to_s.camelize
|
19
|
+
raise InvalidMessageType if !MESSAGE_TYPES.include?(message_type)
|
20
|
+
|
21
|
+
body = Amazon::MWS::FeedBuilder.new(message_type, message)
|
22
|
+
|
23
|
+
response =
|
24
|
+
post("/", {
|
25
|
+
"Action" => "SubmitFeed",
|
26
|
+
"FeedType" => FEED_TYPES[feed_type]
|
27
|
+
}, body)
|
28
|
+
|
29
|
+
result = SubmitFeedResponse.format(response)
|
30
|
+
end
|
31
|
+
|
32
|
+
alias_method :submit, :submit_feed
|
33
|
+
|
34
|
+
# The GetFeedSubmissionList operation returns the total list of feed
|
35
|
+
# submissions within the previous 90 days that match the query
|
36
|
+
# parameters. Amazon MWS limits calls to 1,000 total calls per hour
|
37
|
+
# per seller account, including calls to GetFeedSubmissionList.
|
38
|
+
#
|
39
|
+
# The maximum number of results that will be returned in one call is
|
40
|
+
# one hundred. If there are additional results to return, HasNext will
|
41
|
+
# be returned in the response with a true value. To retrieve all the
|
42
|
+
# results, you can use the value of the NextToken parameter to call
|
43
|
+
# GetFeedSubmissionListByNextToken until HasNext is false.
|
44
|
+
|
45
|
+
# Optional Request Parameters
|
46
|
+
# ------------------
|
47
|
+
# FeedSubmissionIdList
|
48
|
+
# A structured list of feed submission IDs. If you pass in explicit
|
49
|
+
# IDs in this call, the other conditions, if specified, will be
|
50
|
+
# ignored.
|
51
|
+
|
52
|
+
# MaxCount
|
53
|
+
# Maximum number of feed submissions to return in the list. If you
|
54
|
+
# specify a number greater than 100, the call will be rejected.
|
55
|
+
|
56
|
+
# FeedTypeList
|
57
|
+
# A structured list of one or more FeedType constants by which to
|
58
|
+
# filter feed submissions.
|
59
|
+
|
60
|
+
# FeedProcessingStatusList
|
61
|
+
# A structured list of one or more feed processing statuses by which
|
62
|
+
# to filter feed submissions. Valid values are:
|
63
|
+
#
|
64
|
+
# _SUBMITTED_
|
65
|
+
# _IN_PROGRESS_
|
66
|
+
# _CANCELLED_
|
67
|
+
# _DONE_
|
68
|
+
|
69
|
+
# SubmittedFromDate
|
70
|
+
# The earliest submission date you are looking for, in ISO8601 date
|
71
|
+
# format (for example, "2008-07-03T18:12:22Z" or
|
72
|
+
# "2008-07-03T18:12:22.093-07:00").
|
73
|
+
|
74
|
+
# SubmittedToDate
|
75
|
+
# The latest submission date you are looking for, in ISO8601 date
|
76
|
+
# format (for example, "2008-07-03T18:12:22Z" or
|
77
|
+
# "2008-07-03T18:12:22.093-07:00").
|
78
|
+
|
79
|
+
def get_feed_submission_list(params = {})
|
80
|
+
response =
|
81
|
+
get("/", {"Action" => "GetFeedSubmissionList"}.merge(params))
|
82
|
+
|
83
|
+
result = GetFeedSubmissionListResponse.format(response)
|
84
|
+
end
|
85
|
+
|
86
|
+
alias_method :feed_submission_list, :get_feed_submission_list
|
87
|
+
|
88
|
+
# The GetFeedSubmissionListByNextToken operation returns a list of
|
89
|
+
# feed submissions that match the query parameters, using the
|
90
|
+
# NextToken, which was supplied by a previous call to either
|
91
|
+
# GetFeedSubmissionListByNextToken or a call to GetFeedSubmissionList,
|
92
|
+
# where the value of HasNext was true in that previous call.
|
93
|
+
#
|
94
|
+
# Request Parameters
|
95
|
+
# ------------------
|
96
|
+
# NextToken
|
97
|
+
# Token returned in a previous call to either GetFeedSubmissionList or
|
98
|
+
# GetFeedSubmissionListByNextToken when the value of HasNext was true.
|
99
|
+
def get_feed_submission_list_by_next_token(next_token)
|
100
|
+
response =
|
101
|
+
get("/", {
|
102
|
+
"Action" => "GetFeedSubmissionListByNextToken",
|
103
|
+
"NextToken" => next_token
|
104
|
+
})
|
105
|
+
|
106
|
+
GetFeedSubmissionListByNextTokenResponse.format(response)
|
107
|
+
end
|
108
|
+
|
109
|
+
alias_method :feed_submission_list_by_next_token, :get_feed_submission_list_by_next_token
|
110
|
+
|
111
|
+
# The GetFeedsubmissionCount operation returns a count of the total
|
112
|
+
# number of feed submissions within the previous 90 days.
|
113
|
+
#
|
114
|
+
# Optional Request Parameters
|
115
|
+
# ------------------
|
116
|
+
# FeedTypeList
|
117
|
+
# A structured list of one or more FeedType constants by which to
|
118
|
+
# filter feed submissions.
|
119
|
+
|
120
|
+
# FeedProcessingStatusList
|
121
|
+
# A structured list of one or more feed processing statuses by which
|
122
|
+
# to filter feed submissions. Valid values are:
|
123
|
+
#
|
124
|
+
# _SUBMITTED_
|
125
|
+
# _IN_PROGRESS_
|
126
|
+
# _CANCELLED_
|
127
|
+
# _DONE_
|
128
|
+
|
129
|
+
# SubmittedFromDate
|
130
|
+
# The earliest submission date you are looking for, in ISO8601 date
|
131
|
+
# format (for example, "2008-07-03T18:12:22Z" or
|
132
|
+
# "2008-07-03T18:12:22.093-07:00").
|
133
|
+
|
134
|
+
# SubmittedToDate
|
135
|
+
# The latest submission date you are looking for, in ISO8601 date
|
136
|
+
# format (for example, "2008-07-03T18:12:22Z" or
|
137
|
+
# "2008-07-03T18:12:22.093-07:00").
|
138
|
+
|
139
|
+
def get_feed_submission_count(params = {})
|
140
|
+
response =
|
141
|
+
get("/", {"Action" => "GetFeedSubmissionCount"}.merge(params))
|
142
|
+
|
143
|
+
GetFeedSubmissionCountResponse.format(response)
|
144
|
+
end
|
145
|
+
|
146
|
+
alias_method :feed_submission_count, :get_feed_submission_count
|
147
|
+
|
148
|
+
|
149
|
+
# The CancelFeedSubmissions operation cancels one or more feed
|
150
|
+
# submissions, returning the count of the canceled feed submissions
|
151
|
+
# and the feed submission information. You can specify a number to
|
152
|
+
# cancel of greater than one hundred, but information will only be
|
153
|
+
# returned about the first one hundred feed submissions in the list.
|
154
|
+
# To return metadata about a greater number of canceled feed
|
155
|
+
# submissions, you can call GetFeedSubmissionList. If feeds have
|
156
|
+
# already begun processing, they cannot be canceled.
|
157
|
+
|
158
|
+
# Amazon MWS limits calls to 1,000 total calls per hour per seller
|
159
|
+
# account, including calls to CancelFeedSubmissions.
|
160
|
+
|
161
|
+
# Optional Request Parameters
|
162
|
+
# ------------------
|
163
|
+
# FeedSubmissionIdList
|
164
|
+
# A structured list of feed submission IDs. If you pass in explicit
|
165
|
+
# IDs in this call, the other conditions, if specified, will be
|
166
|
+
# ignored.
|
167
|
+
|
168
|
+
# FeedTypeList
|
169
|
+
# A structured list of one or more FeedType constants by which to
|
170
|
+
# filter feed submissions.
|
171
|
+
|
172
|
+
# SubmittedFromDate
|
173
|
+
# The earliest submission date you are looking for, in ISO8601 date
|
174
|
+
# format (for example, "2008-07-03T18:12:22Z" or
|
175
|
+
# "2008-07-03T18:12:22.093-07:00").
|
176
|
+
|
177
|
+
# SubmittedToDate
|
178
|
+
# The latest submission date you are looking for, in ISO8601 date
|
179
|
+
# format (for example, "2008-07-03T18:12:22Z" or
|
180
|
+
# "2008-07-03T18:12:22.093-07:00").
|
181
|
+
|
182
|
+
def cancel_feed_submissions(params = {})
|
183
|
+
response =
|
184
|
+
get("/", {"Action" => "CancelFeedSubmissions"}.merge(params))
|
185
|
+
|
186
|
+
CancelFeedSubmissionsResponse.format(response)
|
187
|
+
end
|
188
|
+
|
189
|
+
# The GetFeedSubmissionResult operation returns the feed processing
|
190
|
+
# report and the Content-MD5 header for the returned body.
|
191
|
+
|
192
|
+
# You should compute the MD5 hash of the HTTP body that we returned to
|
193
|
+
# you, and compare that with the Content-MD5 header value that we
|
194
|
+
# returned. If they do not match, which means the body was corrupted
|
195
|
+
# during transmission, you should discard the result and automatically
|
196
|
+
# retry the call for up to three more times. Please notify us if you
|
197
|
+
# ever see such a corrupted body. You can contact us by using the
|
198
|
+
# contact form at http://mws.amazon.com (http://mws.amazon.com). For
|
199
|
+
# more information on computing the MD5, see Using the Content-MD5
|
200
|
+
# Header with SubmitFeed.
|
201
|
+
|
202
|
+
# FeedSubmissionId
|
203
|
+
# The identifier of the feed submission to get results for. Obtained
|
204
|
+
# by a call to GetFeedSubmissionList.
|
205
|
+
|
206
|
+
def get_feed_submission_result(feed_submission_id)
|
207
|
+
response =
|
208
|
+
get("/", {
|
209
|
+
"Action" => "GetFeedSubmissionResult",
|
210
|
+
"FeedSubmissionId" => feed_submission_id
|
211
|
+
}.merge(params))
|
212
|
+
|
213
|
+
GetFeedSubmissionResultResponse.format(response)
|
214
|
+
end
|
215
|
+
|
216
|
+
alias_method :feed_submission_result, :get_feed_submission_result
|
217
|
+
end
|
218
|
+
|
219
|
+
# end
|
220
|
+
# Feed
|
221
|
+
|
222
|
+
end
|
223
|
+
end
|