Module: Peddler::Reports::VendorTraffic

Defined in:
lib/peddler/reports/vendor_traffic.rb,
lib/peddler/reports/vendor_traffic/report.rb,
lib/peddler/reports/vendor_traffic/report_options.rb,
lib/peddler/reports/vendor_traffic/traffic_by_asin.rb,
lib/peddler/reports/vendor_traffic/traffic_aggregate.rb,
lib/peddler/reports/vendor_traffic/report_specification.rb

Overview

This report shares data on the customer traffic to the detail pages of the vendor's items both at an aggregated level (across the vendor's entire catalog of items) and at a per-ASIN level. Data is available for different date range aggregation levels: DAY, WEEK, MONTH, QUARTER, YEAR. Requests can span multiple date range periods.

Constant Summary collapse

Report =

This report shares data on the customer traffic to the detail pages of the vendor's items both at an aggregated level (across the vendor's entire catalog of items) and at a per-ASIN level. Data is available for different date range aggregation levels: DAY, WEEK, MONTH, QUARTER, YEAR. Requests can span multiple date range periods.

Structure.new do
  # @return [Hash] The report summary including the specified reporting date range and the last updated date in
  # the input.
  attribute(:report_specification, ReportSpecification, from: "reportSpecification")

  # @return [Array<TrafficAggregate>]
  attribute(:traffic_aggregate, [TrafficAggregate], from: "trafficAggregate")

  # @return [Array<TrafficByAsin>]
  attribute(:traffic_by_asin, [TrafficByASIN], from: "trafficByAsin")
end
ReportOptions =

Report options specifying parameters such as reportPeriod.

Structure.new do
  # @return [String] The granularity of the data in the report. Valid values are: DAY, WEEK, MONTH, QUARTER, YEAR.
  attribute(:report_period, String, from: "reportPeriod")
end
TrafficByASIN =

Describes aggregated ASIN-level traffic metrics for ASINs in the vendor's account.

Structure.new do
  # @return [String] The Amazon Standard Identification Number.
  attribute(:asin, String)

  # @return [String] The end date of the aggregated ASIN-level data.
  attribute(:end_date, String, from: "endDate")

  # @return [Integer] The number of customer views of the product detail page.
  attribute(:glance_views, Integer, from: "glanceViews")

  # @return [String] The start date of the aggregated ASIN-level data.
  attribute(:start_date, String, from: "startDate")
end
TrafficAggregate =

Describes aggregated traffic metrics for ASINs in the vendor's account.

Structure.new do
  # @return [Date] The end date of the aggregated data.
  attribute(:end_date, Date, from: "endDate")

  # @return [Integer] Customer views of the vendor's product detail pages.
  attribute(:glance_views, Integer, from: "glanceViews")

  # @return [Date] The start date of the aggregated data.
  attribute(:start_date, Date, from: "startDate")
end
ReportSpecification =

The report summary including the specified reporting date range and the last updated date in the input.

Structure.new do
  # @return [Date] Determines the end date of the report - the time component is ignored. For WEEK, MONTH,
  # QUARTER, and YEAR reportPeriods, this value must correspond to the last day in the specified reportPeriod or
  # else a fatal error is returned. For example, dataEndTime must be a Saturday for the WEEK reportPeriod.
  attribute(:data_end_time, Date, from: "dataEndTime")

  # @return [Date] Determines the start date of the report - the time component is ignored. For WEEK, MONTH,
  # QUARTER, and YEAR reportPeriods, this value must correspond to the first day in the specified reportPeriod or
  # else a fatal error is returned. For example, dataStartTime must be a Sunday for the WEEK reportPeriod.
  attribute(:data_start_time, Date, from: "dataStartTime")

  # @return [Date] The date when the report was last updated. Follows the
  # {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} date format of YYYY-MM-DD.
  attribute(:last_updated_date, Date, from: "lastUpdatedDate")

  # @return [Array<String>] This parameter must match the marketplaceId of the selling partner account (each
  # selling partner account belongs to one and only one marketplaceId).
  attribute(:marketplace_ids, [String], from: "marketplaceIds")

  # @return [ReportOptions] Report options specifying parameters such as reportPeriod.
  attribute(:report_options, ReportOptions, from: "reportOptions")

  # @return [String] The type of report.
  attribute(:report_type, String, from: "reportType")
end

Class Method Summary collapse

Class Method Details

.parse(hash) ⇒ Object



14
15
16
# File 'lib/peddler/reports/vendor_traffic.rb', line 14

def parse(hash)
  Report.parse(hash)
end