shopify_api 14.6.0 → 14.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/Gemfile.lock +12 -7
  4. data/docs/usage/oauth.md +14 -0
  5. data/docs/usage/rest.md +2 -0
  6. data/docs/usage/webhooks.md +11 -0
  7. data/lib/shopify_api/admin_versions.rb +2 -1
  8. data/lib/shopify_api/clients/rest/admin.rb +5 -0
  9. data/lib/shopify_api/context.rb +12 -3
  10. data/lib/shopify_api/errors/disabled_resource_error.rb +8 -0
  11. data/lib/shopify_api/rest/resources/2024_07/webhook.rb +1 -0
  12. data/lib/shopify_api/rest/resources/2024_10/webhook.rb +1 -0
  13. data/lib/shopify_api/rest/resources/2025_01/abandoned_checkout.rb +194 -0
  14. data/lib/shopify_api/rest/resources/2025_01/access_scope.rb +62 -0
  15. data/lib/shopify_api/rest/resources/2025_01/apple_pay_certificate.rb +109 -0
  16. data/lib/shopify_api/rest/resources/2025_01/application_charge.rb +113 -0
  17. data/lib/shopify_api/rest/resources/2025_01/application_credit.rb +95 -0
  18. data/lib/shopify_api/rest/resources/2025_01/article.rb +269 -0
  19. data/lib/shopify_api/rest/resources/2025_01/asset.rb +122 -0
  20. data/lib/shopify_api/rest/resources/2025_01/assigned_fulfillment_order.rb +92 -0
  21. data/lib/shopify_api/rest/resources/2025_01/balance.rb +58 -0
  22. data/lib/shopify_api/rest/resources/2025_01/blog.rb +166 -0
  23. data/lib/shopify_api/rest/resources/2025_01/cancellation_request.rb +87 -0
  24. data/lib/shopify_api/rest/resources/2025_01/carrier_service.rb +120 -0
  25. data/lib/shopify_api/rest/resources/2025_01/checkout.rb +213 -0
  26. data/lib/shopify_api/rest/resources/2025_01/collect.rb +146 -0
  27. data/lib/shopify_api/rest/resources/2025_01/collection.rb +114 -0
  28. data/lib/shopify_api/rest/resources/2025_01/collection_listing.rb +159 -0
  29. data/lib/shopify_api/rest/resources/2025_01/comment.rb +287 -0
  30. data/lib/shopify_api/rest/resources/2025_01/country.rb +141 -0
  31. data/lib/shopify_api/rest/resources/2025_01/currency.rb +61 -0
  32. data/lib/shopify_api/rest/resources/2025_01/custom_collection.rb +191 -0
  33. data/lib/shopify_api/rest/resources/2025_01/customer.rb +328 -0
  34. data/lib/shopify_api/rest/resources/2025_01/customer_address.rb +215 -0
  35. data/lib/shopify_api/rest/resources/2025_01/deprecated_api_call.rb +61 -0
  36. data/lib/shopify_api/rest/resources/2025_01/discount_code.rb +226 -0
  37. data/lib/shopify_api/rest/resources/2025_01/dispute.rb +115 -0
  38. data/lib/shopify_api/rest/resources/2025_01/dispute_evidence.rb +121 -0
  39. data/lib/shopify_api/rest/resources/2025_01/dispute_file_upload.rb +85 -0
  40. data/lib/shopify_api/rest/resources/2025_01/draft_order.rb +279 -0
  41. data/lib/shopify_api/rest/resources/2025_01/event.rb +152 -0
  42. data/lib/shopify_api/rest/resources/2025_01/fulfillment.rb +235 -0
  43. data/lib/shopify_api/rest/resources/2025_01/fulfillment_event.rb +167 -0
  44. data/lib/shopify_api/rest/resources/2025_01/fulfillment_order.rb +326 -0
  45. data/lib/shopify_api/rest/resources/2025_01/fulfillment_request.rb +116 -0
  46. data/lib/shopify_api/rest/resources/2025_01/fulfillment_service.rb +134 -0
  47. data/lib/shopify_api/rest/resources/2025_01/gift_card.rb +222 -0
  48. data/lib/shopify_api/rest/resources/2025_01/gift_card_adjustment.rb +122 -0
  49. data/lib/shopify_api/rest/resources/2025_01/image.rb +161 -0
  50. data/lib/shopify_api/rest/resources/2025_01/inventory_item.rb +112 -0
  51. data/lib/shopify_api/rest/resources/2025_01/inventory_level.rb +183 -0
  52. data/lib/shopify_api/rest/resources/2025_01/location.rb +171 -0
  53. data/lib/shopify_api/rest/resources/2025_01/locations_for_move.rb +60 -0
  54. data/lib/shopify_api/rest/resources/2025_01/marketing_event.rb +213 -0
  55. data/lib/shopify_api/rest/resources/2025_01/metafield.rb +348 -0
  56. data/lib/shopify_api/rest/resources/2025_01/mobile_platform_application.rb +120 -0
  57. data/lib/shopify_api/rest/resources/2025_01/order.rb +503 -0
  58. data/lib/shopify_api/rest/resources/2025_01/order_risk.rb +148 -0
  59. data/lib/shopify_api/rest/resources/2025_01/page.rb +198 -0
  60. data/lib/shopify_api/rest/resources/2025_01/payment.rb +98 -0
  61. data/lib/shopify_api/rest/resources/2025_01/payment_gateway.rb +147 -0
  62. data/lib/shopify_api/rest/resources/2025_01/payment_transaction.rb +117 -0
  63. data/lib/shopify_api/rest/resources/2025_01/payout.rb +101 -0
  64. data/lib/shopify_api/rest/resources/2025_01/policy.rb +73 -0
  65. data/lib/shopify_api/rest/resources/2025_01/price_rule.rb +227 -0
  66. data/lib/shopify_api/rest/resources/2025_01/product.rb +227 -0
  67. data/lib/shopify_api/rest/resources/2025_01/product_listing.rb +200 -0
  68. data/lib/shopify_api/rest/resources/2025_01/product_resource_feedback.rb +92 -0
  69. data/lib/shopify_api/rest/resources/2025_01/province.rb +136 -0
  70. data/lib/shopify_api/rest/resources/2025_01/recurring_application_charge.rb +184 -0
  71. data/lib/shopify_api/rest/resources/2025_01/redirect.rb +143 -0
  72. data/lib/shopify_api/rest/resources/2025_01/refund.rb +158 -0
  73. data/lib/shopify_api/rest/resources/2025_01/resource_feedback.rb +77 -0
  74. data/lib/shopify_api/rest/resources/2025_01/script_tag.rb +159 -0
  75. data/lib/shopify_api/rest/resources/2025_01/shipping_zone.rb +87 -0
  76. data/lib/shopify_api/rest/resources/2025_01/shop.rb +231 -0
  77. data/lib/shopify_api/rest/resources/2025_01/smart_collection.rb +220 -0
  78. data/lib/shopify_api/rest/resources/2025_01/storefront_access_token.rb +91 -0
  79. data/lib/shopify_api/rest/resources/2025_01/tender_transaction.rb +97 -0
  80. data/lib/shopify_api/rest/resources/2025_01/theme.rb +127 -0
  81. data/lib/shopify_api/rest/resources/2025_01/transaction.rb +194 -0
  82. data/lib/shopify_api/rest/resources/2025_01/usage_charge.rb +106 -0
  83. data/lib/shopify_api/rest/resources/2025_01/user.rb +142 -0
  84. data/lib/shopify_api/rest/resources/2025_01/variant.rb +212 -0
  85. data/lib/shopify_api/rest/resources/2025_01/webhook.rb +173 -0
  86. data/lib/shopify_api/version.rb +1 -1
  87. data/lib/shopify_api/webhooks/registration.rb +17 -3
  88. data/lib/shopify_api/webhooks/registrations/event_bridge.rb +22 -3
  89. data/lib/shopify_api/webhooks/registrations/http.rb +22 -3
  90. data/lib/shopify_api/webhooks/registrations/pub_sub.rb +23 -4
  91. data/lib/shopify_api/webhooks/registry.rb +15 -5
  92. metadata +77 -6
@@ -0,0 +1,328 @@
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 Customer < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ @api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
16
+ @retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
17
+
18
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
19
+ def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
20
+
21
+ @addresses = T.let(nil, T.nilable(T::Array[T.untyped]))
22
+ @created_at = T.let(nil, T.nilable(String))
23
+ @currency = T.let(nil, T.nilable(String))
24
+ @default_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
25
+ @email = T.let(nil, T.nilable(String))
26
+ @email_marketing_consent = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
27
+ @first_name = T.let(nil, T.nilable(String))
28
+ @id = T.let(nil, T.nilable(Integer))
29
+ @last_name = T.let(nil, T.nilable(String))
30
+ @last_order_id = T.let(nil, T.nilable(Integer))
31
+ @last_order_name = T.let(nil, T.nilable(String))
32
+ @marketing_opt_in_level = T.let(nil, T.nilable(String))
33
+ @metafield = T.let(nil, T.nilable(Metafield))
34
+ @multipass_identifier = T.let(nil, T.nilable(String))
35
+ @note = T.let(nil, T.nilable(String))
36
+ @orders_count = T.let(nil, T.nilable(Integer))
37
+ @password = T.let(nil, T.nilable(String))
38
+ @password_confirmation = T.let(nil, T.nilable(String))
39
+ @phone = T.let(nil, T.nilable(String))
40
+ @sms_marketing_consent = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
41
+ @state = T.let(nil, T.nilable(String))
42
+ @tags = T.let(nil, T.nilable(String))
43
+ @tax_exempt = T.let(nil, T.nilable(T::Boolean))
44
+ @tax_exemptions = T.let(nil, T.nilable(T::Array[T.untyped]))
45
+ @total_spent = T.let(nil, T.nilable(String))
46
+ @updated_at = T.let(nil, T.nilable(String))
47
+ @verified_email = T.let(nil, T.nilable(T::Boolean))
48
+
49
+ super(session: session, from_hash: from_hash)
50
+ end
51
+
52
+ @has_one = T.let({
53
+ metafield: Metafield
54
+ }, T::Hash[Symbol, Class])
55
+ @has_many = T.let({}, T::Hash[Symbol, Class])
56
+ @atomic_hash_attributes = [:email_marketing_consent]
57
+ @paths = T.let([
58
+ {http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
59
+ {http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
60
+ {http_method: :get, operation: :get, ids: [], path: "customers.json"},
61
+ {http_method: :get, operation: :get, ids: [:id], path: "customers/<id>.json"},
62
+ {http_method: :get, operation: :orders, ids: [:id], path: "customers/<id>/orders.json"},
63
+ {http_method: :get, operation: :search, ids: [], path: "customers/search.json"},
64
+ {http_method: :post, operation: :account_activation_url, ids: [:id], path: "customers/<id>/account_activation_url.json"},
65
+ {http_method: :post, operation: :post, ids: [], path: "customers.json"},
66
+ {http_method: :post, operation: :send_invite, ids: [:id], path: "customers/<id>/send_invite.json"},
67
+ {http_method: :put, operation: :put, ids: [:id], path: "customers/<id>.json"}
68
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
69
+
70
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
71
+ attr_reader :addresses
72
+ sig { returns(T.nilable(String)) }
73
+ attr_reader :created_at
74
+ sig { returns(T.nilable(String)) }
75
+ attr_reader :currency
76
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
77
+ attr_reader :default_address
78
+ sig { returns(T.nilable(String)) }
79
+ attr_reader :email
80
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
81
+ attr_reader :email_marketing_consent
82
+ sig { returns(T.nilable(String)) }
83
+ attr_reader :first_name
84
+ sig { returns(T.nilable(Integer)) }
85
+ attr_reader :id
86
+ sig { returns(T.nilable(String)) }
87
+ attr_reader :last_name
88
+ sig { returns(T.nilable(Integer)) }
89
+ attr_reader :last_order_id
90
+ sig { returns(T.nilable(String)) }
91
+ attr_reader :last_order_name
92
+ sig { returns(T.nilable(String)) }
93
+ attr_reader :marketing_opt_in_level
94
+ sig { returns(T.nilable(Metafield)) }
95
+ attr_reader :metafield
96
+ sig { returns(T.nilable(String)) }
97
+ attr_reader :multipass_identifier
98
+ sig { returns(T.nilable(String)) }
99
+ attr_reader :note
100
+ sig { returns(T.nilable(Integer)) }
101
+ attr_reader :orders_count
102
+ sig { returns(T.nilable(String)) }
103
+ attr_reader :password
104
+ sig { returns(T.nilable(String)) }
105
+ attr_reader :password_confirmation
106
+ sig { returns(T.nilable(String)) }
107
+ attr_reader :phone
108
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
109
+ attr_reader :sms_marketing_consent
110
+ sig { returns(T.nilable(String)) }
111
+ attr_reader :state
112
+ sig { returns(T.nilable(String)) }
113
+ attr_reader :tags
114
+ sig { returns(T.nilable(T::Boolean)) }
115
+ attr_reader :tax_exempt
116
+ sig { returns(T.nilable(T::Array[String])) }
117
+ attr_reader :tax_exemptions
118
+ sig { returns(T.nilable(String)) }
119
+ attr_reader :total_spent
120
+ sig { returns(T.nilable(String)) }
121
+ attr_reader :updated_at
122
+ sig { returns(T.nilable(T::Boolean)) }
123
+ attr_reader :verified_email
124
+
125
+ class << self
126
+ sig do
127
+ params(
128
+ id: T.any(Integer, String),
129
+ fields: T.untyped,
130
+ session: Auth::Session
131
+ ).returns(T.nilable(Customer))
132
+ end
133
+ def find(
134
+ id:,
135
+ fields: nil,
136
+ session: ShopifyAPI::Context.active_session
137
+ )
138
+ result = base_find(
139
+ session: session,
140
+ ids: {id: id},
141
+ params: {fields: fields},
142
+ )
143
+ T.cast(result[0], T.nilable(Customer))
144
+ end
145
+
146
+ sig do
147
+ params(
148
+ id: T.any(Integer, String),
149
+ session: Auth::Session
150
+ ).returns(T.untyped)
151
+ end
152
+ def delete(
153
+ id:,
154
+ session: ShopifyAPI::Context.active_session
155
+ )
156
+ request(
157
+ http_method: :delete,
158
+ operation: :delete,
159
+ session: session,
160
+ ids: {id: id},
161
+ params: {},
162
+ )
163
+ end
164
+
165
+ sig do
166
+ params(
167
+ ids: T.untyped,
168
+ since_id: T.untyped,
169
+ created_at_min: T.untyped,
170
+ created_at_max: T.untyped,
171
+ updated_at_min: T.untyped,
172
+ updated_at_max: T.untyped,
173
+ limit: T.untyped,
174
+ fields: T.untyped,
175
+ session: Auth::Session,
176
+ kwargs: T.untyped
177
+ ).returns(T::Array[Customer])
178
+ end
179
+ def all(
180
+ ids: nil,
181
+ since_id: nil,
182
+ created_at_min: nil,
183
+ created_at_max: nil,
184
+ updated_at_min: nil,
185
+ updated_at_max: nil,
186
+ limit: nil,
187
+ fields: nil,
188
+ session: ShopifyAPI::Context.active_session,
189
+ **kwargs
190
+ )
191
+ response = base_find(
192
+ session: session,
193
+ ids: {},
194
+ params: {ids: ids, since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, limit: limit, fields: fields}.merge(kwargs).compact,
195
+ )
196
+
197
+ T.cast(response, T::Array[Customer])
198
+ end
199
+
200
+ sig do
201
+ params(
202
+ created_at_min: T.untyped,
203
+ created_at_max: T.untyped,
204
+ updated_at_min: T.untyped,
205
+ updated_at_max: T.untyped,
206
+ session: Auth::Session,
207
+ kwargs: T.untyped
208
+ ).returns(T.untyped)
209
+ end
210
+ def count(
211
+ created_at_min: nil,
212
+ created_at_max: nil,
213
+ updated_at_min: nil,
214
+ updated_at_max: nil,
215
+ session: ShopifyAPI::Context.active_session,
216
+ **kwargs
217
+ )
218
+ request(
219
+ http_method: :get,
220
+ operation: :count,
221
+ session: session,
222
+ ids: {},
223
+ 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,
224
+ body: {},
225
+ entity: nil,
226
+ )
227
+ end
228
+
229
+ sig do
230
+ params(
231
+ id: T.any(Integer, String),
232
+ status: T.untyped,
233
+ session: Auth::Session,
234
+ kwargs: T.untyped
235
+ ).returns(T.untyped)
236
+ end
237
+ def orders(
238
+ id:,
239
+ status: nil,
240
+ session: ShopifyAPI::Context.active_session,
241
+ **kwargs
242
+ )
243
+ request(
244
+ http_method: :get,
245
+ operation: :orders,
246
+ session: session,
247
+ ids: {id: id},
248
+ params: {status: status}.merge(kwargs).compact,
249
+ body: {},
250
+ entity: nil,
251
+ )
252
+ end
253
+
254
+ sig do
255
+ params(
256
+ order: T.untyped,
257
+ query: T.untyped,
258
+ limit: T.untyped,
259
+ fields: T.untyped,
260
+ session: Auth::Session,
261
+ kwargs: T.untyped
262
+ ).returns(T.untyped)
263
+ end
264
+ def search(
265
+ order: nil,
266
+ query: nil,
267
+ limit: nil,
268
+ fields: nil,
269
+ session: ShopifyAPI::Context.active_session,
270
+ **kwargs
271
+ )
272
+ request(
273
+ http_method: :get,
274
+ operation: :search,
275
+ session: session,
276
+ ids: {},
277
+ params: {order: order, query: query, limit: limit, fields: fields}.merge(kwargs).compact,
278
+ body: {},
279
+ entity: nil,
280
+ )
281
+ end
282
+
283
+ end
284
+
285
+ sig do
286
+ params(
287
+ body: T.untyped,
288
+ kwargs: T.untyped
289
+ ).returns(T.untyped)
290
+ end
291
+ def account_activation_url(
292
+ body: nil,
293
+ **kwargs
294
+ )
295
+ self.class.request(
296
+ http_method: :post,
297
+ operation: :account_activation_url,
298
+ session: @session,
299
+ ids: {id: @id},
300
+ params: {}.merge(kwargs).compact,
301
+ body: body,
302
+ entity: self,
303
+ )
304
+ end
305
+
306
+ sig do
307
+ params(
308
+ body: T.untyped,
309
+ kwargs: T.untyped
310
+ ).returns(T.untyped)
311
+ end
312
+ def send_invite(
313
+ body: nil,
314
+ **kwargs
315
+ )
316
+ self.class.request(
317
+ http_method: :post,
318
+ operation: :send_invite,
319
+ session: @session,
320
+ ids: {id: @id},
321
+ params: {}.merge(kwargs).compact,
322
+ body: body,
323
+ entity: self,
324
+ )
325
+ end
326
+
327
+ end
328
+ end
@@ -0,0 +1,215 @@
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 CustomerAddress < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ @api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
16
+ @retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
17
+
18
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
19
+ def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
20
+
21
+ @address1 = T.let(nil, T.nilable(String))
22
+ @address2 = T.let(nil, T.nilable(String))
23
+ @city = T.let(nil, T.nilable(String))
24
+ @company = T.let(nil, T.nilable(String))
25
+ @country = T.let(nil, T.nilable(String))
26
+ @country_code = T.let(nil, T.nilable(String))
27
+ @country_name = T.let(nil, T.nilable(String))
28
+ @customer_id = T.let(nil, T.nilable(Integer))
29
+ @first_name = T.let(nil, T.nilable(String))
30
+ @id = T.let(nil, T.nilable(Integer))
31
+ @last_name = T.let(nil, T.nilable(String))
32
+ @name = T.let(nil, T.nilable(String))
33
+ @phone = T.let(nil, T.nilable(String))
34
+ @province = T.let(nil, T.nilable(String))
35
+ @province_code = T.let(nil, T.nilable(String))
36
+ @zip = T.let(nil, T.nilable(String))
37
+
38
+ super(session: session, from_hash: from_hash)
39
+ end
40
+
41
+ @has_one = T.let({}, T::Hash[Symbol, Class])
42
+ @has_many = T.let({}, T::Hash[Symbol, Class])
43
+ @paths = T.let([
44
+ {http_method: :delete, operation: :delete, ids: [:customer_id, :id], path: "customers/<customer_id>/addresses/<id>.json"},
45
+ {http_method: :get, operation: :get, ids: [:customer_id], path: "customers/<customer_id>/addresses.json"},
46
+ {http_method: :get, operation: :get, ids: [:customer_id, :id], path: "customers/<customer_id>/addresses/<id>.json"},
47
+ {http_method: :post, operation: :post, ids: [:customer_id], path: "customers/<customer_id>/addresses.json"},
48
+ {http_method: :put, operation: :default, ids: [:customer_id, :id], path: "customers/<customer_id>/addresses/<id>/default.json"},
49
+ {http_method: :put, operation: :put, ids: [:customer_id, :id], path: "customers/<customer_id>/addresses/<id>.json"},
50
+ {http_method: :put, operation: :set, ids: [:customer_id], path: "customers/<customer_id>/addresses/set.json"}
51
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
52
+
53
+ sig { returns(T.nilable(String)) }
54
+ attr_reader :address1
55
+ sig { returns(T.nilable(String)) }
56
+ attr_reader :address2
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :city
59
+ sig { returns(T.nilable(String)) }
60
+ attr_reader :company
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :country
63
+ sig { returns(T.nilable(String)) }
64
+ attr_reader :country_code
65
+ sig { returns(T.nilable(String)) }
66
+ attr_reader :country_name
67
+ sig { returns(T.nilable(Integer)) }
68
+ attr_reader :customer_id
69
+ sig { returns(T.nilable(String)) }
70
+ attr_reader :first_name
71
+ sig { returns(T.nilable(Integer)) }
72
+ attr_reader :id
73
+ sig { returns(T.nilable(String)) }
74
+ attr_reader :last_name
75
+ sig { returns(T.nilable(String)) }
76
+ attr_reader :name
77
+ sig { returns(T.nilable(String)) }
78
+ attr_reader :phone
79
+ sig { returns(T.nilable(String)) }
80
+ attr_reader :province
81
+ sig { returns(T.nilable(String)) }
82
+ attr_reader :province_code
83
+ sig { returns(T.nilable(String)) }
84
+ attr_reader :zip
85
+
86
+ class << self
87
+ sig do
88
+ returns(String)
89
+ end
90
+ def json_body_name()
91
+ "address"
92
+ end
93
+
94
+ sig do
95
+ returns(T::Array[String])
96
+ end
97
+ def json_response_body_names()
98
+ [
99
+ "customer_address",
100
+ "address"
101
+ ]
102
+ end
103
+
104
+ sig do
105
+ params(
106
+ id: T.any(Integer, String),
107
+ customer_id: T.nilable(T.any(Integer, String)),
108
+ session: Auth::Session
109
+ ).returns(T.nilable(CustomerAddress))
110
+ end
111
+ def find(
112
+ id:,
113
+ customer_id: nil,
114
+ session: ShopifyAPI::Context.active_session
115
+ )
116
+ result = base_find(
117
+ session: session,
118
+ ids: {id: id, customer_id: customer_id},
119
+ params: {},
120
+ )
121
+ T.cast(result[0], T.nilable(CustomerAddress))
122
+ end
123
+
124
+ sig do
125
+ params(
126
+ id: T.any(Integer, String),
127
+ customer_id: T.nilable(T.any(Integer, String)),
128
+ session: Auth::Session
129
+ ).returns(T.untyped)
130
+ end
131
+ def delete(
132
+ id:,
133
+ customer_id: nil,
134
+ session: ShopifyAPI::Context.active_session
135
+ )
136
+ request(
137
+ http_method: :delete,
138
+ operation: :delete,
139
+ session: session,
140
+ ids: {id: id, customer_id: customer_id},
141
+ params: {},
142
+ )
143
+ end
144
+
145
+ sig do
146
+ params(
147
+ customer_id: T.nilable(T.any(Integer, String)),
148
+ session: Auth::Session,
149
+ kwargs: T.untyped
150
+ ).returns(T::Array[CustomerAddress])
151
+ end
152
+ def all(
153
+ customer_id: nil,
154
+ session: ShopifyAPI::Context.active_session,
155
+ **kwargs
156
+ )
157
+ response = base_find(
158
+ session: session,
159
+ ids: {customer_id: customer_id},
160
+ params: {}.merge(kwargs).compact,
161
+ )
162
+
163
+ T.cast(response, T::Array[CustomerAddress])
164
+ end
165
+
166
+ end
167
+
168
+ sig do
169
+ params(
170
+ body: T.untyped,
171
+ kwargs: T.untyped
172
+ ).returns(T.untyped)
173
+ end
174
+ def default(
175
+ body: nil,
176
+ **kwargs
177
+ )
178
+ self.class.request(
179
+ http_method: :put,
180
+ operation: :default,
181
+ session: @session,
182
+ ids: {id: @id, customer_id: @customer_id},
183
+ params: {}.merge(kwargs).compact,
184
+ body: body,
185
+ entity: self,
186
+ )
187
+ end
188
+
189
+ sig do
190
+ params(
191
+ address_ids: T.nilable(T.any(T::Array[T.untyped], Integer, String)),
192
+ operation: T.untyped,
193
+ body: T.untyped,
194
+ kwargs: T.untyped
195
+ ).returns(T.untyped)
196
+ end
197
+ def set(
198
+ address_ids: nil,
199
+ operation: nil,
200
+ body: nil,
201
+ **kwargs
202
+ )
203
+ self.class.request(
204
+ http_method: :put,
205
+ operation: :set,
206
+ session: @session,
207
+ ids: {customer_id: @customer_id},
208
+ params: {address_ids: address_ids, operation: operation}.merge(kwargs).compact,
209
+ body: body,
210
+ entity: self,
211
+ )
212
+ end
213
+
214
+ end
215
+ end
@@ -0,0 +1,61 @@
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 DeprecatedApiCall < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ @api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
16
+ @retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
17
+
18
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
19
+ def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
20
+
21
+ @data_updated_at = T.let(nil, T.nilable(String))
22
+ @deprecated_api_calls = T.let(nil, T.nilable(T::Array[T.untyped]))
23
+
24
+ super(session: session, from_hash: from_hash)
25
+ end
26
+
27
+ @has_one = T.let({}, T::Hash[Symbol, Class])
28
+ @has_many = T.let({}, T::Hash[Symbol, Class])
29
+ @paths = T.let([
30
+ {http_method: :get, operation: :get, ids: [], path: "deprecated_api_calls.json"}
31
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
32
+
33
+ sig { returns(T.nilable(String)) }
34
+ attr_reader :data_updated_at
35
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
36
+ attr_reader :deprecated_api_calls
37
+
38
+ class << self
39
+ sig do
40
+ params(
41
+ session: Auth::Session,
42
+ kwargs: T.untyped
43
+ ).returns(T::Array[DeprecatedApiCall])
44
+ end
45
+ def all(
46
+ session: ShopifyAPI::Context.active_session,
47
+ **kwargs
48
+ )
49
+ response = base_find(
50
+ session: session,
51
+ ids: {},
52
+ params: {}.merge(kwargs).compact,
53
+ )
54
+
55
+ T.cast(response, T::Array[DeprecatedApiCall])
56
+ end
57
+
58
+ end
59
+
60
+ end
61
+ end