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,148 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ ########################################################################################################################
5
+ # This file is auto-generated. If you have an issue, please create a GitHub issue. #
6
+ ########################################################################################################################
7
+
8
+ module ShopifyAPI
9
+ class Event < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
16
+ def initialize(session: ShopifyAPI::Context.active_session)
17
+ super(session: session)
18
+
19
+ @arguments = T.let(nil, T.nilable(T::Array[T.untyped]))
20
+ @body = T.let(nil, T.nilable(String))
21
+ @created_at = T.let(nil, T.nilable(String))
22
+ @description = T.let(nil, T.nilable(String))
23
+ @id = T.let(nil, T.nilable(Integer))
24
+ @message = T.let(nil, T.nilable(String))
25
+ @path = T.let(nil, T.nilable(String))
26
+ @subject_id = T.let(nil, T.nilable(Integer))
27
+ @subject_type = T.let(nil, T.nilable(String))
28
+ @verb = T.let(nil, T.nilable(String))
29
+ end
30
+
31
+ @has_one = T.let({}, T::Hash[Symbol, Class])
32
+ @has_many = T.let({}, T::Hash[Symbol, Class])
33
+ @paths = T.let([
34
+ {http_method: :get, operation: :count, ids: [], path: "events/count.json"},
35
+ {http_method: :get, operation: :get, ids: [], path: "events.json"},
36
+ {http_method: :get, operation: :get, ids: [:id], path: "events/<id>.json"},
37
+ {http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/events.json"},
38
+ {http_method: :get, operation: :get, ids: [:product_id], path: "products/<product_id>/events.json"}
39
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
40
+
41
+ sig { returns(T.nilable(T::Array[String])) }
42
+ attr_reader :arguments
43
+ sig { returns(T.nilable(String)) }
44
+ attr_reader :body
45
+ sig { returns(T.nilable(String)) }
46
+ attr_reader :created_at
47
+ sig { returns(T.nilable(String)) }
48
+ attr_reader :description
49
+ sig { returns(T.nilable(Integer)) }
50
+ attr_reader :id
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :message
53
+ sig { returns(T.nilable(String)) }
54
+ attr_reader :path
55
+ sig { returns(T.nilable(Integer)) }
56
+ attr_reader :subject_id
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :subject_type
59
+ sig { returns(T.nilable(String)) }
60
+ attr_reader :verb
61
+
62
+ class << self
63
+ sig do
64
+ params(
65
+ id: T.any(Integer, String),
66
+ fields: T.untyped,
67
+ session: Auth::Session
68
+ ).returns(T.nilable(Event))
69
+ end
70
+ def find(
71
+ id:,
72
+ fields: nil,
73
+ session: ShopifyAPI::Context.active_session
74
+ )
75
+ result = base_find(
76
+ session: session,
77
+ ids: {id: id},
78
+ params: {fields: fields},
79
+ )
80
+ T.cast(result[0], T.nilable(Event))
81
+ end
82
+
83
+ sig do
84
+ params(
85
+ order_id: T.nilable(T.any(Integer, String)),
86
+ product_id: T.nilable(T.any(Integer, String)),
87
+ limit: T.untyped,
88
+ since_id: T.untyped,
89
+ created_at_min: T.untyped,
90
+ created_at_max: T.untyped,
91
+ filter: T.untyped,
92
+ verb: T.untyped,
93
+ fields: T.untyped,
94
+ session: Auth::Session,
95
+ kwargs: T.untyped
96
+ ).returns(T::Array[Event])
97
+ end
98
+ def all(
99
+ order_id: nil,
100
+ product_id: nil,
101
+ limit: nil,
102
+ since_id: nil,
103
+ created_at_min: nil,
104
+ created_at_max: nil,
105
+ filter: nil,
106
+ verb: nil,
107
+ fields: nil,
108
+ session: ShopifyAPI::Context.active_session,
109
+ **kwargs
110
+ )
111
+ response = base_find(
112
+ session: session,
113
+ ids: {order_id: order_id, product_id: product_id},
114
+ params: {limit: limit, since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, filter: filter, verb: verb, fields: fields}.merge(kwargs).compact,
115
+ )
116
+
117
+ T.cast(response, T::Array[Event])
118
+ end
119
+
120
+ sig do
121
+ params(
122
+ created_at_min: T.untyped,
123
+ created_at_max: T.untyped,
124
+ session: Auth::Session,
125
+ kwargs: T.untyped
126
+ ).returns(T.untyped)
127
+ end
128
+ def count(
129
+ created_at_min: nil,
130
+ created_at_max: nil,
131
+ session: ShopifyAPI::Context.active_session,
132
+ **kwargs
133
+ )
134
+ request(
135
+ http_method: :get,
136
+ operation: :count,
137
+ session: session,
138
+ ids: {},
139
+ params: {created_at_min: created_at_min, created_at_max: created_at_max}.merge(kwargs).compact,
140
+ body: {},
141
+ entity: nil,
142
+ )
143
+ end
144
+
145
+ end
146
+
147
+ end
148
+ end
@@ -0,0 +1,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