Module: Peddler::Feeds::ListingsFeedSchema

Defined in:
lib/peddler/feeds/listings_feed_schema.rb,
lib/peddler/feeds/listings_feed_schema/feed.rb,
lib/peddler/feeds/listings_feed_schema/patch.rb,
lib/peddler/feeds/listings_feed_schema/header.rb,
lib/peddler/feeds/listings_feed_schema/report.rb,
lib/peddler/feeds/listings_feed_schema/message.rb

Overview

Selling Partner Listings Feed (v2)

Constant Summary collapse

Feed =

Selling Partner Listings Feed (v2)

Structure.new do
  # @return [Header] Header information about the feed submission.
  attribute(:header, Header)

  # @return [Array<Message>] Messages containing listings data submissions for the Selling Partner.
  attribute(:messages, [Message])
end
Patch =

Individual JSON Patch operation.

Structure.new do
  # @return [String] Type of JSON Patch operation. Supported JSON Patch operations include add, replace, merge,
  # and delete. See https://tools.ietf.org/html/rfc6902.
  attribute(:op, String)

  # @return [String] JSON Pointer path of the attribute to patch. See https://tools.ietf.org/html/rfc6902.
  attribute(:path, String)

  # @return [Array<Object>] JSON value to add, replace, or delete.
  attribute?(:value, Array)
end
Header =

Header information about the feed submission.

Structure.new do
  # @return [String] Identifier for the Selling Partner, such as the Merchant Account or Vendor Code.
  attribute(:seller_id, String, from: "sellerId")

  # @return [String] Version of the JSON Selling Partner Listings Feeds specification used for the feed
  # submission.
  attribute(:version, String)

  # @return [String] Locale for issue localization. When not provided, the default language code of the first
  # marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". Localized messages default to "en_US" when a
  # localization is not available in the specified locale.
  attribute?(:issue_locale, String, from: "issueLocale")

  # @return [Report] The report information for the feed submission.
  attribute?(:report, Report)
end
Report =

The report information for the feed submission.

Structure.new do
  # @return [String] The version of the Selling Partner Listings Items API to use to retrieve the listing items.
  attribute(:api_version, String, from: "apiVersion")

  # @return [Array<String>] When "includedData" elements are in the feed submission, the processing report that
  # generates for the feed submission includes the listings items output from the Selling Partner Listings Items
  # API with the "includedData" elements from the request. The report includes issues that prevent the acceptance
  # of messages regardless of the "includedData" elements in the feed request.
  attribute(:included_data, [String], from: "includedData")
end
Message =

Message containing an individual listings data submission.

Structure.new do
  # @return [Integer] Identifier for the message that is unique within this feed submission. Response messages are
  # correlated to this identifier.
  attribute(:message_id, Integer, from: "messageId")

  # @return [String] Type of operation to perform for the listings data submission in this message. "UPDATE"
  # indicates the full set of item attributes are provided and any existing attributes data will be replaced with
  # the provided attributes. "PARTIAL_UPDATE" indicates only the provided item attributes will be updated with the
  # provided attribute data. "PATCH" indicates the provided JSON Patch operations will be used to update the
  # applicable attributes. "DELETE" indicates the listings item will be deleted. "PARTIAL_UPDATE" is equivalent to
  # using "PATCH" with the "replace" op.
  attribute(:operation_type, String, from: "operationType")

  # @return [String] Selling Partner SKU (stock keeping unit) identifier for the listing. SKU uniquely identifies
  # a listing for a Selling Partner.
  attribute(:sku, String)

  # @return [Hash] Attributes data for the listings data submission.
  attribute?(:attributes, Hash)

  # @return [Array<Patch>] Attributes data in the form of JSON Patch operations to update or delete.
  attribute?(:patches, [Patch])

  # @return [String] Amazon product type of the listings data submission in this message.
  attribute?(:product_type, String, from: "productType")

  # @return [String] Name of the requirements type for the listings data submission in this message. "LISTING"
  # indicates requirements inclusive of product facts and sales terms. "LISTING_PRODUCT_ONLY" indicates
  # requirements inclusive of product facts only. "LISTING_OFFER_ONLY" indicates requirements inclusive of sales
  # terms only.
  attribute?(:requirements, String)
end

Class Method Summary collapse

Class Method Details

.parse(hash) ⇒ Object



12
13
14
# File 'lib/peddler/feeds/listings_feed_schema.rb', line 12

def parse(hash)
  Feed.parse(hash)
end