peddler 5.4.0 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -1
  3. data/lib/peddler/api.rb +28 -4
  4. data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/order_attribute.rb +20 -0
  5. data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/outbound_execution_error.rb +24 -0
  6. data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/outbound_listing.rb +24 -0
  7. data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/outbound_order.rb +60 -0
  8. data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/outbound_order_creation_data.rb +23 -0
  9. data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/outbound_order_reference.rb +18 -0
  10. data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/outbound_shipment.rb +43 -0
  11. data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09/shipment_label_page_types.rb +20 -0
  12. data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb +100 -0
  13. data/lib/peddler/apis/listings_restrictions_2021_08_01/restriction_list.rb +1 -1
  14. data/lib/peddler/apis/listings_restrictions_2021_08_01.rb +4 -1
  15. data/lib/peddler/apis/notifications_v1/aggregation_filter.rb +2 -2
  16. data/lib/peddler/apis/notifications_v1/destination.rb +1 -1
  17. data/lib/peddler/apis/notifications_v1/event_bridge_resource.rb +2 -2
  18. data/lib/peddler/apis/notifications_v1/event_filter.rb +6 -6
  19. data/lib/peddler/apis/notifications_v1/marketplace_filter.rb +1 -1
  20. data/lib/peddler/apis/notifications_v1/marketplace_ids.rb +2 -2
  21. data/lib/peddler/apis/notifications_v1/order_change_type_filter.rb +2 -1
  22. data/lib/peddler/apis/notifications_v1/order_change_types.rb +2 -2
  23. data/lib/peddler/apis/notifications_v1/processing_directive.rb +18 -7
  24. data/lib/peddler/apis/notifications_v1/send_test_notification_request.rb +20 -0
  25. data/lib/peddler/apis/notifications_v1/send_test_notification_response.rb +20 -0
  26. data/lib/peddler/apis/notifications_v1/test_notification.rb +22 -0
  27. data/lib/peddler/apis/notifications_v1.rb +45 -17
  28. data/lib/peddler/apis/orders_2026_01_01/fulfillment_order.rb +19 -0
  29. data/lib/peddler/apis/orders_2026_01_01/item_proceeds_breakdown.rb +5 -5
  30. data/lib/peddler/apis/orders_2026_01_01/order.rb +5 -0
  31. data/lib/peddler/apis/orders_2026_01_01/order_proceeds.rb +5 -0
  32. data/lib/peddler/apis/orders_2026_01_01/order_proceeds_breakdown.rb +30 -0
  33. data/lib/peddler/apis/orders_v0/approved_alternative_details.rb +20 -0
  34. data/lib/peddler/apis/orders_v0/approved_attribute.rb +23 -0
  35. data/lib/peddler/apis/orders_v0/interim_status_detail.rb +24 -0
  36. data/lib/peddler/apis/orders_v0/regulated_order_verification_status.rb +5 -0
  37. data/lib/peddler/apis/orders_v0/valid_interim_status_code.rb +21 -0
  38. data/lib/peddler/apis/orders_v0/valid_verification_detail.rb +2 -1
  39. data/lib/peddler/apis/orders_v0/verification_details.rb +8 -0
  40. data/lib/peddler/apis/product_type_definitions_2020_09_01/error_list.rb +1 -1
  41. data/lib/peddler/apis/product_type_definitions_2020_09_01/product_type.rb +1 -1
  42. data/lib/peddler/apis/product_type_definitions_2020_09_01/product_type_list.rb +1 -1
  43. data/lib/peddler/apis/product_type_definitions_2020_09_01/schema_link.rb +2 -1
  44. data/lib/peddler/apis/product_type_definitions_2020_09_01.rb +12 -8
  45. data/lib/peddler/apis/replenishment_2022_11_07/get_selling_partner_metrics_request.rb +5 -0
  46. data/lib/peddler/apis/replenishment_2022_11_07/get_selling_partner_metrics_request_filters.rb +48 -0
  47. data/lib/peddler/apis/replenishment_2022_11_07/get_selling_partner_metrics_response_metric.rb +9 -9
  48. data/lib/peddler/apis/replenishment_2022_11_07/list_offer_metrics_request.rb +2 -2
  49. data/lib/peddler/apis/replenishment_2022_11_07/list_offer_metrics_request_filters.rb +16 -3
  50. data/lib/peddler/apis/replenishment_2022_11_07/list_offer_metrics_response_offer.rb +8 -1
  51. data/lib/peddler/apis/replenishment_2022_11_07/list_offers_request.rb +2 -2
  52. data/lib/peddler/apis/replenishment_2022_11_07/list_offers_request_filters.rb +2 -2
  53. data/lib/peddler/apis/replenishment_2022_11_07/time_interval.rb +10 -6
  54. data/lib/peddler/apis/services_v1/associated_item.rb +3 -0
  55. data/lib/peddler/apis/services_v1/linked_asset.rb +24 -0
  56. data/lib/peddler/apis/services_v1/service_job.rb +6 -0
  57. data/lib/peddler/apis/services_v1.rb +10 -4
  58. data/lib/peddler/apis/uploads_2020_11_01.rb +1 -1
  59. data/lib/peddler/notifications/order_change/notification.rb +4 -3
  60. data/lib/peddler/notifications/order_change/order_change_notification.rb +2 -2
  61. data/lib/peddler/notifications/order_change/order_change_trigger.rb +4 -4
  62. data/lib/peddler/notifications/order_change/order_item.rb +7 -7
  63. data/lib/peddler/notifications/order_change/summary.rb +17 -17
  64. data/lib/peddler/version.rb +1 -1
  65. data/sig/peddler/api.rbs +2 -0
  66. data/sig/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rbs +167 -0
  67. data/sig/peddler/apis/listings_restrictions_2021_08_01.rbs +1 -1
  68. data/sig/peddler/apis/notifications_v1.rbs +61 -7
  69. data/sig/peddler/apis/orders_2026_01_01.rbs +59 -23
  70. data/sig/peddler/apis/orders_v0.rbs +73 -14
  71. data/sig/peddler/apis/product_type_definitions_2020_09_01.rbs +1 -1
  72. data/sig/peddler/apis/replenishment_2022_11_07.rbs +48 -21
  73. data/sig/peddler/apis/services_v1.rbs +36 -15
  74. metadata +21 -2
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is generated. Do not edit.
4
+
5
+ require "structure"
6
+
7
+ module Peddler
8
+ module APIs
9
+ class NotificationsV1
10
+ # The response schema for the `sendTestNotification` operation.
11
+ SendTestNotificationResponse = Structure.new do
12
+ # @return [Array<Error>] One or more unexpected errors occurred during the `sendTestNotification` operation.
13
+ attribute?(:errors, [Error])
14
+
15
+ # @return [String] The payload for the `sendTestNotification` operation.
16
+ attribute?(:payload, String)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is generated. Do not edit.
4
+
5
+ require "structure"
6
+
7
+ module Peddler
8
+ module APIs
9
+ class NotificationsV1
10
+ # The describer for the test notification that will be delivered.
11
+ TestNotification = Structure.new do
12
+ # @return [String] The version of the payload object to be used in the notification.
13
+ attribute(:payload_version, String, null: false, from: "payloadVersion")
14
+
15
+ # @return [String] The scenario of the specified notification to be used in the notification payload. If
16
+ # testScenario is empty, a 400 response will be returned back to the developer. The scenarios supported for
17
+ # each notification type can be found in the Selling Partner API Developer Guide.
18
+ attribute?(:test_scenario, String, from: "testScenario")
19
+ end
20
+ end
21
+ end
22
+ end
@@ -16,14 +16,15 @@ module Peddler
16
16
  # @see https://github.com/amzn/selling-partner-api-models/blob/main/models/notifications-api-model/notifications.json
17
17
  class NotificationsV1 < API
18
18
  # Returns information about subscription of the specified notification type and payload version. `payloadVersion`
19
- # is an optional parameter. When `payloadVersion` is not provided, it will return latest payload version
20
- # subscription's information. You can use this API to get subscription information when you do not have a
19
+ # is an optional parameter. When you do not provide `payloadVersion`, the operation returns the latest payload
20
+ # version subscription's information. You can use this API to get subscription information when you do not have a
21
21
  # subscription identifier.
22
22
  #
23
23
  # @note This operation can make a static sandbox call.
24
- # @param payload_version [String] The version of the payload object to be used in the notification.
25
24
  # @param notification_type [String] The type of notification. For more information about notification types, refer
26
- # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
25
+ # to the [Notifications API v1 Use Case
26
+ # Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide).
27
+ # @param payload_version [String] The version of the payload object to be used in the notification.
27
28
  # @param rate_limit [Float] Requests per second
28
29
  # @return [Peddler::Response] The API response
29
30
  def get_subscription(notification_type, payload_version: nil, rate_limit: 1.0)
@@ -36,14 +37,15 @@ module Peddler
36
37
  end
37
38
 
38
39
  # Creates a subscription for the specified notification type to be delivered to the specified destination. Before
39
- # you can subscribe, you must first create the destination by calling the `createDestination` operation. In cases
40
- # where the specified notification type supports multiple payload versions, you can utilize this API to subscribe
40
+ # you can subscribe, you must first create the destination by calling the `createDestination` operation. If the
41
+ # notification type that you specify supports multiple payload versions, you can use this operation to subscribe
41
42
  # to a different payload version if you already have an existing subscription for a different payload version.
42
43
  #
43
44
  # @note This operation can make a static sandbox call.
44
- # @param body [Hash]
45
+ # @param body [Hash] The request schema for the `createSubscription` operation.
45
46
  # @param notification_type [String] The type of notification. For more information about notification types, refer
46
- # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
47
+ # to the [Notifications API v1 Use Case
48
+ # Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide).
47
49
  # @param rate_limit [Float] Requests per second
48
50
  # @return [Peddler::Response] The API response
49
51
  def create_subscription(body, notification_type, rate_limit: 1.0)
@@ -54,12 +56,14 @@ module Peddler
54
56
 
55
57
  # Returns information about a subscription for the specified notification type. The `getSubscriptionById`
56
58
  # operation is grantless. For more information, refer to [Grantless
57
- # operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations).
59
+ # Operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations) in the Selling Partner API
60
+ # Developer Guide.
58
61
  #
59
62
  # @note This operation can make a static sandbox call.
60
63
  # @param subscription_id [String] The identifier for the subscription that you want to get.
61
64
  # @param notification_type [String] The type of notification. For more information about notification types, refer
62
- # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
65
+ # to the [Notifications API v1 Use Case
66
+ # Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide).
63
67
  # @param rate_limit [Float] Requests per second
64
68
  # @return [Peddler::Response] The API response
65
69
  def get_subscription_by_id(subscription_id, notification_type, rate_limit: 1.0)
@@ -72,12 +76,14 @@ module Peddler
72
76
  # subscription identifier can be for any subscription associated with your application. After you successfully
73
77
  # call this operation, notifications will stop being sent for the associated subscription. The
74
78
  # `deleteSubscriptionById` operation is grantless. For more information, refer to [Grantless
75
- # operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations).
79
+ # Operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations) in the Selling Partner API
80
+ # Developer Guide.
76
81
  #
77
82
  # @note This operation can make a static sandbox call.
78
83
  # @param subscription_id [String] The identifier for the subscription that you want to delete.
79
84
  # @param notification_type [String] The type of notification. For more information about notification types, refer
80
- # to [Notification Type Values](https://developer-docs.amazon.com/sp-api/docs/notification-type-values).
85
+ # to the [Notifications API v1 Use Case
86
+ # Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide).
81
87
  # @param rate_limit [Float] Requests per second
82
88
  # @return [Peddler::Response] The API response
83
89
  def delete_subscription_by_id(subscription_id, notification_type, rate_limit: 1.0)
@@ -86,8 +92,27 @@ module Peddler
86
92
  delete(path, rate_limit:, parser:)
87
93
  end
88
94
 
95
+ # Sends a mock notification of the specified type to your SQS. The `sendTestNotification` API is grantless. For
96
+ # more information, see "Grantless operations" in the Selling Partner API Developer Guide.
97
+ #
98
+ # @note This operation can make a dynamic sandbox call.
99
+ # @param body [Hash] The request schema for the `sendTestNotification` operation.
100
+ # @param notification_type [String] The type of notification. For more information about notification types, refer
101
+ # to the [Notifications API v1 Use Case
102
+ # Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide).
103
+ # @param rate_limit [Float] Requests per second
104
+ # @return [Peddler::Response] The API response
105
+ def send_test_notification(body, notification_type, rate_limit: 1.0)
106
+ must_sandbox!
107
+
108
+ path = "/notifications/v1/subscriptions/#{percent_encode(notification_type)}/testNotification"
109
+ parser = -> { SendTestNotificationResponse }
110
+ post(path, body:, rate_limit:, parser:)
111
+ end
112
+
89
113
  # Returns information about all destinations. The `getDestinations` operation is grantless. For more information,
90
- # refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations).
114
+ # refer to [Grantless Operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations) in the
115
+ # Selling Partner API Developer Guide.
91
116
  #
92
117
  # @note This operation can make a static sandbox call.
93
118
  # @param rate_limit [Float] Requests per second
@@ -100,10 +125,11 @@ module Peddler
100
125
 
101
126
  # Creates a destination resource to receive notifications. The `createDestination` operation is grantless. For
102
127
  # more information, refer to [Grantless
103
- # operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations).
128
+ # Operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations) in the Selling Partner API
129
+ # Developer Guide.
104
130
  #
105
131
  # @note This operation can make a static sandbox call.
106
- # @param body [Hash]
132
+ # @param body [Hash] The request schema for the `createDestination` operation.
107
133
  # @param rate_limit [Float] Requests per second
108
134
  # @return [Peddler::Response] The API response
109
135
  def create_destination(body, rate_limit: 1.0)
@@ -114,7 +140,8 @@ module Peddler
114
140
 
115
141
  # Returns information about the destination that you specify. The `getDestination` operation is grantless. For
116
142
  # more information, refer to [Grantless
117
- # operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations).
143
+ # Operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations) in the Selling Partner API
144
+ # Developer Guide.
118
145
  #
119
146
  # @note This operation can make a static sandbox call.
120
147
  # @param destination_id [String] The identifier generated when you created the destination.
@@ -127,7 +154,8 @@ module Peddler
127
154
  end
128
155
 
129
156
  # Deletes the destination that you specify. The `deleteDestination` operation is grantless. For more information,
130
- # refer to [Grantless operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations).
157
+ # refer to [Grantless Operations](https://developer-docs.amazon.com/sp-api/docs/grantless-operations) in the
158
+ # Selling Partner API Developer Guide.
131
159
  #
132
160
  # @note This operation can make a static sandbox call.
133
161
  # @param destination_id [String] The identifier for the destination that you want to delete.
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is generated. Do not edit.
4
+
5
+ require "structure"
6
+
7
+ module Peddler
8
+ module APIs
9
+ class Orders20260101
10
+ # Information about a fulfillment order associated with a customer order. A fulfillment order represents a unit of
11
+ # fulfillment created by Amazon for the order. **Note:** Only available for EasyShip orders at present.
12
+ FulfillmentOrder = Structure.new do
13
+ # @return [String] The Fulfillment Order ID assigned by Amazon after fulfillment planning. This identifier is
14
+ # identical to the Shipment ID required by External Fulfillment APIs.
15
+ attribute(:fulfillment_order_id, String, null: false, from: "fulfillmentOrderId")
16
+ end
17
+ end
18
+ end
19
+ end
@@ -9,16 +9,16 @@ module Peddler
9
9
  class Orders20260101
10
10
  # Detailed proceeds breakdown for a specific order item.
11
11
  ItemProceedsBreakdown = Structure.new do
12
- # @return [Array<ItemProceedsDetailedBreakdown>] Further granular breakdown of the subtotal.
13
- attribute?(:detailed_breakdowns, [ItemProceedsDetailedBreakdown], from: "detailedBreakdowns")
14
-
15
12
  # @return [Money] Monetary amount for the proceeds breakdown.
16
- attribute?(:subtotal, Money)
13
+ attribute(:subtotal, Money, null: false)
17
14
 
18
15
  # @return [String] Category classification of the proceeds breakdown.
19
16
  #
20
17
  # **Possible values**: `ITEM`, `SHIPPING`, `GIFT_WRAP`, `COD_FEE`, `OTHER`, `TAX`, `DISCOUNT`
21
- attribute?(:type, String)
18
+ attribute(:type, String, null: false)
19
+
20
+ # @return [Array<ItemProceedsDetailedBreakdown>] Further granular breakdown of the subtotal.
21
+ attribute?(:detailed_breakdowns, [ItemProceedsDetailedBreakdown], from: "detailedBreakdowns")
22
22
  end
23
23
  end
24
24
  end
@@ -37,6 +37,11 @@ module Peddler
37
37
  # @return [OrderFulfillment] Information about how this order is being processed and shipped.
38
38
  attribute?(:fulfillment, OrderFulfillment)
39
39
 
40
+ # @return [Array<FulfillmentOrder>] The list of fulfillment orders associated with this customer order. Each
41
+ # entry corresponds to one fulfillment unit created by Amazon for this order. **Note:** Only available for
42
+ # EasyShip orders at present.
43
+ attribute?(:fulfillment_orders, [FulfillmentOrder], from: "fulfillmentOrders")
44
+
40
45
  # @return [Array<Alias>] Alternative identifiers that can be used to reference this order, such as
41
46
  # seller-defined order numbers.
42
47
  attribute?(:order_aliases, [Alias], from: "orderAliases")
@@ -9,6 +9,11 @@ module Peddler
9
9
  class Orders20260101
10
10
  # The money that the seller receives from the sale of the order.
11
11
  OrderProceeds = Structure.new do
12
+ # @return [Array<OrderProceedsBreakdown>] Categorized proceeds for the order. Proceed categories are either
13
+ # aggregated across all order items (such as `ITEM`, `SHIPPING`, and `TAX`) or applied at the order level
14
+ # (such as `DELIVERY_TIP`).
15
+ attribute?(:breakdowns, [OrderProceedsBreakdown])
16
+
12
17
  # @return [Money] The total amount that the seller receives from the sale of the order.
13
18
  attribute?(:grand_total, Money, from: "grandTotal")
14
19
  end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is generated. Do not edit.
4
+
5
+ require "structure"
6
+
7
+ module Peddler
8
+ module APIs
9
+ class Orders20260101
10
+ # An entry detailing proceeds information.
11
+ OrderProceedsBreakdown = Structure.new do
12
+ # @return [Money] The monetary amount for the proceeds category.
13
+ attribute(:subtotal, Money, null: false)
14
+
15
+ # @return [String] The proceeds category.
16
+ #
17
+ # **Possible values**: `ITEM`, `SHIPPING`, `GIFT_WRAP`, `COD_FEE`, `TAX`, `DISCOUNT`, `DELIVERY_TIP`, `OTHER`.
18
+ # **Note:** `DELIVERY_TIP` is charged separately and not attributed to a specific item. The remaining
19
+ # categories are aggregated across all order items.
20
+ attribute(:type, String, null: false)
21
+
22
+ # @return [String] The processing status of the charge. Only present for categories processed separately after
23
+ # checkout, such as `DELIVERY_TIP`.
24
+ #
25
+ # **Possible values**: `PENDING`, `FINALIZED`.
26
+ attribute?(:status, String)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is generated. Edit template if necessary.
4
+
5
+ module Peddler
6
+ module APIs
7
+ class OrdersV0
8
+ # Pre-approved alternative product attributes available for a rejected order. Each element contains an attribute
9
+ # name, its original value from the rejected order, and the corrected value that would result in approval (for
10
+ # example, a substituted `asin` or adjusted `petWeight`).
11
+ class ApprovedAlternativeDetails < Array
12
+ class << self
13
+ def parse(array)
14
+ new(array.map { |item| ApprovedAttribute.parse(item) })
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is generated. Do not edit.
4
+
5
+ require "structure"
6
+
7
+ module Peddler
8
+ module APIs
9
+ class OrdersV0
10
+ # An order attribute with its original value and the pre-approved alternative value suggested by the vet.
11
+ ApprovedAttribute = Structure.new do
12
+ # @return [String] The pre-approved value that would result in order approval.
13
+ attribute(:approved_value, String, null: false, from: "approvedValue")
14
+
15
+ # @return [String] The name of the attribute requiring correction (for example, `asin`, `petWeight`).
16
+ attribute(:attribute_name, String, null: false, from: "attributeName")
17
+
18
+ # @return [String] The original value of the attribute in the rejected order.
19
+ attribute(:original_value, String, null: false, from: "originalValue")
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is generated. Do not edit.
4
+
5
+ require "structure"
6
+ require "time"
7
+
8
+ module Peddler
9
+ module APIs
10
+ class OrdersV0
11
+ # Interim status information provided during the verification process to share granular progress updates while an
12
+ # order is pending verification (for example, vet contacted through email).
13
+ InterimStatusDetail = Structure.new do
14
+ # @return [String] The identifier for the interim status type. Must be one of the `ValidInterimStatusCodes`
15
+ # values returned by the `getOrderRegulatedInfo` operation.
16
+ attribute(:status_code, String, null: false, from: "statusCode")
17
+
18
+ # @return [Time] The date and time when this interim status was set, in [ISO
19
+ # 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date and time format.
20
+ attribute(:status_date_time, Time, null: false, from: "statusDateTime")
21
+ end
22
+ end
23
+ end
24
+ end
@@ -31,6 +31,11 @@ module Peddler
31
31
  # 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format.
32
32
  attribute?(:review_date, String, from: "ReviewDate")
33
33
 
34
+ # @return [Array<ValidInterimStatusCode>] Valid interim status codes that may be used when populating
35
+ # `InterimStatusDetail`. Each element contains a `StatusCode` identifier and its customer-facing
36
+ # `StatusDescription`.
37
+ attribute?(:valid_interim_status_codes, [ValidInterimStatusCode], from: "ValidInterimStatusCodes")
38
+
34
39
  # @return [Array<ValidVerificationDetail>] A list of valid verification details that may be provided and the
35
40
  # criteria required for when the verification detail can be provided.
36
41
  attribute?(:valid_verification_details, [ValidVerificationDetail], from: "ValidVerificationDetails")
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is generated. Do not edit.
4
+
5
+ require "structure"
6
+
7
+ module Peddler
8
+ module APIs
9
+ class OrdersV0
10
+ # A valid interim status code and its customer-facing description. Available with the `getOrderRegulatedInfo`
11
+ # operation to indicate which status codes can populate the `InterimStatusDetail` field.
12
+ ValidInterimStatusCode = Structure.new do
13
+ # @return [String] The identifier for the interim status type.
14
+ attribute(:status_code, String, null: false, from: "StatusCode")
15
+
16
+ # @return [String] A customer-facing description of the interim status.
17
+ attribute(:status_description, String, null: false, from: "StatusDescription")
18
+ end
19
+ end
20
+ end
21
+ end
@@ -18,7 +18,8 @@ module Peddler
18
18
  attribute(:valid_verification_statuses, Array, null: false, from: "ValidVerificationStatuses")
19
19
 
20
20
  # @return [String] A supported type of verification detail. The type indicates which verification detail could
21
- # be shared while updating the regulated order. Valid value: `prescriptionDetail`.
21
+ # be shared while updating the regulated order. Valid values: `prescriptionDetail`,
22
+ # `approvedAlternativeDetails`, `interimStatusDetail`.
22
23
  attribute(:verification_detail_type, String, null: false, from: "VerificationDetailType")
23
24
  end
24
25
  end
@@ -9,6 +9,14 @@ module Peddler
9
9
  class OrdersV0
10
10
  # Additional information related to the verification of a regulated order.
11
11
  VerificationDetails = Structure.new do
12
+ # @return [Array<ApprovedAttribute>] Pre-approved alternative product attributes provided when a vet rejects an
13
+ # order but suggests a correction. Only valid when the verification status is `Rejected`.
14
+ attribute?(:approved_alternative_details, [ApprovedAttribute], from: "approvedAlternativeDetails")
15
+
16
+ # @return [InterimStatusDetail] Interim status information provided during the verification process. Only valid
17
+ # when the verification status is `Pending`.
18
+ attribute?(:interim_status_detail, InterimStatusDetail, from: "interimStatusDetail")
19
+
12
20
  # @return [PrescriptionDetail] Information regarding the prescription tied to the order.
13
21
  attribute?(:prescription_detail, PrescriptionDetail, from: "prescriptionDetail")
14
22
  end
@@ -9,7 +9,7 @@ module Peddler
9
9
  class ProductTypeDefinitions20200901
10
10
  # A list of error responses returned when a request is unsuccessful.
11
11
  ErrorList = Structure.new do
12
- # @return [Array<Error>]
12
+ # @return [Array<Error>] A list of error responses.
13
13
  attribute(:errors, [Error], null: false)
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Peddler
9
9
  class ProductTypeDefinitions20200901
10
10
  # An Amazon product type with a definition available.
11
11
  ProductType = Structure.new do
12
- # @return [String] The human-readable and localized description of the Amazon product type.
12
+ # @return [String] Human-readable and localized description of the Amazon product type.
13
13
  attribute(:display_name, String, null: false, from: "displayName")
14
14
 
15
15
  # @return [Array<String>] The Amazon marketplace identifiers for which the product type definition is available.
@@ -12,7 +12,7 @@ module Peddler
12
12
  # @return [String] Amazon product type version identifier.
13
13
  attribute(:product_type_version, String, null: false, from: "productTypeVersion")
14
14
 
15
- # @return [Array<ProductType>]
15
+ # @return [Array<ProductType>] A list of product types.
16
16
  attribute(:product_types, [ProductType], null: false, from: "productTypes")
17
17
  end
18
18
  end
@@ -7,8 +7,9 @@ require "structure"
7
7
  module Peddler
8
8
  module APIs
9
9
  class ProductTypeDefinitions20200901
10
+ # A link to metadata schema.
10
11
  SchemaLink = Structure.new do
11
- # @return [String] Checksum hash of the schema (Base64 MD5). Can be used to verify schema contents, identify
12
+ # @return [String] Checksum hash of the schema (Base64 MD5). Use this to verify schema contents, identify
12
13
  # changes between schema versions, and for caching.
13
14
  attribute(:checksum, String, null: false)
14
15
 
@@ -22,12 +22,11 @@ module Peddler
22
22
  # @param keywords [Array<String>] A comma-delimited list of keywords to search product types. **Note:** Cannot be
23
23
  # used with `itemName`.
24
24
  # @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers for the request.
25
- # @param item_name [String] The title of the ASIN to get the product type recommendation. **Note:** Cannot be used
26
- # with `keywords`.
27
- # @param locale [String] The locale for the display names in the response. Defaults to the primary locale of the
28
- # marketplace.
29
- # @param search_locale [String] The locale used for the `keywords` and `itemName` parameters. Defaults to the
30
- # primary locale of the marketplace.
25
+ # @param item_name [String] Title of ASIN to get product type recommendation. **Note:** Cannot be used with
26
+ # `keywords`.
27
+ # @param locale [String] Locale for display names in response. Defaults to primary locale of the marketplace.
28
+ # @param search_locale [String] Language used for `keywords` or `itemName` parameters. Defaults to primary locale
29
+ # of the marketplace.
31
30
  # @param rate_limit [Float] Requests per second
32
31
  # @return [Peddler::Response] The API response
33
32
  def search_definitions_product_types(marketplace_ids, keywords: nil, item_name: nil, locale: nil,
@@ -53,7 +52,7 @@ module Peddler
53
52
  # partner.
54
53
  # @param marketplace_ids [Array<String>] A comma-delimited list of Amazon marketplace identifiers for the request.
55
54
  # Note: This parameter is limited to one marketplaceId at this time.
56
- # @param product_type_version [String] The version of the Amazon product type to retrieve. Defaults to "LATEST",.
55
+ # @param product_type_version [String] The version of the Amazon product type to retrieve. Defaults to "LATEST".
57
56
  # Prerelease versions of product type definitions may be retrieved with "RELEASE_CANDIDATE". If no prerelease
58
57
  # version is currently available, the "LATEST" live version will be provided.
59
58
  # @param requirements [String] The name of the requirements set to retrieve requirements for.
@@ -62,10 +61,14 @@ module Peddler
62
61
  # attributes without all the required attributes being present (such as for partial updates).
63
62
  # @param locale [String] Locale for retrieving display labels and other presentation details. Defaults to the
64
63
  # default language of the first marketplace in the request.
64
+ # @param parentage_level [String] The parentage level of the listing to retrieve a schema for. When provided, the
65
+ # schema is simplified by resolving all conditional logic related to the specified parentage level, resulting in
66
+ # a smaller schema with fewer conditions.
65
67
  # @param rate_limit [Float] Requests per second
66
68
  # @return [Peddler::Response] The API response
67
69
  def get_definitions_product_type(product_type, marketplace_ids, seller_id: nil, product_type_version: "LATEST",
68
- requirements: "LISTING", requirements_enforced: "ENFORCED", locale: "DEFAULT", rate_limit: 5.0)
70
+ requirements: "LISTING", requirements_enforced: "ENFORCED", locale: "DEFAULT", parentage_level: nil,
71
+ rate_limit: 5.0)
69
72
  path = "/definitions/2020-09-01/productTypes/#{percent_encode(product_type)}"
70
73
  params = {
71
74
  "sellerId" => seller_id,
@@ -74,6 +77,7 @@ module Peddler
74
77
  "requirements" => requirements,
75
78
  "requirementsEnforced" => requirements_enforced,
76
79
  "locale" => locale,
80
+ "parentageLevel" => parentage_level,
77
81
  }.compact
78
82
  parser = -> { ProductTypeDefinition }
79
83
  get(path, params:, rate_limit:, parser:)
@@ -28,6 +28,11 @@ module Peddler
28
28
  # @return [String]
29
29
  attribute?(:aggregation_frequency, String, from: "aggregationFrequency")
30
30
 
31
+ # @return [GetSellingPartnerMetricsRequestFilters] Use these parameters to filter results. Any result must match
32
+ # all provided parameters. For parameters that accept multiple values (arrays), the API returns results that
33
+ # match at least one value in the array.
34
+ attribute?(:filters, GetSellingPartnerMetricsRequestFilters)
35
+
31
36
  # @return [Array<Metric>] The list of metrics requested. If no metric value is provided, data for all metrics
32
37
  # will be returned.
33
38
  attribute?(:metrics, Array)
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is generated. Do not edit.
4
+
5
+ require "structure"
6
+
7
+ module Peddler
8
+ module APIs
9
+ class Replenishment20221107
10
+ # Use these parameters to filter results. Any result must match all provided parameters. For parameters that
11
+ # accept multiple values (arrays), the API returns results that match at least one value in the array.
12
+ GetSellingPartnerMetricsRequestFilters = Structure.new do
13
+ # @return [Array<String>] A list of Amazon Standard Identification Numbers (ASINs) to filter by. ASIN filter is
14
+ # supported for these metrics: SHIPPED_SUBSCRIPTION_UNITS, TOTAL_SUBSCRIPTIONS_REVENUE, ACTIVE_SUBSCRIPTIONS,
15
+ # NOT_DELIVERED_DUE_TO_OOS, LOST_REVENUE_DUE_TO_OOS, COUPONS_REVENUE_PENETRATION,
16
+ # SHARE_OF_COUPON_SUBSCRIPTIONS and REVENUE_PENETRATION.
17
+ attribute?(:asins, [String])
18
+
19
+ # @return [Array<String>] [Applicable only for US marketplace] A list of brand names to filter by. Brand name
20
+ # filter is supported for these metrics: SHIPPED_SUBSCRIPTION_UNITS, TOTAL_SUBSCRIPTIONS_REVENUE,
21
+ # ACTIVE_SUBSCRIPTIONS, NOT_DELIVERED_DUE_TO_OOS, LOST_REVENUE_DUE_TO_OOS, COUPONS_REVENUE_PENETRATION,
22
+ # SHARE_OF_COUPON_SUBSCRIPTIONS, REVENUE_PENETRATION, SUBSCRIBER_NON_SUBSCRIBER_AVERAGE_REVENUE,
23
+ # SUBSCRIBER_NON_SUBSCRIBER_AVERAGE_REORDERS, REVENUE_BY_DELIVERIES, SUBSCRIBER_RETENTION,
24
+ # REVENUE_PENETRATION_BY_SELLER_FUNDING, SUBSCRIBER_LIFETIME_VALUE_BY_CUSTOMER_SEGMENT and
25
+ # SIGNUP_CONVERSION_BY_SELLER_FUNDING.
26
+ attribute?(:brand_names, [String], from: "brandNames")
27
+
28
+ # @return [Array<FulfillmentChannelType>] [Applicable only for Sellers] The fulfillment channel types to filter
29
+ # by. Fulfillment channel type filter is supported for these metrics: SHIPPED_SUBSCRIPTION_UNITS,
30
+ # TOTAL_SUBSCRIPTIONS_REVENUE, ACTIVE_SUBSCRIPTIONS, NOT_DELIVERED_DUE_TO_OOS, LOST_REVENUE_DUE_TO_OOS,
31
+ # COUPONS_REVENUE_PENETRATION, SHARE_OF_COUPON_SUBSCRIPTIONS and REVENUE_PENETRATION.
32
+ attribute?(:fulfillment_channel_types, Array, from: "fulfillmentChannelTypes")
33
+
34
+ # @return [Array<String>] [Applicable only for Vendors] A list of product group names to filter by. Product
35
+ # group filter is supported for these metrics: SHIPPED_SUBSCRIPTION_UNITS, TOTAL_SUBSCRIPTIONS_REVENUE,
36
+ # ACTIVE_SUBSCRIPTIONS, NOT_DELIVERED_DUE_TO_OOS, LOST_REVENUE_DUE_TO_OOS, COUPONS_REVENUE_PENETRATION,
37
+ # SHARE_OF_COUPON_SUBSCRIPTIONS and REVENUE_PENETRATION.
38
+ attribute?(:product_groups, [String], from: "productGroups")
39
+
40
+ # @return [Array<String>] [Applicable only for Sellers] A list of SKUs to filter by. SKU filter is supported for
41
+ # these metrics: SHIPPED_SUBSCRIPTION_UNITS, TOTAL_SUBSCRIPTIONS_REVENUE, ACTIVE_SUBSCRIPTIONS,
42
+ # NOT_DELIVERED_DUE_TO_OOS, LOST_REVENUE_DUE_TO_OOS, COUPONS_REVENUE_PENETRATION,
43
+ # SHARE_OF_COUPON_SUBSCRIPTIONS and REVENUE_PENETRATION.
44
+ attribute?(:skus, [String])
45
+ end
46
+ end
47
+ end
48
+ end
@@ -97,7 +97,7 @@ module Peddler
97
97
  # 5% or above seller-funded discount over the last 12 months. Applicable to `PERFORMANCE` `timePeriodType`.
98
98
  attribute?(:revenue_penetration_for5_plus_percent_seller_funding, Float, from: "revenuePenetrationFor5PlusPercentSellerFunding")
99
99
 
100
- # @return [Float] The percentage of new subscriptions acquired through coupons. Applicable to `PERFORMANCE`
100
+ # @return [Float] The percentage of new subscriptions from coupons. Applicable to `PERFORMANCE`
101
101
  # `timePeriodType`.
102
102
  attribute?(:share_of_coupon_subscriptions, Float, from: "shareOfCouponSubscriptions")
103
103
 
@@ -105,20 +105,20 @@ module Peddler
105
105
  # `PERFORMANCE` and `FORECAST` `timePeriodType`.
106
106
  attribute?(:shipped_subscription_units, Float, from: "shippedSubscriptionUnits")
107
107
 
108
- # @return [Float] Percentage of subscriptions created by offers with 0% seller-funded discount out of the total
109
- # number of new orders placed over the past 12 months
108
+ # @return [Float] Percentage of subscriptions from offers with 0% seller-funded discount out of the total number
109
+ # of new orders placed over the past 12 months.
110
110
  attribute?(:signup_conversion_for0_percent_seller_funding, Float, from: "signupConversionFor0PercentSellerFunding")
111
111
 
112
- # @return [Float] [Applicable only for Sellers] Percentage of subscriptions created by offers with 10%
113
- # seller-funded discount out of the total number of new orders placed over the past 12 months
112
+ # @return [Float] [Applicable only for Sellers] Percentage of subscriptions from offers with 10% seller-funded
113
+ # discount out of the total number of new orders placed over the past 12 months.
114
114
  attribute?(:signup_conversion_for10_percent_seller_funding, Float, from: "signupConversionFor10PercentSellerFunding")
115
115
 
116
- # @return [Float] [Applicable only for Sellers] Percentage of subscriptions created by offers with 5%
117
- # seller-funded discount out of the total number of new orders placed over the past 12 months
116
+ # @return [Float] [Applicable only for Sellers] Percentage of subscriptions from offers with 5% seller-funded
117
+ # discount out of the total number of new orders placed over the past 12 months.
118
118
  attribute?(:signup_conversion_for5_percent_seller_funding, Float, from: "signupConversionFor5PercentSellerFunding")
119
119
 
120
- # @return [Float] [Applicable only for Vendors] Percentage of subscriptions created by offers with 5% or above
121
- # seller-funded discount out of the total number of new orders placed over the past 12 months
120
+ # @return [Float] [Applicable only for Vendors] Percentage of subscriptions from offers with 5% or above
121
+ # seller-funded discount out of the total number of new orders placed over the past 12 months.
122
122
  attribute?(:signup_conversion_for5_plus_percent_seller_funding, Float, from: "signupConversionFor5PlusPercentSellerFunding")
123
123
 
124
124
  # @return [Float] The average reorders per subscriber of the program over a period of 12 months. Applicable to
@@ -10,8 +10,8 @@ module Peddler
10
10
  # The request body for the `listOfferMetrics` operation.
11
11
  ListOfferMetricsRequest = Structure.new do
12
12
  # @return [ListOfferMetricsRequestFilters] Use these parameters to filter results. Any result must match all
13
- # provided parameters. For any parameter that is an array, the result must match at least one element in the
14
- # provided array.
13
+ # provided parameters. For parameters that accept multiple values (arrays), the API returns results that match
14
+ # at least one value in the array.
15
15
  attribute(:filters, ListOfferMetricsRequestFilters, null: false)
16
16
 
17
17
  # @return [ListOfferMetricsRequestPagination] Use these parameters to paginate through the response.