shopify_api 14.3.0 → 14.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/BREAKING_CHANGES_FOR_V15.md +42 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +2 -2
- data/README.md +3 -0
- data/docs/usage/oauth.md +88 -16
- data/lib/shopify_api/admin_versions.rb +2 -1
- data/lib/shopify_api/clients/graphql/client.rb +3 -2
- data/lib/shopify_api/clients/graphql/storefront.rb +4 -2
- data/lib/shopify_api/rest/resources/2022_04/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_07/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2022_10/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_01/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_04/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_07/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2023_10/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2024_01/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2024_04/shop.rb +2 -2
- data/lib/shopify_api/rest/resources/2024_07/abandoned_checkout.rb +194 -0
- data/lib/shopify_api/rest/resources/2024_07/access_scope.rb +62 -0
- data/lib/shopify_api/rest/resources/2024_07/apple_pay_certificate.rb +109 -0
- data/lib/shopify_api/rest/resources/2024_07/application_charge.rb +113 -0
- data/lib/shopify_api/rest/resources/2024_07/application_credit.rb +95 -0
- data/lib/shopify_api/rest/resources/2024_07/article.rb +269 -0
- data/lib/shopify_api/rest/resources/2024_07/asset.rb +122 -0
- data/lib/shopify_api/rest/resources/2024_07/assigned_fulfillment_order.rb +92 -0
- data/lib/shopify_api/rest/resources/2024_07/balance.rb +58 -0
- data/lib/shopify_api/rest/resources/2024_07/blog.rb +166 -0
- data/lib/shopify_api/rest/resources/2024_07/cancellation_request.rb +87 -0
- data/lib/shopify_api/rest/resources/2024_07/carrier_service.rb +120 -0
- data/lib/shopify_api/rest/resources/2024_07/checkout.rb +213 -0
- data/lib/shopify_api/rest/resources/2024_07/collect.rb +146 -0
- data/lib/shopify_api/rest/resources/2024_07/collection.rb +114 -0
- data/lib/shopify_api/rest/resources/2024_07/collection_listing.rb +159 -0
- data/lib/shopify_api/rest/resources/2024_07/comment.rb +287 -0
- data/lib/shopify_api/rest/resources/2024_07/country.rb +141 -0
- data/lib/shopify_api/rest/resources/2024_07/currency.rb +61 -0
- data/lib/shopify_api/rest/resources/2024_07/custom_collection.rb +191 -0
- data/lib/shopify_api/rest/resources/2024_07/customer.rb +333 -0
- data/lib/shopify_api/rest/resources/2024_07/customer_address.rb +215 -0
- data/lib/shopify_api/rest/resources/2024_07/deprecated_api_call.rb +61 -0
- data/lib/shopify_api/rest/resources/2024_07/discount_code.rb +226 -0
- data/lib/shopify_api/rest/resources/2024_07/dispute.rb +115 -0
- data/lib/shopify_api/rest/resources/2024_07/dispute_evidence.rb +121 -0
- data/lib/shopify_api/rest/resources/2024_07/dispute_file_upload.rb +85 -0
- data/lib/shopify_api/rest/resources/2024_07/draft_order.rb +279 -0
- data/lib/shopify_api/rest/resources/2024_07/event.rb +152 -0
- data/lib/shopify_api/rest/resources/2024_07/fulfillment.rb +235 -0
- data/lib/shopify_api/rest/resources/2024_07/fulfillment_event.rb +167 -0
- data/lib/shopify_api/rest/resources/2024_07/fulfillment_order.rb +326 -0
- data/lib/shopify_api/rest/resources/2024_07/fulfillment_request.rb +101 -0
- data/lib/shopify_api/rest/resources/2024_07/fulfillment_service.rb +134 -0
- data/lib/shopify_api/rest/resources/2024_07/gift_card.rb +222 -0
- data/lib/shopify_api/rest/resources/2024_07/gift_card_adjustment.rb +122 -0
- data/lib/shopify_api/rest/resources/2024_07/image.rb +161 -0
- data/lib/shopify_api/rest/resources/2024_07/inventory_item.rb +112 -0
- data/lib/shopify_api/rest/resources/2024_07/inventory_level.rb +183 -0
- data/lib/shopify_api/rest/resources/2024_07/location.rb +171 -0
- data/lib/shopify_api/rest/resources/2024_07/locations_for_move.rb +60 -0
- data/lib/shopify_api/rest/resources/2024_07/marketing_event.rb +213 -0
- data/lib/shopify_api/rest/resources/2024_07/metafield.rb +348 -0
- data/lib/shopify_api/rest/resources/2024_07/mobile_platform_application.rb +114 -0
- data/lib/shopify_api/rest/resources/2024_07/order.rb +489 -0
- data/lib/shopify_api/rest/resources/2024_07/order_risk.rb +148 -0
- data/lib/shopify_api/rest/resources/2024_07/page.rb +198 -0
- data/lib/shopify_api/rest/resources/2024_07/payment.rb +144 -0
- data/lib/shopify_api/rest/resources/2024_07/payment_gateway.rb +147 -0
- data/lib/shopify_api/rest/resources/2024_07/payment_transaction.rb +114 -0
- data/lib/shopify_api/rest/resources/2024_07/payout.rb +101 -0
- data/lib/shopify_api/rest/resources/2024_07/policy.rb +73 -0
- data/lib/shopify_api/rest/resources/2024_07/price_rule.rb +227 -0
- data/lib/shopify_api/rest/resources/2024_07/product.rb +227 -0
- data/lib/shopify_api/rest/resources/2024_07/product_listing.rb +200 -0
- data/lib/shopify_api/rest/resources/2024_07/product_resource_feedback.rb +92 -0
- data/lib/shopify_api/rest/resources/2024_07/province.rb +136 -0
- data/lib/shopify_api/rest/resources/2024_07/recurring_application_charge.rb +176 -0
- data/lib/shopify_api/rest/resources/2024_07/redirect.rb +143 -0
- data/lib/shopify_api/rest/resources/2024_07/refund.rb +155 -0
- data/lib/shopify_api/rest/resources/2024_07/resource_feedback.rb +77 -0
- data/lib/shopify_api/rest/resources/2024_07/script_tag.rb +159 -0
- data/lib/shopify_api/rest/resources/2024_07/shipping_zone.rb +87 -0
- data/lib/shopify_api/rest/resources/2024_07/shop.rb +222 -0
- data/lib/shopify_api/rest/resources/2024_07/smart_collection.rb +220 -0
- data/lib/shopify_api/rest/resources/2024_07/storefront_access_token.rb +91 -0
- data/lib/shopify_api/rest/resources/2024_07/tender_transaction.rb +97 -0
- data/lib/shopify_api/rest/resources/2024_07/theme.rb +127 -0
- data/lib/shopify_api/rest/resources/2024_07/transaction.rb +188 -0
- data/lib/shopify_api/rest/resources/2024_07/usage_charge.rb +106 -0
- data/lib/shopify_api/rest/resources/2024_07/user.rb +142 -0
- data/lib/shopify_api/rest/resources/2024_07/variant.rb +212 -0
- data/lib/shopify_api/rest/resources/2024_07/webhook.rb +172 -0
- data/lib/shopify_api/version.rb +1 -1
- data/lib/shopify_api/webhooks/registry.rb +5 -4
- metadata +80 -6
@@ -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
|
@@ -0,0 +1,167 @@
|
|
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 FulfillmentEvent < 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
|
+
@address1 = T.let(nil, T.nilable(String))
|
22
|
+
@city = T.let(nil, T.nilable(String))
|
23
|
+
@country = T.let(nil, T.nilable(String))
|
24
|
+
@created_at = T.let(nil, T.nilable(String))
|
25
|
+
@estimated_delivery_at = T.let(nil, T.nilable(String))
|
26
|
+
@fulfillment_id = T.let(nil, T.nilable(Integer))
|
27
|
+
@happened_at = T.let(nil, T.nilable(String))
|
28
|
+
@id = T.let(nil, T.nilable(Integer))
|
29
|
+
@latitude = T.let(nil, T.nilable(Float))
|
30
|
+
@longitude = T.let(nil, T.nilable(Float))
|
31
|
+
@message = T.let(nil, T.nilable(String))
|
32
|
+
@order_id = T.let(nil, T.nilable(Integer))
|
33
|
+
@province = T.let(nil, T.nilable(String))
|
34
|
+
@shop_id = T.let(nil, T.nilable(Integer))
|
35
|
+
@status = T.let(nil, T.nilable(String))
|
36
|
+
@updated_at = T.let(nil, T.nilable(String))
|
37
|
+
@zip = T.let(nil, T.nilable(String))
|
38
|
+
|
39
|
+
super(session: session, from_hash: from_hash)
|
40
|
+
end
|
41
|
+
|
42
|
+
@has_one = T.let({}, T::Hash[Symbol, Class])
|
43
|
+
@has_many = T.let({}, T::Hash[Symbol, Class])
|
44
|
+
@paths = T.let([
|
45
|
+
{http_method: :delete, operation: :delete, ids: [:order_id, :fulfillment_id, :id], path: "orders/<order_id>/fulfillments/<fulfillment_id>/events/<id>.json"},
|
46
|
+
{http_method: :get, operation: :get, ids: [:order_id, :fulfillment_id], path: "orders/<order_id>/fulfillments/<fulfillment_id>/events.json"},
|
47
|
+
{http_method: :get, operation: :get, ids: [:order_id, :fulfillment_id, :id], path: "orders/<order_id>/fulfillments/<fulfillment_id>/events/<id>.json"},
|
48
|
+
{http_method: :post, operation: :post, ids: [:order_id, :fulfillment_id], path: "orders/<order_id>/fulfillments/<fulfillment_id>/events.json"}
|
49
|
+
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
|
50
|
+
|
51
|
+
sig { returns(T.nilable(String)) }
|
52
|
+
attr_reader :address1
|
53
|
+
sig { returns(T.nilable(String)) }
|
54
|
+
attr_reader :city
|
55
|
+
sig { returns(T.nilable(String)) }
|
56
|
+
attr_reader :country
|
57
|
+
sig { returns(T.nilable(String)) }
|
58
|
+
attr_reader :created_at
|
59
|
+
sig { returns(T.nilable(String)) }
|
60
|
+
attr_reader :estimated_delivery_at
|
61
|
+
sig { returns(T.nilable(Integer)) }
|
62
|
+
attr_reader :fulfillment_id
|
63
|
+
sig { returns(T.nilable(String)) }
|
64
|
+
attr_reader :happened_at
|
65
|
+
sig { returns(T.nilable(Integer)) }
|
66
|
+
attr_reader :id
|
67
|
+
sig { returns(T.nilable(Float)) }
|
68
|
+
attr_reader :latitude
|
69
|
+
sig { returns(T.nilable(Float)) }
|
70
|
+
attr_reader :longitude
|
71
|
+
sig { returns(T.nilable(String)) }
|
72
|
+
attr_reader :message
|
73
|
+
sig { returns(T.nilable(Integer)) }
|
74
|
+
attr_reader :order_id
|
75
|
+
sig { returns(T.nilable(String)) }
|
76
|
+
attr_reader :province
|
77
|
+
sig { returns(T.nilable(Integer)) }
|
78
|
+
attr_reader :shop_id
|
79
|
+
sig { returns(T.nilable(String)) }
|
80
|
+
attr_reader :status
|
81
|
+
sig { returns(T.nilable(String)) }
|
82
|
+
attr_reader :updated_at
|
83
|
+
sig { returns(T.nilable(String)) }
|
84
|
+
attr_reader :zip
|
85
|
+
|
86
|
+
class << self
|
87
|
+
sig do
|
88
|
+
returns(String)
|
89
|
+
end
|
90
|
+
def json_body_name()
|
91
|
+
"event"
|
92
|
+
end
|
93
|
+
|
94
|
+
sig do
|
95
|
+
params(
|
96
|
+
id: T.any(Integer, String),
|
97
|
+
order_id: T.nilable(T.any(Integer, String)),
|
98
|
+
fulfillment_id: T.nilable(T.any(Integer, String)),
|
99
|
+
event_id: T.untyped,
|
100
|
+
session: Auth::Session
|
101
|
+
).returns(T.nilable(FulfillmentEvent))
|
102
|
+
end
|
103
|
+
def find(
|
104
|
+
id:,
|
105
|
+
order_id: nil,
|
106
|
+
fulfillment_id: nil,
|
107
|
+
event_id: nil,
|
108
|
+
session: ShopifyAPI::Context.active_session
|
109
|
+
)
|
110
|
+
result = base_find(
|
111
|
+
session: session,
|
112
|
+
ids: {id: id, order_id: order_id, fulfillment_id: fulfillment_id},
|
113
|
+
params: {event_id: event_id},
|
114
|
+
)
|
115
|
+
T.cast(result[0], T.nilable(FulfillmentEvent))
|
116
|
+
end
|
117
|
+
|
118
|
+
sig do
|
119
|
+
params(
|
120
|
+
id: T.any(Integer, String),
|
121
|
+
order_id: T.nilable(T.any(Integer, String)),
|
122
|
+
fulfillment_id: T.nilable(T.any(Integer, String)),
|
123
|
+
session: Auth::Session
|
124
|
+
).returns(T.untyped)
|
125
|
+
end
|
126
|
+
def delete(
|
127
|
+
id:,
|
128
|
+
order_id: nil,
|
129
|
+
fulfillment_id: nil,
|
130
|
+
session: ShopifyAPI::Context.active_session
|
131
|
+
)
|
132
|
+
request(
|
133
|
+
http_method: :delete,
|
134
|
+
operation: :delete,
|
135
|
+
session: session,
|
136
|
+
ids: {id: id, order_id: order_id, fulfillment_id: fulfillment_id},
|
137
|
+
params: {},
|
138
|
+
)
|
139
|
+
end
|
140
|
+
|
141
|
+
sig do
|
142
|
+
params(
|
143
|
+
order_id: T.nilable(T.any(Integer, String)),
|
144
|
+
fulfillment_id: T.nilable(T.any(Integer, String)),
|
145
|
+
session: Auth::Session,
|
146
|
+
kwargs: T.untyped
|
147
|
+
).returns(T::Array[FulfillmentEvent])
|
148
|
+
end
|
149
|
+
def all(
|
150
|
+
order_id: nil,
|
151
|
+
fulfillment_id: nil,
|
152
|
+
session: ShopifyAPI::Context.active_session,
|
153
|
+
**kwargs
|
154
|
+
)
|
155
|
+
response = base_find(
|
156
|
+
session: session,
|
157
|
+
ids: {order_id: order_id, fulfillment_id: fulfillment_id},
|
158
|
+
params: {}.merge(kwargs).compact,
|
159
|
+
)
|
160
|
+
|
161
|
+
T.cast(response, T::Array[FulfillmentEvent])
|
162
|
+
end
|
163
|
+
|
164
|
+
end
|
165
|
+
|
166
|
+
end
|
167
|
+
end
|