sp_api_clients 2.0.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 (90) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +161 -0
  3. data/LICENSE +21 -0
  4. data/README.md +284 -0
  5. data/lib/amazon_sp_clients/adapter_loader.rb +28 -0
  6. data/lib/amazon_sp_clients/api_client.rb +309 -0
  7. data/lib/amazon_sp_clients/api_error.rb +37 -0
  8. data/lib/amazon_sp_clients/api_response.rb +54 -0
  9. data/lib/amazon_sp_clients/configuration.rb +144 -0
  10. data/lib/amazon_sp_clients/marketplaces.rb +63 -0
  11. data/lib/amazon_sp_clients/middlewares/raise_error.rb +166 -0
  12. data/lib/amazon_sp_clients/session.rb +124 -0
  13. data/lib/amazon_sp_clients/sp_fba_inventory.rb +8 -0
  14. data/lib/amazon_sp_clients/sp_feeds_2021.rb +8 -0
  15. data/lib/amazon_sp_clients/sp_fulfillment_outbound_2020.rb +8 -0
  16. data/lib/amazon_sp_clients/sp_listings_items_2021.rb +8 -0
  17. data/lib/amazon_sp_clients/sp_orders_v0.rb +8 -0
  18. data/lib/amazon_sp_clients/sp_reports_2021.rb +8 -0
  19. data/lib/amazon_sp_clients/sp_tokens_2021.rb +8 -0
  20. data/lib/amazon_sp_clients/sp_vdf_inventory_v1.rb +8 -0
  21. data/lib/amazon_sp_clients/sp_vdf_orders_v1.rb +8 -0
  22. data/lib/amazon_sp_clients/sp_vdf_shipping_v1.rb +8 -0
  23. data/lib/amazon_sp_clients/sp_vendor_invoices.rb +8 -0
  24. data/lib/amazon_sp_clients/sp_vendor_orders.rb +8 -0
  25. data/lib/amazon_sp_clients/sp_vendor_transaction_status.rb +8 -0
  26. data/lib/amazon_sp_clients/sp_vendors_shipments.rb +8 -0
  27. data/lib/amazon_sp_clients/token_exchange_auth.rb +82 -0
  28. data/lib/amazon_sp_clients/uploader.rb +77 -0
  29. data/lib/amazon_sp_clients/v2/api.rb +43 -0
  30. data/lib/amazon_sp_clients/v2/apis/fba_inventory.rb +80 -0
  31. data/lib/amazon_sp_clients/v2/apis/feeds_2021.rb +86 -0
  32. data/lib/amazon_sp_clients/v2/apis/fulfillment_outbound_2020.rb +184 -0
  33. data/lib/amazon_sp_clients/v2/apis/listings_items_2021.rb +144 -0
  34. data/lib/amazon_sp_clients/v2/apis/orders_v0.rb +165 -0
  35. data/lib/amazon_sp_clients/v2/apis/reports_2021.rb +117 -0
  36. data/lib/amazon_sp_clients/v2/apis/tokens_2021.rb +25 -0
  37. data/lib/amazon_sp_clients/v2/apis/vdf_inventory_v1.rb +26 -0
  38. data/lib/amazon_sp_clients/v2/apis/vdf_orders_v1.rb +61 -0
  39. data/lib/amazon_sp_clients/v2/apis/vdf_shipping_v1.rb +139 -0
  40. data/lib/amazon_sp_clients/v2/apis/vendor_invoices.rb +25 -0
  41. data/lib/amazon_sp_clients/v2/apis/vendor_orders.rb +106 -0
  42. data/lib/amazon_sp_clients/v2/apis/vendor_transaction_status.rb +25 -0
  43. data/lib/amazon_sp_clients/v2/apis/vendors_shipments.rb +120 -0
  44. data/lib/amazon_sp_clients/v2/apis.rb +82 -0
  45. data/lib/amazon_sp_clients/v2/client.rb +198 -0
  46. data/lib/amazon_sp_clients/v2/config.rb +85 -0
  47. data/lib/amazon_sp_clients/v2/credentials.rb +91 -0
  48. data/lib/amazon_sp_clients/v2/documents.rb +115 -0
  49. data/lib/amazon_sp_clients/v2/error_mapper.rb +235 -0
  50. data/lib/amazon_sp_clients/v2/errors.rb +117 -0
  51. data/lib/amazon_sp_clients/v2/lwa.rb +100 -0
  52. data/lib/amazon_sp_clients/v2/rdt.rb +104 -0
  53. data/lib/amazon_sp_clients/v2/token.rb +39 -0
  54. data/lib/amazon_sp_clients/v2.rb +33 -0
  55. data/lib/amazon_sp_clients/version.rb +3 -0
  56. data/lib/amazon_sp_clients.rb +69 -0
  57. data/lib/sp_api_clients.rb +6 -0
  58. data/sp_api_clients.gemspec +53 -0
  59. data/vendor/fba_inventory/lib/sp_fba_inventory/api/fba_inventory_api.rb +289 -0
  60. data/vendor/fba_inventory/lib/sp_fba_inventory.rb +12 -0
  61. data/vendor/feeds_2021/lib/sp_feeds_2021/api/feeds_api.rb +367 -0
  62. data/vendor/feeds_2021/lib/sp_feeds_2021.rb +12 -0
  63. data/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020/api/fba_outbound_api.rb +845 -0
  64. data/vendor/fulfillment_outbound_2020/lib/sp_fulfillment_outbound_2020.rb +12 -0
  65. data/vendor/listings_items_2021/lib/sp_listings_items_2021/api/listings_api.rb +480 -0
  66. data/vendor/listings_items_2021/lib/sp_listings_items_2021.rb +12 -0
  67. data/vendor/orders_v0/lib/sp_orders_v0/api/orders_v0_api.rb +593 -0
  68. data/vendor/orders_v0/lib/sp_orders_v0/api/shipment_api.rb +83 -0
  69. data/vendor/orders_v0/lib/sp_orders_v0.rb +13 -0
  70. data/vendor/reports_2021/lib/sp_reports_2021/api/reports_api.rb +530 -0
  71. data/vendor/reports_2021/lib/sp_reports_2021.rb +12 -0
  72. data/vendor/tokens_2021/lib/sp_tokens_2021/api/tokens_api.rb +77 -0
  73. data/vendor/tokens_2021/lib/sp_tokens_2021.rb +12 -0
  74. data/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1/api/update_inventory_api.rb +83 -0
  75. data/vendor/vdf_inventory_v1/lib/sp_vdf_inventory_v1.rb +12 -0
  76. data/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1/api/vendor_orders_api.rb +217 -0
  77. data/vendor/vdf_orders_v1/lib/sp_vdf_orders_v1.rb +12 -0
  78. data/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/customer_invoices_api.rb +152 -0
  79. data/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/vendor_shipping_api.rb +264 -0
  80. data/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1/api/vendor_shipping_labels_api.rb +208 -0
  81. data/vendor/vdf_shipping_v1/lib/sp_vdf_shipping_v1.rb +14 -0
  82. data/vendor/vendor_invoices/lib/sp_vendor_invoices/api/vendor_payments_api.rb +77 -0
  83. data/vendor/vendor_invoices/lib/sp_vendor_invoices.rb +12 -0
  84. data/vendor/vendor_orders/lib/sp_vendor_orders/api/vendor_orders_api.rb +323 -0
  85. data/vendor/vendor_orders/lib/sp_vendor_orders.rb +12 -0
  86. data/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status/api/vendor_transaction_api.rb +75 -0
  87. data/vendor/vendor_transaction_status/lib/sp_vendor_transaction_status.rb +12 -0
  88. data/vendor/vendors_shipments/lib/sp_vendors_shipments/api/vendor_shipping_api.rb +337 -0
  89. data/vendor/vendors_shipments/lib/sp_vendors_shipments.rb +12 -0
  90. metadata +321 -0
@@ -0,0 +1,77 @@
1
+ =begin
2
+ #Selling Partner API for Tokens
3
+
4
+ #The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide).
5
+
6
+ OpenAPI spec version: 2021-03-01
7
+
8
+ Generated by: lib/generator (bundle exec rake generate)
9
+ =end
10
+
11
+ module AmazonSpClients
12
+ module SpTokens2021
13
+ class TokensApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(session)
17
+ @api_client = AmazonSpClients::ApiClient.new(session)
18
+ end
19
+ # Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
20
+ # @param body The restricted data token request details.
21
+ # @param [Hash] opts the optional parameters
22
+ # @return [CreateRestrictedDataTokenResponse]
23
+ def create_restricted_data_token(body, opts = {})
24
+ data = create_restricted_data_token_with_http_info(body, opts)
25
+ return data
26
+ end
27
+
28
+ # Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted resource is the HTTP method and path from a restricted operation that returns Personally Identifiable Information (PII), plus a dataElements value that indicates the type of PII requested. See the Tokens API Use Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent calls to the corresponding restricted operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
29
+ # @param body The restricted data token request details.
30
+ # @param [Hash] opts the optional parameters
31
+ # @return [Array<(CreateRestrictedDataTokenResponse)>] CreateRestrictedDataTokenResponse data, response status code and response headers
32
+ def create_restricted_data_token_with_http_info(body, opts = {})
33
+ if @api_client.config.debugging
34
+ @api_client.config.logger.debug 'Calling API: TokensApi.create_restricted_data_token ...'
35
+ end
36
+ # verify the required parameter 'body' is set
37
+ if @api_client.config.client_side_validation && body.nil?
38
+ fail ArgumentError, "Missing the required parameter 'body' when calling TokensApi.create_restricted_data_token"
39
+ end
40
+ # resource path
41
+ local_var_path = '/tokens/2021-03-01/restrictedDataToken'
42
+
43
+ # query parameters
44
+ query_params = opts[:query_params] || {}
45
+
46
+ # header parameters
47
+ header_params = opts[:header_params] || {}
48
+ # HTTP header 'Accept' (if needed)
49
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
50
+ # HTTP header 'Content-Type'
51
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
52
+
53
+ # form parameters
54
+ form_params = opts[:form_params] || {}
55
+
56
+ # http body (model)
57
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
58
+
59
+ return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse'
60
+
61
+ auth_names = opts[:auth_names] || []
62
+ data = @api_client.call_api(:POST, local_var_path,
63
+ :header_params => header_params,
64
+ :query_params => query_params,
65
+ :form_params => form_params,
66
+ :body => post_body,
67
+ :auth_names => auth_names,
68
+ :return_type => return_type)
69
+
70
+ if @api_client.config.debugging
71
+ @api_client.config.logger.debug "API called: TokensApi#create_restricted_data_token\nData: #{data.inspect}"
72
+ end
73
+ return data
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,12 @@
1
+ =begin
2
+ #Selling Partner API for Tokens
3
+
4
+ #The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide).
5
+
6
+ OpenAPI spec version: 2021-03-01
7
+
8
+ Generated by: lib/generator (bundle exec rake generate)
9
+ =end
10
+
11
+ # APIs
12
+ require_relative './sp_tokens_2021/api/tokens_api'
@@ -0,0 +1,83 @@
1
+ =begin
2
+ #Selling Partner API for Direct Fulfillment Inventory Updates
3
+
4
+ #The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: lib/generator (bundle exec rake generate)
9
+ =end
10
+
11
+ module AmazonSpClients
12
+ module SpVdfInventoryV1
13
+ class UpdateInventoryApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(session)
17
+ @api_client = AmazonSpClients::ApiClient.new(session)
18
+ end
19
+ # Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
20
+ # @param body The request body containing the inventory update data to submit.
21
+ # @param warehouse_id Identifier for the warehouse for which to update inventory.
22
+ # @param [Hash] opts the optional parameters
23
+ # @return [SubmitInventoryUpdateResponse]
24
+ def submit_inventory_update(body, warehouse_id, opts = {})
25
+ data = submit_inventory_update_with_http_info(body, warehouse_id, opts)
26
+ return data
27
+ end
28
+
29
+ # Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
30
+ # @param body The request body containing the inventory update data to submit.
31
+ # @param warehouse_id Identifier for the warehouse for which to update inventory.
32
+ # @param [Hash] opts the optional parameters
33
+ # @return [Array<(SubmitInventoryUpdateResponse)>] SubmitInventoryUpdateResponse data, response status code and response headers
34
+ def submit_inventory_update_with_http_info(body, warehouse_id, opts = {})
35
+ if @api_client.config.debugging
36
+ @api_client.config.logger.debug 'Calling API: UpdateInventoryApi.submit_inventory_update ...'
37
+ end
38
+ # verify the required parameter 'body' is set
39
+ if @api_client.config.client_side_validation && body.nil?
40
+ fail ArgumentError, "Missing the required parameter 'body' when calling UpdateInventoryApi.submit_inventory_update"
41
+ end
42
+ # verify the required parameter 'warehouse_id' is set
43
+ if @api_client.config.client_side_validation && warehouse_id.nil?
44
+ fail ArgumentError, "Missing the required parameter 'warehouse_id' when calling UpdateInventoryApi.submit_inventory_update"
45
+ end
46
+ # resource path
47
+ local_var_path = '/vendor/directFulfillment/inventory/v1/warehouses/{warehouseId}/items'.sub('{' + 'warehouseId' + '}', warehouse_id.to_s)
48
+
49
+ # query parameters
50
+ query_params = opts[:query_params] || {}
51
+
52
+ # header parameters
53
+ header_params = opts[:header_params] || {}
54
+ # HTTP header 'Accept' (if needed)
55
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
56
+ # HTTP header 'Content-Type'
57
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
64
+
65
+ return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse'
66
+
67
+ auth_names = opts[:auth_names] || []
68
+ data = @api_client.call_api(:POST, local_var_path,
69
+ :header_params => header_params,
70
+ :query_params => query_params,
71
+ :form_params => form_params,
72
+ :body => post_body,
73
+ :auth_names => auth_names,
74
+ :return_type => return_type)
75
+
76
+ if @api_client.config.debugging
77
+ @api_client.config.logger.debug "API called: UpdateInventoryApi#submit_inventory_update\nData: #{data.inspect}"
78
+ end
79
+ return data
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,12 @@
1
+ =begin
2
+ #Selling Partner API for Direct Fulfillment Inventory Updates
3
+
4
+ #The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor's inventory updates.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: lib/generator (bundle exec rake generate)
9
+ =end
10
+
11
+ # APIs
12
+ require_relative './sp_vdf_inventory_v1/api/update_inventory_api'
@@ -0,0 +1,217 @@
1
+ =begin
2
+ #Selling Partner API for Direct Fulfillment Orders
3
+
4
+ #The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: lib/generator (bundle exec rake generate)
9
+ =end
10
+
11
+ module AmazonSpClients
12
+ module SpVdfOrdersV1
13
+ class VendorOrdersApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(session)
17
+ @api_client = AmazonSpClients::ApiClient.new(session)
18
+ end
19
+ # Returns purchase order information for the purchaseOrderNumber that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
20
+ # @param purchase_order_number The order identifier for the purchase order that you want. Formatting Notes: alpha-numeric code.
21
+ # @param [Hash] opts the optional parameters
22
+ # @return [GetOrderResponse]
23
+ def get_order(purchase_order_number, opts = {})
24
+ data = get_order_with_http_info(purchase_order_number, opts)
25
+ return data
26
+ end
27
+
28
+ # Returns purchase order information for the purchaseOrderNumber that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
29
+ # @param purchase_order_number The order identifier for the purchase order that you want. Formatting Notes: alpha-numeric code.
30
+ # @param [Hash] opts the optional parameters
31
+ # @return [Array<(GetOrderResponse)>] GetOrderResponse data, response status code and response headers
32
+ def get_order_with_http_info(purchase_order_number, opts = {})
33
+ if @api_client.config.debugging
34
+ @api_client.config.logger.debug 'Calling API: VendorOrdersApi.get_order ...'
35
+ end
36
+ # verify the required parameter 'purchase_order_number' is set
37
+ if @api_client.config.client_side_validation && purchase_order_number.nil?
38
+ fail ArgumentError, "Missing the required parameter 'purchase_order_number' when calling VendorOrdersApi.get_order"
39
+ end
40
+ # resource path
41
+ local_var_path = '/vendor/directFulfillment/orders/v1/purchaseOrders/{purchaseOrderNumber}'.sub('{' + 'purchaseOrderNumber' + '}', purchase_order_number.to_s)
42
+
43
+ # query parameters
44
+ query_params = opts[:query_params] || {}
45
+
46
+ # header parameters
47
+ header_params = opts[:header_params] || {}
48
+ # HTTP header 'Accept' (if needed)
49
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
50
+
51
+ # form parameters
52
+ form_params = opts[:form_params] || {}
53
+
54
+ # http body (model)
55
+ post_body = opts[:body]
56
+
57
+ return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse'
58
+
59
+ auth_names = opts[:auth_names] || []
60
+ data = @api_client.call_api(:GET, local_var_path,
61
+ :header_params => header_params,
62
+ :query_params => query_params,
63
+ :form_params => form_params,
64
+ :body => post_body,
65
+ :auth_names => auth_names,
66
+ :return_type => return_type)
67
+
68
+ if @api_client.config.debugging
69
+ @api_client.config.logger.debug "API called: VendorOrdersApi#get_order\nData: #{data.inspect}"
70
+ end
71
+ return data
72
+ end
73
+ # Returns a list of purchase orders created during the time frame that you specify. You define the time frame using the createdAfter and createdBefore parameters. You must use both parameters. You can choose to get only the purchase order numbers by setting the includeDetails parameter to false. In that case, the operation returns a list of purchase order numbers. You can then call the getOrder operation to return the details of a specific order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
74
+ # @param created_after Purchase orders that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format.
75
+ # @param created_before Purchase orders that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format.
76
+ # @param [Hash] opts the optional parameters
77
+ # @option opts [String] :ship_from_party_id The vendor warehouse identifier for the fulfillment warehouse. If not specified, the result will contain orders for all warehouses.
78
+ # @option opts [String] :status Returns only the purchase orders that match the specified status. If not specified, the result will contain orders that match any status.
79
+ # @option opts [Integer] :limit The limit to the number of purchase orders returned.
80
+ # @option opts [String] :sort_order Sort the list in ascending or descending order by order creation date.
81
+ # @option opts [String] :next_token Used for pagination when there are more orders than the specified result size limit. The token value is returned in the previous API call.
82
+ # @option opts [String] :include_details When true, returns the complete purchase order details. Otherwise, only purchase order numbers are returned. (default to true)
83
+ # @return [GetOrdersResponse]
84
+ def get_orders(created_after, created_before, opts = {})
85
+ data = get_orders_with_http_info(created_after, created_before, opts)
86
+ return data
87
+ end
88
+
89
+ # Returns a list of purchase orders created during the time frame that you specify. You define the time frame using the createdAfter and createdBefore parameters. You must use both parameters. You can choose to get only the purchase order numbers by setting the includeDetails parameter to false. In that case, the operation returns a list of purchase order numbers. You can then call the getOrder operation to return the details of a specific order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
90
+ # @param created_after Purchase orders that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format.
91
+ # @param created_before Purchase orders that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format.
92
+ # @param [Hash] opts the optional parameters
93
+ # @option opts [String] :ship_from_party_id The vendor warehouse identifier for the fulfillment warehouse. If not specified, the result will contain orders for all warehouses.
94
+ # @option opts [String] :status Returns only the purchase orders that match the specified status. If not specified, the result will contain orders that match any status.
95
+ # @option opts [Integer] :limit The limit to the number of purchase orders returned.
96
+ # @option opts [String] :sort_order Sort the list in ascending or descending order by order creation date.
97
+ # @option opts [String] :next_token Used for pagination when there are more orders than the specified result size limit. The token value is returned in the previous API call.
98
+ # @option opts [String] :include_details When true, returns the complete purchase order details. Otherwise, only purchase order numbers are returned.
99
+ # @return [Array<(GetOrdersResponse)>] GetOrdersResponse data, response status code and response headers
100
+ def get_orders_with_http_info(created_after, created_before, opts = {})
101
+ if @api_client.config.debugging
102
+ @api_client.config.logger.debug 'Calling API: VendorOrdersApi.get_orders ...'
103
+ end
104
+ # verify the required parameter 'created_after' is set
105
+ if @api_client.config.client_side_validation && created_after.nil?
106
+ fail ArgumentError, "Missing the required parameter 'created_after' when calling VendorOrdersApi.get_orders"
107
+ end
108
+ # verify the required parameter 'created_before' is set
109
+ if @api_client.config.client_side_validation && created_before.nil?
110
+ fail ArgumentError, "Missing the required parameter 'created_before' when calling VendorOrdersApi.get_orders"
111
+ end
112
+ if @api_client.config.client_side_validation && opts[:'status'] && !['NEW', 'SHIPPED', 'ACCEPTED', 'CANCELLED'].include?(opts[:'status'])
113
+ fail ArgumentError, 'invalid value for "status", must be one of NEW, SHIPPED, ACCEPTED, CANCELLED'
114
+ end
115
+ if @api_client.config.client_side_validation && opts[:'sort_order'] && !['ASC', 'DESC'].include?(opts[:'sort_order'])
116
+ fail ArgumentError, 'invalid value for "sort_order", must be one of ASC, DESC'
117
+ end
118
+ # resource path
119
+ local_var_path = '/vendor/directFulfillment/orders/v1/purchaseOrders'
120
+
121
+ # query parameters
122
+ query_params = opts[:query_params] || {}
123
+ query_params[:'createdAfter'] = created_after
124
+ query_params[:'createdBefore'] = created_before
125
+ query_params[:'shipFromPartyId'] = opts[:'ship_from_party_id'] if !opts[:'ship_from_party_id'].nil?
126
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
127
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
128
+ query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
129
+ query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
130
+ query_params[:'includeDetails'] = opts[:'include_details'] if !opts[:'include_details'].nil?
131
+
132
+ # header parameters
133
+ header_params = opts[:header_params] || {}
134
+ # HTTP header 'Accept' (if needed)
135
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'payload'])
136
+
137
+ # form parameters
138
+ form_params = opts[:form_params] || {}
139
+
140
+ # http body (model)
141
+ post_body = opts[:body]
142
+
143
+ return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse'
144
+
145
+ auth_names = opts[:auth_names] || []
146
+ data = @api_client.call_api(:GET, local_var_path,
147
+ :header_params => header_params,
148
+ :query_params => query_params,
149
+ :form_params => form_params,
150
+ :body => post_body,
151
+ :auth_names => auth_names,
152
+ :return_type => return_type)
153
+
154
+ if @api_client.config.debugging
155
+ @api_client.config.logger.debug "API called: VendorOrdersApi#get_orders\nData: #{data.inspect}"
156
+ end
157
+ return data
158
+ end
159
+ # Submits acknowledgements for one or more purchase orders. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
160
+ # @param body The request body containing the acknowledgement to an order.
161
+ # @param [Hash] opts the optional parameters
162
+ # @return [SubmitAcknowledgementResponse]
163
+ def submit_acknowledgement(body, opts = {})
164
+ data = submit_acknowledgement_with_http_info(body, opts)
165
+ return data
166
+ end
167
+
168
+ # Submits acknowledgements for one or more purchase orders. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
169
+ # @param body The request body containing the acknowledgement to an order.
170
+ # @param [Hash] opts the optional parameters
171
+ # @return [Array<(SubmitAcknowledgementResponse)>] SubmitAcknowledgementResponse data, response status code and response headers
172
+ def submit_acknowledgement_with_http_info(body, opts = {})
173
+ if @api_client.config.debugging
174
+ @api_client.config.logger.debug 'Calling API: VendorOrdersApi.submit_acknowledgement ...'
175
+ end
176
+ # verify the required parameter 'body' is set
177
+ if @api_client.config.client_side_validation && body.nil?
178
+ fail ArgumentError, "Missing the required parameter 'body' when calling VendorOrdersApi.submit_acknowledgement"
179
+ end
180
+ # resource path
181
+ local_var_path = '/vendor/directFulfillment/orders/v1/acknowledgements'
182
+
183
+ # query parameters
184
+ query_params = opts[:query_params] || {}
185
+
186
+ # header parameters
187
+ header_params = opts[:header_params] || {}
188
+ # HTTP header 'Accept' (if needed)
189
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
190
+ # HTTP header 'Content-Type'
191
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
192
+
193
+ # form parameters
194
+ form_params = opts[:form_params] || {}
195
+
196
+ # http body (model)
197
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
198
+
199
+ return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse'
200
+
201
+ auth_names = opts[:auth_names] || []
202
+ data = @api_client.call_api(:POST, local_var_path,
203
+ :header_params => header_params,
204
+ :query_params => query_params,
205
+ :form_params => form_params,
206
+ :body => post_body,
207
+ :auth_names => auth_names,
208
+ :return_type => return_type)
209
+
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug "API called: VendorOrdersApi#submit_acknowledgement\nData: #{data.inspect}"
212
+ end
213
+ return data
214
+ end
215
+ end
216
+ end
217
+ end
@@ -0,0 +1,12 @@
1
+ =begin
2
+ #Selling Partner API for Direct Fulfillment Orders
3
+
4
+ #The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: lib/generator (bundle exec rake generate)
9
+ =end
10
+
11
+ # APIs
12
+ require_relative './sp_vdf_orders_v1/api/vendor_orders_api'
@@ -0,0 +1,152 @@
1
+ =begin
2
+ #Selling Partner API for Direct Fulfillment Shipping
3
+
4
+ #The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: lib/generator (bundle exec rake generate)
9
+ =end
10
+
11
+ module AmazonSpClients
12
+ module SpVdfShippingV1
13
+ class CustomerInvoicesApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(session)
17
+ @api_client = AmazonSpClients::ApiClient.new(session)
18
+ end
19
+ # Returns a customer invoice based on the purchaseOrderNumber that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
20
+ # @param purchase_order_number Purchase order number of the shipment for which to return the invoice.
21
+ # @param [Hash] opts the optional parameters
22
+ # @return [GetCustomerInvoiceResponse]
23
+ def get_customer_invoice(purchase_order_number, opts = {})
24
+ data = get_customer_invoice_with_http_info(purchase_order_number, opts)
25
+ return data
26
+ end
27
+
28
+ # Returns a customer invoice based on the purchaseOrderNumber that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
29
+ # @param purchase_order_number Purchase order number of the shipment for which to return the invoice.
30
+ # @param [Hash] opts the optional parameters
31
+ # @return [Array<(GetCustomerInvoiceResponse)>] GetCustomerInvoiceResponse data, response status code and response headers
32
+ def get_customer_invoice_with_http_info(purchase_order_number, opts = {})
33
+ if @api_client.config.debugging
34
+ @api_client.config.logger.debug 'Calling API: CustomerInvoicesApi.get_customer_invoice ...'
35
+ end
36
+ # verify the required parameter 'purchase_order_number' is set
37
+ if @api_client.config.client_side_validation && purchase_order_number.nil?
38
+ fail ArgumentError, "Missing the required parameter 'purchase_order_number' when calling CustomerInvoicesApi.get_customer_invoice"
39
+ end
40
+ # resource path
41
+ local_var_path = '/vendor/directFulfillment/shipping/v1/customerInvoices/{purchaseOrderNumber}'.sub('{' + 'purchaseOrderNumber' + '}', purchase_order_number.to_s)
42
+
43
+ # query parameters
44
+ query_params = opts[:query_params] || {}
45
+
46
+ # header parameters
47
+ header_params = opts[:header_params] || {}
48
+ # HTTP header 'Accept' (if needed)
49
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
50
+
51
+ # form parameters
52
+ form_params = opts[:form_params] || {}
53
+
54
+ # http body (model)
55
+ post_body = opts[:body]
56
+
57
+ return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse'
58
+
59
+ auth_names = opts[:auth_names] || []
60
+ data = @api_client.call_api(:GET, local_var_path,
61
+ :header_params => header_params,
62
+ :query_params => query_params,
63
+ :form_params => form_params,
64
+ :body => post_body,
65
+ :auth_names => auth_names,
66
+ :return_type => return_type)
67
+
68
+ if @api_client.config.debugging
69
+ @api_client.config.logger.debug "API called: CustomerInvoicesApi#get_customer_invoice\nData: #{data.inspect}"
70
+ end
71
+ return data
72
+ end
73
+ # Returns a list of customer invoices created during a time frame that you specify. You define the time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must be no more than 7 days. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
74
+ # @param created_after Orders that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format.
75
+ # @param created_before Orders that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format.
76
+ # @param [Hash] opts the optional parameters
77
+ # @option opts [String] :ship_from_party_id The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses.
78
+ # @option opts [Integer] :limit The limit to the number of records returned
79
+ # @option opts [String] :sort_order Sort ASC or DESC by order creation date.
80
+ # @option opts [String] :next_token Used for pagination when there are more orders than the specified result size limit. The token value is returned in the previous API call.
81
+ # @return [GetCustomerInvoicesResponse]
82
+ def get_customer_invoices(created_after, created_before, opts = {})
83
+ data = get_customer_invoices_with_http_info(created_after, created_before, opts)
84
+ return data
85
+ end
86
+
87
+ # Returns a list of customer invoices created during a time frame that you specify. You define the time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must be no more than 7 days. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
88
+ # @param created_after Orders that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format.
89
+ # @param created_before Orders that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format.
90
+ # @param [Hash] opts the optional parameters
91
+ # @option opts [String] :ship_from_party_id The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses.
92
+ # @option opts [Integer] :limit The limit to the number of records returned
93
+ # @option opts [String] :sort_order Sort ASC or DESC by order creation date.
94
+ # @option opts [String] :next_token Used for pagination when there are more orders than the specified result size limit. The token value is returned in the previous API call.
95
+ # @return [Array<(GetCustomerInvoicesResponse)>] GetCustomerInvoicesResponse data, response status code and response headers
96
+ def get_customer_invoices_with_http_info(created_after, created_before, opts = {})
97
+ if @api_client.config.debugging
98
+ @api_client.config.logger.debug 'Calling API: CustomerInvoicesApi.get_customer_invoices ...'
99
+ end
100
+ # verify the required parameter 'created_after' is set
101
+ if @api_client.config.client_side_validation && created_after.nil?
102
+ fail ArgumentError, "Missing the required parameter 'created_after' when calling CustomerInvoicesApi.get_customer_invoices"
103
+ end
104
+ # verify the required parameter 'created_before' is set
105
+ if @api_client.config.client_side_validation && created_before.nil?
106
+ fail ArgumentError, "Missing the required parameter 'created_before' when calling CustomerInvoicesApi.get_customer_invoices"
107
+ end
108
+ if @api_client.config.client_side_validation && opts[:'sort_order'] && !['ASC', 'DESC'].include?(opts[:'sort_order'])
109
+ fail ArgumentError, 'invalid value for "sort_order", must be one of ASC, DESC'
110
+ end
111
+ # resource path
112
+ local_var_path = '/vendor/directFulfillment/shipping/v1/customerInvoices'
113
+
114
+ # query parameters
115
+ query_params = opts[:query_params] || {}
116
+ query_params[:'createdAfter'] = created_after
117
+ query_params[:'createdBefore'] = created_before
118
+ query_params[:'shipFromPartyId'] = opts[:'ship_from_party_id'] if !opts[:'ship_from_party_id'].nil?
119
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
120
+ query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
121
+ query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
122
+
123
+ # header parameters
124
+ header_params = opts[:header_params] || {}
125
+ # HTTP header 'Accept' (if needed)
126
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'payload'])
127
+
128
+ # form parameters
129
+ form_params = opts[:form_params] || {}
130
+
131
+ # http body (model)
132
+ post_body = opts[:body]
133
+
134
+ return_type = opts[:return_type] || 'AmazonSpClients::ApiResponse'
135
+
136
+ auth_names = opts[:auth_names] || []
137
+ data = @api_client.call_api(:GET, local_var_path,
138
+ :header_params => header_params,
139
+ :query_params => query_params,
140
+ :form_params => form_params,
141
+ :body => post_body,
142
+ :auth_names => auth_names,
143
+ :return_type => return_type)
144
+
145
+ if @api_client.config.debugging
146
+ @api_client.config.logger.debug "API called: CustomerInvoicesApi#get_customer_invoices\nData: #{data.inspect}"
147
+ end
148
+ return data
149
+ end
150
+ end
151
+ end
152
+ end