Class: ThePlaidApi::ConsumerDispute

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/consumer_dispute.rb

Overview

The information about a previously submitted valid dispute statement by the consumer

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(consumer_dispute_id:, dispute_field_create_date:, category:, statement:, additional_properties: nil) ⇒ ConsumerDispute

Returns a new instance of ConsumerDispute.



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/the_plaid_api/models/consumer_dispute.rb', line 51

def initialize(consumer_dispute_id:, dispute_field_create_date:, category:,
               statement:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @consumer_dispute_id = consumer_dispute_id
  @dispute_field_create_date = dispute_field_create_date
  @category = category
  @statement = statement
  @additional_properties = additional_properties
end

Instance Attribute Details

#categoryConsumerReportCategory

Type of data being disputed by the consumer



25
26
27
# File 'lib/the_plaid_api/models/consumer_dispute.rb', line 25

def category
  @category
end

#consumer_dispute_idString

(Deprecated) A unique identifier (UUID) of the consumer dispute that can be used for troubleshooting

Returns:

  • (String)


16
17
18
# File 'lib/the_plaid_api/models/consumer_dispute.rb', line 16

def consumer_dispute_id
  @consumer_dispute_id
end

#dispute_field_create_dateDate

Date of the disputed field (e.g. transaction date), in an ISO 8601 format (YYYY-MM-DD)

Returns:

  • (Date)


21
22
23
# File 'lib/the_plaid_api/models/consumer_dispute.rb', line 21

def dispute_field_create_date
  @dispute_field_create_date
end

#statementString

Text content of dispute

Returns:

  • (String)


29
30
31
# File 'lib/the_plaid_api/models/consumer_dispute.rb', line 29

def statement
  @statement
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/the_plaid_api/models/consumer_dispute.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  consumer_dispute_id =
    hash.key?('consumer_dispute_id') ? hash['consumer_dispute_id'] : nil
  dispute_field_create_date =
    hash.key?('dispute_field_create_date') ? hash['dispute_field_create_date'] : nil
  category = hash.key?('category') ? hash['category'] : nil
  statement = hash.key?('statement') ? hash['statement'] : nil

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  ConsumerDispute.new(consumer_dispute_id: consumer_dispute_id,
                      dispute_field_create_date: dispute_field_create_date,
                      category: category,
                      statement: statement,
                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



32
33
34
35
36
37
38
39
# File 'lib/the_plaid_api/models/consumer_dispute.rb', line 32

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['consumer_dispute_id'] = 'consumer_dispute_id'
  @_hash['dispute_field_create_date'] = 'dispute_field_create_date'
  @_hash['category'] = 'category'
  @_hash['statement'] = 'statement'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/the_plaid_api/models/consumer_dispute.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



42
43
44
# File 'lib/the_plaid_api/models/consumer_dispute.rb', line 42

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



99
100
101
102
103
104
105
# File 'lib/the_plaid_api/models/consumer_dispute.rb', line 99

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} consumer_dispute_id: #{@consumer_dispute_id.inspect},"\
  " dispute_field_create_date: #{@dispute_field_create_date.inspect}, category:"\
  " #{@category.inspect}, statement: #{@statement.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



91
92
93
94
95
96
# File 'lib/the_plaid_api/models/consumer_dispute.rb', line 91

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} consumer_dispute_id: #{@consumer_dispute_id}, dispute_field_create_date:"\
  " #{@dispute_field_create_date}, category: #{@category}, statement: #{@statement},"\
  " additional_properties: #{@additional_properties}>"
end