Class: ModernTreasury::CounterpartyUpdateRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ModernTreasury::CounterpartyUpdateRequest
- Defined in:
- lib/modern_treasury/models/counterparty_update_request.rb
Overview
CounterpartyUpdateRequest Model.
Instance Attribute Summary collapse
-
#email ⇒ String
A new email for the counterparty.
-
#metadata ⇒ Hash[String, String]
Additional data in the form of key-value pairs.
-
#name ⇒ String
A new name for the counterparty.
-
#send_remittance_advice ⇒ TrueClass | FalseClass
If this is ‘true`, Modern Treasury will send an email to the counterparty whenever an associated payment order is sent to the bank.
-
#taxpayer_identifier ⇒ String
Either a valid SSN or EIN.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(name: SKIP, email: SKIP, metadata: SKIP, send_remittance_advice: SKIP, taxpayer_identifier: SKIP, additional_properties: nil) ⇒ CounterpartyUpdateRequest
constructor
A new instance of CounterpartyUpdateRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(name: SKIP, email: SKIP, metadata: SKIP, send_remittance_advice: SKIP, taxpayer_identifier: SKIP, additional_properties: nil) ⇒ CounterpartyUpdateRequest
Returns a new instance of CounterpartyUpdateRequest.
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/modern_treasury/models/counterparty_update_request.rb', line 61 def initialize(name: SKIP, email: SKIP, metadata: SKIP, send_remittance_advice: SKIP, taxpayer_identifier: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @name = name unless name == SKIP @email = email unless email == SKIP @metadata = unless == SKIP @send_remittance_advice = send_remittance_advice unless send_remittance_advice == SKIP @taxpayer_identifier = taxpayer_identifier unless taxpayer_identifier == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#email ⇒ String
A new email for the counterparty.
18 19 20 |
# File 'lib/modern_treasury/models/counterparty_update_request.rb', line 18 def email @email end |
#metadata ⇒ Hash[String, String]
Additional data in the form of key-value pairs. Pairs can be removed by passing an empty string or ‘null` as the value.
23 24 25 |
# File 'lib/modern_treasury/models/counterparty_update_request.rb', line 23 def @metadata end |
#name ⇒ String
A new name for the counterparty. Will only update if passed.
14 15 16 |
# File 'lib/modern_treasury/models/counterparty_update_request.rb', line 14 def name @name end |
#send_remittance_advice ⇒ TrueClass | FalseClass
If this is ‘true`, Modern Treasury will send an email to the counterparty whenever an associated payment order is sent to the bank.
28 29 30 |
# File 'lib/modern_treasury/models/counterparty_update_request.rb', line 28 def send_remittance_advice @send_remittance_advice end |
#taxpayer_identifier ⇒ String
Either a valid SSN or EIN.
32 33 34 |
# File 'lib/modern_treasury/models/counterparty_update_request.rb', line 32 def taxpayer_identifier @taxpayer_identifier end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/modern_treasury/models/counterparty_update_request.rb', line 76 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : SKIP email = hash.key?('email') ? hash['email'] : SKIP = hash.key?('metadata') ? hash['metadata'] : SKIP send_remittance_advice = hash.key?('send_remittance_advice') ? hash['send_remittance_advice'] : SKIP taxpayer_identifier = hash.key?('taxpayer_identifier') ? hash['taxpayer_identifier'] : 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. CounterpartyUpdateRequest.new(name: name, email: email, metadata: , send_remittance_advice: send_remittance_advice, taxpayer_identifier: taxpayer_identifier, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
35 36 37 38 39 40 41 42 43 |
# File 'lib/modern_treasury/models/counterparty_update_request.rb', line 35 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['email'] = 'email' @_hash['metadata'] = 'metadata' @_hash['send_remittance_advice'] = 'send_remittance_advice' @_hash['taxpayer_identifier'] = 'taxpayer_identifier' @_hash end |
.nullables ⇒ Object
An array for nullable fields
57 58 59 |
# File 'lib/modern_treasury/models/counterparty_update_request.rb', line 57 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 49 50 51 52 53 54 |
# File 'lib/modern_treasury/models/counterparty_update_request.rb', line 46 def self.optionals %w[ name email metadata send_remittance_advice taxpayer_identifier ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
113 114 115 116 117 118 119 |
# File 'lib/modern_treasury/models/counterparty_update_request.rb', line 113 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, email: #{@email.inspect}, metadata:"\ " #{@metadata.inspect}, send_remittance_advice: #{@send_remittance_advice.inspect},"\ " taxpayer_identifier: #{@taxpayer_identifier.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
105 106 107 108 109 110 |
# File 'lib/modern_treasury/models/counterparty_update_request.rb', line 105 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, email: #{@email}, metadata: #{@metadata},"\ " send_remittance_advice: #{@send_remittance_advice}, taxpayer_identifier:"\ " #{@taxpayer_identifier}, additional_properties: #{@additional_properties}>" end |