@@ -51,6 +51,7 @@ def initialize(session: ShopifyAPI::Context.active_session)
51
51
{ http_method : :delete , operation : :delete , ids : [ :order_id , :id ] , path : "orders/<order_id>/metafields/<id>.json" } ,
52
52
{ http_method : :delete , operation : :delete , ids : [ :page_id , :id ] , path : "pages/<page_id>/metafields/<id>.json" } ,
53
53
{ 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" } ,
54
55
{ http_method : :delete , operation : :delete , ids : [ :product_id , :id ] , path : "products/<product_id>/metafields/<id>.json" } ,
55
56
{ http_method : :delete , operation : :delete , ids : [ :variant_id , :id ] , path : "variants/<variant_id>/metafields/<id>.json" } ,
56
57
{ 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)
61
62
{ http_method : :get , operation : :count , ids : [ ] , path : "metafields/count.json" } ,
62
63
{ http_method : :get , operation : :count , ids : [ :order_id ] , path : "orders/<order_id>/metafields/count.json" } ,
63
64
{ 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" } ,
64
66
{ http_method : :get , operation : :count , ids : [ :product_image_id ] , path : "product_images/<product_image_id>/metafields/count.json" } ,
65
67
{ http_method : :get , operation : :count , ids : [ :product_id ] , path : "products/<product_id>/metafields/count.json" } ,
66
68
{ 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)
73
75
{ http_method : :get , operation : :get , ids : [ :customer_id ] , path : "customers/<customer_id>/metafields.json" } ,
74
76
{ http_method : :get , operation : :get , ids : [ :customer_id , :id ] , path : "customers/<customer_id>/metafields/<id>.json" } ,
75
77
{ 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" } ,
76
79
{ http_method : :get , operation : :get , ids : [ :draft_order_id , :id ] , path : "draft_orders/<draft_order_id>/metafields/<id>.json" } ,
77
80
{ http_method : :get , operation : :get , ids : [ ] , path : "metafields.json" } ,
78
- { http_method : :get , operation : :get , ids : [ ] , path : "metafields.json" } ,
79
81
{ http_method : :get , operation : :get , ids : [ :id ] , path : "metafields/<id>.json" } ,
80
82
{ http_method : :get , operation : :get , ids : [ :order_id ] , path : "orders/<order_id>/metafields.json" } ,
81
83
{ http_method : :get , operation : :get , ids : [ :order_id , :id ] , path : "orders/<order_id>/metafields/<id>.json" } ,
82
84
{ http_method : :get , operation : :get , ids : [ :page_id ] , path : "pages/<page_id>/metafields.json" } ,
83
85
{ http_method : :get , operation : :get , ids : [ :page_id , :id ] , path : "pages/<page_id>/metafields/<id>.json" } ,
84
86
{ http_method : :get , operation : :get , ids : [ :product_image_id ] , path : "product_images/<product_image_id>/metafields.json" } ,
85
87
{ 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" } ,
86
89
{ http_method : :get , operation : :get , ids : [ :product_id ] , path : "products/<product_id>/metafields.json" } ,
87
90
{ http_method : :get , operation : :get , ids : [ :product_id , :id ] , path : "products/<product_id>/metafields/<id>.json" } ,
88
91
{ 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)
94
97
{ http_method : :post , operation : :post , ids : [ :draft_order_id ] , path : "draft_orders/<draft_order_id>/metafields.json" } ,
95
98
{ http_method : :post , operation : :post , ids : [ ] , path : "metafields.json" } ,
96
99
{ 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" } ,
97
101
{ http_method : :post , operation : :post , ids : [ :page_id ] , path : "pages/<page_id>/metafields.json" } ,
98
102
{ http_method : :post , operation : :post , ids : [ :product_image_id ] , path : "product_images/<product_image_id>/metafields.json" } ,
99
103
{ http_method : :post , operation : :post , ids : [ :product_id ] , path : "products/<product_id>/metafields.json" } ,
100
104
{ http_method : :post , operation : :post , ids : [ :variant_id ] , path : "variants/<variant_id>/metafields.json" } ,
101
105
{ http_method : :put , operation : :put , ids : [ :article_id , :id ] , path : "articles/<article_id>/metafields/<id>.json" } ,
102
106
{ 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" } ,
103
108
{ http_method : :put , operation : :put , ids : [ :collection_id , :id ] , path : "collections/<collection_id>/metafields/<id>.json" } ,
104
109
{ http_method : :put , operation : :put , ids : [ :customer_id , :id ] , path : "customers/<customer_id>/metafields/<id>.json" } ,
105
110
{ 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
168
173
product_image_id : T . nilable ( T . any ( Integer , String ) ) ,
169
174
product_id : T . nilable ( T . any ( Integer , String ) ) ,
170
175
variant_id : T . nilable ( T . any ( Integer , String ) ) ,
176
+ fields : T . untyped ,
171
177
session : Auth ::Session
172
178
) . returns ( T . nilable ( Metafield ) )
173
179
end
@@ -183,12 +189,13 @@ def find(
183
189
product_image_id : nil ,
184
190
product_id : nil ,
185
191
variant_id : nil ,
192
+ fields : nil ,
186
193
session : ShopifyAPI ::Context . active_session
187
194
)
188
195
result = base_find (
189
196
session : session ,
190
197
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 } ,
192
199
)
193
200
T . cast ( result [ 0 ] , T . nilable ( Metafield ) )
194
201
end
@@ -252,8 +259,8 @@ def delete(
252
259
updated_at_max : T . untyped ,
253
260
namespace : T . untyped ,
254
261
key : T . untyped ,
255
- type : T . untyped ,
256
262
value_type : T . untyped ,
263
+ type : T . untyped ,
257
264
fields : T . untyped ,
258
265
metafield : T . nilable ( T ::Hash [ T . untyped , T . untyped ] ) ,
259
266
session : Auth ::Session ,
@@ -279,8 +286,8 @@ def all(
279
286
updated_at_max : nil ,
280
287
namespace : nil ,
281
288
key : nil ,
282
- type : nil ,
283
289
value_type : nil ,
290
+ type : nil ,
284
291
fields : nil ,
285
292
metafield : nil ,
286
293
session : ShopifyAPI ::Context . active_session ,
@@ -289,7 +296,7 @@ def all(
289
296
response = base_find (
290
297
session : session ,
291
298
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 ,
293
300
)
294
301
295
302
T . cast ( response , T ::Array [ Metafield ] )
0 commit comments