shopify_api 14.6.0 → 14.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/Gemfile.lock +12 -7
  4. data/docs/usage/oauth.md +14 -0
  5. data/docs/usage/rest.md +2 -0
  6. data/docs/usage/webhooks.md +11 -0
  7. data/lib/shopify_api/admin_versions.rb +2 -1
  8. data/lib/shopify_api/clients/rest/admin.rb +5 -0
  9. data/lib/shopify_api/context.rb +12 -3
  10. data/lib/shopify_api/errors/disabled_resource_error.rb +8 -0
  11. data/lib/shopify_api/rest/resources/2024_07/webhook.rb +1 -0
  12. data/lib/shopify_api/rest/resources/2024_10/webhook.rb +1 -0
  13. data/lib/shopify_api/rest/resources/2025_01/abandoned_checkout.rb +194 -0
  14. data/lib/shopify_api/rest/resources/2025_01/access_scope.rb +62 -0
  15. data/lib/shopify_api/rest/resources/2025_01/apple_pay_certificate.rb +109 -0
  16. data/lib/shopify_api/rest/resources/2025_01/application_charge.rb +113 -0
  17. data/lib/shopify_api/rest/resources/2025_01/application_credit.rb +95 -0
  18. data/lib/shopify_api/rest/resources/2025_01/article.rb +269 -0
  19. data/lib/shopify_api/rest/resources/2025_01/asset.rb +122 -0
  20. data/lib/shopify_api/rest/resources/2025_01/assigned_fulfillment_order.rb +92 -0
  21. data/lib/shopify_api/rest/resources/2025_01/balance.rb +58 -0
  22. data/lib/shopify_api/rest/resources/2025_01/blog.rb +166 -0
  23. data/lib/shopify_api/rest/resources/2025_01/cancellation_request.rb +87 -0
  24. data/lib/shopify_api/rest/resources/2025_01/carrier_service.rb +120 -0
  25. data/lib/shopify_api/rest/resources/2025_01/checkout.rb +213 -0
  26. data/lib/shopify_api/rest/resources/2025_01/collect.rb +146 -0
  27. data/lib/shopify_api/rest/resources/2025_01/collection.rb +114 -0
  28. data/lib/shopify_api/rest/resources/2025_01/collection_listing.rb +159 -0
  29. data/lib/shopify_api/rest/resources/2025_01/comment.rb +287 -0
  30. data/lib/shopify_api/rest/resources/2025_01/country.rb +141 -0
  31. data/lib/shopify_api/rest/resources/2025_01/currency.rb +61 -0
  32. data/lib/shopify_api/rest/resources/2025_01/custom_collection.rb +191 -0
  33. data/lib/shopify_api/rest/resources/2025_01/customer.rb +328 -0
  34. data/lib/shopify_api/rest/resources/2025_01/customer_address.rb +215 -0
  35. data/lib/shopify_api/rest/resources/2025_01/deprecated_api_call.rb +61 -0
  36. data/lib/shopify_api/rest/resources/2025_01/discount_code.rb +226 -0
  37. data/lib/shopify_api/rest/resources/2025_01/dispute.rb +115 -0
  38. data/lib/shopify_api/rest/resources/2025_01/dispute_evidence.rb +121 -0
  39. data/lib/shopify_api/rest/resources/2025_01/dispute_file_upload.rb +85 -0
  40. data/lib/shopify_api/rest/resources/2025_01/draft_order.rb +279 -0
  41. data/lib/shopify_api/rest/resources/2025_01/event.rb +152 -0
  42. data/lib/shopify_api/rest/resources/2025_01/fulfillment.rb +235 -0
  43. data/lib/shopify_api/rest/resources/2025_01/fulfillment_event.rb +167 -0
  44. data/lib/shopify_api/rest/resources/2025_01/fulfillment_order.rb +326 -0
  45. data/lib/shopify_api/rest/resources/2025_01/fulfillment_request.rb +116 -0
  46. data/lib/shopify_api/rest/resources/2025_01/fulfillment_service.rb +134 -0
  47. data/lib/shopify_api/rest/resources/2025_01/gift_card.rb +222 -0
  48. data/lib/shopify_api/rest/resources/2025_01/gift_card_adjustment.rb +122 -0
  49. data/lib/shopify_api/rest/resources/2025_01/image.rb +161 -0
  50. data/lib/shopify_api/rest/resources/2025_01/inventory_item.rb +112 -0
  51. data/lib/shopify_api/rest/resources/2025_01/inventory_level.rb +183 -0
  52. data/lib/shopify_api/rest/resources/2025_01/location.rb +171 -0
  53. data/lib/shopify_api/rest/resources/2025_01/locations_for_move.rb +60 -0
  54. data/lib/shopify_api/rest/resources/2025_01/marketing_event.rb +213 -0
  55. data/lib/shopify_api/rest/resources/2025_01/metafield.rb +348 -0
  56. data/lib/shopify_api/rest/resources/2025_01/mobile_platform_application.rb +120 -0
  57. data/lib/shopify_api/rest/resources/2025_01/order.rb +503 -0
  58. data/lib/shopify_api/rest/resources/2025_01/order_risk.rb +148 -0
  59. data/lib/shopify_api/rest/resources/2025_01/page.rb +198 -0
  60. data/lib/shopify_api/rest/resources/2025_01/payment.rb +98 -0
  61. data/lib/shopify_api/rest/resources/2025_01/payment_gateway.rb +147 -0
  62. data/lib/shopify_api/rest/resources/2025_01/payment_transaction.rb +117 -0
  63. data/lib/shopify_api/rest/resources/2025_01/payout.rb +101 -0
  64. data/lib/shopify_api/rest/resources/2025_01/policy.rb +73 -0
  65. data/lib/shopify_api/rest/resources/2025_01/price_rule.rb +227 -0
  66. data/lib/shopify_api/rest/resources/2025_01/product.rb +227 -0
  67. data/lib/shopify_api/rest/resources/2025_01/product_listing.rb +200 -0
  68. data/lib/shopify_api/rest/resources/2025_01/product_resource_feedback.rb +92 -0
  69. data/lib/shopify_api/rest/resources/2025_01/province.rb +136 -0
  70. data/lib/shopify_api/rest/resources/2025_01/recurring_application_charge.rb +184 -0
  71. data/lib/shopify_api/rest/resources/2025_01/redirect.rb +143 -0
  72. data/lib/shopify_api/rest/resources/2025_01/refund.rb +158 -0
  73. data/lib/shopify_api/rest/resources/2025_01/resource_feedback.rb +77 -0
  74. data/lib/shopify_api/rest/resources/2025_01/script_tag.rb +159 -0
  75. data/lib/shopify_api/rest/resources/2025_01/shipping_zone.rb +87 -0
  76. data/lib/shopify_api/rest/resources/2025_01/shop.rb +231 -0
  77. data/lib/shopify_api/rest/resources/2025_01/smart_collection.rb +220 -0
  78. data/lib/shopify_api/rest/resources/2025_01/storefront_access_token.rb +91 -0
  79. data/lib/shopify_api/rest/resources/2025_01/tender_transaction.rb +97 -0
  80. data/lib/shopify_api/rest/resources/2025_01/theme.rb +127 -0
  81. data/lib/shopify_api/rest/resources/2025_01/transaction.rb +194 -0
  82. data/lib/shopify_api/rest/resources/2025_01/usage_charge.rb +106 -0
  83. data/lib/shopify_api/rest/resources/2025_01/user.rb +142 -0
  84. data/lib/shopify_api/rest/resources/2025_01/variant.rb +212 -0
  85. data/lib/shopify_api/rest/resources/2025_01/webhook.rb +173 -0
  86. data/lib/shopify_api/version.rb +1 -1
  87. data/lib/shopify_api/webhooks/registration.rb +17 -3
  88. data/lib/shopify_api/webhooks/registrations/event_bridge.rb +22 -3
  89. data/lib/shopify_api/webhooks/registrations/http.rb +22 -3
  90. data/lib/shopify_api/webhooks/registrations/pub_sub.rb +23 -4
  91. data/lib/shopify_api/webhooks/registry.rb +15 -5
  92. metadata +77 -6
@@ -0,0 +1,503 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ ########################################################################################################################
5
+ # This file is auto-generated. If you have an issue, please create a GitHub issue. #
6
+ ########################################################################################################################
7
+
8
+ module ShopifyAPI
9
+ class Order < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ @api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
16
+ @retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
17
+
18
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
19
+ def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
20
+
21
+ @line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
22
+ @app_id = T.let(nil, T.nilable(Integer))
23
+ @billing_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
24
+ @browser_ip = T.let(nil, T.nilable(String))
25
+ @buyer_accepts_marketing = T.let(nil, T.nilable(T::Boolean))
26
+ @cancel_reason = T.let(nil, T.nilable(String))
27
+ @cancelled_at = T.let(nil, T.nilable(String))
28
+ @cart_token = T.let(nil, T.nilable(String))
29
+ @checkout_token = T.let(nil, T.nilable(String))
30
+ @client_details = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
31
+ @closed_at = T.let(nil, T.nilable(String))
32
+ @company = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
33
+ @confirmation_number = T.let(nil, T.nilable(String))
34
+ @confirmed = T.let(nil, T.nilable(T::Boolean))
35
+ @created_at = T.let(nil, T.nilable(String))
36
+ @currency = T.let(nil, T.nilable(String))
37
+ @current_subtotal_price = T.let(nil, T.nilable(String))
38
+ @current_subtotal_price_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
39
+ @current_total_additional_fees_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
40
+ @current_total_discounts = T.let(nil, T.nilable(String))
41
+ @current_total_discounts_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
42
+ @current_total_duties_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
43
+ @current_total_price = T.let(nil, T.nilable(String))
44
+ @current_total_price_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
45
+ @current_total_tax = T.let(nil, T.nilable(String))
46
+ @current_total_tax_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
47
+ @customer = T.let(nil, T.nilable(Customer))
48
+ @customer_locale = T.let(nil, T.nilable(String))
49
+ @discount_applications = T.let(nil, T.nilable(T::Array[T.untyped]))
50
+ @discount_codes = T.let(nil, T.nilable(T::Array[T.untyped]))
51
+ @duties_included = T.let(nil, T.nilable(T::Boolean))
52
+ @email = T.let(nil, T.nilable(String))
53
+ @estimated_taxes = T.let(nil, T.nilable(T::Boolean))
54
+ @financial_status = T.let(nil, T.nilable(String))
55
+ @fulfillment_status = T.let(nil, T.nilable(String))
56
+ @fulfillments = T.let(nil, T.nilable(T::Array[T.untyped]))
57
+ @id = T.let(nil, T.nilable(Integer))
58
+ @landing_site = T.let(nil, T.nilable(String))
59
+ @location_id = T.let(nil, T.nilable(Integer))
60
+ @merchant_business_entity_id = T.let(nil, T.nilable(String))
61
+ @merchant_of_record_app_id = T.let(nil, T.nilable(Integer))
62
+ @name = T.let(nil, T.nilable(String))
63
+ @note = T.let(nil, T.nilable(String))
64
+ @note_attributes = T.let(nil, T.nilable(T::Array[T.untyped]))
65
+ @number = T.let(nil, T.nilable(Integer))
66
+ @order_number = T.let(nil, T.nilable(Integer))
67
+ @order_status_url = T.let(nil, T.nilable(String))
68
+ @original_total_additional_fees_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
69
+ @original_total_duties_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
70
+ @payment_gateway_names = T.let(nil, T.nilable(T::Array[T.untyped]))
71
+ @payment_terms = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
72
+ @phone = T.let(nil, T.nilable(String))
73
+ @po_number = T.let(nil, T.nilable(String))
74
+ @presentment_currency = T.let(nil, T.nilable(String))
75
+ @processed_at = T.let(nil, T.nilable(String))
76
+ @referring_site = T.let(nil, T.nilable(String))
77
+ @refunds = T.let(nil, T.nilable(T::Array[T.untyped]))
78
+ @shipping_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
79
+ @shipping_lines = T.let(nil, T.nilable(T::Array[T.untyped]))
80
+ @source_identifier = T.let(nil, T.nilable(String))
81
+ @source_name = T.let(nil, T.nilable(String))
82
+ @source_url = T.let(nil, T.nilable(String))
83
+ @subtotal_price = T.let(nil, T.nilable(String))
84
+ @subtotal_price_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
85
+ @tags = T.let(nil, T.nilable(String))
86
+ @tax_lines = T.let(nil, T.nilable(T::Array[T.untyped]))
87
+ @taxes_included = T.let(nil, T.nilable(T::Boolean))
88
+ @test = T.let(nil, T.nilable(T::Boolean))
89
+ @token = T.let(nil, T.nilable(String))
90
+ @total_cash_rounding_payment_adjustment_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
91
+ @total_cash_rounding_refund_adjustment_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
92
+ @total_discounts = T.let(nil, T.nilable(String))
93
+ @total_discounts_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
94
+ @total_line_items_price = T.let(nil, T.nilable(String))
95
+ @total_line_items_price_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
96
+ @total_outstanding = T.let(nil, T.nilable(String))
97
+ @total_price = T.let(nil, T.nilable(String))
98
+ @total_price_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
99
+ @total_shipping_price_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
100
+ @total_tax = T.let(nil, T.nilable(T.any(String, Float)))
101
+ @total_tax_set = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
102
+ @total_tip_received = T.let(nil, T.nilable(String))
103
+ @total_weight = T.let(nil, T.nilable(Integer))
104
+ @updated_at = T.let(nil, T.nilable(String))
105
+ @user_id = T.let(nil, T.nilable(Integer))
106
+
107
+ super(session: session, from_hash: from_hash)
108
+ end
109
+
110
+ @has_one = T.let({
111
+ customer: Customer
112
+ }, T::Hash[Symbol, Class])
113
+ @has_many = T.let({
114
+ discount_codes: DiscountCode,
115
+ fulfillments: Fulfillment,
116
+ refunds: Refund
117
+ }, T::Hash[Symbol, Class])
118
+ @paths = T.let([
119
+ {http_method: :delete, operation: :delete, ids: [:id], path: "orders/<id>.json"},
120
+ {http_method: :get, operation: :count, ids: [], path: "orders/count.json"},
121
+ {http_method: :get, operation: :get, ids: [], path: "orders.json"},
122
+ {http_method: :get, operation: :get, ids: [:id], path: "orders/<id>.json"},
123
+ {http_method: :post, operation: :cancel, ids: [:id], path: "orders/<id>/cancel.json"},
124
+ {http_method: :post, operation: :close, ids: [:id], path: "orders/<id>/close.json"},
125
+ {http_method: :post, operation: :open, ids: [:id], path: "orders/<id>/open.json"},
126
+ {http_method: :post, operation: :post, ids: [], path: "orders.json"},
127
+ {http_method: :put, operation: :put, ids: [:id], path: "orders/<id>.json"}
128
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
129
+
130
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
131
+ attr_reader :line_items
132
+ sig { returns(T.nilable(Integer)) }
133
+ attr_reader :app_id
134
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
135
+ attr_reader :billing_address
136
+ sig { returns(T.nilable(String)) }
137
+ attr_reader :browser_ip
138
+ sig { returns(T.nilable(T::Boolean)) }
139
+ attr_reader :buyer_accepts_marketing
140
+ sig { returns(T.nilable(String)) }
141
+ attr_reader :cancel_reason
142
+ sig { returns(T.nilable(String)) }
143
+ attr_reader :cancelled_at
144
+ sig { returns(T.nilable(String)) }
145
+ attr_reader :cart_token
146
+ sig { returns(T.nilable(String)) }
147
+ attr_reader :checkout_token
148
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
149
+ attr_reader :client_details
150
+ sig { returns(T.nilable(String)) }
151
+ attr_reader :closed_at
152
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
153
+ attr_reader :company
154
+ sig { returns(T.nilable(String)) }
155
+ attr_reader :confirmation_number
156
+ sig { returns(T.nilable(T::Boolean)) }
157
+ attr_reader :confirmed
158
+ sig { returns(T.nilable(String)) }
159
+ attr_reader :created_at
160
+ sig { returns(T.nilable(String)) }
161
+ attr_reader :currency
162
+ sig { returns(T.nilable(String)) }
163
+ attr_reader :current_subtotal_price
164
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
165
+ attr_reader :current_subtotal_price_set
166
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
167
+ attr_reader :current_total_additional_fees_set
168
+ sig { returns(T.nilable(String)) }
169
+ attr_reader :current_total_discounts
170
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
171
+ attr_reader :current_total_discounts_set
172
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
173
+ attr_reader :current_total_duties_set
174
+ sig { returns(T.nilable(String)) }
175
+ attr_reader :current_total_price
176
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
177
+ attr_reader :current_total_price_set
178
+ sig { returns(T.nilable(String)) }
179
+ attr_reader :current_total_tax
180
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
181
+ attr_reader :current_total_tax_set
182
+ sig { returns(T.nilable(Customer)) }
183
+ attr_reader :customer
184
+ sig { returns(T.nilable(String)) }
185
+ attr_reader :customer_locale
186
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
187
+ attr_reader :discount_applications
188
+ sig { returns(T.nilable(T::Array[DiscountCode])) }
189
+ attr_reader :discount_codes
190
+ sig { returns(T.nilable(T::Boolean)) }
191
+ attr_reader :duties_included
192
+ sig { returns(T.nilable(String)) }
193
+ attr_reader :email
194
+ sig { returns(T.nilable(T::Boolean)) }
195
+ attr_reader :estimated_taxes
196
+ sig { returns(T.nilable(String)) }
197
+ attr_reader :financial_status
198
+ sig { returns(T.nilable(String)) }
199
+ attr_reader :fulfillment_status
200
+ sig { returns(T.nilable(T::Array[Fulfillment])) }
201
+ attr_reader :fulfillments
202
+ sig { returns(T.nilable(Integer)) }
203
+ attr_reader :id
204
+ sig { returns(T.nilable(String)) }
205
+ attr_reader :landing_site
206
+ sig { returns(T.nilable(Integer)) }
207
+ attr_reader :location_id
208
+ sig { returns(T.nilable(String)) }
209
+ attr_reader :merchant_business_entity_id
210
+ sig { returns(T.nilable(Integer)) }
211
+ attr_reader :merchant_of_record_app_id
212
+ sig { returns(T.nilable(String)) }
213
+ attr_reader :name
214
+ sig { returns(T.nilable(String)) }
215
+ attr_reader :note
216
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
217
+ attr_reader :note_attributes
218
+ sig { returns(T.nilable(Integer)) }
219
+ attr_reader :number
220
+ sig { returns(T.nilable(Integer)) }
221
+ attr_reader :order_number
222
+ sig { returns(T.nilable(String)) }
223
+ attr_reader :order_status_url
224
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
225
+ attr_reader :original_total_additional_fees_set
226
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
227
+ attr_reader :original_total_duties_set
228
+ sig { returns(T.nilable(T::Array[String])) }
229
+ attr_reader :payment_gateway_names
230
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
231
+ attr_reader :payment_terms
232
+ sig { returns(T.nilable(String)) }
233
+ attr_reader :phone
234
+ sig { returns(T.nilable(String)) }
235
+ attr_reader :po_number
236
+ sig { returns(T.nilable(String)) }
237
+ attr_reader :presentment_currency
238
+ sig { returns(T.nilable(String)) }
239
+ attr_reader :processed_at
240
+ sig { returns(T.nilable(String)) }
241
+ attr_reader :referring_site
242
+ sig { returns(T.nilable(T::Array[Refund])) }
243
+ attr_reader :refunds
244
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
245
+ attr_reader :shipping_address
246
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
247
+ attr_reader :shipping_lines
248
+ sig { returns(T.nilable(String)) }
249
+ attr_reader :source_identifier
250
+ sig { returns(T.nilable(String)) }
251
+ attr_reader :source_name
252
+ sig { returns(T.nilable(String)) }
253
+ attr_reader :source_url
254
+ sig { returns(T.nilable(String)) }
255
+ attr_reader :subtotal_price
256
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
257
+ attr_reader :subtotal_price_set
258
+ sig { returns(T.nilable(String)) }
259
+ attr_reader :tags
260
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
261
+ attr_reader :tax_lines
262
+ sig { returns(T.nilable(T::Boolean)) }
263
+ attr_reader :taxes_included
264
+ sig { returns(T.nilable(T::Boolean)) }
265
+ attr_reader :test
266
+ sig { returns(T.nilable(String)) }
267
+ attr_reader :token
268
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
269
+ attr_reader :total_cash_rounding_payment_adjustment_set
270
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
271
+ attr_reader :total_cash_rounding_refund_adjustment_set
272
+ sig { returns(T.nilable(String)) }
273
+ attr_reader :total_discounts
274
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
275
+ attr_reader :total_discounts_set
276
+ sig { returns(T.nilable(String)) }
277
+ attr_reader :total_line_items_price
278
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
279
+ attr_reader :total_line_items_price_set
280
+ sig { returns(T.nilable(String)) }
281
+ attr_reader :total_outstanding
282
+ sig { returns(T.nilable(String)) }
283
+ attr_reader :total_price
284
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
285
+ attr_reader :total_price_set
286
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
287
+ attr_reader :total_shipping_price_set
288
+ sig { returns(T.nilable(T.any(String, Float))) }
289
+ attr_reader :total_tax
290
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
291
+ attr_reader :total_tax_set
292
+ sig { returns(T.nilable(String)) }
293
+ attr_reader :total_tip_received
294
+ sig { returns(T.nilable(Integer)) }
295
+ attr_reader :total_weight
296
+ sig { returns(T.nilable(String)) }
297
+ attr_reader :updated_at
298
+ sig { returns(T.nilable(Integer)) }
299
+ attr_reader :user_id
300
+
301
+ class << self
302
+ sig do
303
+ params(
304
+ id: T.any(Integer, String),
305
+ fields: T.untyped,
306
+ session: Auth::Session
307
+ ).returns(T.nilable(Order))
308
+ end
309
+ def find(
310
+ id:,
311
+ fields: nil,
312
+ session: ShopifyAPI::Context.active_session
313
+ )
314
+ result = base_find(
315
+ session: session,
316
+ ids: {id: id},
317
+ params: {fields: fields},
318
+ )
319
+ T.cast(result[0], T.nilable(Order))
320
+ end
321
+
322
+ sig do
323
+ params(
324
+ id: T.any(Integer, String),
325
+ session: Auth::Session
326
+ ).returns(T.untyped)
327
+ end
328
+ def delete(
329
+ id:,
330
+ session: ShopifyAPI::Context.active_session
331
+ )
332
+ request(
333
+ http_method: :delete,
334
+ operation: :delete,
335
+ session: session,
336
+ ids: {id: id},
337
+ params: {},
338
+ )
339
+ end
340
+
341
+ sig do
342
+ params(
343
+ ids: T.untyped,
344
+ limit: T.untyped,
345
+ since_id: T.untyped,
346
+ created_at_min: T.untyped,
347
+ created_at_max: T.untyped,
348
+ updated_at_min: T.untyped,
349
+ updated_at_max: T.untyped,
350
+ processed_at_min: T.untyped,
351
+ processed_at_max: T.untyped,
352
+ attribution_app_id: T.untyped,
353
+ name: T.untyped,
354
+ status: T.untyped,
355
+ financial_status: T.untyped,
356
+ fulfillment_status: T.untyped,
357
+ fields: T.untyped,
358
+ session: Auth::Session,
359
+ kwargs: T.untyped
360
+ ).returns(T::Array[Order])
361
+ end
362
+ def all(
363
+ ids: nil,
364
+ limit: nil,
365
+ since_id: nil,
366
+ created_at_min: nil,
367
+ created_at_max: nil,
368
+ updated_at_min: nil,
369
+ updated_at_max: nil,
370
+ processed_at_min: nil,
371
+ processed_at_max: nil,
372
+ attribution_app_id: nil,
373
+ name: nil,
374
+ status: nil,
375
+ financial_status: nil,
376
+ fulfillment_status: nil,
377
+ fields: nil,
378
+ session: ShopifyAPI::Context.active_session,
379
+ **kwargs
380
+ )
381
+ response = base_find(
382
+ session: session,
383
+ ids: {},
384
+ params: {ids: ids, limit: limit, since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, processed_at_min: processed_at_min, processed_at_max: processed_at_max, attribution_app_id: attribution_app_id, name: name, status: status, financial_status: financial_status, fulfillment_status: fulfillment_status, fields: fields}.merge(kwargs).compact,
385
+ )
386
+
387
+ T.cast(response, T::Array[Order])
388
+ end
389
+
390
+ sig do
391
+ params(
392
+ created_at_min: T.untyped,
393
+ created_at_max: T.untyped,
394
+ updated_at_min: T.untyped,
395
+ updated_at_max: T.untyped,
396
+ status: T.untyped,
397
+ financial_status: T.untyped,
398
+ fulfillment_status: T.untyped,
399
+ session: Auth::Session,
400
+ kwargs: T.untyped
401
+ ).returns(T.untyped)
402
+ end
403
+ def count(
404
+ created_at_min: nil,
405
+ created_at_max: nil,
406
+ updated_at_min: nil,
407
+ updated_at_max: nil,
408
+ status: nil,
409
+ financial_status: nil,
410
+ fulfillment_status: nil,
411
+ session: ShopifyAPI::Context.active_session,
412
+ **kwargs
413
+ )
414
+ request(
415
+ http_method: :get,
416
+ operation: :count,
417
+ session: session,
418
+ ids: {},
419
+ params: {created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, status: status, financial_status: financial_status, fulfillment_status: fulfillment_status}.merge(kwargs).compact,
420
+ body: {},
421
+ entity: nil,
422
+ )
423
+ end
424
+
425
+ end
426
+
427
+ sig do
428
+ params(
429
+ amount: T.untyped,
430
+ currency: T.untyped,
431
+ restock: T.untyped,
432
+ reason: T.untyped,
433
+ email: T.untyped,
434
+ refund: T.untyped,
435
+ body: T.untyped,
436
+ kwargs: T.untyped
437
+ ).returns(T.untyped)
438
+ end
439
+ def cancel(
440
+ amount: nil,
441
+ currency: nil,
442
+ restock: nil,
443
+ reason: nil,
444
+ email: nil,
445
+ refund: nil,
446
+ body: nil,
447
+ **kwargs
448
+ )
449
+ self.class.request(
450
+ http_method: :post,
451
+ operation: :cancel,
452
+ session: @session,
453
+ ids: {id: @id},
454
+ params: {amount: amount, currency: currency, restock: restock, reason: reason, email: email, refund: refund}.merge(kwargs).compact,
455
+ body: body,
456
+ entity: self,
457
+ )
458
+ end
459
+
460
+ sig do
461
+ params(
462
+ body: T.untyped,
463
+ kwargs: T.untyped
464
+ ).returns(T.untyped)
465
+ end
466
+ def close(
467
+ body: nil,
468
+ **kwargs
469
+ )
470
+ self.class.request(
471
+ http_method: :post,
472
+ operation: :close,
473
+ session: @session,
474
+ ids: {id: @id},
475
+ params: {}.merge(kwargs).compact,
476
+ body: body,
477
+ entity: self,
478
+ )
479
+ end
480
+
481
+ sig do
482
+ params(
483
+ body: T.untyped,
484
+ kwargs: T.untyped
485
+ ).returns(T.untyped)
486
+ end
487
+ def open(
488
+ body: nil,
489
+ **kwargs
490
+ )
491
+ self.class.request(
492
+ http_method: :post,
493
+ operation: :open,
494
+ session: @session,
495
+ ids: {id: @id},
496
+ params: {}.merge(kwargs).compact,
497
+ body: body,
498
+ entity: self,
499
+ )
500
+ end
501
+
502
+ end
503
+ end
@@ -0,0 +1,148 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ ########################################################################################################################
5
+ # This file is auto-generated. If you have an issue, please create a GitHub issue. #
6
+ ########################################################################################################################
7
+
8
+ module ShopifyAPI
9
+ class OrderRisk < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ @api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
16
+ @retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
17
+
18
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
19
+ def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
20
+
21
+ @cause_cancel = T.let(nil, T.nilable(T::Boolean))
22
+ @checkout_id = T.let(nil, T.nilable(Integer))
23
+ @display = T.let(nil, T.nilable(T::Boolean))
24
+ @id = T.let(nil, T.nilable(Integer))
25
+ @merchant_message = T.let(nil, T.nilable(String))
26
+ @message = T.let(nil, T.nilable(String))
27
+ @order_id = T.let(nil, T.nilable(Integer))
28
+ @recommendation = T.let(nil, T.nilable(String))
29
+ @score = T.let(nil, T.nilable(String))
30
+ @source = T.let(nil, T.nilable(String))
31
+
32
+ super(session: session, from_hash: from_hash)
33
+ end
34
+
35
+ @has_one = T.let({}, T::Hash[Symbol, Class])
36
+ @has_many = T.let({}, T::Hash[Symbol, Class])
37
+ @paths = T.let([
38
+ {http_method: :delete, operation: :delete, ids: [:order_id, :id], path: "orders/<order_id>/risks/<id>.json"},
39
+ {http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/risks.json"},
40
+ {http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/risks/<id>.json"},
41
+ {http_method: :post, operation: :post, ids: [:order_id], path: "orders/<order_id>/risks.json"},
42
+ {http_method: :put, operation: :put, ids: [:order_id, :id], path: "orders/<order_id>/risks/<id>.json"}
43
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
44
+
45
+ sig { returns(T.nilable(T::Boolean)) }
46
+ attr_reader :cause_cancel
47
+ sig { returns(T.nilable(Integer)) }
48
+ attr_reader :checkout_id
49
+ sig { returns(T.nilable(T::Boolean)) }
50
+ attr_reader :display
51
+ sig { returns(T.nilable(Integer)) }
52
+ attr_reader :id
53
+ sig { returns(T.nilable(String)) }
54
+ attr_reader :merchant_message
55
+ sig { returns(T.nilable(String)) }
56
+ attr_reader :message
57
+ sig { returns(T.nilable(Integer)) }
58
+ attr_reader :order_id
59
+ sig { returns(T.nilable(String)) }
60
+ attr_reader :recommendation
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :score
63
+ sig { returns(T.nilable(String)) }
64
+ attr_reader :source
65
+
66
+ class << self
67
+ sig do
68
+ returns(String)
69
+ end
70
+ def json_body_name()
71
+ "risk"
72
+ end
73
+
74
+ sig do
75
+ returns(T::Array[String])
76
+ end
77
+ def json_response_body_names()
78
+ [
79
+ "risk"
80
+ ]
81
+ end
82
+
83
+ sig do
84
+ params(
85
+ id: T.any(Integer, String),
86
+ order_id: T.nilable(T.any(Integer, String)),
87
+ session: Auth::Session
88
+ ).returns(T.nilable(OrderRisk))
89
+ end
90
+ def find(
91
+ id:,
92
+ order_id: nil,
93
+ session: ShopifyAPI::Context.active_session
94
+ )
95
+ result = base_find(
96
+ session: session,
97
+ ids: {id: id, order_id: order_id},
98
+ params: {},
99
+ )
100
+ T.cast(result[0], T.nilable(OrderRisk))
101
+ end
102
+
103
+ sig do
104
+ params(
105
+ id: T.any(Integer, String),
106
+ order_id: T.nilable(T.any(Integer, String)),
107
+ session: Auth::Session
108
+ ).returns(T.untyped)
109
+ end
110
+ def delete(
111
+ id:,
112
+ order_id: nil,
113
+ session: ShopifyAPI::Context.active_session
114
+ )
115
+ request(
116
+ http_method: :delete,
117
+ operation: :delete,
118
+ session: session,
119
+ ids: {id: id, order_id: order_id},
120
+ params: {},
121
+ )
122
+ end
123
+
124
+ sig do
125
+ params(
126
+ order_id: T.nilable(T.any(Integer, String)),
127
+ session: Auth::Session,
128
+ kwargs: T.untyped
129
+ ).returns(T::Array[OrderRisk])
130
+ end
131
+ def all(
132
+ order_id: nil,
133
+ session: ShopifyAPI::Context.active_session,
134
+ **kwargs
135
+ )
136
+ response = base_find(
137
+ session: session,
138
+ ids: {order_id: order_id},
139
+ params: {}.merge(kwargs).compact,
140
+ )
141
+
142
+ T.cast(response, T::Array[OrderRisk])
143
+ end
144
+
145
+ end
146
+
147
+ end
148
+ end