Skip to content

Commit 9ba9aca

Browse files
authored
Merge pull request #1027 from Shopify/update_api_version
Update api version
2 parents 43392ab + 6fe3925 commit 9ba9aca

File tree

406 files changed

+16035
-15402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

406 files changed

+16035
-15402
lines changed

lib/shopify_api/admin_versions.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ module ShopifyAPI
55
module AdminVersions
66
SUPPORTED_ADMIN_VERSIONS = T.let([
77
"unstable",
8+
"2022-10",
89
"2022-07",
910
"2022-04",
1011
"2022-01",
11-
"2021-10",
1212
], T::Array[String])
1313

14-
LATEST_SUPPORTED_ADMIN_VERSION = T.let("2022-07", String)
14+
LATEST_SUPPORTED_ADMIN_VERSION = T.let("2022-10", String)
1515
end
1616

1717
SUPPORTED_ADMIN_VERSIONS = ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS

lib/shopify_api/rest/resources/2022_01/abandoned_checkout.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def initialize(session: ShopifyAPI::Context.active_session)
6565
discount_codes: DiscountCode
6666
}, T::Hash[Symbol, Class])
6767
@paths = T.let([
68+
{http_method: :get, operation: :checkouts, ids: [], path: "checkouts.json"},
6869
{http_method: :get, operation: :checkouts, ids: [], path: "checkouts.json"}
6970
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
7071

@@ -150,25 +151,25 @@ def initialize(session: ShopifyAPI::Context.active_session)
150151
class << self
151152
sig do
152153
params(
153-
limit: T.untyped,
154154
since_id: T.untyped,
155155
created_at_min: T.untyped,
156156
created_at_max: T.untyped,
157157
updated_at_min: T.untyped,
158158
updated_at_max: T.untyped,
159159
status: T.untyped,
160+
limit: T.untyped,
160161
session: Auth::Session,
161162
kwargs: T.untyped
162163
).returns(T.untyped)
163164
end
164165
def checkouts(
165-
limit: nil,
166166
since_id: nil,
167167
created_at_min: nil,
168168
created_at_max: nil,
169169
updated_at_min: nil,
170170
updated_at_max: nil,
171171
status: nil,
172+
limit: nil,
172173
session: ShopifyAPI::Context.active_session,
173174
**kwargs
174175
)
@@ -177,7 +178,7 @@ def checkouts(
177178
operation: :checkouts,
178179
session: session,
179180
ids: {},
180-
params: {limit: limit, 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, status: status}.merge(kwargs).compact,
181+
params: {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, status: status, limit: limit}.merge(kwargs).compact,
181182
body: {},
182183
entity: nil,
183184
)

lib/shopify_api/rest/resources/2022_01/customer.rb

+26
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ def initialize(session: ShopifyAPI::Context.active_session)
3333
@multipass_identifier = T.let(nil, T.nilable(String))
3434
@note = T.let(nil, T.nilable(String))
3535
@orders_count = T.let(nil, T.nilable(Integer))
36+
@password = T.let(nil, T.nilable(String))
37+
@password_confirmation = T.let(nil, T.nilable(String))
3638
@phone = T.let(nil, T.nilable(String))
3739
@sms_marketing_consent = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
3840
@state = T.let(nil, T.nilable(String))
@@ -49,6 +51,7 @@ def initialize(session: ShopifyAPI::Context.active_session)
4951
}, T::Hash[Symbol, Class])
5052
@has_many = T.let({}, T::Hash[Symbol, Class])
5153
@paths = T.let([
54+
{http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
5255
{http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
5356
{http_method: :get, operation: :get, ids: [], path: "customers.json"},
5457
{http_method: :get, operation: :get, ids: [:id], path: "customers/<id>.json"},
@@ -95,6 +98,10 @@ def initialize(session: ShopifyAPI::Context.active_session)
9598
sig { returns(T.nilable(Integer)) }
9699
attr_reader :orders_count
97100
sig { returns(T.nilable(String)) }
101+
attr_reader :password
102+
sig { returns(T.nilable(String)) }
103+
attr_reader :password_confirmation
104+
sig { returns(T.nilable(String)) }
98105
attr_reader :phone
99106
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
100107
attr_reader :sms_marketing_consent
@@ -134,6 +141,25 @@ def find(
134141
T.cast(result[0], T.nilable(Customer))
135142
end
136143

144+
sig do
145+
params(
146+
id: T.any(Integer, String),
147+
session: Auth::Session
148+
).returns(T.untyped)
149+
end
150+
def delete(
151+
id:,
152+
session: ShopifyAPI::Context.active_session
153+
)
154+
request(
155+
http_method: :delete,
156+
operation: :delete,
157+
session: session,
158+
ids: {id: id},
159+
params: {},
160+
)
161+
end
162+
137163
sig do
138164
params(
139165
ids: T.untyped,

lib/shopify_api/rest/resources/2022_01/draft_order.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,14 @@ def send_invoice(
248248

249249
sig do
250250
params(
251+
payment_gateway_id: T.untyped,
251252
payment_pending: T.untyped,
252253
body: T.untyped,
253254
kwargs: T.untyped
254255
).returns(T.untyped)
255256
end
256257
def complete(
258+
payment_gateway_id: nil,
257259
payment_pending: nil,
258260
body: nil,
259261
**kwargs
@@ -263,7 +265,7 @@ def complete(
263265
operation: :complete,
264266
session: @session,
265267
ids: {id: @id},
266-
params: {payment_pending: payment_pending}.merge(kwargs).compact,
268+
params: {payment_gateway_id: payment_gateway_id, payment_pending: payment_pending}.merge(kwargs).compact,
267269
body: body,
268270
entity: self,
269271
)

lib/shopify_api/rest/resources/2022_01/fulfillment_request.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,16 @@ def accept(
5959
sig do
6060
params(
6161
message: T.untyped,
62+
reason: T.untyped,
63+
line_items: T.untyped,
6264
body: T.untyped,
6365
kwargs: T.untyped
6466
).returns(T.untyped)
6567
end
6668
def reject(
6769
message: nil,
70+
reason: nil,
71+
line_items: nil,
6872
body: nil,
6973
**kwargs
7074
)
@@ -73,7 +77,7 @@ def reject(
7377
operation: :reject,
7478
session: @session,
7579
ids: {fulfillment_order_id: @fulfillment_order_id},
76-
params: {message: message}.merge(kwargs).compact,
80+
params: {message: message, reason: reason, line_items: line_items}.merge(kwargs).compact,
7781
body: body,
7882
entity: self,
7983
)

lib/shopify_api/rest/resources/2022_01/gift_card.rb

+9-1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ def count(
157157
query: T.untyped,
158158
limit: T.untyped,
159159
fields: T.untyped,
160+
created_at_min: T.untyped,
161+
created_at_max: T.untyped,
162+
updated_at_min: T.untyped,
163+
updated_at_max: T.untyped,
160164
session: Auth::Session,
161165
kwargs: T.untyped
162166
).returns(T.untyped)
@@ -166,6 +170,10 @@ def search(
166170
query: nil,
167171
limit: nil,
168172
fields: nil,
173+
created_at_min: nil,
174+
created_at_max: nil,
175+
updated_at_min: nil,
176+
updated_at_max: nil,
169177
session: ShopifyAPI::Context.active_session,
170178
**kwargs
171179
)
@@ -174,7 +182,7 @@ def search(
174182
operation: :search,
175183
session: session,
176184
ids: {},
177-
params: {order: order, query: query, limit: limit, fields: fields}.merge(kwargs).compact,
185+
params: {order: order, query: query, limit: limit, fields: fields, 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,
178186
body: {},
179187
entity: nil,
180188
)

lib/shopify_api/rest/resources/2022_01/metafield.rb

+12-5
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def initialize(session: ShopifyAPI::Context.active_session)
5151
{http_method: :delete, operation: :delete, ids: [:order_id, :id], path: "orders/<order_id>/metafields/<id>.json"},
5252
{http_method: :delete, operation: :delete, ids: [:page_id, :id], path: "pages/<page_id>/metafields/<id>.json"},
5353
{http_method: :delete, operation: :delete, ids: [:product_image_id, :id], path: "product_images/<product_image_id>/metafields/<id>.json"},
54+
{http_method: :delete, operation: :delete, ids: [:product_image_id, :id], path: "product_images/<product_image_id>/metafields/<id>.json"},
5455
{http_method: :delete, operation: :delete, ids: [:product_id, :id], path: "products/<product_id>/metafields/<id>.json"},
5556
{http_method: :delete, operation: :delete, ids: [:variant_id, :id], path: "variants/<variant_id>/metafields/<id>.json"},
5657
{http_method: :get, operation: :count, ids: [:article_id], path: "articles/<article_id>/metafields/count.json"},
@@ -61,6 +62,7 @@ def initialize(session: ShopifyAPI::Context.active_session)
6162
{http_method: :get, operation: :count, ids: [], path: "metafields/count.json"},
6263
{http_method: :get, operation: :count, ids: [:order_id], path: "orders/<order_id>/metafields/count.json"},
6364
{http_method: :get, operation: :count, ids: [:page_id], path: "pages/<page_id>/metafields/count.json"},
65+
{http_method: :get, operation: :count, ids: [:page_id], path: "pages/<page_id>/metafields/count.json"},
6466
{http_method: :get, operation: :count, ids: [:product_image_id], path: "product_images/<product_image_id>/metafields/count.json"},
6567
{http_method: :get, operation: :count, ids: [:product_id], path: "products/<product_id>/metafields/count.json"},
6668
{http_method: :get, operation: :count, ids: [:variant_id], path: "variants/<variant_id>/metafields/count.json"},
@@ -73,16 +75,17 @@ def initialize(session: ShopifyAPI::Context.active_session)
7375
{http_method: :get, operation: :get, ids: [:customer_id], path: "customers/<customer_id>/metafields.json"},
7476
{http_method: :get, operation: :get, ids: [:customer_id, :id], path: "customers/<customer_id>/metafields/<id>.json"},
7577
{http_method: :get, operation: :get, ids: [:draft_order_id], path: "draft_orders/<draft_order_id>/metafields.json"},
78+
{http_method: :get, operation: :get, ids: [:draft_order_id], path: "draft_orders/<draft_order_id>/metafields.json"},
7679
{http_method: :get, operation: :get, ids: [:draft_order_id, :id], path: "draft_orders/<draft_order_id>/metafields/<id>.json"},
7780
{http_method: :get, operation: :get, ids: [], path: "metafields.json"},
78-
{http_method: :get, operation: :get, ids: [], path: "metafields.json"},
7981
{http_method: :get, operation: :get, ids: [:id], path: "metafields/<id>.json"},
8082
{http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/metafields.json"},
8183
{http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/metafields/<id>.json"},
8284
{http_method: :get, operation: :get, ids: [:page_id], path: "pages/<page_id>/metafields.json"},
8385
{http_method: :get, operation: :get, ids: [:page_id, :id], path: "pages/<page_id>/metafields/<id>.json"},
8486
{http_method: :get, operation: :get, ids: [:product_image_id], path: "product_images/<product_image_id>/metafields.json"},
8587
{http_method: :get, operation: :get, ids: [:product_image_id, :id], path: "product_images/<product_image_id>/metafields/<id>.json"},
88+
{http_method: :get, operation: :get, ids: [:product_image_id, :id], path: "product_images/<product_image_id>/metafields/<id>.json"},
8689
{http_method: :get, operation: :get, ids: [:product_id], path: "products/<product_id>/metafields.json"},
8790
{http_method: :get, operation: :get, ids: [:product_id, :id], path: "products/<product_id>/metafields/<id>.json"},
8891
{http_method: :get, operation: :get, ids: [:variant_id], path: "variants/<variant_id>/metafields.json"},
@@ -94,12 +97,14 @@ def initialize(session: ShopifyAPI::Context.active_session)
9497
{http_method: :post, operation: :post, ids: [:draft_order_id], path: "draft_orders/<draft_order_id>/metafields.json"},
9598
{http_method: :post, operation: :post, ids: [], path: "metafields.json"},
9699
{http_method: :post, operation: :post, ids: [:order_id], path: "orders/<order_id>/metafields.json"},
100+
{http_method: :post, operation: :post, ids: [:order_id], path: "orders/<order_id>/metafields.json"},
97101
{http_method: :post, operation: :post, ids: [:page_id], path: "pages/<page_id>/metafields.json"},
98102
{http_method: :post, operation: :post, ids: [:product_image_id], path: "product_images/<product_image_id>/metafields.json"},
99103
{http_method: :post, operation: :post, ids: [:product_id], path: "products/<product_id>/metafields.json"},
100104
{http_method: :post, operation: :post, ids: [:variant_id], path: "variants/<variant_id>/metafields.json"},
101105
{http_method: :put, operation: :put, ids: [:article_id, :id], path: "articles/<article_id>/metafields/<id>.json"},
102106
{http_method: :put, operation: :put, ids: [:blog_id, :id], path: "blogs/<blog_id>/metafields/<id>.json"},
107+
{http_method: :put, operation: :put, ids: [:blog_id, :id], path: "blogs/<blog_id>/metafields/<id>.json"},
103108
{http_method: :put, operation: :put, ids: [:collection_id, :id], path: "collections/<collection_id>/metafields/<id>.json"},
104109
{http_method: :put, operation: :put, ids: [:customer_id, :id], path: "customers/<customer_id>/metafields/<id>.json"},
105110
{http_method: :put, operation: :put, ids: [:draft_order_id, :id], path: "draft_orders/<draft_order_id>/metafields/<id>.json"},
@@ -168,6 +173,7 @@ class << self
168173
product_image_id: T.nilable(T.any(Integer, String)),
169174
product_id: T.nilable(T.any(Integer, String)),
170175
variant_id: T.nilable(T.any(Integer, String)),
176+
fields: T.untyped,
171177
session: Auth::Session
172178
).returns(T.nilable(Metafield))
173179
end
@@ -183,12 +189,13 @@ def find(
183189
product_image_id: nil,
184190
product_id: nil,
185191
variant_id: nil,
192+
fields: nil,
186193
session: ShopifyAPI::Context.active_session
187194
)
188195
result = base_find(
189196
session: session,
190197
ids: {id: id, article_id: article_id, blog_id: blog_id, collection_id: collection_id, customer_id: customer_id, draft_order_id: draft_order_id, order_id: order_id, page_id: page_id, product_image_id: product_image_id, product_id: product_id, variant_id: variant_id},
191-
params: {},
198+
params: {fields: fields},
192199
)
193200
T.cast(result[0], T.nilable(Metafield))
194201
end
@@ -252,8 +259,8 @@ def delete(
252259
updated_at_max: T.untyped,
253260
namespace: T.untyped,
254261
key: T.untyped,
255-
type: T.untyped,
256262
value_type: T.untyped,
263+
type: T.untyped,
257264
fields: T.untyped,
258265
metafield: T.nilable(T::Hash[T.untyped, T.untyped]),
259266
session: Auth::Session,
@@ -279,8 +286,8 @@ def all(
279286
updated_at_max: nil,
280287
namespace: nil,
281288
key: nil,
282-
type: nil,
283289
value_type: nil,
290+
type: nil,
284291
fields: nil,
285292
metafield: nil,
286293
session: ShopifyAPI::Context.active_session,
@@ -289,7 +296,7 @@ def all(
289296
response = base_find(
290297
session: session,
291298
ids: {article_id: article_id, blog_id: blog_id, collection_id: collection_id, customer_id: customer_id, draft_order_id: draft_order_id, order_id: order_id, page_id: page_id, product_image_id: product_image_id, product_id: product_id, variant_id: variant_id},
292-
params: {limit: limit, 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, namespace: namespace, key: key, type: type, value_type: value_type, fields: fields, metafield: metafield}.merge(kwargs).compact,
299+
params: {limit: limit, 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, namespace: namespace, key: key, value_type: value_type, type: type, fields: fields, metafield: metafield}.merge(kwargs).compact,
293300
)
294301

295302
T.cast(response, T::Array[Metafield])

lib/shopify_api/rest/resources/2022_04/abandoned_checkout.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def initialize(session: ShopifyAPI::Context.active_session)
6565
discount_codes: DiscountCode
6666
}, T::Hash[Symbol, Class])
6767
@paths = T.let([
68+
{http_method: :get, operation: :checkouts, ids: [], path: "checkouts.json"},
6869
{http_method: :get, operation: :checkouts, ids: [], path: "checkouts.json"}
6970
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
7071

@@ -150,25 +151,25 @@ def initialize(session: ShopifyAPI::Context.active_session)
150151
class << self
151152
sig do
152153
params(
153-
limit: T.untyped,
154154
since_id: T.untyped,
155155
created_at_min: T.untyped,
156156
created_at_max: T.untyped,
157157
updated_at_min: T.untyped,
158158
updated_at_max: T.untyped,
159159
status: T.untyped,
160+
limit: T.untyped,
160161
session: Auth::Session,
161162
kwargs: T.untyped
162163
).returns(T.untyped)
163164
end
164165
def checkouts(
165-
limit: nil,
166166
since_id: nil,
167167
created_at_min: nil,
168168
created_at_max: nil,
169169
updated_at_min: nil,
170170
updated_at_max: nil,
171171
status: nil,
172+
limit: nil,
172173
session: ShopifyAPI::Context.active_session,
173174
**kwargs
174175
)
@@ -177,7 +178,7 @@ def checkouts(
177178
operation: :checkouts,
178179
session: session,
179180
ids: {},
180-
params: {limit: limit, 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, status: status}.merge(kwargs).compact,
181+
params: {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, status: status, limit: limit}.merge(kwargs).compact,
181182
body: {},
182183
entity: nil,
183184
)

lib/shopify_api/rest/resources/2022_04/customer.rb

+26
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def initialize(session: ShopifyAPI::Context.active_session)
3434
@multipass_identifier = T.let(nil, T.nilable(String))
3535
@note = T.let(nil, T.nilable(String))
3636
@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))
3739
@phone = T.let(nil, T.nilable(String))
3840
@sms_marketing_consent = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
3941
@state = T.let(nil, T.nilable(String))
@@ -50,6 +52,7 @@ def initialize(session: ShopifyAPI::Context.active_session)
5052
}, T::Hash[Symbol, Class])
5153
@has_many = T.let({}, T::Hash[Symbol, Class])
5254
@paths = T.let([
55+
{http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
5356
{http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
5457
{http_method: :get, operation: :get, ids: [], path: "customers.json"},
5558
{http_method: :get, operation: :get, ids: [:id], path: "customers/<id>.json"},
@@ -98,6 +101,10 @@ def initialize(session: ShopifyAPI::Context.active_session)
98101
sig { returns(T.nilable(Integer)) }
99102
attr_reader :orders_count
100103
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)) }
101108
attr_reader :phone
102109
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
103110
attr_reader :sms_marketing_consent
@@ -137,6 +144,25 @@ def find(
137144
T.cast(result[0], T.nilable(Customer))
138145
end
139146

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+
140166
sig do
141167
params(
142168
ids: T.untyped,

0 commit comments

Comments
 (0)