Class: ThePlaidApi::CraNetworkInsightsReport
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::CraNetworkInsightsReport
- Defined in:
- lib/the_plaid_api/models/cra_network_insights_report.rb
Overview
Contains data for the CRA Network Attributes Report.
Instance Attribute Summary collapse
-
#generated_time ⇒ DateTime
The time when the report was generated.
-
#items ⇒ Array[CraNetworkInsightsItem]
The Items the end user connected in Link.
-
#network_attributes ⇒ Object
A map of network attributes, where the key is a string, and the value is a float, int, or boolean.
-
#report_id ⇒ String
The unique identifier associated with the report object.
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(report_id:, generated_time:, network_attributes:, items:, additional_properties: nil) ⇒ CraNetworkInsightsReport
constructor
A new instance of CraNetworkInsightsReport.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_generated_time ⇒ Object
-
#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(report_id:, generated_time:, network_attributes:, items:, additional_properties: nil) ⇒ CraNetworkInsightsReport
Returns a new instance of CraNetworkInsightsReport.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/the_plaid_api/models/cra_network_insights_report.rb', line 51 def initialize(report_id:, generated_time:, network_attributes:, items:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @report_id = report_id @generated_time = generated_time @network_attributes = network_attributes @items = items @additional_properties = additional_properties end |
Instance Attribute Details
#generated_time ⇒ DateTime
The time when the report was generated.
19 20 21 |
# File 'lib/the_plaid_api/models/cra_network_insights_report.rb', line 19 def generated_time @generated_time end |
#items ⇒ Array[CraNetworkInsightsItem]
The Items the end user connected in Link.
29 30 31 |
# File 'lib/the_plaid_api/models/cra_network_insights_report.rb', line 29 def items @items end |
#network_attributes ⇒ Object
A map of network attributes, where the key is a string, and the value is a float, int, or boolean. For a full list of attributes, contact your account manager.
25 26 27 |
# File 'lib/the_plaid_api/models/cra_network_insights_report.rb', line 25 def network_attributes @network_attributes end |
#report_id ⇒ String
The unique identifier associated with the report object.
15 16 17 |
# File 'lib/the_plaid_api/models/cra_network_insights_report.rb', line 15 def report_id @report_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/the_plaid_api/models/cra_network_insights_report.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. report_id = hash.key?('report_id') ? hash['report_id'] : nil generated_time = if hash.key?('generated_time') (DateTimeHelper.from_rfc3339(hash['generated_time']) if hash['generated_time']) end network_attributes = hash.key?('network_attributes') ? hash['network_attributes'] : nil # Parameter is an array, so we need to iterate through it items = nil unless hash['items'].nil? items = [] hash['items'].each do |structure| items << (CraNetworkInsightsItem.from_hash(structure) if structure) end end items = nil unless hash.key?('items') # 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. CraNetworkInsightsReport.new(report_id: report_id, generated_time: generated_time, network_attributes: network_attributes, items: items, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
32 33 34 35 36 37 38 39 |
# File 'lib/the_plaid_api/models/cra_network_insights_report.rb', line 32 def self.names @_hash = {} if @_hash.nil? @_hash['report_id'] = 'report_id' @_hash['generated_time'] = 'generated_time' @_hash['network_attributes'] = 'network_attributes' @_hash['items'] = 'items' @_hash end |
.nullables ⇒ Object
An array for nullable fields
47 48 49 |
# File 'lib/the_plaid_api/models/cra_network_insights_report.rb', line 47 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
42 43 44 |
# File 'lib/the_plaid_api/models/cra_network_insights_report.rb', line 42 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
113 114 115 116 117 118 |
# File 'lib/the_plaid_api/models/cra_network_insights_report.rb', line 113 def inspect class_name = self.class.name.split('::').last "<#{class_name} report_id: #{@report_id.inspect}, generated_time:"\ " #{@generated_time.inspect}, network_attributes: #{@network_attributes.inspect}, items:"\ " #{@items.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_generated_time ⇒ Object
100 101 102 |
# File 'lib/the_plaid_api/models/cra_network_insights_report.rb', line 100 def to_custom_generated_time DateTimeHelper.to_rfc3339(generated_time) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
105 106 107 108 109 110 |
# File 'lib/the_plaid_api/models/cra_network_insights_report.rb', line 105 def to_s class_name = self.class.name.split('::').last "<#{class_name} report_id: #{@report_id}, generated_time: #{@generated_time},"\ " network_attributes: #{@network_attributes}, items: #{@items}, additional_properties:"\ " #{@additional_properties}>" end |