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,279 @@
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 DraftOrder < 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
+ @applied_discount = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
22
+ @billing_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
23
+ @completed_at = T.let(nil, T.nilable(String))
24
+ @created_at = T.let(nil, T.nilable(String))
25
+ @currency = T.let(nil, T.nilable(String))
26
+ @customer = T.let(nil, T.nilable(Customer))
27
+ @email = T.let(nil, T.nilable(String))
28
+ @id = T.let(nil, T.nilable(Integer))
29
+ @invoice_sent_at = T.let(nil, T.nilable(String))
30
+ @invoice_url = T.let(nil, T.nilable(String))
31
+ @line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
32
+ @name = T.let(nil, T.nilable(String))
33
+ @note = T.let(nil, T.nilable(String))
34
+ @note_attributes = T.let(nil, T.nilable(T::Array[T.untyped]))
35
+ @order_id = T.let(nil, T.nilable(Integer))
36
+ @payment_terms = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
37
+ @shipping_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
38
+ @shipping_line = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
39
+ @source_name = T.let(nil, T.nilable(String))
40
+ @status = T.let(nil, T.nilable(String))
41
+ @subtotal_price = T.let(nil, T.nilable(String))
42
+ @tags = T.let(nil, T.nilable(String))
43
+ @tax_exempt = T.let(nil, T.nilable(T::Boolean))
44
+ @tax_exemptions = T.let(nil, T.nilable(T::Array[T.untyped]))
45
+ @tax_lines = T.let(nil, T.nilable(T::Array[T.untyped]))
46
+ @taxes_included = T.let(nil, T.nilable(T::Boolean))
47
+ @total_price = T.let(nil, T.nilable(String))
48
+ @total_tax = T.let(nil, T.nilable(String))
49
+ @updated_at = T.let(nil, T.nilable(String))
50
+
51
+ super(session: session, from_hash: from_hash)
52
+ end
53
+
54
+ @has_one = T.let({
55
+ customer: Customer
56
+ }, T::Hash[Symbol, Class])
57
+ @has_many = T.let({}, T::Hash[Symbol, Class])
58
+ @paths = T.let([
59
+ {http_method: :delete, operation: :delete, ids: [:id], path: "draft_orders/<id>.json"},
60
+ {http_method: :get, operation: :count, ids: [], path: "draft_orders/count.json"},
61
+ {http_method: :get, operation: :get, ids: [], path: "draft_orders.json"},
62
+ {http_method: :get, operation: :get, ids: [:id], path: "draft_orders/<id>.json"},
63
+ {http_method: :post, operation: :post, ids: [], path: "draft_orders.json"},
64
+ {http_method: :post, operation: :send_invoice, ids: [:id], path: "draft_orders/<id>/send_invoice.json"},
65
+ {http_method: :put, operation: :complete, ids: [:id], path: "draft_orders/<id>/complete.json"},
66
+ {http_method: :put, operation: :put, ids: [:id], path: "draft_orders/<id>.json"}
67
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
68
+
69
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
70
+ attr_reader :applied_discount
71
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
72
+ attr_reader :billing_address
73
+ sig { returns(T.nilable(String)) }
74
+ attr_reader :completed_at
75
+ sig { returns(T.nilable(String)) }
76
+ attr_reader :created_at
77
+ sig { returns(T.nilable(String)) }
78
+ attr_reader :currency
79
+ sig { returns(T.nilable(Customer)) }
80
+ attr_reader :customer
81
+ sig { returns(T.nilable(String)) }
82
+ attr_reader :email
83
+ sig { returns(T.nilable(Integer)) }
84
+ attr_reader :id
85
+ sig { returns(T.nilable(String)) }
86
+ attr_reader :invoice_sent_at
87
+ sig { returns(T.nilable(String)) }
88
+ attr_reader :invoice_url
89
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
90
+ attr_reader :line_items
91
+ sig { returns(T.nilable(String)) }
92
+ attr_reader :name
93
+ sig { returns(T.nilable(String)) }
94
+ attr_reader :note
95
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
96
+ attr_reader :note_attributes
97
+ sig { returns(T.nilable(Integer)) }
98
+ attr_reader :order_id
99
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
100
+ attr_reader :payment_terms
101
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
102
+ attr_reader :shipping_address
103
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
104
+ attr_reader :shipping_line
105
+ sig { returns(T.nilable(String)) }
106
+ attr_reader :source_name
107
+ sig { returns(T.nilable(String)) }
108
+ attr_reader :status
109
+ sig { returns(T.nilable(String)) }
110
+ attr_reader :subtotal_price
111
+ sig { returns(T.nilable(String)) }
112
+ attr_reader :tags
113
+ sig { returns(T.nilable(T::Boolean)) }
114
+ attr_reader :tax_exempt
115
+ sig { returns(T.nilable(T::Array[String])) }
116
+ attr_reader :tax_exemptions
117
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
118
+ attr_reader :tax_lines
119
+ sig { returns(T.nilable(T::Boolean)) }
120
+ attr_reader :taxes_included
121
+ sig { returns(T.nilable(String)) }
122
+ attr_reader :total_price
123
+ sig { returns(T.nilable(String)) }
124
+ attr_reader :total_tax
125
+ sig { returns(T.nilable(String)) }
126
+ attr_reader :updated_at
127
+
128
+ class << self
129
+ sig do
130
+ params(
131
+ id: T.any(Integer, String),
132
+ fields: T.untyped,
133
+ session: Auth::Session
134
+ ).returns(T.nilable(DraftOrder))
135
+ end
136
+ def find(
137
+ id:,
138
+ fields: nil,
139
+ session: ShopifyAPI::Context.active_session
140
+ )
141
+ result = base_find(
142
+ session: session,
143
+ ids: {id: id},
144
+ params: {fields: fields},
145
+ )
146
+ T.cast(result[0], T.nilable(DraftOrder))
147
+ end
148
+
149
+ sig do
150
+ params(
151
+ id: T.any(Integer, String),
152
+ session: Auth::Session
153
+ ).returns(T.untyped)
154
+ end
155
+ def delete(
156
+ id:,
157
+ session: ShopifyAPI::Context.active_session
158
+ )
159
+ request(
160
+ http_method: :delete,
161
+ operation: :delete,
162
+ session: session,
163
+ ids: {id: id},
164
+ params: {},
165
+ )
166
+ end
167
+
168
+ sig do
169
+ params(
170
+ fields: T.untyped,
171
+ limit: T.untyped,
172
+ since_id: T.untyped,
173
+ updated_at_min: T.untyped,
174
+ updated_at_max: T.untyped,
175
+ ids: T.untyped,
176
+ status: T.untyped,
177
+ session: Auth::Session,
178
+ kwargs: T.untyped
179
+ ).returns(T::Array[DraftOrder])
180
+ end
181
+ def all(
182
+ fields: nil,
183
+ limit: nil,
184
+ since_id: nil,
185
+ updated_at_min: nil,
186
+ updated_at_max: nil,
187
+ ids: nil,
188
+ status: nil,
189
+ session: ShopifyAPI::Context.active_session,
190
+ **kwargs
191
+ )
192
+ response = base_find(
193
+ session: session,
194
+ ids: {},
195
+ params: {fields: fields, limit: limit, since_id: since_id, updated_at_min: updated_at_min, updated_at_max: updated_at_max, ids: ids, status: status}.merge(kwargs).compact,
196
+ )
197
+
198
+ T.cast(response, T::Array[DraftOrder])
199
+ end
200
+
201
+ sig do
202
+ params(
203
+ since_id: T.untyped,
204
+ status: T.untyped,
205
+ updated_at_max: T.untyped,
206
+ updated_at_min: T.untyped,
207
+ session: Auth::Session,
208
+ kwargs: T.untyped
209
+ ).returns(T.untyped)
210
+ end
211
+ def count(
212
+ since_id: nil,
213
+ status: nil,
214
+ updated_at_max: nil,
215
+ updated_at_min: nil,
216
+ session: ShopifyAPI::Context.active_session,
217
+ **kwargs
218
+ )
219
+ request(
220
+ http_method: :get,
221
+ operation: :count,
222
+ session: session,
223
+ ids: {},
224
+ params: {since_id: since_id, status: status, updated_at_max: updated_at_max, updated_at_min: updated_at_min}.merge(kwargs).compact,
225
+ body: {},
226
+ entity: nil,
227
+ )
228
+ end
229
+
230
+ end
231
+
232
+ sig do
233
+ params(
234
+ body: T.untyped,
235
+ kwargs: T.untyped
236
+ ).returns(T.untyped)
237
+ end
238
+ def send_invoice(
239
+ body: nil,
240
+ **kwargs
241
+ )
242
+ self.class.request(
243
+ http_method: :post,
244
+ operation: :send_invoice,
245
+ session: @session,
246
+ ids: {id: @id},
247
+ params: {}.merge(kwargs).compact,
248
+ body: body,
249
+ entity: self,
250
+ )
251
+ end
252
+
253
+ sig do
254
+ params(
255
+ payment_gateway_id: T.untyped,
256
+ payment_pending: T.untyped,
257
+ body: T.untyped,
258
+ kwargs: T.untyped
259
+ ).returns(T.untyped)
260
+ end
261
+ def complete(
262
+ payment_gateway_id: nil,
263
+ payment_pending: nil,
264
+ body: nil,
265
+ **kwargs
266
+ )
267
+ self.class.request(
268
+ http_method: :put,
269
+ operation: :complete,
270
+ session: @session,
271
+ ids: {id: @id},
272
+ params: {payment_gateway_id: payment_gateway_id, payment_pending: payment_pending}.merge(kwargs).compact,
273
+ body: body,
274
+ entity: self,
275
+ )
276
+ end
277
+
278
+ end
279
+ end
@@ -0,0 +1,152 @@
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 Event < 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
+ @arguments = T.let(nil, T.nilable(T::Array[T.untyped]))
22
+ @body = T.let(nil, T.nilable(String))
23
+ @created_at = T.let(nil, T.nilable(String))
24
+ @description = T.let(nil, T.nilable(String))
25
+ @id = T.let(nil, T.nilable(Integer))
26
+ @message = T.let(nil, T.nilable(String))
27
+ @path = T.let(nil, T.nilable(String))
28
+ @subject_id = T.let(nil, T.nilable(Integer))
29
+ @subject_type = T.let(nil, T.nilable(String))
30
+ @verb = 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: :get, operation: :count, ids: [], path: "events/count.json"},
39
+ {http_method: :get, operation: :get, ids: [], path: "events.json"},
40
+ {http_method: :get, operation: :get, ids: [:id], path: "events/<id>.json"},
41
+ {http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/events.json"},
42
+ {http_method: :get, operation: :get, ids: [:product_id], path: "products/<product_id>/events.json"}
43
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
44
+
45
+ sig { returns(T.nilable(T::Array[String])) }
46
+ attr_reader :arguments
47
+ sig { returns(T.nilable(String)) }
48
+ attr_reader :body
49
+ sig { returns(T.nilable(String)) }
50
+ attr_reader :created_at
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :description
53
+ sig { returns(T.nilable(Integer)) }
54
+ attr_reader :id
55
+ sig { returns(T.nilable(String)) }
56
+ attr_reader :message
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :path
59
+ sig { returns(T.nilable(Integer)) }
60
+ attr_reader :subject_id
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :subject_type
63
+ sig { returns(T.nilable(String)) }
64
+ attr_reader :verb
65
+
66
+ class << self
67
+ sig do
68
+ params(
69
+ id: T.any(Integer, String),
70
+ fields: T.untyped,
71
+ session: Auth::Session
72
+ ).returns(T.nilable(Event))
73
+ end
74
+ def find(
75
+ id:,
76
+ fields: nil,
77
+ session: ShopifyAPI::Context.active_session
78
+ )
79
+ result = base_find(
80
+ session: session,
81
+ ids: {id: id},
82
+ params: {fields: fields},
83
+ )
84
+ T.cast(result[0], T.nilable(Event))
85
+ end
86
+
87
+ sig do
88
+ params(
89
+ order_id: T.nilable(T.any(Integer, String)),
90
+ product_id: T.nilable(T.any(Integer, String)),
91
+ limit: T.untyped,
92
+ since_id: T.untyped,
93
+ created_at_min: T.untyped,
94
+ created_at_max: T.untyped,
95
+ filter: T.untyped,
96
+ verb: T.untyped,
97
+ fields: T.untyped,
98
+ session: Auth::Session,
99
+ kwargs: T.untyped
100
+ ).returns(T::Array[Event])
101
+ end
102
+ def all(
103
+ order_id: nil,
104
+ product_id: nil,
105
+ limit: nil,
106
+ since_id: nil,
107
+ created_at_min: nil,
108
+ created_at_max: nil,
109
+ filter: nil,
110
+ verb: nil,
111
+ fields: nil,
112
+ session: ShopifyAPI::Context.active_session,
113
+ **kwargs
114
+ )
115
+ response = base_find(
116
+ session: session,
117
+ ids: {order_id: order_id, product_id: product_id},
118
+ params: {limit: limit, since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, filter: filter, verb: verb, fields: fields}.merge(kwargs).compact,
119
+ )
120
+
121
+ T.cast(response, T::Array[Event])
122
+ end
123
+
124
+ sig do
125
+ params(
126
+ created_at_min: T.untyped,
127
+ created_at_max: T.untyped,
128
+ session: Auth::Session,
129
+ kwargs: T.untyped
130
+ ).returns(T.untyped)
131
+ end
132
+ def count(
133
+ created_at_min: nil,
134
+ created_at_max: nil,
135
+ session: ShopifyAPI::Context.active_session,
136
+ **kwargs
137
+ )
138
+ request(
139
+ http_method: :get,
140
+ operation: :count,
141
+ session: session,
142
+ ids: {},
143
+ params: {created_at_min: created_at_min, created_at_max: created_at_max}.merge(kwargs).compact,
144
+ body: {},
145
+ entity: nil,
146
+ )
147
+ end
148
+
149
+ end
150
+
151
+ end
152
+ end
@@ -0,0 +1,235 @@
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 Fulfillment < 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
+ @created_at = T.let(nil, T.nilable(String))
22
+ @id = T.let(nil, T.nilable(Integer))
23
+ @line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
24
+ @location_id = T.let(nil, T.nilable(Integer))
25
+ @name = T.let(nil, T.nilable(String))
26
+ @notify_customer = T.let(nil, T.nilable(T::Boolean))
27
+ @order_id = T.let(nil, T.nilable(Integer))
28
+ @origin_address = T.let(nil, T.nilable(T::Array[T.untyped]))
29
+ @receipt = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
30
+ @service = T.let(nil, T.nilable(String))
31
+ @shipment_status = T.let(nil, T.nilable(String))
32
+ @status = T.let(nil, T.nilable(String))
33
+ @tracking_company = T.let(nil, T.nilable(String))
34
+ @tracking_number = T.let(nil, T.nilable(String))
35
+ @tracking_numbers = T.let(nil, T.nilable(T::Array[T.untyped]))
36
+ @tracking_url = T.let(nil, T.nilable(String))
37
+ @tracking_urls = T.let(nil, T.nilable(T::Array[T.untyped]))
38
+ @updated_at = T.let(nil, T.nilable(String))
39
+ @variant_inventory_management = T.let(nil, T.nilable(String))
40
+
41
+ super(session: session, from_hash: from_hash)
42
+ end
43
+
44
+ @has_one = T.let({}, T::Hash[Symbol, Class])
45
+ @has_many = T.let({}, T::Hash[Symbol, Class])
46
+ @paths = T.let([
47
+ {http_method: :get, operation: :count, ids: [:order_id], path: "orders/<order_id>/fulfillments/count.json"},
48
+ {http_method: :get, operation: :get, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/fulfillments.json"},
49
+ {http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/fulfillments.json"},
50
+ {http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/fulfillments/<id>.json"},
51
+ {http_method: :post, operation: :cancel, ids: [:id], path: "fulfillments/<id>/cancel.json"},
52
+ {http_method: :post, operation: :post, ids: [], path: "fulfillments.json"},
53
+ {http_method: :post, operation: :update_tracking, ids: [:id], path: "fulfillments/<id>/update_tracking.json"}
54
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
55
+
56
+ sig { returns(T.nilable(String)) }
57
+ attr_reader :created_at
58
+ sig { returns(T.nilable(Integer)) }
59
+ attr_reader :id
60
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
61
+ attr_reader :line_items
62
+ sig { returns(T.nilable(Integer)) }
63
+ attr_reader :location_id
64
+ sig { returns(T.nilable(String)) }
65
+ attr_reader :name
66
+ sig { returns(T.nilable(T::Boolean)) }
67
+ attr_reader :notify_customer
68
+ sig { returns(T.nilable(Integer)) }
69
+ attr_reader :order_id
70
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
71
+ attr_reader :origin_address
72
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
73
+ attr_reader :receipt
74
+ sig { returns(T.nilable(String)) }
75
+ attr_reader :service
76
+ sig { returns(T.nilable(String)) }
77
+ attr_reader :shipment_status
78
+ sig { returns(T.nilable(String)) }
79
+ attr_reader :status
80
+ sig { returns(T.nilable(String)) }
81
+ attr_reader :tracking_company
82
+ sig { returns(T.nilable(String)) }
83
+ attr_reader :tracking_number
84
+ sig { returns(T.nilable(T::Array[String])) }
85
+ attr_reader :tracking_numbers
86
+ sig { returns(T.nilable(String)) }
87
+ attr_reader :tracking_url
88
+ sig { returns(T.nilable(T::Array[String])) }
89
+ attr_reader :tracking_urls
90
+ sig { returns(T.nilable(String)) }
91
+ attr_reader :updated_at
92
+ sig { returns(T.nilable(String)) }
93
+ attr_reader :variant_inventory_management
94
+
95
+ class << self
96
+ sig do
97
+ params(
98
+ id: T.any(Integer, String),
99
+ order_id: T.nilable(T.any(Integer, String)),
100
+ fields: T.untyped,
101
+ session: Auth::Session
102
+ ).returns(T.nilable(Fulfillment))
103
+ end
104
+ def find(
105
+ id:,
106
+ order_id: nil,
107
+ fields: nil,
108
+ session: ShopifyAPI::Context.active_session
109
+ )
110
+ result = base_find(
111
+ session: session,
112
+ ids: {id: id, order_id: order_id},
113
+ params: {fields: fields},
114
+ )
115
+ T.cast(result[0], T.nilable(Fulfillment))
116
+ end
117
+
118
+ sig do
119
+ params(
120
+ fulfillment_order_id: T.nilable(T.any(Integer, String)),
121
+ order_id: T.nilable(T.any(Integer, String)),
122
+ created_at_max: T.untyped,
123
+ created_at_min: T.untyped,
124
+ fields: T.untyped,
125
+ limit: T.untyped,
126
+ since_id: T.untyped,
127
+ updated_at_max: T.untyped,
128
+ updated_at_min: T.untyped,
129
+ session: Auth::Session,
130
+ kwargs: T.untyped
131
+ ).returns(T::Array[Fulfillment])
132
+ end
133
+ def all(
134
+ fulfillment_order_id: nil,
135
+ order_id: nil,
136
+ created_at_max: nil,
137
+ created_at_min: nil,
138
+ fields: nil,
139
+ limit: nil,
140
+ since_id: nil,
141
+ updated_at_max: nil,
142
+ updated_at_min: nil,
143
+ session: ShopifyAPI::Context.active_session,
144
+ **kwargs
145
+ )
146
+ response = base_find(
147
+ session: session,
148
+ ids: {fulfillment_order_id: fulfillment_order_id, order_id: order_id},
149
+ params: {created_at_max: created_at_max, created_at_min: created_at_min, fields: fields, limit: limit, since_id: since_id, updated_at_max: updated_at_max, updated_at_min: updated_at_min}.merge(kwargs).compact,
150
+ )
151
+
152
+ T.cast(response, T::Array[Fulfillment])
153
+ end
154
+
155
+ sig do
156
+ params(
157
+ order_id: T.nilable(T.any(Integer, String)),
158
+ created_at_min: T.untyped,
159
+ created_at_max: T.untyped,
160
+ updated_at_min: T.untyped,
161
+ updated_at_max: T.untyped,
162
+ session: Auth::Session,
163
+ kwargs: T.untyped
164
+ ).returns(T.untyped)
165
+ end
166
+ def count(
167
+ order_id: nil,
168
+ created_at_min: nil,
169
+ created_at_max: nil,
170
+ updated_at_min: nil,
171
+ updated_at_max: nil,
172
+ session: ShopifyAPI::Context.active_session,
173
+ **kwargs
174
+ )
175
+ request(
176
+ http_method: :get,
177
+ operation: :count,
178
+ session: session,
179
+ ids: {order_id: order_id},
180
+ 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}.merge(kwargs).compact,
181
+ body: {},
182
+ entity: nil,
183
+ )
184
+ end
185
+
186
+ end
187
+
188
+ sig do
189
+ params(
190
+ body: T.untyped,
191
+ kwargs: T.untyped
192
+ ).returns(T.untyped)
193
+ end
194
+ def cancel(
195
+ body: nil,
196
+ **kwargs
197
+ )
198
+ self.class.request(
199
+ http_method: :post,
200
+ operation: :cancel,
201
+ session: @session,
202
+ ids: {id: @id},
203
+ params: {}.merge(kwargs).compact,
204
+ body: body,
205
+ entity: self,
206
+ )
207
+ end
208
+
209
+ sig do
210
+ params(
211
+ notify_customer: T.untyped,
212
+ tracking_info: T.untyped,
213
+ body: T.untyped,
214
+ kwargs: T.untyped
215
+ ).returns(T.untyped)
216
+ end
217
+ def update_tracking(
218
+ notify_customer: nil,
219
+ tracking_info: nil,
220
+ body: nil,
221
+ **kwargs
222
+ )
223
+ self.class.request(
224
+ http_method: :post,
225
+ operation: :update_tracking,
226
+ session: @session,
227
+ ids: {id: @id},
228
+ params: {notify_customer: notify_customer, tracking_info: tracking_info}.merge(kwargs).compact,
229
+ body: body,
230
+ entity: self,
231
+ )
232
+ end
233
+
234
+ end
235
+ end