Class: ModernTreasury::LedgerAccountPayoutUpdateRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/modern_treasury/models/ledger_account_payout_update_request.rb

Overview

LedgerAccountPayoutUpdateRequest Model.

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(description = SKIP, status = SKIP, metadata = SKIP) ⇒ LedgerAccountPayoutUpdateRequest

Returns a new instance of LedgerAccountPayoutUpdateRequest.



51
52
53
54
55
# File 'lib/modern_treasury/models/ledger_account_payout_update_request.rb', line 51

def initialize(description = SKIP, status = SKIP,  = SKIP)
  @description = description unless description == SKIP
  @status = status unless status == SKIP
  @metadata =  unless  == SKIP
end

Instance Attribute Details

#descriptionString

The description of the ledger account payout.

Returns:

  • (String)


14
15
16
# File 'lib/modern_treasury/models/ledger_account_payout_update_request.rb', line 14

def description
  @description
end

#metadataHash[String, String]

Additional data represented as key-value pairs. Both the key and value must be strings.

Returns:

  • (Hash[String, String])


24
25
26
# File 'lib/modern_treasury/models/ledger_account_payout_update_request.rb', line 24

def 
  @metadata
end

#statusStatus8Enum

To post a pending ledger account payout, use ‘posted`. To archive a pending ledger transaction, use `archived`.

Returns:



19
20
21
# File 'lib/modern_treasury/models/ledger_account_payout_update_request.rb', line 19

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/modern_treasury/models/ledger_account_payout_update_request.rb', line 58

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  description = hash.key?('description') ? hash['description'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
   = hash.key?('metadata') ? hash['metadata'] : SKIP

  # Create object from extracted values.
  LedgerAccountPayoutUpdateRequest.new(description,
                                       status,
                                       )
end

.namesObject

A mapping from model property names to API property names.



27
28
29
30
31
32
33
# File 'lib/modern_treasury/models/ledger_account_payout_update_request.rb', line 27

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['description'] = 'description'
  @_hash['status'] = 'status'
  @_hash['metadata'] = 'metadata'
  @_hash
end

.nullablesObject

An array for nullable fields



45
46
47
48
49
# File 'lib/modern_treasury/models/ledger_account_payout_update_request.rb', line 45

def self.nullables
  %w[
    description
  ]
end

.optionalsObject

An array for optional fields



36
37
38
39
40
41
42
# File 'lib/modern_treasury/models/ledger_account_payout_update_request.rb', line 36

def self.optionals
  %w[
    description
    status
    metadata
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



79
80
81
82
83
# File 'lib/modern_treasury/models/ledger_account_payout_update_request.rb', line 79

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} description: #{@description.inspect}, status: #{@status.inspect}, metadata:"\
  " #{@metadata.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



73
74
75
76
# File 'lib/modern_treasury/models/ledger_account_payout_update_request.rb', line 73

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} description: #{@description}, status: #{@status}, metadata: #{@metadata}>"
end