Class: ShopifyAPI::GiftCard
- Inherits:
-
Rest::Base
- Object
- Rest::Base
- ShopifyAPI::GiftCard
- Extended by:
- T::Sig
- Defined in:
- 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
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) ⇒ GiftCard
constructor
A new instance of GiftCard.
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, json_response_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) ⇒ GiftCard
Returns a new instance of GiftCard.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 16 def initialize(session: ShopifyAPI::Context.active_session) super(session: session) @api_client_id = T.let(nil, T.nilable(Integer)) @balance = T.let(nil, T.nilable(String)) @code = T.let(nil, T.nilable(String)) @created_at = T.let(nil, T.nilable(String)) @currency = T.let(nil, T.nilable(String)) @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)) 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.
51 52 53 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 51 def api_client_id @api_client_id end |
#balance ⇒ Object (readonly)
Returns the value of attribute balance.
53 54 55 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 53 def balance @balance end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
55 56 57 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 55 def code @code end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
57 58 59 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 57 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
59 60 61 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 59 def currency @currency end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
61 62 63 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 61 def customer_id @customer_id end |
#disabled_at ⇒ Object (readonly)
Returns the value of attribute disabled_at.
63 64 65 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 63 def disabled_at @disabled_at end |
#expires_on ⇒ Object (readonly)
Returns the value of attribute expires_on.
65 66 67 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 65 def expires_on @expires_on end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
67 68 69 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 67 def id @id end |
#initial_value ⇒ Object (readonly)
Returns the value of attribute initial_value.
69 70 71 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 69 def initial_value @initial_value end |
#last_characters ⇒ Object (readonly)
Returns the value of attribute last_characters.
71 72 73 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 71 def last_characters @last_characters end |
#line_item_id ⇒ Object (readonly)
Returns the value of attribute line_item_id.
73 74 75 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 73 def line_item_id @line_item_id end |
#note ⇒ Object (readonly)
Returns the value of attribute note.
75 76 77 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 75 def note @note end |
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
77 78 79 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 77 def order_id @order_id end |
#template_suffix ⇒ Object (readonly)
Returns the value of attribute template_suffix.
79 80 81 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 79 def template_suffix @template_suffix end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
81 82 83 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 81 def updated_at @updated_at end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
83 84 85 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 83 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
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 114 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
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 138 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
92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 92 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
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 168 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
199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/shopify_api/rest/resources/2022_07/gift_card.rb', line 199 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 |