shopify_api 13.0.0 → 13.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/Gemfile.lock +7 -7
  4. data/README.md +0 -7
  5. data/docs/getting_started.md +1 -8
  6. data/lib/shopify_api/admin_versions.rb +2 -1
  7. data/lib/shopify_api/context.rb +1 -0
  8. data/lib/shopify_api/rest/base.rb +5 -1
  9. data/lib/shopify_api/rest/resources/2022_04/fulfillment_order.rb +3 -7
  10. data/lib/shopify_api/rest/resources/2022_04/shop.rb +2 -2
  11. data/lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb +3 -7
  12. data/lib/shopify_api/rest/resources/2022_07/shop.rb +2 -2
  13. data/lib/shopify_api/rest/resources/2022_10/fulfillment_order.rb +3 -7
  14. data/lib/shopify_api/rest/resources/2022_10/shop.rb +2 -2
  15. data/lib/shopify_api/rest/resources/2023_01/fulfillment_order.rb +3 -7
  16. data/lib/shopify_api/rest/resources/2023_01/shop.rb +2 -2
  17. data/lib/shopify_api/rest/resources/2023_04/shop.rb +2 -2
  18. data/lib/shopify_api/rest/resources/2023_07/abandoned_checkout.rb +190 -0
  19. data/lib/shopify_api/rest/resources/2023_07/access_scope.rb +58 -0
  20. data/lib/shopify_api/rest/resources/2023_07/apple_pay_certificate.rb +105 -0
  21. data/lib/shopify_api/rest/resources/2023_07/application_charge.rb +109 -0
  22. data/lib/shopify_api/rest/resources/2023_07/application_credit.rb +91 -0
  23. data/lib/shopify_api/rest/resources/2023_07/article.rb +265 -0
  24. data/lib/shopify_api/rest/resources/2023_07/asset.rb +118 -0
  25. data/lib/shopify_api/rest/resources/2023_07/assigned_fulfillment_order.rb +86 -0
  26. data/lib/shopify_api/rest/resources/2023_07/balance.rb +50 -0
  27. data/lib/shopify_api/rest/resources/2023_07/blog.rb +162 -0
  28. data/lib/shopify_api/rest/resources/2023_07/cancellation_request.rb +83 -0
  29. data/lib/shopify_api/rest/resources/2023_07/carrier_service.rb +116 -0
  30. data/lib/shopify_api/rest/resources/2023_07/checkout.rb +209 -0
  31. data/lib/shopify_api/rest/resources/2023_07/collect.rb +142 -0
  32. data/lib/shopify_api/rest/resources/2023_07/collection.rb +110 -0
  33. data/lib/shopify_api/rest/resources/2023_07/collection_listing.rb +155 -0
  34. data/lib/shopify_api/rest/resources/2023_07/comment.rb +283 -0
  35. data/lib/shopify_api/rest/resources/2023_07/country.rb +137 -0
  36. data/lib/shopify_api/rest/resources/2023_07/currency.rb +57 -0
  37. data/lib/shopify_api/rest/resources/2023_07/custom_collection.rb +187 -0
  38. data/lib/shopify_api/rest/resources/2023_07/customer.rb +329 -0
  39. data/lib/shopify_api/rest/resources/2023_07/customer_address.rb +201 -0
  40. data/lib/shopify_api/rest/resources/2023_07/customer_saved_search.rb +169 -0
  41. data/lib/shopify_api/rest/resources/2023_07/deprecated_api_call.rb +57 -0
  42. data/lib/shopify_api/rest/resources/2023_07/discount_code.rb +222 -0
  43. data/lib/shopify_api/rest/resources/2023_07/dispute.rb +111 -0
  44. data/lib/shopify_api/rest/resources/2023_07/dispute_evidence.rb +117 -0
  45. data/lib/shopify_api/rest/resources/2023_07/dispute_file_upload.rb +81 -0
  46. data/lib/shopify_api/rest/resources/2023_07/draft_order.rb +275 -0
  47. data/lib/shopify_api/rest/resources/2023_07/event.rb +148 -0
  48. data/lib/shopify_api/rest/resources/2023_07/fulfillment.rb +231 -0
  49. data/lib/shopify_api/rest/resources/2023_07/fulfillment_event.rb +166 -0
  50. data/lib/shopify_api/rest/resources/2023_07/fulfillment_order.rb +312 -0
  51. data/lib/shopify_api/rest/resources/2023_07/fulfillment_request.rb +87 -0
  52. data/lib/shopify_api/rest/resources/2023_07/fulfillment_service.rb +130 -0
  53. data/lib/shopify_api/rest/resources/2023_07/gift_card.rb +218 -0
  54. data/lib/shopify_api/rest/resources/2023_07/gift_card_adjustment.rb +118 -0
  55. data/lib/shopify_api/rest/resources/2023_07/image.rb +157 -0
  56. data/lib/shopify_api/rest/resources/2023_07/inventory_item.rb +108 -0
  57. data/lib/shopify_api/rest/resources/2023_07/inventory_level.rb +179 -0
  58. data/lib/shopify_api/rest/resources/2023_07/location.rb +167 -0
  59. data/lib/shopify_api/rest/resources/2023_07/locations_for_move.rb +56 -0
  60. data/lib/shopify_api/rest/resources/2023_07/marketing_event.rb +209 -0
  61. data/lib/shopify_api/rest/resources/2023_07/metafield.rb +344 -0
  62. data/lib/shopify_api/rest/resources/2023_07/mobile_platform_application.rb +110 -0
  63. data/lib/shopify_api/rest/resources/2023_07/order.rb +488 -0
  64. data/lib/shopify_api/rest/resources/2023_07/order_risk.rb +142 -0
  65. data/lib/shopify_api/rest/resources/2023_07/page.rb +194 -0
  66. data/lib/shopify_api/rest/resources/2023_07/payment.rb +140 -0
  67. data/lib/shopify_api/rest/resources/2023_07/payment_gateway.rb +143 -0
  68. data/lib/shopify_api/rest/resources/2023_07/payment_transaction.rb +107 -0
  69. data/lib/shopify_api/rest/resources/2023_07/payout.rb +97 -0
  70. data/lib/shopify_api/rest/resources/2023_07/policy.rb +69 -0
  71. data/lib/shopify_api/rest/resources/2023_07/price_rule.rb +223 -0
  72. data/lib/shopify_api/rest/resources/2023_07/product.rb +223 -0
  73. data/lib/shopify_api/rest/resources/2023_07/product_listing.rb +196 -0
  74. data/lib/shopify_api/rest/resources/2023_07/product_resource_feedback.rb +88 -0
  75. data/lib/shopify_api/rest/resources/2023_07/province.rb +132 -0
  76. data/lib/shopify_api/rest/resources/2023_07/recurring_application_charge.rb +172 -0
  77. data/lib/shopify_api/rest/resources/2023_07/redirect.rb +139 -0
  78. data/lib/shopify_api/rest/resources/2023_07/refund.rb +151 -0
  79. data/lib/shopify_api/rest/resources/2023_07/resource_feedback.rb +73 -0
  80. data/lib/shopify_api/rest/resources/2023_07/script_tag.rb +155 -0
  81. data/lib/shopify_api/rest/resources/2023_07/shipping_zone.rb +83 -0
  82. data/lib/shopify_api/rest/resources/2023_07/shop.rb +221 -0
  83. data/lib/shopify_api/rest/resources/2023_07/smart_collection.rb +216 -0
  84. data/lib/shopify_api/rest/resources/2023_07/storefront_access_token.rb +87 -0
  85. data/lib/shopify_api/rest/resources/2023_07/tender_transaction.rb +93 -0
  86. data/lib/shopify_api/rest/resources/2023_07/theme.rb +123 -0
  87. data/lib/shopify_api/rest/resources/2023_07/transaction.rb +184 -0
  88. data/lib/shopify_api/rest/resources/2023_07/usage_charge.rb +102 -0
  89. data/lib/shopify_api/rest/resources/2023_07/user.rb +138 -0
  90. data/lib/shopify_api/rest/resources/2023_07/variant.rb +212 -0
  91. data/lib/shopify_api/rest/resources/2023_07/webhook.rb +168 -0
  92. data/lib/shopify_api/version.rb +1 -1
  93. data/shopify_api.gemspec +1 -1
  94. metadata +77 -9
@@ -0,0 +1,312 @@
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 FulfillmentOrder < 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
+ @assigned_location = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
20
+ @assigned_location_id = T.let(nil, T.nilable(Integer))
21
+ @created_at = T.let(nil, T.nilable(String))
22
+ @delivery_method = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
23
+ @destination = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
24
+ @fulfill_at = T.let(nil, T.nilable(String))
25
+ @fulfill_by = T.let(nil, T.nilable(String))
26
+ @fulfillment_holds = T.let(nil, T.nilable(T::Array[T.untyped]))
27
+ @id = T.let(nil, T.nilable(Integer))
28
+ @international_duties = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
29
+ @line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
30
+ @merchant_requests = T.let(nil, T.nilable(T::Array[T.untyped]))
31
+ @order_id = T.let(nil, T.nilable(Integer))
32
+ @request_status = T.let(nil, T.nilable(String))
33
+ @shop_id = T.let(nil, T.nilable(Integer))
34
+ @status = T.let(nil, T.nilable(String))
35
+ @supported_actions = T.let(nil, T.nilable(T::Array[T.untyped]))
36
+ @updated_at = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
37
+ end
38
+
39
+ @has_one = T.let({}, T::Hash[Symbol, Class])
40
+ @has_many = T.let({}, T::Hash[Symbol, Class])
41
+ @paths = T.let([
42
+ {http_method: :get, operation: :get, ids: [:id], path: "fulfillment_orders/<id>.json"},
43
+ {http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/fulfillment_orders.json"},
44
+ {http_method: :post, operation: :cancel, ids: [:id], path: "fulfillment_orders/<id>/cancel.json"},
45
+ {http_method: :post, operation: :close, ids: [:id], path: "fulfillment_orders/<id>/close.json"},
46
+ {http_method: :post, operation: :hold, ids: [:id], path: "fulfillment_orders/<id>/hold.json"},
47
+ {http_method: :post, operation: :move, ids: [:id], path: "fulfillment_orders/<id>/move.json"},
48
+ {http_method: :post, operation: :open, ids: [:id], path: "fulfillment_orders/<id>/open.json"},
49
+ {http_method: :post, operation: :release_hold, ids: [:id], path: "fulfillment_orders/<id>/release_hold.json"},
50
+ {http_method: :post, operation: :reschedule, ids: [:id], path: "fulfillment_orders/<id>/reschedule.json"},
51
+ {http_method: :post, operation: :set_fulfillment_orders_deadline, ids: [], path: "fulfillment_orders/set_fulfillment_orders_deadline.json"}
52
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
53
+
54
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
55
+ attr_reader :assigned_location
56
+ sig { returns(T.nilable(Integer)) }
57
+ attr_reader :assigned_location_id
58
+ sig { returns(T.nilable(String)) }
59
+ attr_reader :created_at
60
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
61
+ attr_reader :delivery_method
62
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
63
+ attr_reader :destination
64
+ sig { returns(T.nilable(String)) }
65
+ attr_reader :fulfill_at
66
+ sig { returns(T.nilable(String)) }
67
+ attr_reader :fulfill_by
68
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
69
+ attr_reader :fulfillment_holds
70
+ sig { returns(T.nilable(Integer)) }
71
+ attr_reader :id
72
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
73
+ attr_reader :international_duties
74
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
75
+ attr_reader :line_items
76
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
77
+ attr_reader :merchant_requests
78
+ sig { returns(T.nilable(Integer)) }
79
+ attr_reader :order_id
80
+ sig { returns(T.nilable(String)) }
81
+ attr_reader :request_status
82
+ sig { returns(T.nilable(Integer)) }
83
+ attr_reader :shop_id
84
+ sig { returns(T.nilable(String)) }
85
+ attr_reader :status
86
+ sig { returns(T.nilable(T::Array[String])) }
87
+ attr_reader :supported_actions
88
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
89
+ attr_reader :updated_at
90
+
91
+ class << self
92
+ sig do
93
+ params(
94
+ id: T.any(Integer, String),
95
+ session: Auth::Session
96
+ ).returns(T.nilable(FulfillmentOrder))
97
+ end
98
+ def find(
99
+ id:,
100
+ session: ShopifyAPI::Context.active_session
101
+ )
102
+ result = base_find(
103
+ session: session,
104
+ ids: {id: id},
105
+ params: {},
106
+ )
107
+ T.cast(result[0], T.nilable(FulfillmentOrder))
108
+ end
109
+
110
+ sig do
111
+ params(
112
+ order_id: T.nilable(T.any(Integer, String)),
113
+ session: Auth::Session,
114
+ kwargs: T.untyped
115
+ ).returns(T::Array[FulfillmentOrder])
116
+ end
117
+ def all(
118
+ order_id: nil,
119
+ session: ShopifyAPI::Context.active_session,
120
+ **kwargs
121
+ )
122
+ response = base_find(
123
+ session: session,
124
+ ids: {order_id: order_id},
125
+ params: {}.merge(kwargs).compact,
126
+ )
127
+
128
+ T.cast(response, T::Array[FulfillmentOrder])
129
+ end
130
+
131
+ end
132
+
133
+ sig do
134
+ params(
135
+ body: T.untyped,
136
+ kwargs: T.untyped
137
+ ).returns(T.untyped)
138
+ end
139
+ def cancel(
140
+ body: nil,
141
+ **kwargs
142
+ )
143
+ self.class.request(
144
+ http_method: :post,
145
+ operation: :cancel,
146
+ session: @session,
147
+ ids: {id: @id},
148
+ params: {}.merge(kwargs).compact,
149
+ body: body,
150
+ entity: self,
151
+ )
152
+ end
153
+
154
+ sig do
155
+ params(
156
+ message: T.untyped,
157
+ body: T.untyped,
158
+ kwargs: T.untyped
159
+ ).returns(T.untyped)
160
+ end
161
+ def close(
162
+ message: nil,
163
+ body: nil,
164
+ **kwargs
165
+ )
166
+ self.class.request(
167
+ http_method: :post,
168
+ operation: :close,
169
+ session: @session,
170
+ ids: {id: @id},
171
+ params: {message: message}.merge(kwargs).compact,
172
+ body: body,
173
+ entity: self,
174
+ )
175
+ end
176
+
177
+ sig do
178
+ params(
179
+ fulfillment_hold: T.untyped,
180
+ body: T.untyped,
181
+ kwargs: T.untyped
182
+ ).returns(T.untyped)
183
+ end
184
+ def hold(
185
+ fulfillment_hold: nil,
186
+ body: nil,
187
+ **kwargs
188
+ )
189
+ self.class.request(
190
+ http_method: :post,
191
+ operation: :hold,
192
+ session: @session,
193
+ ids: {id: @id},
194
+ params: {fulfillment_hold: fulfillment_hold}.merge(kwargs).compact,
195
+ body: body,
196
+ entity: self,
197
+ )
198
+ end
199
+
200
+ sig do
201
+ params(
202
+ fulfillment_order: T.untyped,
203
+ body: T.untyped,
204
+ kwargs: T.untyped
205
+ ).returns(T.untyped)
206
+ end
207
+ def move(
208
+ fulfillment_order: nil,
209
+ body: nil,
210
+ **kwargs
211
+ )
212
+ self.class.request(
213
+ http_method: :post,
214
+ operation: :move,
215
+ session: @session,
216
+ ids: {id: @id},
217
+ params: {fulfillment_order: fulfillment_order}.merge(kwargs).compact,
218
+ body: body,
219
+ entity: self,
220
+ )
221
+ end
222
+
223
+ sig do
224
+ params(
225
+ body: T.untyped,
226
+ kwargs: T.untyped
227
+ ).returns(T.untyped)
228
+ end
229
+ def open(
230
+ body: nil,
231
+ **kwargs
232
+ )
233
+ self.class.request(
234
+ http_method: :post,
235
+ operation: :open,
236
+ session: @session,
237
+ ids: {id: @id},
238
+ params: {}.merge(kwargs).compact,
239
+ body: body,
240
+ entity: self,
241
+ )
242
+ end
243
+
244
+ sig do
245
+ params(
246
+ body: T.untyped,
247
+ kwargs: T.untyped
248
+ ).returns(T.untyped)
249
+ end
250
+ def release_hold(
251
+ body: nil,
252
+ **kwargs
253
+ )
254
+ self.class.request(
255
+ http_method: :post,
256
+ operation: :release_hold,
257
+ session: @session,
258
+ ids: {id: @id},
259
+ params: {}.merge(kwargs).compact,
260
+ body: body,
261
+ entity: self,
262
+ )
263
+ end
264
+
265
+ sig do
266
+ params(
267
+ body: T.untyped,
268
+ kwargs: T.untyped
269
+ ).returns(T.untyped)
270
+ end
271
+ def reschedule(
272
+ body: nil,
273
+ **kwargs
274
+ )
275
+ self.class.request(
276
+ http_method: :post,
277
+ operation: :reschedule,
278
+ session: @session,
279
+ ids: {id: @id},
280
+ params: {}.merge(kwargs).compact,
281
+ body: body,
282
+ entity: self,
283
+ )
284
+ end
285
+
286
+ sig do
287
+ params(
288
+ fulfillment_order_ids: T.untyped,
289
+ fulfillment_deadline: T.untyped,
290
+ body: T.untyped,
291
+ kwargs: T.untyped
292
+ ).returns(T.untyped)
293
+ end
294
+ def set_fulfillment_orders_deadline(
295
+ fulfillment_order_ids: nil,
296
+ fulfillment_deadline: nil,
297
+ body: nil,
298
+ **kwargs
299
+ )
300
+ self.class.request(
301
+ http_method: :post,
302
+ operation: :set_fulfillment_orders_deadline,
303
+ session: @session,
304
+ ids: {},
305
+ params: {fulfillment_order_ids: fulfillment_order_ids, fulfillment_deadline: fulfillment_deadline}.merge(kwargs).compact,
306
+ body: body,
307
+ entity: self,
308
+ )
309
+ end
310
+
311
+ end
312
+ end
@@ -0,0 +1,87 @@
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 FulfillmentRequest < 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
+ @fulfillment_order_id = T.let(nil, T.nilable(Integer))
20
+ end
21
+
22
+ @has_one = T.let({}, T::Hash[Symbol, Class])
23
+ @has_many = T.let({}, T::Hash[Symbol, Class])
24
+ @paths = T.let([
25
+ {http_method: :post, operation: :accept, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/fulfillment_request/accept.json"},
26
+ {http_method: :post, operation: :post, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/fulfillment_request.json"},
27
+ {http_method: :post, operation: :reject, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/fulfillment_request/reject.json"}
28
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
29
+
30
+ sig { returns(T.nilable(Integer)) }
31
+ attr_reader :fulfillment_order_id
32
+
33
+ class << self
34
+ end
35
+
36
+ sig do
37
+ params(
38
+ message: T.untyped,
39
+ body: T.untyped,
40
+ kwargs: T.untyped
41
+ ).returns(T.untyped)
42
+ end
43
+ def accept(
44
+ message: nil,
45
+ body: nil,
46
+ **kwargs
47
+ )
48
+ self.class.request(
49
+ http_method: :post,
50
+ operation: :accept,
51
+ session: @session,
52
+ ids: {fulfillment_order_id: @fulfillment_order_id},
53
+ params: {message: message}.merge(kwargs).compact,
54
+ body: body,
55
+ entity: self,
56
+ )
57
+ end
58
+
59
+ sig do
60
+ params(
61
+ message: T.untyped,
62
+ reason: T.untyped,
63
+ line_items: T.untyped,
64
+ body: T.untyped,
65
+ kwargs: T.untyped
66
+ ).returns(T.untyped)
67
+ end
68
+ def reject(
69
+ message: nil,
70
+ reason: nil,
71
+ line_items: nil,
72
+ body: nil,
73
+ **kwargs
74
+ )
75
+ self.class.request(
76
+ http_method: :post,
77
+ operation: :reject,
78
+ session: @session,
79
+ ids: {fulfillment_order_id: @fulfillment_order_id},
80
+ params: {message: message, reason: reason, line_items: line_items}.merge(kwargs).compact,
81
+ body: body,
82
+ entity: self,
83
+ )
84
+ end
85
+
86
+ end
87
+ end
@@ -0,0 +1,130 @@
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 FulfillmentService < 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
+ @admin_graphql_api_id = T.let(nil, T.nilable(String))
20
+ @callback_url = T.let(nil, T.nilable(String))
21
+ @fulfillment_orders_opt_in = T.let(nil, T.nilable(T::Boolean))
22
+ @handle = T.let(nil, T.nilable(String))
23
+ @id = T.let(nil, T.nilable(Integer))
24
+ @inventory_management = T.let(nil, T.nilable(T::Boolean))
25
+ @location_id = T.let(nil, T.nilable(Integer))
26
+ @name = T.let(nil, T.nilable(String))
27
+ @permits_sku_sharing = T.let(nil, T.nilable(T::Boolean))
28
+ @provider_id = T.let(nil, T.nilable(String))
29
+ @requires_shipping_method = T.let(nil, T.nilable(T::Boolean))
30
+ @tracking_support = T.let(nil, T.nilable(T::Boolean))
31
+ end
32
+
33
+ @has_one = T.let({}, T::Hash[Symbol, Class])
34
+ @has_many = T.let({}, T::Hash[Symbol, Class])
35
+ @paths = T.let([
36
+ {http_method: :delete, operation: :delete, ids: [:id], path: "fulfillment_services/<id>.json"},
37
+ {http_method: :get, operation: :get, ids: [], path: "fulfillment_services.json"},
38
+ {http_method: :get, operation: :get, ids: [:id], path: "fulfillment_services/<id>.json"},
39
+ {http_method: :post, operation: :post, ids: [], path: "fulfillment_services.json"},
40
+ {http_method: :put, operation: :put, ids: [:id], path: "fulfillment_services/<id>.json"}
41
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
42
+
43
+ sig { returns(T.nilable(String)) }
44
+ attr_reader :admin_graphql_api_id
45
+ sig { returns(T.nilable(String)) }
46
+ attr_reader :callback_url
47
+ sig { returns(T.nilable(T::Boolean)) }
48
+ attr_reader :fulfillment_orders_opt_in
49
+ sig { returns(T.nilable(String)) }
50
+ attr_reader :handle
51
+ sig { returns(T.nilable(Integer)) }
52
+ attr_reader :id
53
+ sig { returns(T.nilable(T::Boolean)) }
54
+ attr_reader :inventory_management
55
+ sig { returns(T.nilable(Integer)) }
56
+ attr_reader :location_id
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :name
59
+ sig { returns(T.nilable(T::Boolean)) }
60
+ attr_reader :permits_sku_sharing
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :provider_id
63
+ sig { returns(T.nilable(T::Boolean)) }
64
+ attr_reader :requires_shipping_method
65
+ sig { returns(T.nilable(T::Boolean)) }
66
+ attr_reader :tracking_support
67
+
68
+ class << self
69
+ sig do
70
+ params(
71
+ id: T.any(Integer, String),
72
+ session: Auth::Session
73
+ ).returns(T.nilable(FulfillmentService))
74
+ end
75
+ def find(
76
+ id:,
77
+ session: ShopifyAPI::Context.active_session
78
+ )
79
+ result = base_find(
80
+ session: session,
81
+ ids: {id: id},
82
+ params: {},
83
+ )
84
+ T.cast(result[0], T.nilable(FulfillmentService))
85
+ end
86
+
87
+ sig do
88
+ params(
89
+ id: T.any(Integer, String),
90
+ session: Auth::Session
91
+ ).returns(T.untyped)
92
+ end
93
+ def delete(
94
+ id:,
95
+ session: ShopifyAPI::Context.active_session
96
+ )
97
+ request(
98
+ http_method: :delete,
99
+ operation: :delete,
100
+ session: session,
101
+ ids: {id: id},
102
+ params: {},
103
+ )
104
+ end
105
+
106
+ sig do
107
+ params(
108
+ scope: T.untyped,
109
+ session: Auth::Session,
110
+ kwargs: T.untyped
111
+ ).returns(T::Array[FulfillmentService])
112
+ end
113
+ def all(
114
+ scope: nil,
115
+ session: ShopifyAPI::Context.active_session,
116
+ **kwargs
117
+ )
118
+ response = base_find(
119
+ session: session,
120
+ ids: {},
121
+ params: {scope: scope}.merge(kwargs).compact,
122
+ )
123
+
124
+ T.cast(response, T::Array[FulfillmentService])
125
+ end
126
+
127
+ end
128
+
129
+ end
130
+ end