Skip to content

Commit

Permalink
Regenerate code
Browse files Browse the repository at this point in the history
Mostly updates to documentation, some changes to rate limits, plus one removed method I spotted in ListingsItems
  • Loading branch information
hakanensari committed Dec 13, 2024
1 parent 771da29 commit 689dff9
Show file tree
Hide file tree
Showing 21 changed files with 108 additions and 156 deletions.
2 changes: 1 addition & 1 deletion lib/peddler/apis/catalog_items_2022_04_01.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def catalog_items_2022_04_01(...)
end

module APIs
# Selling Partner API for Catalog Items
# Catalog Items v2022-04-01
#
# The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon
# catalog. For more information, refer to the
Expand Down
27 changes: 13 additions & 14 deletions lib/peddler/apis/easy_ship_2022_03_23.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,19 @@ def update_scheduled_packages(update_scheduled_packages_request: nil, rate_limit
meter(rate_limit).patch(path, body:)
end

# This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the
# associated shipping labels, along with other compliance documents according to the marketplace (refer to the
# {https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table
# marketplace document support table}). Developers calling this operation may optionally assign a `packageDetails`
# object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will
# try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time
# slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label's file
# format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly.
# This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file
# containing the generated shipping labels and the other documents enabled for your marketplace. If at least an
# order couldn't be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an
# entry for each order we couldn't process. Each entry is composed of an error message describing the reason of
# the failure, so that sellers can take action. The table below displays the supported request and burst maximum
# rates:
# This operation automatically schedules a time slot for all specified `amazonOrderId` values and generates the
# associated shipping labels and compliance documents based on the marketplace. For more information, refer to the
# [marketplace support
# table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).
# You can optionally assign a `packageDetails` object to input a preferred time slot for each order in your
# request. In such cases, Amazon schedules the respective packages using the specified optional settings. If you
# don't specify a time slot, Amazon assigns the earliest available time slot. You can choose PDF or ZPL for your
# shipping label's file format and Amazon creates the label accordingly. This operation returns an array that
# contains the scheduled packages, and a temporary URL that you can use to access a ZIP file. The ZIP file
# includes the generated shipping labels and any other documents that are required for your marketplace. If an
# order can't be scheduled, Amazon adds the `rejectedOrders` list in the response. The response contains an entry
# for each order that could not be processed. Each entry contains an error message that describes the reason for
# the failure. The following table contains the supported request and burst maximum rates:
#
# @note This operation can make a static sandbox call.
# @param create_scheduled_packages_request [Hash] The request schema for the `createScheduledPackageBulk`
Expand Down
2 changes: 1 addition & 1 deletion lib/peddler/apis/feeds_2021_06_30.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def feeds_2021_06_30(...)
end

module APIs
# Selling Partner API for Feeds
# Feeds v2021-06-30
#
# The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner.
class Feeds20210630 < API
Expand Down
95 changes: 41 additions & 54 deletions lib/peddler/apis/finances_v0.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,26 @@ def finances_v0(...)
module APIs
# Selling Partner API for Finances
#
# The Selling Partner API for Finances provides financial information that is relevant to a seller's business. You
# The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You
# can obtain financial events for a given order, financial event group, or date range without having to wait until a
# statement period closes. You can also obtain financial event groups for a given date range.
class FinancesV0 < API
# Returns financial event groups for a given date range. Orders from the last 48 hours might not be included in
# Returns financial event groups for a given date range. It may take up to 48 hours for orders to appear in your
# financial events.
#
# @note This operation can make a static sandbox call.
# @param max_results_per_page [Integer] The maximum number of results per page. If the response exceeds the
# maximum number of transactions or 10 MB, the response is `InvalidInput`.
# @param financial_event_group_started_before [String] A date that selects financial event groups that opened
# before (but not at) a specified date and time, in [ISO
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. The date-time must be after
# `FinancialEventGroupStartedAfter` and more than two minutes before the time of request. If
# `FinancialEventGroupStartedAfter` and `FinancialEventGroupStartedBefore` are more than 180 days apart, no
# @param max_results_per_page [Integer] The maximum number of results to return per page. If the response exceeds
# the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'.
# @param financial_event_group_started_before [String] A date used for selecting financial event groups that
# opened before (but not at) a specified date and time, in [ISO
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. The date-time must be later than
# FinancialEventGroupStartedAfter and no later than two minutes before the request was submitted. If
# FinancialEventGroupStartedAfter and FinancialEventGroupStartedBefore are more than 180 days apart, no
# financial event groups are returned.
# @param financial_event_group_started_after [String] A date that selects financial event groups that opened after
# (or at) a specified date and time, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
# format. The date-time must be more than two minutes before you submit the request.
# @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
# `pageSize` value. To get the next page of results, call the operation with this token and include the same
# arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
# is null. Note that this operation can return empty pages.
# @param financial_event_group_started_after [String] A date used for selecting financial event groups that opened
# after (or at) a specified date and time, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601)
# format. The date-time must be no later than two minutes before the request was submitted.
# @param next_token [String] A string token returned in the response of your previous request.
# @param rate_limit [Float] Requests per second
# @return [Peddler::Response] The API response
def list_financial_event_groups(max_results_per_page: 10, financial_event_group_started_before: nil,
Expand All @@ -50,27 +47,24 @@ def list_financial_event_groups(max_results_per_page: 10, financial_event_group_
meter(rate_limit).get(path, params:)
end

# Returns all financial events for the specified financial event group. Orders from the last 48 hours might not be
# included in financial events. **Note:** This operation only retrieves a group's data for the past two years. A
# request for data spanning more than two years produces an empty response.
# Returns all financial events for the specified financial event group. It may take up to 48 hours for orders to
# appear in your financial events. **Note:** This operation will only retrieve group's data for the past two
# years. If a request is submitted for data spanning more than two years, an empty response is returned.
#
# @note This operation can make a static sandbox call.
# @param max_results_per_page [Integer] The maximum number of results to return per page. If the response exceeds
# the maximum number of transactions or 10 MB, the response is `InvalidInput`.
# @param posted_after [String] The response includes financial events posted after (or on) this date. This date
# must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time
# must be more than two minutes before the time of the request.
# @param posted_before [String] The response includes financial events posted before (but not on) this date. This
# date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The
# date-time must be later than `PostedAfter` and more than two minutes before the requestd was submitted. If
# `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. If you include the
# `PostedBefore` parameter in your request, you must also specify the `PostedAfter` parameter. **Default:** Two
# minutes before the time of the request.
# the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'.
# @param posted_after [String] A date used for selecting financial events posted after (or at) a specified time.
# The date-time **must** be more than two minutes before the time of the request, in [ISO
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format.
# @param posted_before [String] A date used for selecting financial events posted before (but not at) a specified
# time. The date-time must be later than `PostedAfter` and no later than two minutes before the request was
# submitted, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. If
# `PostedAfter` and `PostedBefore` are more than 180 days apart, no financial events are returned. You must
# specify the `PostedAfter` parameter if you specify the `PostedBefore` parameter. Default: Now minus two
# minutes.
# @param event_group_id [String] The identifier of the financial event group to which the events belong.
# @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
# `pageSize` value. To get the next page of results, call the operation with this token and include the same
# arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
# is null. Note that this operation can return empty pages.
# @param next_token [String] A string token returned in the response of your previous request.
# @param rate_limit [Float] Requests per second
# @return [Peddler::Response] The API response
def list_financial_events_by_group_id(event_group_id, max_results_per_page: 100, posted_after: nil,
Expand All @@ -86,17 +80,14 @@ def list_financial_events_by_group_id(event_group_id, max_results_per_page: 100,
meter(rate_limit).get(path, params:)
end

# Returns all financial events for the specified order. Orders from the last 48 hours might not be included in
# Returns all financial events for the specified order. It may take up to 48 hours for orders to appear in your
# financial events.
#
# @note This operation can make a static sandbox call.
# @param order_id [String] An Amazon-defined order identifier, in 3-7-7 format.
# @param max_results_per_page [Integer] The maximum number of results to return per page. If the response exceeds
# the maximum number of transactions or 10 MB, the response is `InvalidInput`.
# @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
# `pageSize` value. To get the next page of results, call the operation with this token and include the same
# arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
# is null. Note that this operation can return empty pages.
# the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'.
# @param next_token [String] A string token returned in the response of your previous request.
# @param rate_limit [Float] Requests per second
# @return [Peddler::Response] The API response
def list_financial_events_by_order_id(order_id, max_results_per_page: 100, next_token: nil, rate_limit: 0.5)
Expand All @@ -109,26 +100,22 @@ def list_financial_events_by_order_id(order_id, max_results_per_page: 100, next_
meter(rate_limit).get(path, params:)
end

# Returns financial events for the specified data range. Orders from the last 48 hours might not be included in
# Returns financial events for the specified data range. It may take up to 48 hours for orders to appear in your
# financial events. **Note:** in `ListFinancialEvents`, deferred events don't show up in responses until in they
# are released.
#
# @note This operation can make a static sandbox call.
# @param max_results_per_page [Integer] The maximum number of results to return per page. If the response exceeds
# the maximum number of transactions or 10 MB, the response is `InvalidInput`.
# @param posted_after [String] The response includes financial events posted after (or on) this date. This date
# must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time
# must be more than two minutes before the time of the request.
# @param posted_before [String] The response includes financial events posted before (but not on) this date. This
# date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The
# date-time must be later than `PostedAfter` and more than two minutes before the request was submitted. If
# `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. If you include the
# `PostedBefore` parameter in your request, you must also specify the `PostedAfter` parameter. **Default:** Two
# minutes before the time of the request.
# @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
# `pageSize` value. To get the next page of results, call the operation with this token and include the same
# arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
# is null. Note that this operation can return empty pages.
# the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'.
# @param posted_after [String] A date used for selecting financial events posted after (or at) a specified time.
# The date-time must be no later than two minutes before the request was submitted, in [ISO
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format.
# @param posted_before [String] A date used for selecting financial events posted before (but not at) a specified
# time. The date-time must be later than PostedAfter and no later than two minutes before the request was
# submitted, in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. If
# PostedAfter and PostedBefore are more than 180 days apart, no financial events are returned. You must specify
# the PostedAfter parameter if you specify the PostedBefore parameter. Default: Now minus two minutes.
# @param next_token [String] A string token returned in the response of your previous request.
# @param rate_limit [Float] Requests per second
# @return [Peddler::Response] The API response
def list_financial_events(max_results_per_page: 100, posted_after: nil, posted_before: nil, next_token: nil,
Expand Down
2 changes: 1 addition & 1 deletion lib/peddler/apis/fulfillment_inbound_2024_03_20.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def fulfillment_inbound_2024_03_20(...)
end

module APIs
# The Selling Partner API for FBA inbound operations.
# Fulfillment Inbound v2024-03-20
#
# The Selling Partner API for Fulfillment By Amazon (FBA) Inbound. The FBA Inbound API enables building inbound
# workflows to create, manage, and send shipments into Amazon's fulfillment network. The API has interoperability
Expand Down
36 changes: 1 addition & 35 deletions lib/peddler/apis/listings_items_2021_08_01.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def listings_items_2021_08_01(...)
end

module APIs
# Selling Partner API for Listings Items
# Listings Items v2021-08-01
#
# The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner
# listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which
Expand Down Expand Up @@ -131,40 +131,6 @@ def put_listings_item(seller_id, sku, marketplace_ids, body, included_data: ["is

meter(rate_limit).put(path, body:, params:)
end

# Search for and return list of listings items and respective details for a selling partner.
#
# @note This operation can make a static sandbox call.
# @param seller_id [String] A selling partner identifier, such as a merchant account or vendor code.
# @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers for the request.
# @param identifiers [Array<String>] A comma-delimited list of product identifiers to search for listings items
# by. **Note**: 1. Required when `identifiersType` is provided.
# @param identifiers_type [String] Type of product identifiers to search for listings items by. **Note**: 1.
# Required when `identifiers` is provided.
# @param page_size [Integer] Number of results to be returned per page.
# @param page_token [String] A token to fetch a certain page when there are multiple pages worth of results.
# @param included_data [Array<String>] A comma-delimited list of data sets to include in the response. Default:
# summaries.
# @param issue_locale [String] A locale for localization of issues. 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.
# @param rate_limit [Float] Requests per second
# @return [Peddler::Response] The API response
def search_listings_items(seller_id, marketplace_ids, identifiers: nil, identifiers_type: nil, page_size: 10,
page_token: nil, included_data: ["summaries"], issue_locale: nil, rate_limit: 5.0)
path = "/listings/2021-08-01/items/#{seller_id}"
params = {
"marketplaceIds" => marketplace_ids,
"identifiers" => identifiers,
"identifiersType" => identifiers_type,
"pageSize" => page_size,
"pageToken" => page_token,
"includedData" => included_data,
"issueLocale" => issue_locale,
}.compact

meter(rate_limit).get(path, params:)
end
end
end
end
Loading

0 comments on commit 689dff9

Please sign in to comment.