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