shopify_api 13.1.0 → 13.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/BREAKING_CHANGES_FOR_V10.md +231 -0
  3. data/CHANGELOG.md +8 -1
  4. data/Gemfile.lock +5 -5
  5. data/README.md +10 -34
  6. data/docs/README.md +0 -1
  7. data/docs/getting_started.md +20 -3
  8. data/docs/usage/custom_apps.md +75 -0
  9. data/docs/usage/graphql.md +63 -18
  10. data/docs/usage/oauth.md +160 -27
  11. data/docs/usage/rest.md +204 -62
  12. data/docs/usage/webhooks.md +22 -4
  13. data/lib/shopify_api/admin_versions.rb +2 -1
  14. data/lib/shopify_api/context.rb +5 -3
  15. data/lib/shopify_api/rest/base.rb +22 -14
  16. data/lib/shopify_api/rest/resources/2022_10/assigned_fulfillment_order.rb +5 -3
  17. data/lib/shopify_api/rest/resources/2022_10/customer_address.rb +10 -0
  18. data/lib/shopify_api/rest/resources/2022_10/fulfillment_request.rb +10 -0
  19. data/lib/shopify_api/rest/resources/2022_10/order_risk.rb +5 -3
  20. data/lib/shopify_api/rest/resources/2023_01/assigned_fulfillment_order.rb +5 -3
  21. data/lib/shopify_api/rest/resources/2023_01/balance.rb +4 -0
  22. data/lib/shopify_api/rest/resources/2023_01/customer_address.rb +10 -0
  23. data/lib/shopify_api/rest/resources/2023_01/fulfillment_request.rb +10 -0
  24. data/lib/shopify_api/rest/resources/2023_01/order.rb +3 -0
  25. data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +5 -3
  26. data/lib/shopify_api/rest/resources/2023_01/shop.rb +0 -3
  27. data/lib/shopify_api/rest/resources/2023_01/variant.rb +1 -5
  28. data/lib/shopify_api/rest/resources/2023_04/assigned_fulfillment_order.rb +5 -3
  29. data/lib/shopify_api/rest/resources/2023_04/balance.rb +4 -0
  30. data/lib/shopify_api/rest/resources/2023_04/customer_address.rb +10 -0
  31. data/lib/shopify_api/rest/resources/2023_04/fulfillment_request.rb +10 -0
  32. data/lib/shopify_api/rest/resources/2023_04/order.rb +3 -0
  33. data/lib/shopify_api/rest/resources/2023_04/order_risk.rb +5 -3
  34. data/lib/shopify_api/rest/resources/2023_04/shop.rb +0 -3
  35. data/lib/shopify_api/rest/resources/2023_04/variant.rb +1 -5
  36. data/lib/shopify_api/rest/resources/2023_07/assigned_fulfillment_order.rb +5 -3
  37. data/lib/shopify_api/rest/resources/2023_07/balance.rb +4 -0
  38. data/lib/shopify_api/rest/resources/2023_07/customer_address.rb +10 -0
  39. data/lib/shopify_api/rest/resources/2023_07/fulfillment_request.rb +10 -0
  40. data/lib/shopify_api/rest/resources/2023_07/order.rb +3 -0
  41. data/lib/shopify_api/rest/resources/2023_07/order_risk.rb +5 -3
  42. data/lib/shopify_api/rest/resources/2023_07/report.rb +121 -0
  43. data/lib/shopify_api/rest/resources/2023_07/shop.rb +0 -3
  44. data/lib/shopify_api/rest/resources/2023_07/variant.rb +1 -5
  45. data/lib/shopify_api/rest/resources/2023_10/abandoned_checkout.rb +190 -0
  46. data/lib/shopify_api/rest/resources/2023_10/access_scope.rb +58 -0
  47. data/lib/shopify_api/rest/resources/2023_10/apple_pay_certificate.rb +105 -0
  48. data/lib/shopify_api/rest/resources/2023_10/application_charge.rb +109 -0
  49. data/lib/shopify_api/rest/resources/2023_10/application_credit.rb +91 -0
  50. data/lib/shopify_api/rest/resources/2023_10/article.rb +265 -0
  51. data/lib/shopify_api/rest/resources/2023_10/asset.rb +118 -0
  52. data/lib/shopify_api/rest/resources/2023_10/assigned_fulfillment_order.rb +88 -0
  53. data/lib/shopify_api/rest/resources/2023_10/balance.rb +54 -0
  54. data/lib/shopify_api/rest/resources/2023_10/blog.rb +162 -0
  55. data/lib/shopify_api/rest/resources/2023_10/cancellation_request.rb +83 -0
  56. data/lib/shopify_api/rest/resources/2023_10/carrier_service.rb +116 -0
  57. data/lib/shopify_api/rest/resources/2023_10/checkout.rb +209 -0
  58. data/lib/shopify_api/rest/resources/2023_10/collect.rb +142 -0
  59. data/lib/shopify_api/rest/resources/2023_10/collection.rb +110 -0
  60. data/lib/shopify_api/rest/resources/2023_10/collection_listing.rb +155 -0
  61. data/lib/shopify_api/rest/resources/2023_10/comment.rb +283 -0
  62. data/lib/shopify_api/rest/resources/2023_10/country.rb +137 -0
  63. data/lib/shopify_api/rest/resources/2023_10/currency.rb +57 -0
  64. data/lib/shopify_api/rest/resources/2023_10/custom_collection.rb +187 -0
  65. data/lib/shopify_api/rest/resources/2023_10/customer.rb +329 -0
  66. data/lib/shopify_api/rest/resources/2023_10/customer_address.rb +211 -0
  67. data/lib/shopify_api/rest/resources/2023_10/deprecated_api_call.rb +57 -0
  68. data/lib/shopify_api/rest/resources/2023_10/discount_code.rb +222 -0
  69. data/lib/shopify_api/rest/resources/2023_10/dispute.rb +111 -0
  70. data/lib/shopify_api/rest/resources/2023_10/dispute_evidence.rb +117 -0
  71. data/lib/shopify_api/rest/resources/2023_10/dispute_file_upload.rb +81 -0
  72. data/lib/shopify_api/rest/resources/2023_10/draft_order.rb +275 -0
  73. data/lib/shopify_api/rest/resources/2023_10/event.rb +148 -0
  74. data/lib/shopify_api/rest/resources/2023_10/fulfillment.rb +231 -0
  75. data/lib/shopify_api/rest/resources/2023_10/fulfillment_event.rb +166 -0
  76. data/lib/shopify_api/rest/resources/2023_10/fulfillment_order.rb +312 -0
  77. data/lib/shopify_api/rest/resources/2023_10/fulfillment_request.rb +97 -0
  78. data/lib/shopify_api/rest/resources/2023_10/fulfillment_service.rb +130 -0
  79. data/lib/shopify_api/rest/resources/2023_10/gift_card.rb +218 -0
  80. data/lib/shopify_api/rest/resources/2023_10/gift_card_adjustment.rb +118 -0
  81. data/lib/shopify_api/rest/resources/2023_10/image.rb +157 -0
  82. data/lib/shopify_api/rest/resources/2023_10/inventory_item.rb +108 -0
  83. data/lib/shopify_api/rest/resources/2023_10/inventory_level.rb +179 -0
  84. data/lib/shopify_api/rest/resources/2023_10/location.rb +167 -0
  85. data/lib/shopify_api/rest/resources/2023_10/locations_for_move.rb +56 -0
  86. data/lib/shopify_api/rest/resources/2023_10/marketing_event.rb +209 -0
  87. data/lib/shopify_api/rest/resources/2023_10/metafield.rb +344 -0
  88. data/lib/shopify_api/rest/resources/2023_10/mobile_platform_application.rb +110 -0
  89. data/lib/shopify_api/rest/resources/2023_10/order.rb +491 -0
  90. data/lib/shopify_api/rest/resources/2023_10/order_risk.rb +144 -0
  91. data/lib/shopify_api/rest/resources/2023_10/page.rb +194 -0
  92. data/lib/shopify_api/rest/resources/2023_10/payment.rb +140 -0
  93. data/lib/shopify_api/rest/resources/2023_10/payment_gateway.rb +143 -0
  94. data/lib/shopify_api/rest/resources/2023_10/payment_transaction.rb +107 -0
  95. data/lib/shopify_api/rest/resources/2023_10/payout.rb +97 -0
  96. data/lib/shopify_api/rest/resources/2023_10/policy.rb +69 -0
  97. data/lib/shopify_api/rest/resources/2023_10/price_rule.rb +223 -0
  98. data/lib/shopify_api/rest/resources/2023_10/product.rb +223 -0
  99. data/lib/shopify_api/rest/resources/2023_10/product_listing.rb +196 -0
  100. data/lib/shopify_api/rest/resources/2023_10/product_resource_feedback.rb +88 -0
  101. data/lib/shopify_api/rest/resources/2023_10/province.rb +132 -0
  102. data/lib/shopify_api/rest/resources/2023_10/recurring_application_charge.rb +172 -0
  103. data/lib/shopify_api/rest/resources/2023_10/redirect.rb +139 -0
  104. data/lib/shopify_api/rest/resources/2023_10/refund.rb +151 -0
  105. data/lib/shopify_api/rest/resources/2023_10/report.rb +121 -0
  106. data/lib/shopify_api/rest/resources/2023_10/resource_feedback.rb +73 -0
  107. data/lib/shopify_api/rest/resources/2023_10/script_tag.rb +155 -0
  108. data/lib/shopify_api/rest/resources/2023_10/shipping_zone.rb +83 -0
  109. data/lib/shopify_api/rest/resources/2023_10/shop.rb +218 -0
  110. data/lib/shopify_api/rest/resources/2023_10/smart_collection.rb +216 -0
  111. data/lib/shopify_api/rest/resources/2023_10/storefront_access_token.rb +87 -0
  112. data/lib/shopify_api/rest/resources/2023_10/tender_transaction.rb +93 -0
  113. data/lib/shopify_api/rest/resources/2023_10/theme.rb +123 -0
  114. data/lib/shopify_api/rest/resources/2023_10/transaction.rb +184 -0
  115. data/lib/shopify_api/rest/resources/2023_10/usage_charge.rb +102 -0
  116. data/lib/shopify_api/rest/resources/2023_10/user.rb +138 -0
  117. data/lib/shopify_api/rest/resources/2023_10/variant.rb +208 -0
  118. data/lib/shopify_api/rest/resources/2023_10/webhook.rb +168 -0
  119. data/lib/shopify_api/version.rb +1 -1
  120. data/lib/shopify_api/webhooks/registration.rb +19 -4
  121. data/lib/shopify_api/webhooks/registrations/event_bridge.rb +1 -1
  122. data/lib/shopify_api/webhooks/registrations/http.rb +1 -1
  123. data/lib/shopify_api/webhooks/registrations/pub_sub.rb +2 -1
  124. data/lib/shopify_api/webhooks/registry.rb +9 -5
  125. metadata +80 -6
  126. data/.github/workflows/stale.yml +0 -43
  127. data/docs/issues.md +0 -39
  128. data/docs/usage/session_storage.md +0 -46
@@ -0,0 +1,231 @@
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_number = T.let(nil, T.nilable(String))
33
+ @tracking_numbers = T.let(nil, T.nilable(T::Array[T.untyped]))
34
+ @tracking_url = T.let(nil, T.nilable(String))
35
+ @tracking_urls = T.let(nil, T.nilable(T::Array[T.untyped]))
36
+ @updated_at = T.let(nil, T.nilable(String))
37
+ @variant_inventory_management = T.let(nil, T.nilable(String))
38
+ end
39
+
40
+ @has_one = T.let({}, T::Hash[Symbol, Class])
41
+ @has_many = T.let({}, T::Hash[Symbol, Class])
42
+ @paths = T.let([
43
+ {http_method: :get, operation: :count, ids: [:order_id], path: "orders/<order_id>/fulfillments/count.json"},
44
+ {http_method: :get, operation: :get, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/fulfillments.json"},
45
+ {http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/fulfillments.json"},
46
+ {http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/fulfillments/<id>.json"},
47
+ {http_method: :post, operation: :cancel, ids: [:id], path: "fulfillments/<id>/cancel.json"},
48
+ {http_method: :post, operation: :post, ids: [], path: "fulfillments.json"},
49
+ {http_method: :post, operation: :update_tracking, ids: [:id], path: "fulfillments/<id>/update_tracking.json"}
50
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
51
+
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :created_at
54
+ sig { returns(T.nilable(Integer)) }
55
+ attr_reader :id
56
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
57
+ attr_reader :line_items
58
+ sig { returns(T.nilable(Integer)) }
59
+ attr_reader :location_id
60
+ sig { returns(T.nilable(String)) }
61
+ attr_reader :name
62
+ sig { returns(T.nilable(T::Boolean)) }
63
+ attr_reader :notify_customer
64
+ sig { returns(T.nilable(Integer)) }
65
+ attr_reader :order_id
66
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
67
+ attr_reader :origin_address
68
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
69
+ attr_reader :receipt
70
+ sig { returns(T.nilable(String)) }
71
+ attr_reader :service
72
+ sig { returns(T.nilable(String)) }
73
+ attr_reader :shipment_status
74
+ sig { returns(T.nilable(String)) }
75
+ attr_reader :status
76
+ sig { returns(T.nilable(String)) }
77
+ attr_reader :tracking_company
78
+ sig { returns(T.nilable(String)) }
79
+ attr_reader :tracking_number
80
+ sig { returns(T.nilable(T::Array[String])) }
81
+ attr_reader :tracking_numbers
82
+ sig { returns(T.nilable(String)) }
83
+ attr_reader :tracking_url
84
+ sig { returns(T.nilable(T::Array[String])) }
85
+ attr_reader :tracking_urls
86
+ sig { returns(T.nilable(String)) }
87
+ attr_reader :updated_at
88
+ sig { returns(T.nilable(String)) }
89
+ attr_reader :variant_inventory_management
90
+
91
+ class << self
92
+ sig do
93
+ params(
94
+ id: T.any(Integer, String),
95
+ order_id: T.nilable(T.any(Integer, String)),
96
+ fields: T.untyped,
97
+ session: Auth::Session
98
+ ).returns(T.nilable(Fulfillment))
99
+ end
100
+ def find(
101
+ id:,
102
+ order_id: nil,
103
+ fields: nil,
104
+ session: ShopifyAPI::Context.active_session
105
+ )
106
+ result = base_find(
107
+ session: session,
108
+ ids: {id: id, order_id: order_id},
109
+ params: {fields: fields},
110
+ )
111
+ T.cast(result[0], T.nilable(Fulfillment))
112
+ end
113
+
114
+ sig do
115
+ params(
116
+ fulfillment_order_id: T.nilable(T.any(Integer, String)),
117
+ order_id: T.nilable(T.any(Integer, String)),
118
+ created_at_max: T.untyped,
119
+ created_at_min: T.untyped,
120
+ fields: T.untyped,
121
+ limit: T.untyped,
122
+ since_id: T.untyped,
123
+ updated_at_max: T.untyped,
124
+ updated_at_min: T.untyped,
125
+ session: Auth::Session,
126
+ kwargs: T.untyped
127
+ ).returns(T::Array[Fulfillment])
128
+ end
129
+ def all(
130
+ fulfillment_order_id: nil,
131
+ order_id: nil,
132
+ created_at_max: nil,
133
+ created_at_min: nil,
134
+ fields: nil,
135
+ limit: nil,
136
+ since_id: nil,
137
+ updated_at_max: nil,
138
+ updated_at_min: nil,
139
+ session: ShopifyAPI::Context.active_session,
140
+ **kwargs
141
+ )
142
+ response = base_find(
143
+ session: session,
144
+ ids: {fulfillment_order_id: fulfillment_order_id, order_id: order_id},
145
+ 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,
146
+ )
147
+
148
+ T.cast(response, T::Array[Fulfillment])
149
+ end
150
+
151
+ sig do
152
+ params(
153
+ order_id: T.nilable(T.any(Integer, String)),
154
+ created_at_min: T.untyped,
155
+ created_at_max: T.untyped,
156
+ updated_at_min: T.untyped,
157
+ updated_at_max: T.untyped,
158
+ session: Auth::Session,
159
+ kwargs: T.untyped
160
+ ).returns(T.untyped)
161
+ end
162
+ def count(
163
+ order_id: nil,
164
+ created_at_min: nil,
165
+ created_at_max: nil,
166
+ updated_at_min: nil,
167
+ updated_at_max: nil,
168
+ session: ShopifyAPI::Context.active_session,
169
+ **kwargs
170
+ )
171
+ request(
172
+ http_method: :get,
173
+ operation: :count,
174
+ session: session,
175
+ ids: {order_id: order_id},
176
+ 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,
177
+ body: {},
178
+ entity: nil,
179
+ )
180
+ end
181
+
182
+ end
183
+
184
+ sig do
185
+ params(
186
+ body: T.untyped,
187
+ kwargs: T.untyped
188
+ ).returns(T.untyped)
189
+ end
190
+ def cancel(
191
+ body: nil,
192
+ **kwargs
193
+ )
194
+ self.class.request(
195
+ http_method: :post,
196
+ operation: :cancel,
197
+ session: @session,
198
+ ids: {id: @id},
199
+ params: {}.merge(kwargs).compact,
200
+ body: body,
201
+ entity: self,
202
+ )
203
+ end
204
+
205
+ sig do
206
+ params(
207
+ notify_customer: T.untyped,
208
+ tracking_info: T.untyped,
209
+ body: T.untyped,
210
+ kwargs: T.untyped
211
+ ).returns(T.untyped)
212
+ end
213
+ def update_tracking(
214
+ notify_customer: nil,
215
+ tracking_info: nil,
216
+ body: nil,
217
+ **kwargs
218
+ )
219
+ self.class.request(
220
+ http_method: :post,
221
+ operation: :update_tracking,
222
+ session: @session,
223
+ ids: {id: @id},
224
+ params: {notify_customer: notify_customer, tracking_info: tracking_info}.merge(kwargs).compact,
225
+ body: body,
226
+ entity: self,
227
+ )
228
+ end
229
+
230
+ end
231
+ end
@@ -0,0 +1,166 @@
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
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
16
+ def initialize(session: ShopifyAPI::Context.active_session)
17
+ super(session: session)
18
+
19
+ @address1 = T.let(nil, T.nilable(String))
20
+ @city = T.let(nil, T.nilable(String))
21
+ @country = T.let(nil, T.nilable(Country))
22
+ @created_at = T.let(nil, T.nilable(String))
23
+ @estimated_delivery_at = T.let(nil, T.nilable(String))
24
+ @fulfillment_id = T.let(nil, T.nilable(Integer))
25
+ @happened_at = T.let(nil, T.nilable(String))
26
+ @id = T.let(nil, T.nilable(Integer))
27
+ @latitude = T.let(nil, T.nilable(Float))
28
+ @longitude = T.let(nil, T.nilable(Float))
29
+ @message = T.let(nil, T.nilable(String))
30
+ @order_id = T.let(nil, T.nilable(Integer))
31
+ @province = T.let(nil, T.nilable(Province))
32
+ @shop_id = T.let(nil, T.nilable(Integer))
33
+ @status = T.let(nil, T.nilable(String))
34
+ @updated_at = T.let(nil, T.nilable(String))
35
+ @zip = T.let(nil, T.nilable(String))
36
+ end
37
+
38
+ @has_one = T.let({
39
+ country: Country,
40
+ province: Province
41
+ }, T::Hash[Symbol, Class])
42
+ @has_many = T.let({}, T::Hash[Symbol, Class])
43
+ @paths = T.let([
44
+ {http_method: :delete, operation: :delete, ids: [:order_id, :fulfillment_id, :id], path: "orders/<order_id>/fulfillments/<fulfillment_id>/events/<id>.json"},
45
+ {http_method: :get, operation: :get, ids: [:order_id, :fulfillment_id], path: "orders/<order_id>/fulfillments/<fulfillment_id>/events.json"},
46
+ {http_method: :get, operation: :get, ids: [:order_id, :fulfillment_id, :id], path: "orders/<order_id>/fulfillments/<fulfillment_id>/events/<id>.json"},
47
+ {http_method: :post, operation: :post, ids: [:order_id, :fulfillment_id], path: "orders/<order_id>/fulfillments/<fulfillment_id>/events.json"}
48
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
49
+
50
+ sig { returns(T.nilable(String)) }
51
+ attr_reader :address1
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :city
54
+ sig { returns(T.nilable(Country)) }
55
+ attr_reader :country
56
+ sig { returns(T.nilable(String)) }
57
+ attr_reader :created_at
58
+ sig { returns(T.nilable(String)) }
59
+ attr_reader :estimated_delivery_at
60
+ sig { returns(T.nilable(Integer)) }
61
+ attr_reader :fulfillment_id
62
+ sig { returns(T.nilable(String)) }
63
+ attr_reader :happened_at
64
+ sig { returns(T.nilable(Integer)) }
65
+ attr_reader :id
66
+ sig { returns(T.nilable(Float)) }
67
+ attr_reader :latitude
68
+ sig { returns(T.nilable(Float)) }
69
+ attr_reader :longitude
70
+ sig { returns(T.nilable(String)) }
71
+ attr_reader :message
72
+ sig { returns(T.nilable(Integer)) }
73
+ attr_reader :order_id
74
+ sig { returns(T.nilable(Province)) }
75
+ attr_reader :province
76
+ sig { returns(T.nilable(Integer)) }
77
+ attr_reader :shop_id
78
+ sig { returns(T.nilable(String)) }
79
+ attr_reader :status
80
+ sig { returns(T.nilable(String)) }
81
+ attr_reader :updated_at
82
+ sig { returns(T.nilable(String)) }
83
+ attr_reader :zip
84
+
85
+ class << self
86
+ sig do
87
+ returns(String)
88
+ end
89
+ def json_body_name()
90
+ "event"
91
+ end
92
+
93
+ sig do
94
+ params(
95
+ id: T.any(Integer, String),
96
+ order_id: T.nilable(T.any(Integer, String)),
97
+ fulfillment_id: T.nilable(T.any(Integer, String)),
98
+ event_id: T.untyped,
99
+ session: Auth::Session
100
+ ).returns(T.nilable(FulfillmentEvent))
101
+ end
102
+ def find(
103
+ id:,
104
+ order_id: nil,
105
+ fulfillment_id: nil,
106
+ event_id: nil,
107
+ session: ShopifyAPI::Context.active_session
108
+ )
109
+ result = base_find(
110
+ session: session,
111
+ ids: {id: id, order_id: order_id, fulfillment_id: fulfillment_id},
112
+ params: {event_id: event_id},
113
+ )
114
+ T.cast(result[0], T.nilable(FulfillmentEvent))
115
+ end
116
+
117
+ sig do
118
+ params(
119
+ id: T.any(Integer, String),
120
+ order_id: T.nilable(T.any(Integer, String)),
121
+ fulfillment_id: T.nilable(T.any(Integer, String)),
122
+ session: Auth::Session
123
+ ).returns(T.untyped)
124
+ end
125
+ def delete(
126
+ id:,
127
+ order_id: nil,
128
+ fulfillment_id: nil,
129
+ session: ShopifyAPI::Context.active_session
130
+ )
131
+ request(
132
+ http_method: :delete,
133
+ operation: :delete,
134
+ session: session,
135
+ ids: {id: id, order_id: order_id, fulfillment_id: fulfillment_id},
136
+ params: {},
137
+ )
138
+ end
139
+
140
+ sig do
141
+ params(
142
+ order_id: T.nilable(T.any(Integer, String)),
143
+ fulfillment_id: T.nilable(T.any(Integer, String)),
144
+ session: Auth::Session,
145
+ kwargs: T.untyped
146
+ ).returns(T::Array[FulfillmentEvent])
147
+ end
148
+ def all(
149
+ order_id: nil,
150
+ fulfillment_id: nil,
151
+ session: ShopifyAPI::Context.active_session,
152
+ **kwargs
153
+ )
154
+ response = base_find(
155
+ session: session,
156
+ ids: {order_id: order_id, fulfillment_id: fulfillment_id},
157
+ params: {}.merge(kwargs).compact,
158
+ )
159
+
160
+ T.cast(response, T::Array[FulfillmentEvent])
161
+ end
162
+
163
+ end
164
+
165
+ end
166
+ end
@@ -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