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