Class: ShopifyAPI::Dispute

Inherits:
Rest::Base show all
Extended by:
T::Sig
Defined in:
lib/shopify_api/rest/resources/2022_04/dispute.rb,
lib/shopify_api/rest/resources/2022_07/dispute.rb,
lib/shopify_api/rest/resources/2022_10/dispute.rb,
lib/shopify_api/rest/resources/2023_01/dispute.rb,
lib/shopify_api/rest/resources/2023_04/dispute.rb,
lib/shopify_api/rest/resources/2023_07/dispute.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_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?, #save, #save!, #to_hash

Constructor Details

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

Returns a new instance of Dispute.



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

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

  @amount = T.let(nil, T.nilable(String))
  @currency = T.let(nil, T.nilable(String))
  @evidence_due_by = T.let(nil, T.nilable(String))
  @evidence_sent_on = T.let(nil, T.nilable(String))
  @finalized_on = T.let(nil, T.nilable(String))
  @id = T.let(nil, T.nilable(Integer))
  @network_reason_code = T.let(nil, T.nilable(String))
  @order_id = T.let(nil, T.nilable(Integer))
  @reason = T.let(nil, T.nilable(String))
  @status = T.let(nil, T.nilable(String))
  @type = T.let(nil, T.nilable(String))
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.



40
41
42
# File 'lib/shopify_api/rest/resources/2022_04/dispute.rb', line 40

def amount
  @amount
end

#currencyObject (readonly)

Returns the value of attribute currency.



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

def currency
  @currency
end

#evidence_due_byObject (readonly)

Returns the value of attribute evidence_due_by.



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

def evidence_due_by
  @evidence_due_by
end

#evidence_sent_onObject (readonly)

Returns the value of attribute evidence_sent_on.



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

def evidence_sent_on
  @evidence_sent_on
end

#finalized_onObject (readonly)

Returns the value of attribute finalized_on.



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

def finalized_on
  @finalized_on
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#network_reason_codeObject (readonly)

Returns the value of attribute network_reason_code.



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

def network_reason_code
  @network_reason_code
end

#order_idObject (readonly)

Returns the value of attribute order_id.



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

def order_id
  @order_id
end

#reasonObject (readonly)

Returns the value of attribute reason.



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

def reason
  @reason
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Class Method Details

.all(since_id: nil, last_id: nil, status: nil, initiated_at: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/shopify_api/rest/resources/2022_04/dispute.rb', line 91

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

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

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



69
70
71
72
73
74
75
76
77
78
79
# File 'lib/shopify_api/rest/resources/2022_04/dispute.rb', line 69

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