Class: MWS::Reports::Client

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

Overview

The Reports API lets you request reports about your inventory and orders.

Instance Attribute Summary

Attributes inherited from Peddler::Client

#auth_token, #body, #marketplace, #merchant_id, #path

Instance Method Summary collapse

Methods inherited from Peddler::Client

#aws_endpoint, #defaults, #headers, #initialize, #operation, #run

Constructor Details

This class inherits a constructor from Peddler::Client

Instance Method Details

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

Cancels one or more report requests

Parameters:

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

Options Hash (opts):

  • :report_type_list (Array<String>, String)
  • :report_processing_status_list (Array<String>, String)
  • :requested_from_date (String, #iso8601)
  • :requested_to_date (String, #iso8601)

Returns:

See Also:



91
92
93
94
95
96
97
98
# File 'lib/mws/reports/client.rb', line 91

def cancel_report_requests(opts = {})
  operation('CancelReportRequests')
    .add(opts)
    .structure!('ReportTypeList', 'Type')
    .structure!('ReportProcessingStatusList', 'Status')

  run
end

#get_report(report_id, &blk) ⇒ Peddler::XMLParser, Peddler::FlatFileParser

Gets a report and its Content-MD5 header

Parameters:

  • report_id (String)

Returns:

See Also:



155
156
157
158
159
160
# File 'lib/mws/reports/client.rb', line 155

def get_report(report_id, &blk)
  operation('GetReport')
    .add('ReportId' => report_id)

  run(&blk)
end

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

Counts reports

Parameters:

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

Options Hash (opts):

  • :report_type_list (Array<String>, String)
  • :acknowledged (Boolean)
  • :available_from_date (String, #iso8601)
  • :available_to_date (String, #iso8601)

Returns:

See Also:



141
142
143
144
145
146
147
# File 'lib/mws/reports/client.rb', line 141

def get_report_count(opts = {})
  operation('GetReportCount')
    .add(opts)
    .structure!('ReportTypeList', 'Type')

  run
end

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

Lists reports

Parameters:

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

Options Hash (opts):

  • :max_count (Integer)
  • :report_type_list (Array<String>, String)
  • :acknowledged (Boolean)
  • :available_from_date (String, #iso8601)
  • :available_to_date (String, #iso8601)
  • :report_request_id_list (Array<String>, String)

Returns:

See Also:



111
112
113
114
115
116
117
118
# File 'lib/mws/reports/client.rb', line 111

def get_report_list(opts = {})
  operation('GetReportList')
    .add(opts)
    .structure!('ReportTypeList', 'Type')
    .structure!('ReportRequestIdList', 'Id')

  run
end

#get_report_list_by_next_token(next_token) ⇒ Peddler::XMLParser

Lists the next page of reports



125
126
127
128
129
130
# File 'lib/mws/reports/client.rb', line 125

def get_report_list_by_next_token(next_token)
  operation('GetReportListByNextToken')
    .add('NextToken' => next_token)

  run
end

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

Counts requested reports

Parameters:

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

Options Hash (opts):

  • :report_type_list (Array<String>, String)
  • :report_processing_status_list (Array<String>, String)
  • :requested_from_date (String, #iso8601)
  • :requested_to_date (String, #iso8601)

Returns:

See Also:



73
74
75
76
77
78
79
80
# File 'lib/mws/reports/client.rb', line 73

def get_report_request_count(opts = {})
  operation('GetReportRequestCount')
    .add(opts)
    .structure!('ReportTypeList', 'Type')
    .structure!('ReportProcessingStatusList', 'Status')

  run
end

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

Lists report requests

Parameters:

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

Options Hash (opts):

  • :report_request_id_list (Array<String>, String)
  • :report_type_list (Array<String>, String)
  • :report_processing_status_list (Array<String>, String)
  • :max_count (Integer)
  • :requested_from_date (String, #iso8601)
  • :requested_to_date (String, #iso8601)

Returns:

See Also:



42
43
44
45
46
47
48
49
50
# File 'lib/mws/reports/client.rb', line 42

def get_report_request_list(opts = {})
  operation('GetReportRequestList')
    .add(opts)
    .structure!('ReportRequestIdList', 'Id')
    .structure!('ReportTypeList', 'Type')
    .structure!('ReportProcessingStatusList', 'Status')

  run
end

#get_report_request_list_by_next_token(next_token) ⇒ Peddler::XMLParser

Lists the next page of the report requests



57
58
59
60
61
62
# File 'lib/mws/reports/client.rb', line 57

def get_report_request_list_by_next_token(next_token)
  operation('GetReportRequestListByNextToken')
    .add('NextToken' => next_token)

  run
end

#get_report_schedule_count(*report_type_list) ⇒ Peddler::XMLParser

Counts scheduled reports



204
205
206
207
208
209
210
# File 'lib/mws/reports/client.rb', line 204

def get_report_schedule_count(*report_type_list)
  operation('GetReportScheduleCount')
    .add('ReportTypeList' => report_type_list)
    .structure!('ReportTypeList', 'Type')

  run
end

#get_report_schedule_list(*report_type_list) ⇒ Peddler::XMLParser

Lists scheduled reports



183
184
185
186
187
188
189
# File 'lib/mws/reports/client.rb', line 183

def get_report_schedule_list(*report_type_list)
  operation('GetReportScheduleList')
    .add('ReportTypeList' => report_type_list)
    .structure!('ReportTypeList', 'Type')

  run
end

#get_report_schedule_list_by_next_tokenObject

Lists next page of scheduled reports



195
196
197
# File 'lib/mws/reports/client.rb', line 195

def get_report_schedule_list_by_next_token(*)
  raise NotImplementedError
end

#manage_report_schedule(report_type, schedule, opts = {}) ⇒ Peddler::XMLParser

Creates, updates, or deletes a report request schedule

Parameters:

  • report_type (String)
  • schedule (String)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :schedule_date (String, #iso8601)

Returns:

See Also:



170
171
172
173
174
175
176
# File 'lib/mws/reports/client.rb', line 170

def manage_report_schedule(report_type, schedule, opts = {})
  operation('ManageReportSchedule')
    .add(opts)
    .add('ReportType' => report_type, 'Schedule' => schedule)

  run
end

#request_report(report_type, opts = {}) ⇒ Peddler::XMLParser

Creates a report request

Parameters:

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

Options Hash (opts):

  • :start_date (String, #iso8601)
  • :end_date (String, #iso8601)
  • :report_options (String)
  • :marketplace_id_list (Array<String>, String)

Returns:

See Also:



22
23
24
25
26
27
28
29
# File 'lib/mws/reports/client.rb', line 22

def request_report(report_type, opts = {})
  operation('RequestReport')
    .add(opts)
    .add('ReportType' => report_type)
    .structure!('MarketplaceIdList', 'Id')

  run
end

#update_report_acknowledgements(acknowledged, *report_id_list) ⇒ Peddler::XMLParser

Updates acknowledged status of one or more reports

Parameters:

  • acknowledged (Boolean)
  • report_id_list (Array<String>)

Returns:

See Also:



218
219
220
221
222
223
224
# File 'lib/mws/reports/client.rb', line 218

def update_report_acknowledgements(acknowledged, *report_id_list)
  operation('UpdateReportAcknowledgements')
    .add('ReportIdList' => report_id_list, 'Acknowledged' => acknowledged)
    .structure!('ReportIdList', 'Id')

  run
end