Class: ShopifyAPI::InventoryItem
- Inherits:
-
Rest::Base
- Object
- Rest::Base
- ShopifyAPI::InventoryItem
- Extended by:
- T::Sig
- Defined in:
- lib/shopify_api/rest/resources/2022_04/inventory_item.rb,
lib/shopify_api/rest/resources/2022_07/inventory_item.rb,
lib/shopify_api/rest/resources/2022_10/inventory_item.rb,
lib/shopify_api/rest/resources/2023_01/inventory_item.rb,
lib/shopify_api/rest/resources/2023_04/inventory_item.rb,
lib/shopify_api/rest/resources/2023_07/inventory_item.rb,
lib/shopify_api/rest/resources/2023_10/inventory_item.rb,
lib/shopify_api/rest/resources/2024_01/inventory_item.rb,
lib/shopify_api/rest/resources/2024_04/inventory_item.rb,
lib/shopify_api/rest/resources/2024_07/inventory_item.rb,
lib/shopify_api/rest/resources/2024_10/inventory_item.rb
Instance Attribute Summary collapse
-
#cost ⇒ Object
readonly
Returns the value of attribute cost.
-
#country_code_of_origin ⇒ Object
readonly
Returns the value of attribute country_code_of_origin.
-
#country_harmonized_system_codes ⇒ Object
readonly
Returns the value of attribute country_harmonized_system_codes.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#harmonized_system_code ⇒ Object
readonly
Returns the value of attribute harmonized_system_code.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#province_code_of_origin ⇒ Object
readonly
Returns the value of attribute province_code_of_origin.
-
#requires_shipping ⇒ Object
readonly
Returns the value of attribute requires_shipping.
-
#sku ⇒ Object
readonly
Returns the value of attribute sku.
-
#tracked ⇒ Object
readonly
Returns the value of attribute tracked.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Attributes inherited from Rest::Base
Class Method Summary collapse
- .all(ids: nil, limit: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
- .find(id:, session: ShopifyAPI::Context.active_session) ⇒ Object
Instance Method Summary collapse
-
#initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) ⇒ InventoryItem
constructor
A new instance of InventoryItem.
Methods inherited from Rest::Base
api_call_limit, base_find, class_name, create_instance, create_instances_from_response, #delete, get_path, get_path_ids, has_many?, has_one?, inherited, json_body_name, json_response_body_names, #method_missing, next_page?, next_page_info, prev_page?, prev_page_info, primary_key, read_only_attributes, request, #respond_to_missing?, retry_request_after, #save, #save!, #to_hash
Constructor Details
#initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) ⇒ InventoryItem
Returns a new instance of InventoryItem.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 19 def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) @cost = T.let(nil, T.nilable(String)) @country_code_of_origin = T.let(nil, T.nilable(String)) @country_harmonized_system_codes = T.let(nil, T.nilable(T::Array[T.untyped])) @created_at = T.let(nil, T.nilable(String)) @harmonized_system_code = T.let(nil, T.nilable(T.any(Integer, String))) @id = T.let(nil, T.nilable(Integer)) @province_code_of_origin = T.let(nil, T.nilable(String)) @requires_shipping = T.let(nil, T.nilable(T::Boolean)) @sku = T.let(nil, T.nilable(String)) @tracked = T.let(nil, T.nilable(T::Boolean)) @updated_at = T.let(nil, T.nilable(String)) super(session: session, from_hash: from_hash) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ShopifyAPI::Rest::Base
Instance Attribute Details
#cost ⇒ Object (readonly)
Returns the value of attribute cost.
45 46 47 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 45 def cost @cost end |
#country_code_of_origin ⇒ Object (readonly)
Returns the value of attribute country_code_of_origin.
47 48 49 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 47 def country_code_of_origin @country_code_of_origin end |
#country_harmonized_system_codes ⇒ Object (readonly)
Returns the value of attribute country_harmonized_system_codes.
49 50 51 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 49 def country_harmonized_system_codes @country_harmonized_system_codes end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
51 52 53 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 51 def created_at @created_at end |
#harmonized_system_code ⇒ Object (readonly)
Returns the value of attribute harmonized_system_code.
53 54 55 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 53 def harmonized_system_code @harmonized_system_code end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
55 56 57 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 55 def id @id end |
#province_code_of_origin ⇒ Object (readonly)
Returns the value of attribute province_code_of_origin.
57 58 59 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 57 def province_code_of_origin @province_code_of_origin end |
#requires_shipping ⇒ Object (readonly)
Returns the value of attribute requires_shipping.
59 60 61 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 59 def requires_shipping @requires_shipping end |
#sku ⇒ Object (readonly)
Returns the value of attribute sku.
61 62 63 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 61 def sku @sku end |
#tracked ⇒ Object (readonly)
Returns the value of attribute tracked.
63 64 65 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 63 def tracked @tracked end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
65 66 67 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 65 def updated_at @updated_at end |
Class Method Details
.all(ids: nil, limit: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 94 def all( ids: nil, limit: nil, session: ShopifyAPI::Context.active_session, **kwargs ) response = base_find( session: session, ids: {}, params: {ids: ids, limit: limit}.merge(kwargs).compact, ) T.cast(response, T::Array[InventoryItem]) end |
.find(id:, session: ShopifyAPI::Context.active_session) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/shopify_api/rest/resources/2022_04/inventory_item.rb', line 74 def find( id:, session: ShopifyAPI::Context.active_session ) result = base_find( session: session, ids: {id: id}, params: {}, ) T.cast(result[0], T.nilable(InventoryItem)) end |