Class: CcipDirectoryAndConfigurationRestApiV1::ChainMetadata
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CcipDirectoryAndConfigurationRestApiV1::ChainMetadata
- Defined in:
- lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb
Overview
ChainMetadata Model.
Instance Attribute Summary collapse
-
#environment ⇒ Environment
The network environment.
-
#ignored_chain_count ⇒ Integer
Number of chains ignored due to configuration issues.
-
#request_id ⇒ UUID | String
Unique identifier for the request.
-
#search_query ⇒ String
The search query that was used (only present when search parameter was provided).
-
#search_type ⇒ SearchType
The detected type of search query.
-
#timestamp ⇒ DateTime
ISO timestamp of the response.
-
#valid_chain_count ⇒ Integer
Number of valid chains 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_chain_count:, valid_chain_count:, search_query: SKIP, search_type: SKIP, additional_properties: nil) ⇒ ChainMetadata
constructor
A new instance of ChainMetadata.
-
#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_chain_count:, valid_chain_count:, search_query: SKIP, search_type: SKIP, additional_properties: nil) ⇒ ChainMetadata
Returns a new instance of ChainMetadata.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 71 def initialize(environment:, timestamp:, request_id:, ignored_chain_count:, valid_chain_count:, search_query: SKIP, search_type: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @environment = environment @timestamp = @request_id = request_id @ignored_chain_count = ignored_chain_count @valid_chain_count = valid_chain_count @search_query = search_query unless search_query == SKIP @search_type = search_type unless search_type == SKIP @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/chain_metadata.rb', line 15 def environment @environment end |
#ignored_chain_count ⇒ Integer
Number of chains ignored due to configuration issues
27 28 29 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 27 def ignored_chain_count @ignored_chain_count end |
#request_id ⇒ UUID | String
Unique identifier for the request
23 24 25 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 23 def request_id @request_id end |
#search_query ⇒ String
The search query that was used (only present when search parameter was provided)
36 37 38 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 36 def search_query @search_query end |
#search_type ⇒ SearchType
The detected type of search query. ‘selector’ for CCIP selectors (>17 digits), ‘chainId’ for chain IDs (≤17 digits or Solana base58), ‘internalId’ for kebab-case identifiers, ‘displayName’ for fuzzy text search.
43 44 45 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 43 def search_type @search_type end |
#timestamp ⇒ DateTime
ISO timestamp of the response
19 20 21 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 19 def @timestamp end |
#valid_chain_count ⇒ Integer
Number of valid chains in the response
31 32 33 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 31 def valid_chain_count @valid_chain_count end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 117 118 119 120 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 88 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_chain_count = hash.key?('ignoredChainCount') ? hash['ignoredChainCount'] : nil valid_chain_count = hash.key?('validChainCount') ? hash['validChainCount'] : nil search_query = hash.key?('searchQuery') ? hash['searchQuery'] : SKIP search_type = hash.key?('searchType') ? hash['searchType'] : 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. ChainMetadata.new(environment: environment, timestamp: , request_id: request_id, ignored_chain_count: ignored_chain_count, valid_chain_count: valid_chain_count, search_query: search_query, search_type: search_type, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 46 def self.names @_hash = {} if @_hash.nil? @_hash['environment'] = 'environment' @_hash['timestamp'] = 'timestamp' @_hash['request_id'] = 'requestId' @_hash['ignored_chain_count'] = 'ignoredChainCount' @_hash['valid_chain_count'] = 'validChainCount' @_hash['search_query'] = 'searchQuery' @_hash['search_type'] = 'searchType' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 62 63 64 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 59 def self.optionals %w[ search_query search_type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
136 137 138 139 140 141 142 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 136 def inspect class_name = self.class.name.split('::').last "<#{class_name} environment: #{@environment.inspect}, timestamp: #{@timestamp.inspect},"\ " request_id: #{@request_id.inspect}, ignored_chain_count: #{@ignored_chain_count.inspect},"\ " valid_chain_count: #{@valid_chain_count.inspect}, search_query: #{@search_query.inspect},"\ " search_type: #{@search_type.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_timestamp ⇒ Object
122 123 124 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 122 def DateTimeHelper.to_rfc3339() end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
127 128 129 130 131 132 133 |
# File 'lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb', line 127 def to_s class_name = self.class.name.split('::').last "<#{class_name} environment: #{@environment}, timestamp: #{@timestamp}, request_id:"\ " #{@request_id}, ignored_chain_count: #{@ignored_chain_count}, valid_chain_count:"\ " #{@valid_chain_count}, search_query: #{@search_query}, search_type: #{@search_type},"\ " additional_properties: #{@additional_properties}>" end |