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

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

base_find, class_name, create_instance, create_instances_from_response, #delete, get_path, has_many?, has_one?, 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?, #save, #save!, #to_hash

Constructor Details

#initialize(session: ShopifyAPI::Context.active_session) ⇒ GiftCardAdjustment

Returns a new instance of GiftCardAdjustment.



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

def initialize(session: ShopifyAPI::Context.active_session)
  super(session: session)

  @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))
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.



42
43
44
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 42

def amount
  @amount
end

#api_client_idObject (readonly)

Returns the value of attribute api_client_id.



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

def api_client_id
  @api_client_id
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#gift_card_idObject (readonly)

Returns the value of attribute gift_card_id.



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

def gift_card_id
  @gift_card_id
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#noteObject (readonly)

Returns the value of attribute note.



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

def note
  @note
end

#numberObject (readonly)

Returns the value of attribute number.



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

def number
  @number
end

#order_transaction_idObject (readonly)

Returns the value of attribute order_transaction_id.



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

def order_transaction_id
  @order_transaction_id
end

#processed_atObject (readonly)

Returns the value of attribute processed_at.



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

def processed_at
  @processed_at
end

#remote_transaction_refObject (readonly)

Returns the value of attribute remote_transaction_ref.



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

def remote_transaction_ref
  @remote_transaction_ref
end

#remote_transaction_urlObject (readonly)

Returns the value of attribute remote_transaction_url.



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

def remote_transaction_url
  @remote_transaction_url
end

#user_idObject (readonly)

Returns the value of attribute user_id.



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

def user_id
  @user_id
end

Class Method Details

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



101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 101

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



81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb', line 81

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



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

def json_body_name()
  "adjustment"
end