Class: MWS::Feeds

Inherits:
Peddler::Client show all
Defined in:
lib/mws/feeds.rb

Overview

The MWS Feeds API lets you upload inventory and order data to Amazon. You can also use this API to get information about the processing of feeds.

Constant Summary

Constants inherited from Peddler::Client

Peddler::Client::BadMarketplaceId, Peddler::Client::HOSTS

Instance Attribute Summary

Attributes inherited from Peddler::Client

#body, #marketplace_id, #merchant_id

Instance Method Summary collapse

Methods inherited from Peddler::Client

#aws_endpoint, #headers, inherited, #operation, path, #run

Instance Method Details

#cancel_feed_submissions(opts = {}) ⇒ Peddler::Parser

Cancel one or more feed submissions

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :feed_submission_id_list (Array<String>, String)
  • :feed_type_list (Array<String>, String)
  • :submitted_from_date (String, #iso8601)
  • :submitted_to_date (String, #iso8601)

Returns:

See Also:



91
92
93
94
95
96
# File 'lib/mws/feeds.rb', line 91

def cancel_feed_submissions(opts = {})
  operation('CancelFeedSubmissions')
    .add(opts)

  run
end

#get_feed_submission_count(opts = {}) ⇒ Peddler::Parser

Counts submitted feeds

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :feed_type_list (Array<String>, String)
  • :feed_processing_status_list (Array<String>, String)
  • :submitted_from_date (String, #iso8601)
  • :submitted_to_date (String, #iso8601)

Returns:

See Also:



72
73
74
75
76
77
78
79
# File 'lib/mws/feeds.rb', line 72

def get_feed_submission_count(opts = {})
  operation('GetFeedSubmissionCount')
    .add(opts)
    .structure!('FeedTypeList', 'Type')
    .structure!('FeedProcessingStatusList', 'Status')

  run
end

#get_feed_submission_list(opts = {}) ⇒ Peddler::Parser

List feed submissions

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :feed_submission_id_list (Array<String>, String)
  • :max_count (Integer)
  • :feed_type_list (Array<String>, String)
  • :feed_processing_status_list (Array<String>, String)
  • :submitted_from_date (String, #iso8601)
  • :submitted_to_date (String, #iso8601)

Returns:

See Also:



39
40
41
42
43
44
45
46
47
# File 'lib/mws/feeds.rb', line 39

def get_feed_submission_list(opts = {})
  operation('GetFeedSubmissionList')
    .add(opts)
    .structure!('FeedSubmissionIdList', 'Id')
    .structure!('FeedTypeList', 'Type')
    .structure!('FeedProcessingStatusList', 'Status')

  run
end

#get_feed_submission_list_by_next_token(next_token) ⇒ Peddler::Parser

List the next page of feed submissions

Parameters:

  • next_token (String)

Returns:

See Also:



55
56
57
58
59
60
# File 'lib/mws/feeds.rb', line 55

def get_feed_submission_list_by_next_token(next_token)
  operation('GetFeedSubmissionListByNextToken')
    .add('NextToken' => next_token)

  run
end

#get_feed_submission_result(feed_submission_id) ⇒ Object

Gets the processing report for a feed and its Content-MD5 header

Parameters:

  • feed_submission_id (Integer, String)

Returns:

  • Peddler::Parser

See Also:



103
104
105
106
107
108
# File 'lib/mws/feeds.rb', line 103

def get_feed_submission_result(feed_submission_id)
  operation('GetFeedSubmissionResult')
    .add('FeedSubmissionId' => feed_submission_id)

  run
end

#submit_feed(content, feed_type, opts = {}) ⇒ Peddler::Parser

Note:

Feed size is limited to 2,147,483,647 bytes (2^31 -1) per feed

Uploads a feed

Parameters:

  • feed_content (String)

    an XML or flat file feed

  • feed_type (String)

    the feed type

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :marketplace_id_list (Array<String>, String)
  • :purge_and_replace (Boolean)

Returns:

See Also:



18
19
20
21
22
23
24
25
# File 'lib/mws/feeds.rb', line 18

def submit_feed(content, feed_type, opts = {})
  self.body = content
  operation('SubmitFeed')
    .add(opts.merge('FeedType' => feed_type))
    .structure!('MarketplaceId', 'Id')

  run
end