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.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/BUG_REPORT.md +40 -0
- data/.github/ISSUE_TEMPLATE/ENHANCEMENT.md +9 -0
- data/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +9 -0
- data/.github/workflows/build.yml +0 -3
- data/.github/workflows/stale.yml +1 -0
- data/CHANGELOG.md +8 -1
- data/Gemfile.lock +9 -9
- data/lib/shopify_api/admin_versions.rb +2 -1
- data/lib/shopify_api/rest/base.rb +11 -4
- data/lib/shopify_api/rest/resources/2022_01/assigned_fulfillment_order.rb +7 -0
- data/lib/shopify_api/rest/resources/2022_01/customer.rb +9 -1
- data/lib/shopify_api/rest/resources/2022_01/fulfillment.rb +5 -1
- data/lib/shopify_api/rest/resources/2022_01/fulfillment_order.rb +3 -3
- data/lib/shopify_api/rest/resources/2022_04/assigned_fulfillment_order.rb +7 -0
- data/lib/shopify_api/rest/resources/2022_04/customer.rb +9 -1
- data/lib/shopify_api/rest/resources/2022_04/fulfillment.rb +5 -1
- data/lib/shopify_api/rest/resources/2022_04/fulfillment_order.rb +3 -3
- data/lib/shopify_api/rest/resources/2022_04/metafield.rb +5 -3
- data/lib/shopify_api/rest/resources/2022_07/assigned_fulfillment_order.rb +7 -0
- data/lib/shopify_api/rest/resources/2022_07/customer.rb +9 -1
- data/lib/shopify_api/rest/resources/2022_07/fulfillment.rb +5 -1
- data/lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb +3 -3
- data/lib/shopify_api/rest/resources/2022_07/metafield.rb +5 -3
- data/lib/shopify_api/rest/resources/2022_10/assigned_fulfillment_order.rb +7 -0
- data/lib/shopify_api/rest/resources/2022_10/customer.rb +9 -1
- data/lib/shopify_api/rest/resources/2022_10/fulfillment.rb +5 -1
- data/lib/shopify_api/rest/resources/2022_10/fulfillment_order.rb +3 -3
- data/lib/shopify_api/rest/resources/2022_10/metafield.rb +5 -3
- data/lib/shopify_api/rest/resources/2023_01/abandoned_checkout.rb +190 -0
- data/lib/shopify_api/rest/resources/2023_01/access_scope.rb +58 -0
- data/lib/shopify_api/rest/resources/2023_01/apple_pay_certificate.rb +105 -0
- data/lib/shopify_api/rest/resources/2023_01/application_charge.rb +104 -0
- data/lib/shopify_api/rest/resources/2023_01/application_credit.rb +87 -0
- data/lib/shopify_api/rest/resources/2023_01/article.rb +265 -0
- data/lib/shopify_api/rest/resources/2023_01/asset.rb +118 -0
- data/lib/shopify_api/rest/resources/2023_01/assigned_fulfillment_order.rb +86 -0
- data/lib/shopify_api/rest/resources/2023_01/balance.rb +50 -0
- data/lib/shopify_api/rest/resources/2023_01/blog.rb +162 -0
- data/lib/shopify_api/rest/resources/2023_01/cancellation_request.rb +83 -0
- data/lib/shopify_api/rest/resources/2023_01/carrier_service.rb +113 -0
- data/lib/shopify_api/rest/resources/2023_01/checkout.rb +209 -0
- data/lib/shopify_api/rest/resources/2023_01/collect.rb +142 -0
- data/lib/shopify_api/rest/resources/2023_01/collection.rb +110 -0
- data/lib/shopify_api/rest/resources/2023_01/collection_listing.rb +155 -0
- data/lib/shopify_api/rest/resources/2023_01/comment.rb +283 -0
- data/lib/shopify_api/rest/resources/2023_01/country.rb +137 -0
- data/lib/shopify_api/rest/resources/2023_01/currency.rb +57 -0
- data/lib/shopify_api/rest/resources/2023_01/custom_collection.rb +187 -0
- data/lib/shopify_api/rest/resources/2023_01/customer.rb +329 -0
- data/lib/shopify_api/rest/resources/2023_01/customer_address.rb +201 -0
- data/lib/shopify_api/rest/resources/2023_01/customer_saved_search.rb +169 -0
- data/lib/shopify_api/rest/resources/2023_01/deprecated_api_call.rb +57 -0
- data/lib/shopify_api/rest/resources/2023_01/discount_code.rb +219 -0
- data/lib/shopify_api/rest/resources/2023_01/dispute.rb +111 -0
- data/lib/shopify_api/rest/resources/2023_01/draft_order.rb +275 -0
- data/lib/shopify_api/rest/resources/2023_01/event.rb +148 -0
- data/lib/shopify_api/rest/resources/2023_01/fulfillment.rb +225 -0
- data/lib/shopify_api/rest/resources/2023_01/fulfillment_event.rb +166 -0
- data/lib/shopify_api/rest/resources/2023_01/fulfillment_order.rb +316 -0
- data/lib/shopify_api/rest/resources/2023_01/fulfillment_request.rb +87 -0
- data/lib/shopify_api/rest/resources/2023_01/fulfillment_service.rb +130 -0
- data/lib/shopify_api/rest/resources/2023_01/gift_card.rb +215 -0
- data/lib/shopify_api/rest/resources/2023_01/gift_card_adjustment.rb +118 -0
- data/lib/shopify_api/rest/resources/2023_01/image.rb +157 -0
- data/lib/shopify_api/rest/resources/2023_01/inventory_item.rb +108 -0
- data/lib/shopify_api/rest/resources/2023_01/inventory_level.rb +179 -0
- data/lib/shopify_api/rest/resources/2023_01/location.rb +167 -0
- data/lib/shopify_api/rest/resources/2023_01/locations_for_move.rb +56 -0
- data/lib/shopify_api/rest/resources/2023_01/marketing_event.rb +209 -0
- data/lib/shopify_api/rest/resources/2023_01/metafield.rb +344 -0
- data/lib/shopify_api/rest/resources/2023_01/mobile_platform_application.rb +110 -0
- data/lib/shopify_api/rest/resources/2023_01/order.rb +479 -0
- data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +135 -0
- data/lib/shopify_api/rest/resources/2023_01/page.rb +194 -0
- data/lib/shopify_api/rest/resources/2023_01/payment.rb +140 -0
- data/lib/shopify_api/rest/resources/2023_01/payment_gateway.rb +143 -0
- data/lib/shopify_api/rest/resources/2023_01/payment_transaction.rb +107 -0
- data/lib/shopify_api/rest/resources/2023_01/payout.rb +97 -0
- data/lib/shopify_api/rest/resources/2023_01/policy.rb +69 -0
- data/lib/shopify_api/rest/resources/2023_01/price_rule.rb +223 -0
- data/lib/shopify_api/rest/resources/2023_01/product.rb +223 -0
- data/lib/shopify_api/rest/resources/2023_01/product_listing.rb +196 -0
- data/lib/shopify_api/rest/resources/2023_01/product_resource_feedback.rb +88 -0
- data/lib/shopify_api/rest/resources/2023_01/province.rb +132 -0
- data/lib/shopify_api/rest/resources/2023_01/recurring_application_charge.rb +167 -0
- data/lib/shopify_api/rest/resources/2023_01/redirect.rb +139 -0
- data/lib/shopify_api/rest/resources/2023_01/refund.rb +151 -0
- data/lib/shopify_api/rest/resources/2023_01/report.rb +121 -0
- data/lib/shopify_api/rest/resources/2023_01/resource_feedback.rb +73 -0
- data/lib/shopify_api/rest/resources/2023_01/script_tag.rb +155 -0
- data/lib/shopify_api/rest/resources/2023_01/shipping_zone.rb +83 -0
- data/lib/shopify_api/rest/resources/2023_01/shop.rb +221 -0
- data/lib/shopify_api/rest/resources/2023_01/smart_collection.rb +216 -0
- data/lib/shopify_api/rest/resources/2023_01/storefront_access_token.rb +87 -0
- data/lib/shopify_api/rest/resources/2023_01/tender_transaction.rb +93 -0
- data/lib/shopify_api/rest/resources/2023_01/theme.rb +120 -0
- data/lib/shopify_api/rest/resources/2023_01/transaction.rb +181 -0
- data/lib/shopify_api/rest/resources/2023_01/usage_charge.rb +97 -0
- data/lib/shopify_api/rest/resources/2023_01/user.rb +138 -0
- data/lib/shopify_api/rest/resources/2023_01/variant.rb +212 -0
- data/lib/shopify_api/rest/resources/2023_01/webhook.rb +168 -0
- data/lib/shopify_api/version.rb +1 -1
- metadata +78 -3
- data/.github/ISSUE_TEMPLATE.md +0 -35
@@ -0,0 +1,275 @@
|
|
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
|
+
sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
|
16
|
+
def initialize(session: ShopifyAPI::Context.active_session)
|
17
|
+
super(session: session)
|
18
|
+
|
19
|
+
@applied_discount = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
20
|
+
@billing_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
21
|
+
@completed_at = T.let(nil, T.nilable(String))
|
22
|
+
@created_at = T.let(nil, T.nilable(String))
|
23
|
+
@currency = T.let(nil, T.nilable(String))
|
24
|
+
@customer = T.let(nil, T.nilable(Customer))
|
25
|
+
@email = T.let(nil, T.nilable(String))
|
26
|
+
@id = T.let(nil, T.nilable(Integer))
|
27
|
+
@invoice_sent_at = T.let(nil, T.nilable(String))
|
28
|
+
@invoice_url = T.let(nil, T.nilable(String))
|
29
|
+
@line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
|
30
|
+
@name = T.let(nil, T.nilable(String))
|
31
|
+
@note = T.let(nil, T.nilable(String))
|
32
|
+
@note_attributes = T.let(nil, T.nilable(T::Array[T.untyped]))
|
33
|
+
@order_id = T.let(nil, T.nilable(Integer))
|
34
|
+
@payment_terms = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
35
|
+
@shipping_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
36
|
+
@shipping_line = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
37
|
+
@source_name = T.let(nil, T.nilable(String))
|
38
|
+
@status = T.let(nil, T.nilable(String))
|
39
|
+
@subtotal_price = T.let(nil, T.nilable(Float))
|
40
|
+
@tags = T.let(nil, T.nilable(String))
|
41
|
+
@tax_exempt = T.let(nil, T.nilable(T::Boolean))
|
42
|
+
@tax_exemptions = T.let(nil, T.nilable(T::Array[T.untyped]))
|
43
|
+
@tax_lines = T.let(nil, T.nilable(T::Array[T.untyped]))
|
44
|
+
@taxes_included = T.let(nil, T.nilable(T::Boolean))
|
45
|
+
@total_price = T.let(nil, T.nilable(String))
|
46
|
+
@total_tax = T.let(nil, T.nilable(String))
|
47
|
+
@updated_at = T.let(nil, T.nilable(String))
|
48
|
+
end
|
49
|
+
|
50
|
+
@has_one = T.let({
|
51
|
+
customer: Customer
|
52
|
+
}, T::Hash[Symbol, Class])
|
53
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
54
|
+
@paths = T.let([
|
55
|
+
{http_method: :delete, operation: :delete, ids: [:id], path: "draft_orders/<id>.json"},
|
56
|
+
{http_method: :get, operation: :count, ids: [], path: "draft_orders/count.json"},
|
57
|
+
{http_method: :get, operation: :get, ids: [], path: "draft_orders.json"},
|
58
|
+
{http_method: :get, operation: :get, ids: [:id], path: "draft_orders/<id>.json"},
|
59
|
+
{http_method: :post, operation: :post, ids: [], path: "draft_orders.json"},
|
60
|
+
{http_method: :post, operation: :send_invoice, ids: [:id], path: "draft_orders/<id>/send_invoice.json"},
|
61
|
+
{http_method: :put, operation: :complete, ids: [:id], path: "draft_orders/<id>/complete.json"},
|
62
|
+
{http_method: :put, operation: :put, ids: [:id], path: "draft_orders/<id>.json"}
|
63
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
64
|
+
|
65
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
66
|
+
attr_reader :applied_discount
|
67
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
68
|
+
attr_reader :billing_address
|
69
|
+
sig { returns(T.nilable(String)) }
|
70
|
+
attr_reader :completed_at
|
71
|
+
sig { returns(T.nilable(String)) }
|
72
|
+
attr_reader :created_at
|
73
|
+
sig { returns(T.nilable(String)) }
|
74
|
+
attr_reader :currency
|
75
|
+
sig { returns(T.nilable(Customer)) }
|
76
|
+
attr_reader :customer
|
77
|
+
sig { returns(T.nilable(String)) }
|
78
|
+
attr_reader :email
|
79
|
+
sig { returns(T.nilable(Integer)) }
|
80
|
+
attr_reader :id
|
81
|
+
sig { returns(T.nilable(String)) }
|
82
|
+
attr_reader :invoice_sent_at
|
83
|
+
sig { returns(T.nilable(String)) }
|
84
|
+
attr_reader :invoice_url
|
85
|
+
sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
|
86
|
+
attr_reader :line_items
|
87
|
+
sig { returns(T.nilable(String)) }
|
88
|
+
attr_reader :name
|
89
|
+
sig { returns(T.nilable(String)) }
|
90
|
+
attr_reader :note
|
91
|
+
sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
|
92
|
+
attr_reader :note_attributes
|
93
|
+
sig { returns(T.nilable(Integer)) }
|
94
|
+
attr_reader :order_id
|
95
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
96
|
+
attr_reader :payment_terms
|
97
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
98
|
+
attr_reader :shipping_address
|
99
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
100
|
+
attr_reader :shipping_line
|
101
|
+
sig { returns(T.nilable(String)) }
|
102
|
+
attr_reader :source_name
|
103
|
+
sig { returns(T.nilable(String)) }
|
104
|
+
attr_reader :status
|
105
|
+
sig { returns(T.nilable(Float)) }
|
106
|
+
attr_reader :subtotal_price
|
107
|
+
sig { returns(T.nilable(String)) }
|
108
|
+
attr_reader :tags
|
109
|
+
sig { returns(T.nilable(T::Boolean)) }
|
110
|
+
attr_reader :tax_exempt
|
111
|
+
sig { returns(T.nilable(T::Array[String])) }
|
112
|
+
attr_reader :tax_exemptions
|
113
|
+
sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
|
114
|
+
attr_reader :tax_lines
|
115
|
+
sig { returns(T.nilable(T::Boolean)) }
|
116
|
+
attr_reader :taxes_included
|
117
|
+
sig { returns(T.nilable(String)) }
|
118
|
+
attr_reader :total_price
|
119
|
+
sig { returns(T.nilable(String)) }
|
120
|
+
attr_reader :total_tax
|
121
|
+
sig { returns(T.nilable(String)) }
|
122
|
+
attr_reader :updated_at
|
123
|
+
|
124
|
+
class << self
|
125
|
+
sig do
|
126
|
+
params(
|
127
|
+
id: T.any(Integer, String),
|
128
|
+
fields: T.untyped,
|
129
|
+
session: Auth::Session
|
130
|
+
).returns(T.nilable(DraftOrder))
|
131
|
+
end
|
132
|
+
def find(
|
133
|
+
id:,
|
134
|
+
fields: nil,
|
135
|
+
session: ShopifyAPI::Context.active_session
|
136
|
+
)
|
137
|
+
result = base_find(
|
138
|
+
session: session,
|
139
|
+
ids: {id: id},
|
140
|
+
params: {fields: fields},
|
141
|
+
)
|
142
|
+
T.cast(result[0], T.nilable(DraftOrder))
|
143
|
+
end
|
144
|
+
|
145
|
+
sig do
|
146
|
+
params(
|
147
|
+
id: T.any(Integer, String),
|
148
|
+
session: Auth::Session
|
149
|
+
).returns(T.untyped)
|
150
|
+
end
|
151
|
+
def delete(
|
152
|
+
id:,
|
153
|
+
session: ShopifyAPI::Context.active_session
|
154
|
+
)
|
155
|
+
request(
|
156
|
+
http_method: :delete,
|
157
|
+
operation: :delete,
|
158
|
+
session: session,
|
159
|
+
ids: {id: id},
|
160
|
+
params: {},
|
161
|
+
)
|
162
|
+
end
|
163
|
+
|
164
|
+
sig do
|
165
|
+
params(
|
166
|
+
fields: T.untyped,
|
167
|
+
limit: T.untyped,
|
168
|
+
since_id: T.untyped,
|
169
|
+
updated_at_min: T.untyped,
|
170
|
+
updated_at_max: T.untyped,
|
171
|
+
ids: T.untyped,
|
172
|
+
status: T.untyped,
|
173
|
+
session: Auth::Session,
|
174
|
+
kwargs: T.untyped
|
175
|
+
).returns(T::Array[DraftOrder])
|
176
|
+
end
|
177
|
+
def all(
|
178
|
+
fields: nil,
|
179
|
+
limit: nil,
|
180
|
+
since_id: nil,
|
181
|
+
updated_at_min: nil,
|
182
|
+
updated_at_max: nil,
|
183
|
+
ids: nil,
|
184
|
+
status: nil,
|
185
|
+
session: ShopifyAPI::Context.active_session,
|
186
|
+
**kwargs
|
187
|
+
)
|
188
|
+
response = base_find(
|
189
|
+
session: session,
|
190
|
+
ids: {},
|
191
|
+
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,
|
192
|
+
)
|
193
|
+
|
194
|
+
T.cast(response, T::Array[DraftOrder])
|
195
|
+
end
|
196
|
+
|
197
|
+
sig do
|
198
|
+
params(
|
199
|
+
since_id: T.untyped,
|
200
|
+
status: T.untyped,
|
201
|
+
updated_at_max: T.untyped,
|
202
|
+
updated_at_min: T.untyped,
|
203
|
+
session: Auth::Session,
|
204
|
+
kwargs: T.untyped
|
205
|
+
).returns(T.untyped)
|
206
|
+
end
|
207
|
+
def count(
|
208
|
+
since_id: nil,
|
209
|
+
status: nil,
|
210
|
+
updated_at_max: nil,
|
211
|
+
updated_at_min: nil,
|
212
|
+
session: ShopifyAPI::Context.active_session,
|
213
|
+
**kwargs
|
214
|
+
)
|
215
|
+
request(
|
216
|
+
http_method: :get,
|
217
|
+
operation: :count,
|
218
|
+
session: session,
|
219
|
+
ids: {},
|
220
|
+
params: {since_id: since_id, status: status, updated_at_max: updated_at_max, updated_at_min: updated_at_min}.merge(kwargs).compact,
|
221
|
+
body: {},
|
222
|
+
entity: nil,
|
223
|
+
)
|
224
|
+
end
|
225
|
+
|
226
|
+
end
|
227
|
+
|
228
|
+
sig do
|
229
|
+
params(
|
230
|
+
body: T.untyped,
|
231
|
+
kwargs: T.untyped
|
232
|
+
).returns(T.untyped)
|
233
|
+
end
|
234
|
+
def send_invoice(
|
235
|
+
body: nil,
|
236
|
+
**kwargs
|
237
|
+
)
|
238
|
+
self.class.request(
|
239
|
+
http_method: :post,
|
240
|
+
operation: :send_invoice,
|
241
|
+
session: @session,
|
242
|
+
ids: {id: @id},
|
243
|
+
params: {}.merge(kwargs).compact,
|
244
|
+
body: body,
|
245
|
+
entity: self,
|
246
|
+
)
|
247
|
+
end
|
248
|
+
|
249
|
+
sig do
|
250
|
+
params(
|
251
|
+
payment_gateway_id: T.untyped,
|
252
|
+
payment_pending: T.untyped,
|
253
|
+
body: T.untyped,
|
254
|
+
kwargs: T.untyped
|
255
|
+
).returns(T.untyped)
|
256
|
+
end
|
257
|
+
def complete(
|
258
|
+
payment_gateway_id: nil,
|
259
|
+
payment_pending: nil,
|
260
|
+
body: nil,
|
261
|
+
**kwargs
|
262
|
+
)
|
263
|
+
self.class.request(
|
264
|
+
http_method: :put,
|
265
|
+
operation: :complete,
|
266
|
+
session: @session,
|
267
|
+
ids: {id: @id},
|
268
|
+
params: {payment_gateway_id: payment_gateway_id, payment_pending: payment_pending}.merge(kwargs).compact,
|
269
|
+
body: body,
|
270
|
+
entity: self,
|
271
|
+
)
|
272
|
+
end
|
273
|
+
|
274
|
+
end
|
275
|
+
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 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
|
+
sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
|
16
|
+
def initialize(session: ShopifyAPI::Context.active_session)
|
17
|
+
super(session: session)
|
18
|
+
|
19
|
+
@arguments = T.let(nil, T.nilable(String))
|
20
|
+
@body = T.let(nil, T.nilable(String))
|
21
|
+
@created_at = T.let(nil, T.nilable(String))
|
22
|
+
@description = T.let(nil, T.nilable(String))
|
23
|
+
@id = T.let(nil, T.nilable(Integer))
|
24
|
+
@message = T.let(nil, T.nilable(String))
|
25
|
+
@path = T.let(nil, T.nilable(String))
|
26
|
+
@subject_id = T.let(nil, T.nilable(Integer))
|
27
|
+
@subject_type = T.let(nil, T.nilable(String))
|
28
|
+
@verb = 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: :get, operation: :count, ids: [], path: "events/count.json"},
|
35
|
+
{http_method: :get, operation: :get, ids: [], path: "events.json"},
|
36
|
+
{http_method: :get, operation: :get, ids: [:id], path: "events/<id>.json"},
|
37
|
+
{http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/events.json"},
|
38
|
+
{http_method: :get, operation: :get, ids: [:product_id], path: "products/<product_id>/events.json"}
|
39
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
40
|
+
|
41
|
+
sig { returns(T.nilable(String)) }
|
42
|
+
attr_reader :arguments
|
43
|
+
sig { returns(T.nilable(String)) }
|
44
|
+
attr_reader :body
|
45
|
+
sig { returns(T.nilable(String)) }
|
46
|
+
attr_reader :created_at
|
47
|
+
sig { returns(T.nilable(String)) }
|
48
|
+
attr_reader :description
|
49
|
+
sig { returns(T.nilable(Integer)) }
|
50
|
+
attr_reader :id
|
51
|
+
sig { returns(T.nilable(String)) }
|
52
|
+
attr_reader :message
|
53
|
+
sig { returns(T.nilable(String)) }
|
54
|
+
attr_reader :path
|
55
|
+
sig { returns(T.nilable(Integer)) }
|
56
|
+
attr_reader :subject_id
|
57
|
+
sig { returns(T.nilable(String)) }
|
58
|
+
attr_reader :subject_type
|
59
|
+
sig { returns(T.nilable(String)) }
|
60
|
+
attr_reader :verb
|
61
|
+
|
62
|
+
class << self
|
63
|
+
sig do
|
64
|
+
params(
|
65
|
+
id: T.any(Integer, String),
|
66
|
+
fields: T.untyped,
|
67
|
+
session: Auth::Session
|
68
|
+
).returns(T.nilable(Event))
|
69
|
+
end
|
70
|
+
def find(
|
71
|
+
id:,
|
72
|
+
fields: nil,
|
73
|
+
session: ShopifyAPI::Context.active_session
|
74
|
+
)
|
75
|
+
result = base_find(
|
76
|
+
session: session,
|
77
|
+
ids: {id: id},
|
78
|
+
params: {fields: fields},
|
79
|
+
)
|
80
|
+
T.cast(result[0], T.nilable(Event))
|
81
|
+
end
|
82
|
+
|
83
|
+
sig do
|
84
|
+
params(
|
85
|
+
order_id: T.nilable(T.any(Integer, String)),
|
86
|
+
product_id: T.nilable(T.any(Integer, String)),
|
87
|
+
limit: T.untyped,
|
88
|
+
since_id: T.untyped,
|
89
|
+
created_at_min: T.untyped,
|
90
|
+
created_at_max: T.untyped,
|
91
|
+
filter: T.untyped,
|
92
|
+
verb: T.untyped,
|
93
|
+
fields: T.untyped,
|
94
|
+
session: Auth::Session,
|
95
|
+
kwargs: T.untyped
|
96
|
+
).returns(T::Array[Event])
|
97
|
+
end
|
98
|
+
def all(
|
99
|
+
order_id: nil,
|
100
|
+
product_id: nil,
|
101
|
+
limit: nil,
|
102
|
+
since_id: nil,
|
103
|
+
created_at_min: nil,
|
104
|
+
created_at_max: nil,
|
105
|
+
filter: nil,
|
106
|
+
verb: nil,
|
107
|
+
fields: nil,
|
108
|
+
session: ShopifyAPI::Context.active_session,
|
109
|
+
**kwargs
|
110
|
+
)
|
111
|
+
response = base_find(
|
112
|
+
session: session,
|
113
|
+
ids: {order_id: order_id, product_id: product_id},
|
114
|
+
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,
|
115
|
+
)
|
116
|
+
|
117
|
+
T.cast(response, T::Array[Event])
|
118
|
+
end
|
119
|
+
|
120
|
+
sig do
|
121
|
+
params(
|
122
|
+
created_at_min: T.untyped,
|
123
|
+
created_at_max: T.untyped,
|
124
|
+
session: Auth::Session,
|
125
|
+
kwargs: T.untyped
|
126
|
+
).returns(T.untyped)
|
127
|
+
end
|
128
|
+
def count(
|
129
|
+
created_at_min: nil,
|
130
|
+
created_at_max: nil,
|
131
|
+
session: ShopifyAPI::Context.active_session,
|
132
|
+
**kwargs
|
133
|
+
)
|
134
|
+
request(
|
135
|
+
http_method: :get,
|
136
|
+
operation: :count,
|
137
|
+
session: session,
|
138
|
+
ids: {},
|
139
|
+
params: {created_at_min: created_at_min, created_at_max: created_at_max}.merge(kwargs).compact,
|
140
|
+
body: {},
|
141
|
+
entity: nil,
|
142
|
+
)
|
143
|
+
end
|
144
|
+
|
145
|
+
end
|
146
|
+
|
147
|
+
end
|
148
|
+
end
|
@@ -0,0 +1,225 @@
|
|
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
|
+
sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
|
16
|
+
def initialize(session: ShopifyAPI::Context.active_session)
|
17
|
+
super(session: session)
|
18
|
+
|
19
|
+
@created_at = T.let(nil, T.nilable(String))
|
20
|
+
@id = T.let(nil, T.nilable(Integer))
|
21
|
+
@line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
|
22
|
+
@location_id = T.let(nil, T.nilable(Integer))
|
23
|
+
@name = T.let(nil, T.nilable(String))
|
24
|
+
@notify_customer = T.let(nil, T.nilable(T::Boolean))
|
25
|
+
@order_id = T.let(nil, T.nilable(Integer))
|
26
|
+
@origin_address = T.let(nil, T.nilable(T::Array[T.untyped]))
|
27
|
+
@receipt = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
|
28
|
+
@service = T.let(nil, T.nilable(String))
|
29
|
+
@shipment_status = T.let(nil, T.nilable(String))
|
30
|
+
@status = T.let(nil, T.nilable(String))
|
31
|
+
@tracking_company = T.let(nil, T.nilable(String))
|
32
|
+
@tracking_numbers = T.let(nil, T.nilable(T::Array[T.untyped]))
|
33
|
+
@tracking_urls = T.let(nil, T.nilable(T::Array[T.untyped]))
|
34
|
+
@updated_at = T.let(nil, T.nilable(String))
|
35
|
+
@variant_inventory_management = T.let(nil, T.nilable(String))
|
36
|
+
end
|
37
|
+
|
38
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
39
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
40
|
+
@paths = T.let([
|
41
|
+
{http_method: :get, operation: :count, ids: [:order_id], path: "orders/<order_id>/fulfillments/count.json"},
|
42
|
+
{http_method: :get, operation: :get, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/fulfillments.json"},
|
43
|
+
{http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/fulfillments.json"},
|
44
|
+
{http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/fulfillments/<id>.json"},
|
45
|
+
{http_method: :post, operation: :cancel, ids: [:id], path: "fulfillments/<id>/cancel.json"},
|
46
|
+
{http_method: :post, operation: :post, ids: [], path: "fulfillments.json"},
|
47
|
+
{http_method: :post, operation: :update_tracking, ids: [:id], path: "fulfillments/<id>/update_tracking.json"}
|
48
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
49
|
+
|
50
|
+
sig { returns(T.nilable(String)) }
|
51
|
+
attr_reader :created_at
|
52
|
+
sig { returns(T.nilable(Integer)) }
|
53
|
+
attr_reader :id
|
54
|
+
sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
|
55
|
+
attr_reader :line_items
|
56
|
+
sig { returns(T.nilable(Integer)) }
|
57
|
+
attr_reader :location_id
|
58
|
+
sig { returns(T.nilable(String)) }
|
59
|
+
attr_reader :name
|
60
|
+
sig { returns(T.nilable(T::Boolean)) }
|
61
|
+
attr_reader :notify_customer
|
62
|
+
sig { returns(T.nilable(Integer)) }
|
63
|
+
attr_reader :order_id
|
64
|
+
sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
|
65
|
+
attr_reader :origin_address
|
66
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
67
|
+
attr_reader :receipt
|
68
|
+
sig { returns(T.nilable(String)) }
|
69
|
+
attr_reader :service
|
70
|
+
sig { returns(T.nilable(String)) }
|
71
|
+
attr_reader :shipment_status
|
72
|
+
sig { returns(T.nilable(String)) }
|
73
|
+
attr_reader :status
|
74
|
+
sig { returns(T.nilable(String)) }
|
75
|
+
attr_reader :tracking_company
|
76
|
+
sig { returns(T.nilable(T::Array[String])) }
|
77
|
+
attr_reader :tracking_numbers
|
78
|
+
sig { returns(T.nilable(T::Array[String])) }
|
79
|
+
attr_reader :tracking_urls
|
80
|
+
sig { returns(T.nilable(String)) }
|
81
|
+
attr_reader :updated_at
|
82
|
+
sig { returns(T.nilable(String)) }
|
83
|
+
attr_reader :variant_inventory_management
|
84
|
+
|
85
|
+
class << self
|
86
|
+
sig do
|
87
|
+
params(
|
88
|
+
id: T.any(Integer, String),
|
89
|
+
order_id: T.nilable(T.any(Integer, String)),
|
90
|
+
fields: T.untyped,
|
91
|
+
session: Auth::Session
|
92
|
+
).returns(T.nilable(Fulfillment))
|
93
|
+
end
|
94
|
+
def find(
|
95
|
+
id:,
|
96
|
+
order_id: nil,
|
97
|
+
fields: nil,
|
98
|
+
session: ShopifyAPI::Context.active_session
|
99
|
+
)
|
100
|
+
result = base_find(
|
101
|
+
session: session,
|
102
|
+
ids: {id: id, order_id: order_id},
|
103
|
+
params: {fields: fields},
|
104
|
+
)
|
105
|
+
T.cast(result[0], T.nilable(Fulfillment))
|
106
|
+
end
|
107
|
+
|
108
|
+
sig do
|
109
|
+
params(
|
110
|
+
fulfillment_order_id: T.nilable(T.any(Integer, String)),
|
111
|
+
order_id: T.nilable(T.any(Integer, String)),
|
112
|
+
created_at_max: T.untyped,
|
113
|
+
created_at_min: T.untyped,
|
114
|
+
fields: T.untyped,
|
115
|
+
limit: T.untyped,
|
116
|
+
since_id: T.untyped,
|
117
|
+
updated_at_max: T.untyped,
|
118
|
+
updated_at_min: T.untyped,
|
119
|
+
session: Auth::Session,
|
120
|
+
kwargs: T.untyped
|
121
|
+
).returns(T::Array[Fulfillment])
|
122
|
+
end
|
123
|
+
def all(
|
124
|
+
fulfillment_order_id: nil,
|
125
|
+
order_id: nil,
|
126
|
+
created_at_max: nil,
|
127
|
+
created_at_min: nil,
|
128
|
+
fields: nil,
|
129
|
+
limit: nil,
|
130
|
+
since_id: nil,
|
131
|
+
updated_at_max: nil,
|
132
|
+
updated_at_min: nil,
|
133
|
+
session: ShopifyAPI::Context.active_session,
|
134
|
+
**kwargs
|
135
|
+
)
|
136
|
+
response = base_find(
|
137
|
+
session: session,
|
138
|
+
ids: {fulfillment_order_id: fulfillment_order_id, order_id: order_id},
|
139
|
+
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,
|
140
|
+
)
|
141
|
+
|
142
|
+
T.cast(response, T::Array[Fulfillment])
|
143
|
+
end
|
144
|
+
|
145
|
+
sig do
|
146
|
+
params(
|
147
|
+
order_id: T.nilable(T.any(Integer, String)),
|
148
|
+
created_at_min: T.untyped,
|
149
|
+
created_at_max: T.untyped,
|
150
|
+
updated_at_min: T.untyped,
|
151
|
+
updated_at_max: T.untyped,
|
152
|
+
session: Auth::Session,
|
153
|
+
kwargs: T.untyped
|
154
|
+
).returns(T.untyped)
|
155
|
+
end
|
156
|
+
def count(
|
157
|
+
order_id: nil,
|
158
|
+
created_at_min: nil,
|
159
|
+
created_at_max: nil,
|
160
|
+
updated_at_min: nil,
|
161
|
+
updated_at_max: nil,
|
162
|
+
session: ShopifyAPI::Context.active_session,
|
163
|
+
**kwargs
|
164
|
+
)
|
165
|
+
request(
|
166
|
+
http_method: :get,
|
167
|
+
operation: :count,
|
168
|
+
session: session,
|
169
|
+
ids: {order_id: order_id},
|
170
|
+
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,
|
171
|
+
body: {},
|
172
|
+
entity: nil,
|
173
|
+
)
|
174
|
+
end
|
175
|
+
|
176
|
+
end
|
177
|
+
|
178
|
+
sig do
|
179
|
+
params(
|
180
|
+
body: T.untyped,
|
181
|
+
kwargs: T.untyped
|
182
|
+
).returns(T.untyped)
|
183
|
+
end
|
184
|
+
def cancel(
|
185
|
+
body: nil,
|
186
|
+
**kwargs
|
187
|
+
)
|
188
|
+
self.class.request(
|
189
|
+
http_method: :post,
|
190
|
+
operation: :cancel,
|
191
|
+
session: @session,
|
192
|
+
ids: {id: @id},
|
193
|
+
params: {}.merge(kwargs).compact,
|
194
|
+
body: body,
|
195
|
+
entity: self,
|
196
|
+
)
|
197
|
+
end
|
198
|
+
|
199
|
+
sig do
|
200
|
+
params(
|
201
|
+
notify_customer: T.untyped,
|
202
|
+
tracking_info: T.untyped,
|
203
|
+
body: T.untyped,
|
204
|
+
kwargs: T.untyped
|
205
|
+
).returns(T.untyped)
|
206
|
+
end
|
207
|
+
def update_tracking(
|
208
|
+
notify_customer: nil,
|
209
|
+
tracking_info: nil,
|
210
|
+
body: nil,
|
211
|
+
**kwargs
|
212
|
+
)
|
213
|
+
self.class.request(
|
214
|
+
http_method: :post,
|
215
|
+
operation: :update_tracking,
|
216
|
+
session: @session,
|
217
|
+
ids: {id: @id},
|
218
|
+
params: {notify_customer: notify_customer, tracking_info: tracking_info}.merge(kwargs).compact,
|
219
|
+
body: body,
|
220
|
+
entity: self,
|
221
|
+
)
|
222
|
+
end
|
223
|
+
|
224
|
+
end
|
225
|
+
end
|