Class: ShopifyAPI::GiftCardAdjustment

Inherits:
Rest::Base
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb,
lib/shopify_api/rest/resources/2022_07/gift_card_adjustment.rb,
lib/shopify_api/rest/resources/2022_10/gift_card_adjustment.rb,
lib/shopify_api/rest/resources/2023_01/gift_card_adjustment.rb,
lib/shopify_api/rest/resources/2023_04/gift_card_adjustment.rb,
lib/shopify_api/rest/resources/2023_07/gift_card_adjustment.rb,
lib/shopify_api/rest/resources/2023_10/gift_card_adjustment.rb,
lib/shopify_api/rest/resources/2024_01/gift_card_adjustment.rb,
lib/shopify_api/rest/resources/2024_04/gift_card_adjustment.rb,
lib/shopify_api/rest/resources/2024_07/gift_card_adjustment.rb,
lib/shopify_api/rest/resources/2024_10/gift_card_adjustment.rb

Instance Attribute Summary collapse

Attributes inherited from Rest::Base

#errors, #original_state

Class Method Summary collapse

Instance Method Summary collapse

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_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) ⇒ GiftCardAdjustment

Returns a new instance of GiftCardAdjustment.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 19

def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

  @amount = T.let(nil, T.nilable(Float))
  @api_client_id = T.let(nil, T.nilable(Integer))
  @created_at = T.let(nil, T.nilable(String))
  @gift_card_id = T.let(nil, T.nilable(Integer))
  @id = T.let(nil, T.nilable(Integer))
  @note = T.let(nil, T.nilable(String))
  @number = T.let(nil, T.nilable(Integer))
  @order_transaction_id = T.let(nil, T.nilable(Integer))
  @processed_at = T.let(nil, T.nilable(String))
  @remote_transaction_ref = T.let(nil, T.nilable(String))
  @remote_transaction_url = 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

#amountObject (readonly)

Returns the value of attribute amount.



46
47
48
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 46

def amount
  @amount
end

#api_client_idObject (readonly)

Returns the value of attribute api_client_id.



48
49
50
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 48

def api_client_id
  @api_client_id
end

#created_atObject (readonly)

Returns the value of attribute created_at.



50
51
52
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 50

def created_at
  @created_at
end

#gift_card_idObject (readonly)

Returns the value of attribute gift_card_id.



52
53
54
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 52

def gift_card_id
  @gift_card_id
end

#idObject (readonly)

Returns the value of attribute id.



54
55
56
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 54

def id
  @id
end

#noteObject (readonly)

Returns the value of attribute note.



56
57
58
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 56

def note
  @note
end

#numberObject (readonly)

Returns the value of attribute number.



58
59
60
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 58

def number
  @number
end

#order_transaction_idObject (readonly)

Returns the value of attribute order_transaction_id.



60
61
62
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 60

def order_transaction_id
  @order_transaction_id
end

#processed_atObject (readonly)

Returns the value of attribute processed_at.



62
63
64
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 62

def processed_at
  @processed_at
end

#remote_transaction_refObject (readonly)

Returns the value of attribute remote_transaction_ref.



64
65
66
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 64

def remote_transaction_ref
  @remote_transaction_ref
end

#remote_transaction_urlObject (readonly)

Returns the value of attribute remote_transaction_url.



66
67
68
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 66

def remote_transaction_url
  @remote_transaction_url
end

#user_idObject (readonly)

Returns the value of attribute user_id.



68
69
70
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 68

def user_id
  @user_id
end

Class Method Details

.all(gift_card_id: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object



105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 105

def all(
  gift_card_id: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  response = base_find(
    session: session,
    ids: {gift_card_id: gift_card_id},
    params: {}.merge(kwargs).compact,
  )

  T.cast(response, T::Array[GiftCardAdjustment])
end

.find(id:, gift_card_id: nil, session: ShopifyAPI::Context.active_session) ⇒ Object



85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 85

def find(
  id:,
  gift_card_id: nil,
  session: ShopifyAPI::Context.active_session
)
  result = base_find(
    session: session,
    ids: {id: id, gift_card_id: gift_card_id},
    params: {},
  )
  T.cast(result[0], T.nilable(GiftCardAdjustment))
end

.json_body_nameObject



74
75
76
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 74

def json_body_name()
  "adjustment"
end