Module: Peddler::Notifications::ListingsItemStatusChange

Defined in:
lib/peddler/notifications/listings_item_status_change.rb,
lib/peddler/notifications/listings_item_status_change/payload.rb,
lib/peddler/notifications/listings_item_status_change/notification.rb

Overview

Listings Item Status Change Notification

To be delivered when the status (e.g. buyability, discoverability) of a listings item changes.

Constant Summary collapse

Payload =

Notification payload data

Structure.new do
  # @return [String] Selling partner identifier, such as a merchant account, of the affected listings item.
  attribute(:seller_id, String, from: "SellerId")

  # @return [String] Identifier of the affected listings item.
  attribute(:sku, String, from: "Sku")

  # @return [Array<String>] Array of status states currently associated with the affected listings item. The
  # absence of a value indicates the status state is not currently applicable to the listings item. For example,
  # if "BUYABLE" is not present, the listings item is not currently buyable.
  attribute(:status, [String], from: "Status")

  # @return [String] The Amazon Standard Identification Number (ASIN) identifier of the catalog item associated
  # with the listings item.
  attribute?(:asin, String, from: "Asin")

  # @return [Time] Timestamp of when the listings item was created, formatted as ISO8601 date-time.
  attribute?(:created_date, Time, from: "CreatedDate")

  # @return [String] Amazon marketplace identifier of the affected listings item.
  attribute?(:marketplace_id, String, from: "MarketplaceId")
end
Notification =

To be delivered when the status (e.g. buyability, discoverability) of a listings item changes.

Structure.new do
  # @return [Time] Timestamp of the event, formatted as ISO8601 date-time.
  attribute(:event_time, Time, from: "EventTime")

  # @return [Hash] The metadata of the notification.
  attribute(:notification_metadata, Hash, from: "NotificationMetadata")

  # @return [String] The type of the notification.
  attribute(:notification_type, String, from: "NotificationType")

  # @return [String] The version of the notification.
  attribute(:notification_version, String, from: "NotificationVersion")

  # @return [Payload] The details of this notification.
  attribute(:payload, Payload, from: "Payload")

  # @return [String] The version of the payload.
  attribute(:payload_version, String, from: "PayloadVersion")
end

Class Method Summary collapse

Class Method Details

.parse(hash) ⇒ Object



12
13
14
# File 'lib/peddler/notifications/listings_item_status_change.rb', line 12

def parse(hash)
  Notification.parse(hash)
end