Class: MWS::Feeds::Client

Inherits:
Peddler::Client show all
Defined in:
lib/mws/feeds/client.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.

Instance Attribute Summary

Attributes inherited from Peddler::Client

#auth_token, #body, #marketplace, #merchant_id

Instance Method Summary collapse

Methods inherited from Peddler::Client

#initialize

Constructor Details

This class inherits a constructor from Peddler::Client

Instance Method Details

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

Cancels 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:

  • (Peddler::XMLParser)

See Also:


99
100
101
102
103
104
105
106
# File 'lib/mws/feeds/client.rb', line 99

def cancel_feed_submissions(opts = {})
  operation('CancelFeedSubmissions')
    .add(opts)
    .structure!('FeedSubmissionIdList', 'Id')
    .structure!('FeedTypeList', 'Type')

  run
end

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

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:

  • (Peddler::XMLParser)

See Also:


80
81
82
83
84
85
86
87
# File 'lib/mws/feeds/client.rb', line 80

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

  run
end

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

Lists 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:

  • (Peddler::XMLParser)

See Also:


48
49
50
51
52
53
54
55
56
# File 'lib/mws/feeds/client.rb', line 48

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::XMLParser

Lists the next page of feed submissions

Parameters:

  • next_token (String)

Returns:

  • (Peddler::XMLParser)

See Also:


63
64
65
66
67
68
# File 'lib/mws/feeds/client.rb', line 63

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) ⇒ Peddler::XMLParser, Peddler::FlatFileParser

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

Parameters:

  • feed_submission_id (Integer, String)

Returns:

  • (Peddler::XMLParser)

    if the report is in XML format

  • (Peddler::FlatFileParser)

    if the report is a flat file

See Also:


114
115
116
117
118
119
# File 'lib/mws/feeds/client.rb', line 114

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

  run
end

#submit_feed(feed_content, feed_type, opts = {}) ⇒ Peddler::XMLParser

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:

  • (Peddler::XMLParser)

See Also:


25
26
27
28
29
30
31
32
33
34
# File 'lib/mws/feeds/client.rb', line 25

def submit_feed(feed_content, feed_type, opts = {})
  self.body = feed_content

  operation('SubmitFeed')
    .add(opts)
    .add('FeedType' => feed_type)
    .structure!('MarketplaceIdList', 'Id')

  run
end