shopify_api 14.5.0 → 14.7.0

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