Module: Peddler::Notifications::FulfillmentOrderStatus

Defined in:
lib/peddler/notifications/fulfillment_order_status.rb,
lib/peddler/notifications/fulfillment_order_status/payload.rb,
lib/peddler/notifications/fulfillment_order_status/notification.rb,
lib/peddler/notifications/fulfillment_order_status/fulfillment_shipment.rb,
lib/peddler/notifications/fulfillment_order_status/fulfillment_return_item.rb,
lib/peddler/notifications/fulfillment_order_status/fulfillment_shipment_package.rb,
lib/peddler/notifications/fulfillment_order_status/fulfillment_order_status_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 [FulfillmentOrderStatusNotification]
  attribute(:fulfillment_order_status_notification, FulfillmentOrderStatusNotification, from: "FulfillmentOrderStatusNotification")
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
FulfillmentShipment =
Structure.new do
  # @return [String]
  attribute(:amazon_shipment_id, String, from: "AmazonShipmentId")

  # @return [String]
  attribute(:estimated_arrival_date_time, String, from: "EstimatedArrivalDateTime")

  # @return [Array]
  attribute(:fulfillment_shipment_packages, Array, from: "FulfillmentShipmentPackages")

  # @return [String]
  attribute(:fulfillment_shipment_status, String, from: "FulfillmentShipmentStatus")
end
FulfillmentReturnItem =
Structure.new do
  # @return [String]
  attribute(:received_date_time, String, from: "ReceivedDateTime")

  # @return [Integer]
  attribute(:returned_quantity, Integer, from: "ReturnedQuantity")

  # @return [String]
  attribute(:seller_sku, String, from: "SellerSKU")
end
FulfillmentShipmentPackage =
Structure.new do
  # @return [String]
  attribute(:carrier_code, String, from: "CarrierCode")

  # @return [Integer]
  attribute(:package_number, Integer, from: "PackageNumber")

  # @return [String]
  attribute(:tracking_number, String, from: "TrackingNumber")
end
FulfillmentOrderStatusNotification =

Nested notification data

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

  # @return [String]
  attribute(:fulfillment_order_status, String, from: "FulfillmentOrderStatus")

  # @return [FulfillmentReturnItem]
  attribute(:fulfillment_return_item, FulfillmentReturnItem, from: "FulfillmentReturnItem")

  # @return [FulfillmentShipment]
  attribute(:fulfillment_shipment, FulfillmentShipment, from: "FulfillmentShipment")

  # @return [String]
  attribute(:seller_fulfillment_order_id, String, from: "SellerFulfillmentOrderId")

  # @return [String]
  attribute(:seller_id, String, from: "SellerId")

  # @return [String]
  attribute(:status_updated_date_time, String, from: "StatusUpdatedDateTime")
end

Class Method Summary collapse

Class Method Details

.parse(hash) ⇒ Object



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

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