Class: ShopifyAPI::GiftCard
- Inherits:
-
Rest::Base
- Object
- Rest::Base
- ShopifyAPI::GiftCard
- Extended by:
- T::Sig
- Defined in:
- lib/shopify_api/rest/resources/2022_04/gift_card.rb,
lib/shopify_api/rest/resources/2022_07/gift_card.rb,
lib/shopify_api/rest/resources/2022_10/gift_card.rb,
lib/shopify_api/rest/resources/2023_01/gift_card.rb,
lib/shopify_api/rest/resources/2023_04/gift_card.rb,
lib/shopify_api/rest/resources/2023_07/gift_card.rb,
lib/shopify_api/rest/resources/2023_10/gift_card.rb,
lib/shopify_api/rest/resources/2024_01/gift_card.rb,
lib/shopify_api/rest/resources/2024_04/gift_card.rb,
lib/shopify_api/rest/resources/2024_07/gift_card.rb,
lib/shopify_api/rest/resources/2024_10/gift_card.rb
Instance Attribute Summary collapse
-
#api_client_id ⇒ Object
readonly
Returns the value of attribute api_client_id.
-
#balance ⇒ Object
readonly
Returns the value of attribute balance.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#disabled_at ⇒ Object
readonly
Returns the value of attribute disabled_at.
-
#expires_on ⇒ Object
readonly
Returns the value of attribute expires_on.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#initial_value ⇒ Object
readonly
Returns the value of attribute initial_value.
-
#last_characters ⇒ Object
readonly
Returns the value of attribute last_characters.
-
#line_item_id ⇒ Object
readonly
Returns the value of attribute line_item_id.
-
#note ⇒ Object
readonly
Returns the value of attribute note.
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#template_suffix ⇒ Object
readonly
Returns the value of attribute template_suffix.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Attributes inherited from Rest::Base
Class Method Summary collapse
- .all(status: nil, limit: nil, since_id: nil, fields: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
- .count(status: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
- .find(id:, session: ShopifyAPI::Context.active_session) ⇒ Object
- .search(order: nil, query: nil, limit: nil, fields: nil, created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
Instance Method Summary collapse
- #disable(body: nil, **kwargs) ⇒ Object
-
#initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) ⇒ GiftCard
constructor
A new instance of GiftCard.
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) ⇒ GiftCard
Returns a new instance of GiftCard.
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/2022_04/gift_card.rb', line 19 def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) @api_client_id = T.let(nil, T.nilable(Integer)) @balance = T.let(nil, T.nilable(Balance)) @code = T.let(nil, T.nilable(String)) @created_at = T.let(nil, T.nilable(String)) @currency = T.let(nil, T.nilable(Currency)) @customer_id = T.let(nil, T.nilable(Integer)) @disabled_at = T.let(nil, T.nilable(String)) @expires_on = T.let(nil, T.nilable(String)) @id = T.let(nil, T.nilable(Integer)) @initial_value = T.let(nil, T.nilable(String)) @last_characters = T.let(nil, T.nilable(String)) @line_item_id = T.let(nil, T.nilable(Integer)) @note = T.let(nil, T.nilable(String)) @order_id = T.let(nil, T.nilable(Integer)) @template_suffix = T.let(nil, T.nilable(String)) @updated_at = T.let(nil, T.nilable(String)) @user_id = T.let(nil, T.nilable(Integer)) 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
#api_client_id ⇒ Object (readonly)
Returns the value of attribute api_client_id.
58 59 60 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 58 def api_client_id @api_client_id end |
#balance ⇒ Object (readonly)
Returns the value of attribute balance.
60 61 62 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 60 def balance @balance end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
62 63 64 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 62 def code @code end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
64 65 66 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 64 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
66 67 68 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 66 def currency @currency end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
68 69 70 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 68 def customer_id @customer_id end |
#disabled_at ⇒ Object (readonly)
Returns the value of attribute disabled_at.
70 71 72 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 70 def disabled_at @disabled_at end |
#expires_on ⇒ Object (readonly)
Returns the value of attribute expires_on.
72 73 74 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 72 def expires_on @expires_on end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
74 75 76 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 74 def id @id end |
#initial_value ⇒ Object (readonly)
Returns the value of attribute initial_value.
76 77 78 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 76 def initial_value @initial_value end |
#last_characters ⇒ Object (readonly)
Returns the value of attribute last_characters.
78 79 80 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 78 def last_characters @last_characters end |
#line_item_id ⇒ Object (readonly)
Returns the value of attribute line_item_id.
80 81 82 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 80 def line_item_id @line_item_id end |
#note ⇒ Object (readonly)
Returns the value of attribute note.
82 83 84 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 82 def note @note end |
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
84 85 86 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 84 def order_id @order_id end |
#template_suffix ⇒ Object (readonly)
Returns the value of attribute template_suffix.
86 87 88 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 86 def template_suffix @template_suffix end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
88 89 90 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 88 def updated_at @updated_at end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
90 91 92 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 90 def user_id @user_id end |
Class Method Details
.all(status: nil, limit: nil, since_id: nil, fields: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 121 def all( status: nil, limit: nil, since_id: nil, fields: nil, session: ShopifyAPI::Context.active_session, **kwargs ) response = base_find( session: session, ids: {}, params: {status: status, limit: limit, since_id: since_id, fields: fields}.merge(kwargs).compact, ) T.cast(response, T::Array[GiftCard]) end |
.count(status: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 145 def count( status: nil, session: ShopifyAPI::Context.active_session, **kwargs ) request( http_method: :get, operation: :count, session: session, ids: {}, params: {status: status}.merge(kwargs).compact, body: {}, entity: nil, ) end |
.find(id:, session: ShopifyAPI::Context.active_session) ⇒ Object
99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 99 def find( id:, session: ShopifyAPI::Context.active_session ) result = base_find( session: session, ids: {id: id}, params: {}, ) T.cast(result[0], T.nilable(GiftCard)) end |
.search(order: nil, query: nil, limit: nil, fields: nil, created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 175 def search( order: nil, query: nil, limit: nil, fields: nil, created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, session: ShopifyAPI::Context.active_session, **kwargs ) request( http_method: :get, operation: :search, session: session, ids: {}, 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, body: {}, entity: nil, ) end |
Instance Method Details
#disable(body: nil, **kwargs) ⇒ Object
206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/shopify_api/rest/resources/2022_04/gift_card.rb', line 206 def disable( body: nil, **kwargs ) self.class.request( http_method: :post, operation: :disable, session: @session, ids: {id: @id}, params: {}.merge(kwargs).compact, body: body, entity: self, ) end |