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, additional_properties: nil) ⇒ LedgerAccountPayoutUpdateRequest

Returns a new instance of LedgerAccountPayoutUpdateRequest.



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

def initialize(description: SKIP, status: SKIP, metadata: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @description = description unless description == SKIP
  @status = status unless status == SKIP
  @metadata =  unless  == SKIP
  @additional_properties = additional_properties
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

#statusStatus8

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.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/modern_treasury/models/ledger_account_payout_update_request.rb', line 63

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 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.
  LedgerAccountPayoutUpdateRequest.new(description: description,
                                       status: status,
                                       metadata: ,
                                       additional_properties: additional_properties)
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.



93
94
95
96
97
# File 'lib/modern_treasury/models/ledger_account_payout_update_request.rb', line 93

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

#to_sObject

Provides a human-readable string representation of the object.



86
87
88
89
90
# File 'lib/modern_treasury/models/ledger_account_payout_update_request.rb', line 86

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