Module: Peddler::Notifications::B2BAnyOfferChanged

Defined in:
lib/peddler/notifications/b2b_any_offer_changed.rb,
lib/peddler/notifications/b2b_any_offer_changed/offer.rb,
lib/peddler/notifications/b2b_any_offer_changed/payload.rb,
lib/peddler/notifications/b2b_any_offer_changed/summary.rb,
lib/peddler/notifications/b2b_any_offer_changed/ships_from.rb,
lib/peddler/notifications/b2b_any_offer_changed/offer_count.rb,
lib/peddler/notifications/b2b_any_offer_changed/lowest_price.rb,
lib/peddler/notifications/b2b_any_offer_changed/notification.rb,
lib/peddler/notifications/b2b_any_offer_changed/buy_box_price.rb,
lib/peddler/notifications/b2b_any_offer_changed/shipping_time.rb,
lib/peddler/notifications/b2b_any_offer_changed/prime_information.rb,
lib/peddler/notifications/b2b_any_offer_changed/offer_change_trigger.rb,
lib/peddler/notifications/b2b_any_offer_changed/notification_metadata.rb,
lib/peddler/notifications/b2b_any_offer_changed/seller_feedback_rating.rb,
lib/peddler/notifications/b2b_any_offer_changed/quantity_discount_price_type.rb,
lib/peddler/notifications/b2b_any_offer_changed/b2b_any_offer_changed_notification.rb

Constant Summary collapse

Offer =
Structure.new do
  # @return [:boolean] True when fulfilled by Amazon.
  attribute(:fulfilled_by_amazon, :boolean, from: "isFulfilledByAmazon")

  # @return [Money]
  attribute(:listing_price, Money, from: "listingPrice")

  # @return [String] The seller identifier for the offer.
  attribute(:seller_id, String, from: "sellerId")

  # @return [Money]
  attribute(:shipping, Money)

  # @return [String]
  attribute(:shipping_time, String, from: "shippingTime")

  # @return [String] The subcondition of the item.
  attribute(:sub_condition, String, from: "subCondition")

  # @return [String] Information about the condition of the item.
  attribute?(:condition_notes, String, from: "conditionNotes")

  # @return [:boolean] True when the offer is currently in the Buy Box. There can be up to two Buy Box winners at
  # any time per ASIN, one that is eligible for Prime and one that is not eligible for Prime.
  attribute?(:buy_box_winner, :boolean, from: "isBuyBoxWinner")

  # @return [:boolean] True when the seller of the item is eligible to win the Buy Box.
  attribute?(:featured_merchant, :boolean, from: "isFeaturedMerchant")

  # @return [Array<QuantityDiscountPriceType>] Contains a list of pricing information that includes special
  # pricing when buying in bulk.
  attribute?(:quantity_discount_price, [QuantityDiscountPriceType], from: "quantityDiscountPrice")

  # @return [String]
  attribute?(:seller_feedback_rating, String, from: "sellerFeedbackRating")

  # @return [String]
  attribute?(:ships_from, String, from: "shipsFrom")
end
Payload =

Notification payload that wraps nested notification data

Structure.new do
  # @return [B2BAnyOfferChangedNotification]
  attribute(:b2b_any_offer_changed_notification, B2BAnyOfferChangedNotification, from: "b2bAnyOfferChangedNotification")
end
Summary =
Structure.new do
  # @return [Array<OfferCount>] A list that contains the total number of B2B offers that are eligible for the Buy
  # Box for the given conditions and fulfillment channels.
  attribute(:buy_box_eligible_offers, [OfferCount], from: "buyBoxEligibleOffers")

  # @return [Array<BuyBoxPrice>] A list that contains the Buy Box price of the item for the given conditions,
  # quantity tiers, and discount types.
  attribute(:buy_box_prices, [BuyBoxPrice], from: "buyBoxPrices")

  # @return [Array<LowestPrice>] A list that contains the lowest prices of the item for the given conditions,
  # fulfillment channels, quantity tiers, and discount types.
  attribute(:lowest_prices, [LowestPrice], from: "lowestPrices")

  # @return [Array<OfferCount>] A list that contains the total number of B2B offers for the item for the given
  # conditions and fulfillment channels.
  attribute(:number_of_offers, [OfferCount], from: "numberOfOffers")
end
ShipsFrom =
Structure.new do
  # @return [String]
  attribute(:country, String)
end
OfferCount =
Structure.new do
  # @return [String]
  attribute(:condition, String)

  # @return [String]
  attribute(:fulfillment_channel, String, from: "fulfillmentChannel")

  # @return [Integer] The total number of offers for the specified condition and fulfillment channel.
  attribute(:offer_count, Integer, from: "offerCount")
end
LowestPrice =
Structure.new do
  # @return [String]
  attribute(:condition, String)

  # @return [String]
  attribute(:fulfillment_channel, String, from: "fulfillmentChannel")

  # @return [Money]
  attribute(:listing_price, Money, from: "listingPrice")

  # @return [String]
  attribute(:offer_type, String, from: "offerType")

  # @return [String]
  attribute(:quantity_tier, String, from: "quantityTier")

  # @return [String]
  attribute?(:discount_type, String, from: "discountType")

  # @return [Money]
  attribute?(:landed_price, Money, from: "landedPrice")

  # @return [Money]
  attribute?(:shipping, Money)
end
Notification =

Notification envelope with metadata

Structure.new do
  # @return [String] The date and time in ISO 8601 format in UTC time that the event which triggered the
  # notification occurred.
  attribute(:event_time, String, from: "eventTime")

  # @return [String]
  attribute(:notification_metadata, String, from: "notificationMetadata")

  # @return [String] The notification type. Combined with the payload version this controls the structure of the
  # payload object.
  attribute(:notification_type, String, from: "notificationType")

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

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

  # @return [String] The payload version. Combined with the notification type this controls the structure of the
  # payload object.
  attribute(:payload_version, String, from: "payloadVersion")
end
BuyBoxPrice =
Structure.new do
  # @return [String]
  attribute(:condition, String)

  # @return [Money]
  attribute(:listing_price, Money, from: "listingPrice")

  # @return [String]
  attribute(:offer_type, String, from: "offerType")

  # @return [String]
  attribute(:quantity_tier, String, from: "quantityTier")

  # @return [String]
  attribute?(:discount_type, String, from: "discountType")

  # @return [Money]
  attribute?(:landed_price, Money, from: "landedPrice")

  # @return [String] The seller identifier for the offer.
  attribute?(:seller_id, String, from: "sellerId")

  # @return [Money]
  attribute?(:shipping, Money)
end
ShippingTime =
Structure.new do
  # @return [String] Indicates whether the item is available for shipping now, or on a known or unknown date in
  # the future.
  attribute?(:availability_type, String, from: "availabilityType")

  # @return [String] The date when the item will be available for shipping. Only displayed for items that are not
  # currently available for shipping.
  attribute?(:available_date, String, from: "availableDate")

  # @return [Integer] The maximum time, in hours, that the item will likely be shipped after the order has been
  # placed.
  attribute?(:maximum_hours, Integer, from: "maximumHours")

  # @return [Integer] The minimum time, in hours, that the item will likely be shipped after the order has been
  # placed.
  attribute?(:minimum_hours, Integer, from: "minimumHours")
end
PrimeInformation =
Structure.new do
  # @return [:boolean] Indicates whether the offer is an Amazon Prime offer throughout the entire marketplace
  # where it is listed.
  attribute(:offer_national_prime, :boolean, from: "isOfferNationalPrime")

  # @return [:boolean] Indicates whether the offer is an Amazon Prime offer.
  attribute(:offer_prime, :boolean, from: "isOfferPrime")
end
OfferChangeTrigger =

The event that caused the notification to be sent.

Structure.new do
  # @return [String] The ASIN for the item that had an offer change.
  attribute(:asin, String)

  # @return [String] The condition of the item that had an offer change.
  attribute(:item_condition, String, from: "itemCondition")

  # @return [String] The marketplace identifier of the item that had an offer change.
  attribute(:marketplace_id, String, from: "marketplaceId")

  # @return [String] The update time for the offer that caused this notification.
  attribute(:time_of_offer_change, String, from: "timeOfOfferChange")
end
NotificationMetadata =
Structure.new do
  # @return [String] The identifier for the application that uses the notifications.
  attribute(:application_id, String, from: "applicationId")

  # @return [String] A unique identifier for this notification instance.
  attribute(:notification_id, String, from: "notificationId")

  # @return [String] The date and time in ISO 8601 format in UTC time that the notification was sent.
  attribute(:publish_time, String, from: "publishTime")

  # @return [String] A unique identifier for the subscription which resulted in this notification.
  attribute(:subscription_id, String, from: "subscriptionId")
end
SellerFeedbackRating =
Structure.new do
  # @return [Integer] The count of feedback received about the seller.
  attribute(:feedback_count, Integer, from: "feedbackCount")

  # @return [Float] The percentage of positive feedback for the seller in the past 365 days.
  attribute(:seller_positive_feedback_rating, Float, from: "sellerPositiveFeedbackRating")
end
QuantityDiscountPriceType =

Contains pricing information that includes special pricing when buying in bulk.

Structure.new do
  # @return [Money] The price at this quantity tier.
  attribute(:listing_price, Money, from: "listingPrice")

  # @return [String] Indicates the type of quantity discount this price applies to.
  attribute(:quantity_discount_type, String, from: "quantityDiscountType")

  # @return [Integer] Indicates at what quantity this price becomes active.
  attribute(:quantity_tier, Integer, from: "quantityTier")
end
B2BAnyOfferChangedNotification =
Structure.new do
  # @return [String]
  attribute(:offer_change_trigger, String, from: "offerChangeTrigger")

  # @return [Array<Offer>] The top 20 competitive B2B offers for the item and condition that triggered the
  # notification.
  attribute(:offers, [Offer])

  # @return [String] The seller identifier for the offer.
  attribute(:seller_id, String, from: "sellerId")

  # @return [String]
  attribute(:summary, String)
end

Class Method Summary collapse

Class Method Details

.parse(hash) ⇒ Object



9
10
11
# File 'lib/peddler/notifications/b2b_any_offer_changed.rb', line 9

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