Class: FdxV660Api::StatementEntity
- Defined in:
- lib/fdx_v660_api/models/statement_entity.rb
Overview
An account statement
Instance Attribute Summary collapse
-
#account_id ⇒ String
Corresponds to accountId in Account entity.
-
#description ⇒ String
Description of statement.
-
#links ⇒ Array[HateoasLink]
The links to retrieve this account statement, or to invoke other APIs.
-
#statement_date ⇒ Date
Date of the statement.
-
#statement_id ⇒ String
Long-term persistent identity of the statement.
-
#status ⇒ DocumentStatus2
Availability status of statement.
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(account_id: SKIP, statement_id: SKIP, statement_date: SKIP, description: SKIP, links: SKIP, status: SKIP, additional_properties: nil) ⇒ StatementEntity
constructor
A new instance of StatementEntity.
-
#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(account_id: SKIP, statement_id: SKIP, statement_date: SKIP, description: SKIP, links: SKIP, status: SKIP, additional_properties: nil) ⇒ StatementEntity
Returns a new instance of StatementEntity.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/fdx_v660_api/models/statement_entity.rb', line 65 def initialize(account_id: SKIP, statement_id: SKIP, statement_date: SKIP, description: SKIP, links: SKIP, status: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_id = account_id unless account_id == SKIP @statement_id = statement_id unless statement_id == SKIP @statement_date = statement_date unless statement_date == SKIP @description = description unless description == SKIP @links = links unless links == SKIP @status = status unless status == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
Corresponds to accountId in Account entity
14 15 16 |
# File 'lib/fdx_v660_api/models/statement_entity.rb', line 14 def account_id @account_id end |
#description ⇒ String
Description of statement
26 27 28 |
# File 'lib/fdx_v660_api/models/statement_entity.rb', line 26 def description @description end |
#links ⇒ Array[HateoasLink]
The links to retrieve this account statement, or to invoke other APIs
30 31 32 |
# File 'lib/fdx_v660_api/models/statement_entity.rb', line 30 def links @links end |
#statement_date ⇒ Date
Date of the statement
22 23 24 |
# File 'lib/fdx_v660_api/models/statement_entity.rb', line 22 def statement_date @statement_date end |
#statement_id ⇒ String
Long-term persistent identity of the statement
18 19 20 |
# File 'lib/fdx_v660_api/models/statement_entity.rb', line 18 def statement_id @statement_id end |
#status ⇒ DocumentStatus2
Availability status of statement
34 35 36 |
# File 'lib/fdx_v660_api/models/statement_entity.rb', line 34 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/fdx_v660_api/models/statement_entity.rb', line 81 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_id = hash.key?('accountId') ? hash['accountId'] : SKIP statement_id = hash.key?('statementId') ? hash['statementId'] : SKIP statement_date = hash.key?('statementDate') ? hash['statementDate'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP # Parameter is an array, so we need to iterate through it links = nil unless hash['links'].nil? links = [] hash['links'].each do |structure| links << (HateoasLink.from_hash(structure) if structure) end end links = SKIP unless hash.key?('links') status = hash.key?('status') ? hash['status'] : 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. StatementEntity.new(account_id: account_id, statement_id: statement_id, statement_date: statement_date, description: description, links: links, status: status, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fdx_v660_api/models/statement_entity.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['account_id'] = 'accountId' @_hash['statement_id'] = 'statementId' @_hash['statement_date'] = 'statementDate' @_hash['description'] = 'description' @_hash['links'] = 'links' @_hash['status'] = 'status' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/fdx_v660_api/models/statement_entity.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fdx_v660_api/models/statement_entity.rb', line 49 def self.optionals %w[ account_id statement_id statement_date description links status ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
127 128 129 130 131 132 133 |
# File 'lib/fdx_v660_api/models/statement_entity.rb', line 127 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id.inspect}, statement_id: #{@statement_id.inspect},"\ " statement_date: #{@statement_date.inspect}, description: #{@description.inspect}, links:"\ " #{@links.inspect}, status: #{@status.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
119 120 121 122 123 124 |
# File 'lib/fdx_v660_api/models/statement_entity.rb', line 119 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id}, statement_id: #{@statement_id}, statement_date:"\ " #{@statement_date}, description: #{@description}, links: #{@links}, status: #{@status},"\ " additional_properties: #{@additional_properties}>" end |