Class: CcipDirectoryAndConfigurationRestApiV1::LaneMetadata
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CcipDirectoryAndConfigurationRestApiV1::LaneMetadata
- Defined in:
- lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb
Overview
LaneMetadata Model.
Instance Attribute Summary collapse
-
#environment ⇒ Environment
The network environment.
-
#ignored_lane_count ⇒ Integer
Number of lanes ignored due to configuration issues.
-
#request_id ⇒ UUID | String
Unique identifier for the request.
-
#timestamp ⇒ DateTime
ISO timestamp of the response.
-
#valid_lane_count ⇒ Integer
Number of valid lanes in the response.
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(environment:, timestamp:, request_id:, ignored_lane_count:, valid_lane_count:, additional_properties: nil) ⇒ LaneMetadata
constructor
A new instance of LaneMetadata.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_timestamp ⇒ 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(environment:, timestamp:, request_id:, ignored_lane_count:, valid_lane_count:, additional_properties: nil) ⇒ LaneMetadata
Returns a new instance of LaneMetadata.
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb', line 54 def initialize(environment:, timestamp:, request_id:, ignored_lane_count:, valid_lane_count:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @environment = environment @timestamp = @request_id = request_id @ignored_lane_count = ignored_lane_count @valid_lane_count = valid_lane_count @additional_properties = additional_properties end |
Instance Attribute Details
#environment ⇒ Environment
The network environment
15 16 17 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb', line 15 def environment @environment end |
#ignored_lane_count ⇒ Integer
Number of lanes ignored due to configuration issues
27 28 29 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb', line 27 def ignored_lane_count @ignored_lane_count end |
#request_id ⇒ UUID | String
Unique identifier for the request
23 24 25 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb', line 23 def request_id @request_id end |
#timestamp ⇒ DateTime
ISO timestamp of the response
19 20 21 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb', line 19 def @timestamp end |
#valid_lane_count ⇒ Integer
Number of valid lanes in the response
31 32 33 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb', line 31 def valid_lane_count @valid_lane_count end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb', line 68 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. environment = hash.key?('environment') ? hash['environment'] : nil = if hash.key?('timestamp') (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp']) end request_id = hash.key?('requestId') ? hash['requestId'] : nil ignored_lane_count = hash.key?('ignoredLaneCount') ? hash['ignoredLaneCount'] : nil valid_lane_count = hash.key?('validLaneCount') ? hash['validLaneCount'] : nil # 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. LaneMetadata.new(environment: environment, timestamp: , request_id: request_id, ignored_lane_count: ignored_lane_count, valid_lane_count: valid_lane_count, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['environment'] = 'environment' @_hash['timestamp'] = 'timestamp' @_hash['request_id'] = 'requestId' @_hash['ignored_lane_count'] = 'ignoredLaneCount' @_hash['valid_lane_count'] = 'validLaneCount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb', line 45 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
111 112 113 114 115 116 117 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb', line 111 def inspect class_name = self.class.name.split('::').last "<#{class_name} environment: #{@environment.inspect}, timestamp: #{@timestamp.inspect},"\ " request_id: #{@request_id.inspect}, ignored_lane_count: #{@ignored_lane_count.inspect},"\ " valid_lane_count: #{@valid_lane_count.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_timestamp ⇒ Object
98 99 100 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb', line 98 def DateTimeHelper.to_rfc3339() end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
103 104 105 106 107 108 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb', line 103 def to_s class_name = self.class.name.split('::').last "<#{class_name} environment: #{@environment}, timestamp: #{@timestamp}, request_id:"\ " #{@request_id}, ignored_lane_count: #{@ignored_lane_count}, valid_lane_count:"\ " #{@valid_lane_count}, additional_properties: #{@additional_properties}>" end |