shopify_api 12.5.0 → 13.0.0

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