Module: Peddler::Notifications::ProductTypeDefinitionsChange

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

Overview

The root schema

The root schema comprises the entire JSON document.

Constant Summary collapse

Payload =

Notification payload data

Structure.new do
  # @return [String] The Merchant Id or Vendor Group Id related to the subscription.
  attribute(:account_id, String, from: "AccountId")

  # @return [String] Provides the latest released Product Type Definition version.
  attribute(:product_type_version, String, from: "ProductTypeVersion")

  # @return [String] The marketplace where the Product Type Definition has changed
  attribute?(:marketplace_id, String, from: "MarketplaceId")

  # @return [Array] List of new Product Types release in the marketplace.
  attribute?(:new_product_types, Array, from: "NewProductTypes")
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

Class Method Summary collapse

Class Method Details

.parse(hash) ⇒ Object



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

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