shopify_api 13.0.0 → 13.1.0

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