Module: Peddler::Notifications::OrderStatusChange

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

Overview

The root schema

The root schema comprises the entire JSON document.

Constant Summary collapse

Payload =

Notification payload that wraps nested notification data

Structure.new do
  # @return [OrderStatusChangeNotification]
  attribute(:order_status_change_notification, OrderStatusChangeNotification, from: "OrderStatusChangeNotification")
end
Notification =

The root schema comprises the entire JSON document.

Structure.new do
  # @return [String]
  attribute(:event_time, String, from: "EventTime")

  # @return [Hash]
  attribute(:notification_metadata, Hash, from: "NotificationMetadata")

  # @return [String]
  attribute(:notification_type, String, from: "NotificationType")

  # @return [String]
  attribute(:notification_version, String, from: "NotificationVersion")

  # @return [Payload]
  attribute(:payload, Payload, from: "Payload")

  # @return [String]
  attribute(:payload_version, String, from: "PayloadVersion")
end
OrderStatusChangeNotification =

Nested notification data

Structure.new do
  # @return [String] An Amazon-defined order identifier in 3-7-7 format.
  attribute(:amazon_order_id, String, from: "AmazonOrderId")

  # @return [String] The destination postal code.
  attribute(:destination_postal_code, String, from: "DestinationPostalCode")

  # @return [String] Fulfillment channel of the affected order, MFN or AFN.
  attribute(:fulfillment_channel, String, from: "FulfillmentChannel")

  # @return [String] Amazon marketplace identifier of the affected order.
  attribute(:marketplace_id, String, from: "MarketplaceId")

  # @return [String] The Amazon-defined order item identifier.
  attribute(:order_item_id, String, from: "OrderItemId")

  # @return [String] The current order status. The possible values include UpComing, Pending, Unshipped,
  # PartiallyShipped, PendingAvailability, Canceled, InvoiceUnconfirmed, Shipped, and Unfulfillable.
  attribute(:order_status, String, from: "OrderStatus")

  # @return [String] The purchase date of the order in Epoch time.
  attribute(:purchase_date, String, from: "PurchaseDate")

  # @return [Integer] The number of items in the order.
  attribute(:quantity, Integer, from: "Quantity")

  # @return [String] The selling partner identifier.
  attribute(:seller_id, String, from: "SellerId")

  # @return [String] The seller-specific SKU identifier for an item.
  attribute(:seller_sku, String, from: "SellerSKU")

  # @return [String] The unique identifier of the supply source.
  attribute(:supply_source_id, String, from: "SupplySourceId")
end

Class Method Summary collapse

Class Method Details

.parse(hash) ⇒ Object



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

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