shopify_api 12.3.0 → 12.4.0

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