Class: ModernTreasury::LedgerAccountStatementCreateRequest

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

Overview

LedgerAccountStatementCreateRequest 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(ledger_account_id = nil, effective_at_lower_bound = nil, effective_at_upper_bound = nil, description = SKIP, metadata = SKIP) ⇒ LedgerAccountStatementCreateRequest

Returns a new instance of LedgerAccountStatementCreateRequest.



63
64
65
66
67
68
69
70
71
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 63

def initialize( = nil, effective_at_lower_bound = nil,
               effective_at_upper_bound = nil, description = SKIP,
                = SKIP)
  @description = description unless description == SKIP
  @ledger_account_id = 
  @effective_at_lower_bound = effective_at_lower_bound
  @effective_at_upper_bound = effective_at_upper_bound
  @metadata =  unless  == SKIP
end

Instance Attribute Details

#descriptionString

The description of the ledger account statement.

Returns:

  • (String)


15
16
17
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 15

def description
  @description
end

#effective_at_lower_boundDateTime

The inclusive lower bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement.

Returns:

  • (DateTime)


25
26
27
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 25

def effective_at_lower_bound
  @effective_at_lower_bound
end

#effective_at_upper_boundDateTime

The exclusive upper bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement.

Returns:

  • (DateTime)


30
31
32
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 30

def effective_at_upper_bound
  @effective_at_upper_bound
end

#ledger_account_idUUID | String

The id of the ledger account whose ledger entries are queried against, and its balances are computed as a result.

Returns:

  • (UUID | String)


20
21
22
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 20

def 
  @ledger_account_id
end

#metadataHash[String, String]

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

Returns:

  • (Hash[String, String])


35
36
37
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 35

def 
  @metadata
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 74

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   =
    hash.key?('ledger_account_id') ? hash['ledger_account_id'] : nil
  effective_at_lower_bound = if hash.key?('effective_at_lower_bound')
                               (DateTimeHelper.from_rfc3339(hash['effective_at_lower_bound']) if hash['effective_at_lower_bound'])
                             end
  effective_at_upper_bound = if hash.key?('effective_at_upper_bound')
                               (DateTimeHelper.from_rfc3339(hash['effective_at_upper_bound']) if hash['effective_at_upper_bound'])
                             end
  description = hash.key?('description') ? hash['description'] : SKIP
   = hash.key?('metadata') ? hash['metadata'] : SKIP

  # Create object from extracted values.
  LedgerAccountStatementCreateRequest.new(,
                                          effective_at_lower_bound,
                                          effective_at_upper_bound,
                                          description,
                                          )
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
46
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 38

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

.nullablesObject

An array for nullable fields



57
58
59
60
61
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 57

def self.nullables
  %w[
    description
  ]
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 49

def self.optionals
  %w[
    description
    metadata
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



114
115
116
117
118
119
120
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 114

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

#to_custom_effective_at_lower_boundObject



97
98
99
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 97

def to_custom_effective_at_lower_bound
  DateTimeHelper.to_rfc3339(effective_at_lower_bound)
end

#to_custom_effective_at_upper_boundObject



101
102
103
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 101

def to_custom_effective_at_upper_bound
  DateTimeHelper.to_rfc3339(effective_at_upper_bound)
end

#to_sObject

Provides a human-readable string representation of the object.



106
107
108
109
110
111
# File 'lib/modern_treasury/models/ledger_account_statement_create_request.rb', line 106

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