shopify_api 14.5.0 → 14.7.0

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