Class: ThePlaidApi::ProtectIncidentEventResponse

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

Overview

Details about the incident event.

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(protect_event_id: SKIP, link_session_id: SKIP, idv_session_id: SKIP, signal_client_transaction_id: SKIP, internal_reference: SKIP, time: SKIP, amount: SKIP, item_id: SKIP, additional_properties: nil) ⇒ ProtectIncidentEventResponse

Returns a new instance of ProtectIncidentEventResponse.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/the_plaid_api/models/protect_incident_event_response.rb', line 94

def initialize(protect_event_id: SKIP, link_session_id: SKIP,
               idv_session_id: SKIP, signal_client_transaction_id: SKIP,
               internal_reference: SKIP, time: SKIP, amount: SKIP,
               item_id: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @protect_event_id = protect_event_id unless protect_event_id == SKIP
  @link_session_id = link_session_id unless link_session_id == SKIP
  @idv_session_id = idv_session_id unless idv_session_id == SKIP
  unless signal_client_transaction_id == SKIP
    @signal_client_transaction_id =
      signal_client_transaction_id
  end
  @internal_reference = internal_reference unless internal_reference == SKIP
  @time = time unless time == SKIP
  @amount = amount unless amount == SKIP
  @item_id = item_id unless item_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#amountProtectIncidentAmount

The monetary amount associated with the incident.



46
47
48
# File 'lib/the_plaid_api/models/protect_incident_event_response.rb', line 46

def amount
  @amount
end

#idv_session_idString

A unique identifier for an Identity Verification session that may be associated with this incident.

Returns:

  • (String)


26
27
28
# File 'lib/the_plaid_api/models/protect_incident_event_response.rb', line 26

def idv_session_id
  @idv_session_id
end

#internal_referenceString

A unique ID representing the incident in your system. Personally identifiable information, such as an email address or phone number, should not be used in this field.

Returns:

  • (String)


37
38
39
# File 'lib/the_plaid_api/models/protect_incident_event_response.rb', line 37

def internal_reference
  @internal_reference
end

#item_idString

The ‘item_id` associated with the Item related to this incident.

Returns:

  • (String)


50
51
52
# File 'lib/the_plaid_api/models/protect_incident_event_response.rb', line 50

def item_id
  @item_id
end

A unique identifier for a Link session that may be associated with this incident.

Returns:

  • (String)


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

def link_session_id
  @link_session_id
end

#protect_event_idString

A globally unique identifier representing a Protect event that may be associated with this incident.

Returns:

  • (String)


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

def protect_event_id
  @protect_event_id
end

#signal_client_transaction_idString

The unique ID used to refer to a Signal transaction evaluation that may be associated with this incident.

Returns:

  • (String)


31
32
33
# File 'lib/the_plaid_api/models/protect_incident_event_response.rb', line 31

def signal_client_transaction_id
  @signal_client_transaction_id
end

#timeDateTime

The timestamp when the incident occurred, in ISO 8601 format (e.g., ‘2020-07-24T03:26:02Z’).

Returns:

  • (DateTime)


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

def time
  @time
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/the_plaid_api/models/protect_incident_event_response.rb', line 116

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  protect_event_id =
    hash.key?('protect_event_id') ? hash['protect_event_id'] : SKIP
  link_session_id =
    hash.key?('link_session_id') ? hash['link_session_id'] : SKIP
  idv_session_id =
    hash.key?('idv_session_id') ? hash['idv_session_id'] : SKIP
  signal_client_transaction_id =
    hash.key?('signal_client_transaction_id') ? hash['signal_client_transaction_id'] : SKIP
  internal_reference =
    hash.key?('internal_reference') ? hash['internal_reference'] : SKIP
  time = if hash.key?('time')
           (DateTimeHelper.from_rfc3339(hash['time']) if hash['time'])
         else
           SKIP
         end
  amount = ProtectIncidentAmount.from_hash(hash['amount']) if hash['amount']
  item_id = hash.key?('item_id') ? hash['item_id'] : SKIP

  # 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.
  ProtectIncidentEventResponse.new(protect_event_id: protect_event_id,
                                   link_session_id: link_session_id,
                                   idv_session_id: idv_session_id,
                                   signal_client_transaction_id: signal_client_transaction_id,
                                   internal_reference: internal_reference,
                                   time: time,
                                   amount: amount,
                                   item_id: item_id,
                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/the_plaid_api/models/protect_incident_event_response.rb', line 53

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['protect_event_id'] = 'protect_event_id'
  @_hash['link_session_id'] = 'link_session_id'
  @_hash['idv_session_id'] = 'idv_session_id'
  @_hash['signal_client_transaction_id'] = 'signal_client_transaction_id'
  @_hash['internal_reference'] = 'internal_reference'
  @_hash['time'] = 'time'
  @_hash['amount'] = 'amount'
  @_hash['item_id'] = 'item_id'
  @_hash
end

.nullablesObject

An array for nullable fields



81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/the_plaid_api/models/protect_incident_event_response.rb', line 81

def self.nullables
  %w[
    protect_event_id
    link_session_id
    idv_session_id
    signal_client_transaction_id
    internal_reference
    time
    amount
    item_id
  ]
end

.optionalsObject

An array for optional fields



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/the_plaid_api/models/protect_incident_event_response.rb', line 67

def self.optionals
  %w[
    protect_event_id
    link_session_id
    idv_session_id
    signal_client_transaction_id
    internal_reference
    time
    amount
    item_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



172
173
174
175
176
177
178
179
180
# File 'lib/the_plaid_api/models/protect_incident_event_response.rb', line 172

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} protect_event_id: #{@protect_event_id.inspect}, link_session_id:"\
  " #{@link_session_id.inspect}, idv_session_id: #{@idv_session_id.inspect},"\
  " signal_client_transaction_id: #{@signal_client_transaction_id.inspect},"\
  " internal_reference: #{@internal_reference.inspect}, time: #{@time.inspect}, amount:"\
  " #{@amount.inspect}, item_id: #{@item_id.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_custom_timeObject



157
158
159
# File 'lib/the_plaid_api/models/protect_incident_event_response.rb', line 157

def to_custom_time
  DateTimeHelper.to_rfc3339(time)
end

#to_sObject

Provides a human-readable string representation of the object.



162
163
164
165
166
167
168
169
# File 'lib/the_plaid_api/models/protect_incident_event_response.rb', line 162

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} protect_event_id: #{@protect_event_id}, link_session_id:"\
  " #{@link_session_id}, idv_session_id: #{@idv_session_id}, signal_client_transaction_id:"\
  " #{@signal_client_transaction_id}, internal_reference: #{@internal_reference}, time:"\
  " #{@time}, amount: #{@amount}, item_id: #{@item_id}, additional_properties:"\
  " #{@additional_properties}>"
end