Class: ShopifyAPI::Metafield
- Inherits:
-
Rest::Base
- Object
- Rest::Base
- ShopifyAPI::Metafield
- Extended by:
- T::Sig
- Defined in:
- lib/shopify_api/rest/resources/2021_07/metafield.rb,
lib/shopify_api/rest/resources/2021_10/metafield.rb,
lib/shopify_api/rest/resources/2022_01/metafield.rb,
lib/shopify_api/rest/resources/2022_04/metafield.rb
Instance Attribute Summary collapse
-
#article_id ⇒ Object
readonly
Returns the value of attribute article_id.
-
#blog_id ⇒ Object
readonly
Returns the value of attribute blog_id.
-
#collection_id ⇒ Object
readonly
Returns the value of attribute collection_id.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#draft_order_id ⇒ Object
readonly
Returns the value of attribute draft_order_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#owner_id ⇒ Object
readonly
Returns the value of attribute owner_id.
-
#owner_resource ⇒ Object
readonly
Returns the value of attribute owner_resource.
-
#page_id ⇒ Object
readonly
Returns the value of attribute page_id.
-
#product_id ⇒ Object
readonly
Returns the value of attribute product_id.
-
#product_image_id ⇒ Object
readonly
Returns the value of attribute product_image_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#value_type ⇒ Object
readonly
Returns the value of attribute value_type.
-
#variant_id ⇒ Object
readonly
Returns the value of attribute variant_id.
Attributes inherited from Rest::Base
Class Method Summary collapse
- .all(article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, limit: nil, since_id: nil, created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, namespace: nil, key: nil, type: nil, value_type: nil, fields: nil, metafield: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
- .count(article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
- .delete(id:, article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
- .find(id:, article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
Instance Method Summary collapse
-
#initialize(session: ShopifyAPI::Context.active_session) ⇒ Metafield
constructor
A new instance of Metafield.
Methods inherited from Rest::Base
base_find, class_name, create_instance, create_instances_from_response, #delete, get_path, has_many?, has_one?, json_body_name, #method_missing, next_page?, next_page_info, prev_page?, prev_page_info, primary_key, read_only_attributes, request, #respond_to_missing?, #save, #save!, #to_hash
Constructor Details
#initialize(session: ShopifyAPI::Context.active_session) ⇒ Metafield
Returns a new instance of Metafield.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 16 def initialize(session: ShopifyAPI::Context.active_session) super(session: session) @key = T.let(nil, T.nilable(String)) @namespace = T.let(nil, T.nilable(String)) @value = T.let(nil, T.nilable(T.any(String, Integer, Float))) @article_id = T.let(nil, T.nilable(Integer)) @blog_id = T.let(nil, T.nilable(Integer)) @collection_id = T.let(nil, T.nilable(Integer)) @created_at = T.let(nil, T.nilable(String)) @customer_id = T.let(nil, T.nilable(Integer)) @description = T.let(nil, T.nilable(String)) @draft_order_id = T.let(nil, T.nilable(Integer)) @id = T.let(nil, T.nilable(Integer)) @order_id = T.let(nil, T.nilable(Integer)) @owner_id = T.let(nil, T.nilable(Integer)) @owner_resource = T.let(nil, T.nilable(String)) @page_id = T.let(nil, T.nilable(Integer)) @product_id = T.let(nil, T.nilable(Integer)) @product_image_id = T.let(nil, T.nilable(Integer)) @type = T.let(nil, T.nilable(String)) @updated_at = T.let(nil, T.nilable(String)) @value_type = T.let(nil, T.nilable(String)) @variant_id = T.let(nil, T.nilable(Integer)) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ShopifyAPI::Rest::Base
Instance Attribute Details
#article_id ⇒ Object (readonly)
Returns the value of attribute article_id.
121 122 123 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 121 def article_id @article_id end |
#blog_id ⇒ Object (readonly)
Returns the value of attribute blog_id.
123 124 125 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 123 def blog_id @blog_id end |
#collection_id ⇒ Object (readonly)
Returns the value of attribute collection_id.
125 126 127 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 125 def collection_id @collection_id end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
127 128 129 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 127 def created_at @created_at end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
129 130 131 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 129 def customer_id @customer_id end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
131 132 133 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 131 def description @description end |
#draft_order_id ⇒ Object (readonly)
Returns the value of attribute draft_order_id.
133 134 135 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 133 def draft_order_id @draft_order_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
135 136 137 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 135 def id @id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
115 116 117 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 115 def key @key end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
117 118 119 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 117 def namespace @namespace end |
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
137 138 139 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 137 def order_id @order_id end |
#owner_id ⇒ Object (readonly)
Returns the value of attribute owner_id.
139 140 141 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 139 def owner_id @owner_id end |
#owner_resource ⇒ Object (readonly)
Returns the value of attribute owner_resource.
141 142 143 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 141 def owner_resource @owner_resource end |
#page_id ⇒ Object (readonly)
Returns the value of attribute page_id.
143 144 145 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 143 def page_id @page_id end |
#product_id ⇒ Object (readonly)
Returns the value of attribute product_id.
145 146 147 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 145 def product_id @product_id end |
#product_image_id ⇒ Object (readonly)
Returns the value of attribute product_image_id.
147 148 149 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 147 def product_image_id @product_image_id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
149 150 151 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 149 def type @type end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
151 152 153 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 151 def updated_at @updated_at end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
119 120 121 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 119 def value @value end |
#value_type ⇒ Object (readonly)
Returns the value of attribute value_type.
153 154 155 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 153 def value_type @value_type end |
#variant_id ⇒ Object (readonly)
Returns the value of attribute variant_id.
155 156 157 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 155 def variant_id @variant_id end |
Class Method Details
.all(article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, limit: nil, since_id: nil, created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, namespace: nil, key: nil, type: nil, value_type: nil, fields: nil, metafield: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 263 def all( article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, limit: nil, since_id: nil, created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, namespace: nil, key: nil, type: nil, value_type: nil, fields: nil, metafield: nil, session: ShopifyAPI::Context.active_session, **kwargs ) response = base_find( session: session, 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}, 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: }.merge(kwargs).compact, ) T.cast(response, T::Array[Metafield]) end |
.count(article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 314 def count( article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, session: ShopifyAPI::Context.active_session, **kwargs ) request( http_method: :get, operation: :count, session: session, 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}, params: {}.merge(kwargs).compact, body: {}, entity: nil, ) end |
.delete(id:, article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 212 def delete( id:, article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, session: ShopifyAPI::Context.active_session ) request( http_method: :delete, operation: :delete, session: session, 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}, params: {}, ) end |
.find(id:, article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/shopify_api/rest/resources/2021_07/metafield.rb', line 174 def find( id:, article_id: nil, blog_id: nil, collection_id: nil, customer_id: nil, draft_order_id: nil, order_id: nil, page_id: nil, product_image_id: nil, product_id: nil, variant_id: nil, session: ShopifyAPI::Context.active_session ) result = base_find( session: session, 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}, params: {}, ) T.cast(result[0], T.nilable(Metafield)) end |