chainlink-apimatic-sdk 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +35 -60
  3. data/bin/console +4 -4
  4. data/lib/ccip_directory_and_configuration_rest_api_v1/api_helper.rb +10 -0
  5. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/apis/base_api.rb +5 -5
  6. data/lib/ccip_directory_and_configuration_rest_api_v1/apis/chains_api.rb +69 -0
  7. data/lib/ccip_directory_and_configuration_rest_api_v1/apis/lanes_api.rb +75 -0
  8. data/lib/ccip_directory_and_configuration_rest_api_v1/apis/tokens_api.rb +51 -0
  9. data/lib/ccip_directory_and_configuration_rest_api_v1/client.rb +72 -0
  10. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/configuration.rb +27 -41
  11. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/exceptions/api_exception.rb +4 -4
  12. data/lib/ccip_directory_and_configuration_rest_api_v1/exceptions/error_response_exception.rb +57 -0
  13. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/http/api_response.rb +4 -4
  14. data/lib/ccip_directory_and_configuration_rest_api_v1/http/http_call_back.rb +10 -0
  15. data/lib/ccip_directory_and_configuration_rest_api_v1/http/http_method_enum.rb +10 -0
  16. data/lib/ccip_directory_and_configuration_rest_api_v1/http/http_request.rb +10 -0
  17. data/lib/ccip_directory_and_configuration_rest_api_v1/http/http_response.rb +10 -0
  18. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/http/proxy_settings.rb +4 -4
  19. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/logging/configuration/api_logging_configuration.rb +4 -4
  20. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/logging/sdk_logger.rb +4 -4
  21. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/models/base_model.rb +4 -4
  22. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_api_response.rb +99 -0
  23. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_config_error.rb +100 -0
  24. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_details.rb +272 -0
  25. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_family.rb +64 -0
  26. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_info.rb +135 -0
  27. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_metadata.rb +144 -0
  28. data/lib/ccip_directory_and_configuration_rest_api_v1/models/chain_type.rb +64 -0
  29. data/lib/ccip_directory_and_configuration_rest_api_v1/models/data.rb +171 -0
  30. data/lib/ccip_directory_and_configuration_rest_api_v1/models/enrich_fee_tokens.rb +36 -0
  31. data/lib/ccip_directory_and_configuration_rest_api_v1/models/environment.rb +36 -0
  32. data/lib/ccip_directory_and_configuration_rest_api_v1/models/environment3.rb +36 -0
  33. data/lib/ccip_directory_and_configuration_rest_api_v1/models/family.rb +64 -0
  34. data/lib/ccip_directory_and_configuration_rest_api_v1/models/fee_token_enriched.rb +130 -0
  35. data/lib/ccip_directory_and_configuration_rest_api_v1/models/lane_api_response.rb +102 -0
  36. data/lib/ccip_directory_and_configuration_rest_api_v1/models/lane_config_error.rb +102 -0
  37. data/lib/ccip_directory_and_configuration_rest_api_v1/models/lane_details.rb +116 -0
  38. data/lib/ccip_directory_and_configuration_rest_api_v1/models/lane_metadata.rb +119 -0
  39. data/lib/ccip_directory_and_configuration_rest_api_v1/models/off_ramp.rb +82 -0
  40. data/lib/ccip_directory_and_configuration_rest_api_v1/models/on_ramp.rb +95 -0
  41. data/lib/ccip_directory_and_configuration_rest_api_v1/models/output_key.rb +40 -0
  42. data/lib/ccip_directory_and_configuration_rest_api_v1/models/pool_type.rb +44 -0
  43. data/lib/ccip_directory_and_configuration_rest_api_v1/models/search_type.rb +46 -0
  44. data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_api_response.rb +101 -0
  45. data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_chain_data.rb +190 -0
  46. data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_chain_info.rb +159 -0
  47. data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_config_error.rb +91 -0
  48. data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_details.rb +99 -0
  49. data/lib/ccip_directory_and_configuration_rest_api_v1/models/token_metadata.rb +119 -0
  50. data/lib/ccip_directory_and_configuration_rest_api_v1/utilities/date_time_helper.rb +11 -0
  51. data/lib/{swagger_petstore_open_api30 → ccip_directory_and_configuration_rest_api_v1}/utilities/file_wrapper.rb +4 -4
  52. data/lib/ccip_directory_and_configuration_rest_api_v1/utilities/union_type_lookup.rb +61 -0
  53. data/lib/ccip_directory_and_configuration_rest_api_v1.rb +112 -0
  54. metadata +51 -36
  55. data/lib/swagger_petstore_open_api30/api_helper.rb +0 -10
  56. data/lib/swagger_petstore_open_api30/apis/pet_api.rb +0 -287
  57. data/lib/swagger_petstore_open_api30/apis/store_api.rb +0 -131
  58. data/lib/swagger_petstore_open_api30/apis/user_api.rb +0 -233
  59. data/lib/swagger_petstore_open_api30/client.rb +0 -94
  60. data/lib/swagger_petstore_open_api30/exceptions/oauth_provider_exception.rb +0 -64
  61. data/lib/swagger_petstore_open_api30/http/auth/api_key.rb +0 -52
  62. data/lib/swagger_petstore_open_api30/http/auth/petstore_auth.rb +0 -112
  63. data/lib/swagger_petstore_open_api30/http/http_call_back.rb +0 -10
  64. data/lib/swagger_petstore_open_api30/http/http_method_enum.rb +0 -10
  65. data/lib/swagger_petstore_open_api30/http/http_request.rb +0 -10
  66. data/lib/swagger_petstore_open_api30/http/http_response.rb +0 -10
  67. data/lib/swagger_petstore_open_api30/models/api_response.rb +0 -118
  68. data/lib/swagger_petstore_open_api30/models/category.rb +0 -105
  69. data/lib/swagger_petstore_open_api30/models/oauth_provider_error.rb +0 -62
  70. data/lib/swagger_petstore_open_api30/models/oauth_scope_petstore_auth.rb +0 -36
  71. data/lib/swagger_petstore_open_api30/models/oauth_token.rb +0 -125
  72. data/lib/swagger_petstore_open_api30/models/order.rb +0 -167
  73. data/lib/swagger_petstore_open_api30/models/order_status.rb +0 -40
  74. data/lib/swagger_petstore_open_api30/models/pet.rb +0 -168
  75. data/lib/swagger_petstore_open_api30/models/pet_status.rb +0 -40
  76. data/lib/swagger_petstore_open_api30/models/tag.rb +0 -105
  77. data/lib/swagger_petstore_open_api30/models/user.rb +0 -182
  78. data/lib/swagger_petstore_open_api30/utilities/date_time_helper.rb +0 -11
  79. data/lib/swagger_petstore_open_api30/utilities/xml_utilities.rb +0 -12
  80. data/lib/swagger_petstore_open_api30.rb +0 -62
@@ -0,0 +1,272 @@
1
+ # ccip_directory_and_configuration_rest_api_v1
2
+ #
3
+ # This file was automatically
4
+ # generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module CcipDirectoryAndConfigurationRestApiV1
7
+ # ChainDetails Model.
8
+ class ChainDetails < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Identifier of the chain (numeric for EVM chains, string for Solana/Aptos
13
+ # chains)
14
+ # @return [Object]
15
+ attr_accessor :chain_id
16
+
17
+ # Human-readable name of the chain. For supported chains, this comes from
18
+ # configuration. For unsupported chains, it is derived from the internalId.
19
+ # @return [String]
20
+ attr_accessor :display_name
21
+
22
+ # CCIP chain selector
23
+ # @return [String]
24
+ attr_accessor :selector
25
+
26
+ # Internal identifier for the chain
27
+ # @return [String]
28
+ attr_accessor :internal_id
29
+
30
+ # Fee tokens - either as string symbols or enriched objects with addresses.
31
+ # Empty array for unsupported chains.
32
+ # @return [Object]
33
+ attr_accessor :fee_tokens
34
+
35
+ # CCIP Router contract address. Empty string for unsupported chains.
36
+ # @return [String]
37
+ attr_accessor :router
38
+
39
+ # Risk Management Network contract address. Empty string for unsupported
40
+ # chains.
41
+ # @return [String]
42
+ attr_accessor :rmn
43
+
44
+ # Type of blockchain
45
+ # @return [ChainType]
46
+ attr_accessor :chain_type
47
+
48
+ # Blockchain family grouping
49
+ # @return [ChainFamily]
50
+ attr_accessor :chain_family
51
+
52
+ # Whether this chain is fully supported with complete configuration.
53
+ # Unsupported chains have minimal details (empty router, rmn, feeTokens).
54
+ # @return [TrueClass | FalseClass]
55
+ attr_accessor :supported
56
+
57
+ # Registry Module contract address (EVM chains only)
58
+ # @return [String]
59
+ attr_accessor :registry_module
60
+
61
+ # Token Admin Registry contract address (EVM and Aptos chains)
62
+ # @return [String]
63
+ attr_accessor :token_admin_registry
64
+
65
+ # Token Pool Factory contract address (EVM chains only)
66
+ # @return [String]
67
+ attr_accessor :token_pool_factory
68
+
69
+ # Fee Quoter address (Solana chains only)
70
+ # @return [String]
71
+ attr_accessor :fee_quoter
72
+
73
+ # MCMS (Multi-Chain Management Service) address (Aptos chains only)
74
+ # @return [String]
75
+ attr_accessor :mcms
76
+
77
+ # A mapping from model property names to API property names.
78
+ def self.names
79
+ @_hash = {} if @_hash.nil?
80
+ @_hash['chain_id'] = 'chainId'
81
+ @_hash['display_name'] = 'displayName'
82
+ @_hash['selector'] = 'selector'
83
+ @_hash['internal_id'] = 'internalId'
84
+ @_hash['fee_tokens'] = 'feeTokens'
85
+ @_hash['router'] = 'router'
86
+ @_hash['rmn'] = 'rmn'
87
+ @_hash['chain_type'] = 'chainType'
88
+ @_hash['chain_family'] = 'chainFamily'
89
+ @_hash['supported'] = 'supported'
90
+ @_hash['registry_module'] = 'registryModule'
91
+ @_hash['token_admin_registry'] = 'tokenAdminRegistry'
92
+ @_hash['token_pool_factory'] = 'tokenPoolFactory'
93
+ @_hash['fee_quoter'] = 'feeQuoter'
94
+ @_hash['mcms'] = 'mcms'
95
+ @_hash
96
+ end
97
+
98
+ # An array for optional fields
99
+ def self.optionals
100
+ %w[
101
+ registry_module
102
+ token_admin_registry
103
+ token_pool_factory
104
+ fee_quoter
105
+ mcms
106
+ ]
107
+ end
108
+
109
+ # An array for nullable fields
110
+ def self.nullables
111
+ []
112
+ end
113
+
114
+ def initialize(chain_id:, display_name:, selector:, internal_id:,
115
+ fee_tokens:, router:, rmn:, chain_type:, chain_family:,
116
+ supported:, registry_module: SKIP,
117
+ token_admin_registry: SKIP, token_pool_factory: SKIP,
118
+ fee_quoter: SKIP, mcms: SKIP, additional_properties: nil)
119
+ # Add additional model properties to the instance
120
+ additional_properties = {} if additional_properties.nil?
121
+
122
+ @chain_id = chain_id
123
+ @display_name = display_name
124
+ @selector = selector
125
+ @internal_id = internal_id
126
+ @fee_tokens = fee_tokens
127
+ @router = router
128
+ @rmn = rmn
129
+ @chain_type = chain_type
130
+ @chain_family = chain_family
131
+ @supported = supported
132
+ @registry_module = registry_module unless registry_module == SKIP
133
+ @token_admin_registry = token_admin_registry unless token_admin_registry == SKIP
134
+ @token_pool_factory = token_pool_factory unless token_pool_factory == SKIP
135
+ @fee_quoter = fee_quoter unless fee_quoter == SKIP
136
+ @mcms = mcms unless mcms == SKIP
137
+ @additional_properties = additional_properties
138
+ end
139
+
140
+ # Creates an instance of the object from a hash.
141
+ def self.from_hash(hash)
142
+ return nil unless hash
143
+
144
+ # Extract variables from the hash.
145
+ chain_id = hash.key?('chainId') ? APIHelper.deserialize_union_type(
146
+ UnionTypeLookUp.get(:ChainDetailsChainId), hash['chainId']
147
+ ) : nil
148
+ display_name = hash.key?('displayName') ? hash['displayName'] : nil
149
+ selector = hash.key?('selector') ? hash['selector'] : nil
150
+ internal_id = hash.key?('internalId') ? hash['internalId'] : nil
151
+ fee_tokens = hash.key?('feeTokens') ? APIHelper.deserialize_union_type(
152
+ UnionTypeLookUp.get(:ChainDetailsFeeTokens), hash['feeTokens']
153
+ ) : nil
154
+ router = hash.key?('router') ? hash['router'] : nil
155
+ rmn = hash.key?('rmn') ? hash['rmn'] : nil
156
+ chain_type = hash.key?('chainType') ? hash['chainType'] : nil
157
+ chain_family = hash.key?('chainFamily') ? hash['chainFamily'] : nil
158
+ supported = hash.key?('supported') ? hash['supported'] : nil
159
+ registry_module =
160
+ hash.key?('registryModule') ? hash['registryModule'] : SKIP
161
+ token_admin_registry =
162
+ hash.key?('tokenAdminRegistry') ? hash['tokenAdminRegistry'] : SKIP
163
+ token_pool_factory =
164
+ hash.key?('tokenPoolFactory') ? hash['tokenPoolFactory'] : SKIP
165
+ fee_quoter = hash.key?('feeQuoter') ? hash['feeQuoter'] : SKIP
166
+ mcms = hash.key?('mcms') ? hash['mcms'] : SKIP
167
+
168
+ # Create a new hash for additional properties, removing known properties.
169
+ new_hash = hash.reject { |k, _| names.value?(k) }
170
+
171
+ additional_properties = APIHelper.get_additional_properties(
172
+ new_hash, proc { |value| value }
173
+ )
174
+
175
+ # Create object from extracted values.
176
+ ChainDetails.new(chain_id: chain_id,
177
+ display_name: display_name,
178
+ selector: selector,
179
+ internal_id: internal_id,
180
+ fee_tokens: fee_tokens,
181
+ router: router,
182
+ rmn: rmn,
183
+ chain_type: chain_type,
184
+ chain_family: chain_family,
185
+ supported: supported,
186
+ registry_module: registry_module,
187
+ token_admin_registry: token_admin_registry,
188
+ token_pool_factory: token_pool_factory,
189
+ fee_quoter: fee_quoter,
190
+ mcms: mcms,
191
+ additional_properties: additional_properties)
192
+ end
193
+
194
+ # Validates an instance of the object from a given value.
195
+ # @param [ChainDetails | Hash] The value against the validation is performed.
196
+ def self.validate(value)
197
+ if value.instance_of? self
198
+ return (
199
+ UnionTypeLookUp.get(:ChainDetailsChainId)
200
+ .validate(value.chain_id) and
201
+ APIHelper.valid_type?(value.display_name,
202
+ ->(val) { val.instance_of? String }) and
203
+ APIHelper.valid_type?(value.selector,
204
+ ->(val) { val.instance_of? String }) and
205
+ APIHelper.valid_type?(value.internal_id,
206
+ ->(val) { val.instance_of? String }) and
207
+ UnionTypeLookUp.get(:ChainDetailsFeeTokens)
208
+ .validate(value.fee_tokens) and
209
+ APIHelper.valid_type?(value.router,
210
+ ->(val) { val.instance_of? String }) and
211
+ APIHelper.valid_type?(value.rmn,
212
+ ->(val) { val.instance_of? String }) and
213
+ APIHelper.valid_type?(value.chain_type,
214
+ ->(val) { ChainType.validate(val) }) and
215
+ APIHelper.valid_type?(value.chain_family,
216
+ ->(val) { ChainFamily.validate(val) }) and
217
+ APIHelper.valid_type?(value.supported,
218
+ ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass })
219
+ )
220
+ end
221
+
222
+ return false unless value.instance_of? Hash
223
+
224
+ (
225
+ UnionTypeLookUp.get(:ChainDetailsChainId)
226
+ .validate(value['chainId']) and
227
+ APIHelper.valid_type?(value['displayName'],
228
+ ->(val) { val.instance_of? String }) and
229
+ APIHelper.valid_type?(value['selector'],
230
+ ->(val) { val.instance_of? String }) and
231
+ APIHelper.valid_type?(value['internalId'],
232
+ ->(val) { val.instance_of? String }) and
233
+ UnionTypeLookUp.get(:ChainDetailsFeeTokens)
234
+ .validate(value['feeTokens']) and
235
+ APIHelper.valid_type?(value['router'],
236
+ ->(val) { val.instance_of? String }) and
237
+ APIHelper.valid_type?(value['rmn'],
238
+ ->(val) { val.instance_of? String }) and
239
+ APIHelper.valid_type?(value['chainType'],
240
+ ->(val) { ChainType.validate(val) }) and
241
+ APIHelper.valid_type?(value['chainFamily'],
242
+ ->(val) { ChainFamily.validate(val) }) and
243
+ APIHelper.valid_type?(value['supported'],
244
+ ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass })
245
+ )
246
+ end
247
+
248
+ # Provides a human-readable string representation of the object.
249
+ def to_s
250
+ class_name = self.class.name.split('::').last
251
+ "<#{class_name} chain_id: #{@chain_id}, display_name: #{@display_name}, selector:"\
252
+ " #{@selector}, internal_id: #{@internal_id}, fee_tokens: #{@fee_tokens}, router:"\
253
+ " #{@router}, rmn: #{@rmn}, chain_type: #{@chain_type}, chain_family: #{@chain_family},"\
254
+ " supported: #{@supported}, registry_module: #{@registry_module}, token_admin_registry:"\
255
+ " #{@token_admin_registry}, token_pool_factory: #{@token_pool_factory}, fee_quoter:"\
256
+ " #{@fee_quoter}, mcms: #{@mcms}, additional_properties: #{@additional_properties}>"
257
+ end
258
+
259
+ # Provides a debugging-friendly string with detailed object information.
260
+ def inspect
261
+ class_name = self.class.name.split('::').last
262
+ "<#{class_name} chain_id: #{@chain_id.inspect}, display_name: #{@display_name.inspect},"\
263
+ " selector: #{@selector.inspect}, internal_id: #{@internal_id.inspect}, fee_tokens:"\
264
+ " #{@fee_tokens.inspect}, router: #{@router.inspect}, rmn: #{@rmn.inspect}, chain_type:"\
265
+ " #{@chain_type.inspect}, chain_family: #{@chain_family.inspect}, supported:"\
266
+ " #{@supported.inspect}, registry_module: #{@registry_module.inspect}, token_admin_registry:"\
267
+ " #{@token_admin_registry.inspect}, token_pool_factory: #{@token_pool_factory.inspect},"\
268
+ " fee_quoter: #{@fee_quoter.inspect}, mcms: #{@mcms.inspect}, additional_properties:"\
269
+ " #{@additional_properties}>"
270
+ end
271
+ end
272
+ end
@@ -0,0 +1,64 @@
1
+ # ccip_directory_and_configuration_rest_api_v1
2
+ #
3
+ # This file was automatically
4
+ # generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module CcipDirectoryAndConfigurationRestApiV1
7
+ # Blockchain family grouping
8
+ class ChainFamily
9
+ CHAIN_FAMILY = [
10
+ # TODO: Write general description for EVM
11
+ EVM = 'evm'.freeze,
12
+
13
+ # TODO: Write general description for SOLANA
14
+ SOLANA = 'solana'.freeze,
15
+
16
+ # TODO: Write general description for APTOS
17
+ APTOS = 'aptos'.freeze,
18
+
19
+ # TODO: Write general description for SUI
20
+ SUI = 'sui'.freeze,
21
+
22
+ # TODO: Write general description for TRON
23
+ TRON = 'tron'.freeze,
24
+
25
+ # TODO: Write general description for CANTON
26
+ CANTON = 'canton'.freeze,
27
+
28
+ # TODO: Write general description for TON
29
+ TON = 'ton'.freeze,
30
+
31
+ # TODO: Write general description for STELLAR
32
+ STELLAR = 'stellar'.freeze,
33
+
34
+ # TODO: Write general description for STARKNET
35
+ STARKNET = 'starknet'.freeze
36
+ ].freeze
37
+
38
+ def self.validate(value)
39
+ return false if value.nil?
40
+
41
+ CHAIN_FAMILY.include?(value)
42
+ end
43
+
44
+ def self.from_value(value, default_value = EVM)
45
+ return default_value if value.nil?
46
+
47
+ str = value.to_s.strip
48
+
49
+ case str.downcase
50
+ when 'evm' then EVM
51
+ when 'solana' then SOLANA
52
+ when 'aptos' then APTOS
53
+ when 'sui' then SUI
54
+ when 'tron' then TRON
55
+ when 'canton' then CANTON
56
+ when 'ton' then TON
57
+ when 'stellar' then STELLAR
58
+ when 'starknet' then STARKNET
59
+ else
60
+ default_value
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,135 @@
1
+ # ccip_directory_and_configuration_rest_api_v1
2
+ #
3
+ # This file was automatically
4
+ # generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module CcipDirectoryAndConfigurationRestApiV1
7
+ # Chain information used in lane endpoints. Note: chainType and chainFamily
8
+ # are intentionally excluded from this schema for API responses.
9
+ class ChainInfo < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Identifier of the chain (numeric for EVM chains, string for Solana/Aptos
14
+ # chains)
15
+ # @return [Object]
16
+ attr_accessor :chain_id
17
+
18
+ # Human-readable name of the chain
19
+ # @return [String]
20
+ attr_accessor :display_name
21
+
22
+ # CCIP chain selector as a string
23
+ # @return [String]
24
+ attr_accessor :selector
25
+
26
+ # Internal identifier used in configuration
27
+ # @return [String]
28
+ attr_accessor :internal_id
29
+
30
+ # A mapping from model property names to API property names.
31
+ def self.names
32
+ @_hash = {} if @_hash.nil?
33
+ @_hash['chain_id'] = 'chainId'
34
+ @_hash['display_name'] = 'displayName'
35
+ @_hash['selector'] = 'selector'
36
+ @_hash['internal_id'] = 'internalId'
37
+ @_hash
38
+ end
39
+
40
+ # An array for optional fields
41
+ def self.optionals
42
+ []
43
+ end
44
+
45
+ # An array for nullable fields
46
+ def self.nullables
47
+ []
48
+ end
49
+
50
+ def initialize(chain_id:, display_name:, selector:, internal_id:,
51
+ additional_properties: nil)
52
+ # Add additional model properties to the instance
53
+ additional_properties = {} if additional_properties.nil?
54
+
55
+ @chain_id = chain_id
56
+ @display_name = display_name
57
+ @selector = selector
58
+ @internal_id = internal_id
59
+ @additional_properties = additional_properties
60
+ end
61
+
62
+ # Creates an instance of the object from a hash.
63
+ def self.from_hash(hash)
64
+ return nil unless hash
65
+
66
+ # Extract variables from the hash.
67
+ chain_id = hash.key?('chainId') ? APIHelper.deserialize_union_type(
68
+ UnionTypeLookUp.get(:ChainInfoChainId), hash['chainId']
69
+ ) : nil
70
+ display_name = hash.key?('displayName') ? hash['displayName'] : nil
71
+ selector = hash.key?('selector') ? hash['selector'] : nil
72
+ internal_id = hash.key?('internalId') ? hash['internalId'] : nil
73
+
74
+ # Create a new hash for additional properties, removing known properties.
75
+ new_hash = hash.reject { |k, _| names.value?(k) }
76
+
77
+ additional_properties = APIHelper.get_additional_properties(
78
+ new_hash, proc { |value| value }
79
+ )
80
+
81
+ # Create object from extracted values.
82
+ ChainInfo.new(chain_id: chain_id,
83
+ display_name: display_name,
84
+ selector: selector,
85
+ internal_id: internal_id,
86
+ additional_properties: additional_properties)
87
+ end
88
+
89
+ # Validates an instance of the object from a given value.
90
+ # @param [ChainInfo | Hash] The value against the validation is performed.
91
+ def self.validate(value)
92
+ if value.instance_of? self
93
+ return (
94
+ UnionTypeLookUp.get(:ChainInfoChainId)
95
+ .validate(value.chain_id) and
96
+ APIHelper.valid_type?(value.display_name,
97
+ ->(val) { val.instance_of? String }) and
98
+ APIHelper.valid_type?(value.selector,
99
+ ->(val) { val.instance_of? String }) and
100
+ APIHelper.valid_type?(value.internal_id,
101
+ ->(val) { val.instance_of? String })
102
+ )
103
+ end
104
+
105
+ return false unless value.instance_of? Hash
106
+
107
+ (
108
+ UnionTypeLookUp.get(:ChainInfoChainId)
109
+ .validate(value['chainId']) and
110
+ APIHelper.valid_type?(value['displayName'],
111
+ ->(val) { val.instance_of? String }) and
112
+ APIHelper.valid_type?(value['selector'],
113
+ ->(val) { val.instance_of? String }) and
114
+ APIHelper.valid_type?(value['internalId'],
115
+ ->(val) { val.instance_of? String })
116
+ )
117
+ end
118
+
119
+ # Provides a human-readable string representation of the object.
120
+ def to_s
121
+ class_name = self.class.name.split('::').last
122
+ "<#{class_name} chain_id: #{@chain_id}, display_name: #{@display_name}, selector:"\
123
+ " #{@selector}, internal_id: #{@internal_id}, additional_properties:"\
124
+ " #{@additional_properties}>"
125
+ end
126
+
127
+ # Provides a debugging-friendly string with detailed object information.
128
+ def inspect
129
+ class_name = self.class.name.split('::').last
130
+ "<#{class_name} chain_id: #{@chain_id.inspect}, display_name: #{@display_name.inspect},"\
131
+ " selector: #{@selector.inspect}, internal_id: #{@internal_id.inspect},"\
132
+ " additional_properties: #{@additional_properties}>"
133
+ end
134
+ end
135
+ end
@@ -0,0 +1,144 @@
1
+ # ccip_directory_and_configuration_rest_api_v1
2
+ #
3
+ # This file was automatically
4
+ # generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module CcipDirectoryAndConfigurationRestApiV1
8
+ # ChainMetadata Model.
9
+ class ChainMetadata < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # The network environment
14
+ # @return [Environment]
15
+ attr_accessor :environment
16
+
17
+ # ISO timestamp of the response
18
+ # @return [DateTime]
19
+ attr_accessor :timestamp
20
+
21
+ # Unique identifier for the request
22
+ # @return [UUID | String]
23
+ attr_accessor :request_id
24
+
25
+ # Number of chains ignored due to configuration issues
26
+ # @return [Integer]
27
+ attr_accessor :ignored_chain_count
28
+
29
+ # Number of valid chains in the response
30
+ # @return [Integer]
31
+ attr_accessor :valid_chain_count
32
+
33
+ # The search query that was used (only present when search parameter was
34
+ # provided)
35
+ # @return [String]
36
+ attr_accessor :search_query
37
+
38
+ # The detected type of search query. 'selector' for CCIP selectors (>17
39
+ # digits), 'chainId' for chain IDs (≤17 digits or Solana base58),
40
+ # 'internalId' for kebab-case identifiers, 'displayName' for fuzzy text
41
+ # search.
42
+ # @return [SearchType]
43
+ attr_accessor :search_type
44
+
45
+ # A mapping from model property names to API property names.
46
+ def self.names
47
+ @_hash = {} if @_hash.nil?
48
+ @_hash['environment'] = 'environment'
49
+ @_hash['timestamp'] = 'timestamp'
50
+ @_hash['request_id'] = 'requestId'
51
+ @_hash['ignored_chain_count'] = 'ignoredChainCount'
52
+ @_hash['valid_chain_count'] = 'validChainCount'
53
+ @_hash['search_query'] = 'searchQuery'
54
+ @_hash['search_type'] = 'searchType'
55
+ @_hash
56
+ end
57
+
58
+ # An array for optional fields
59
+ def self.optionals
60
+ %w[
61
+ search_query
62
+ search_type
63
+ ]
64
+ end
65
+
66
+ # An array for nullable fields
67
+ def self.nullables
68
+ []
69
+ end
70
+
71
+ def initialize(environment:, timestamp:, request_id:, ignored_chain_count:,
72
+ valid_chain_count:, search_query: SKIP, search_type: SKIP,
73
+ additional_properties: nil)
74
+ # Add additional model properties to the instance
75
+ additional_properties = {} if additional_properties.nil?
76
+
77
+ @environment = environment
78
+ @timestamp = timestamp
79
+ @request_id = request_id
80
+ @ignored_chain_count = ignored_chain_count
81
+ @valid_chain_count = valid_chain_count
82
+ @search_query = search_query unless search_query == SKIP
83
+ @search_type = search_type unless search_type == SKIP
84
+ @additional_properties = additional_properties
85
+ end
86
+
87
+ # Creates an instance of the object from a hash.
88
+ def self.from_hash(hash)
89
+ return nil unless hash
90
+
91
+ # Extract variables from the hash.
92
+ environment = hash.key?('environment') ? hash['environment'] : nil
93
+ timestamp = if hash.key?('timestamp')
94
+ (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
95
+ end
96
+ request_id = hash.key?('requestId') ? hash['requestId'] : nil
97
+ ignored_chain_count =
98
+ hash.key?('ignoredChainCount') ? hash['ignoredChainCount'] : nil
99
+ valid_chain_count =
100
+ hash.key?('validChainCount') ? hash['validChainCount'] : nil
101
+ search_query = hash.key?('searchQuery') ? hash['searchQuery'] : SKIP
102
+ search_type = hash.key?('searchType') ? hash['searchType'] : SKIP
103
+
104
+ # Create a new hash for additional properties, removing known properties.
105
+ new_hash = hash.reject { |k, _| names.value?(k) }
106
+
107
+ additional_properties = APIHelper.get_additional_properties(
108
+ new_hash, proc { |value| value }
109
+ )
110
+
111
+ # Create object from extracted values.
112
+ ChainMetadata.new(environment: environment,
113
+ timestamp: timestamp,
114
+ request_id: request_id,
115
+ ignored_chain_count: ignored_chain_count,
116
+ valid_chain_count: valid_chain_count,
117
+ search_query: search_query,
118
+ search_type: search_type,
119
+ additional_properties: additional_properties)
120
+ end
121
+
122
+ def to_custom_timestamp
123
+ DateTimeHelper.to_rfc3339(timestamp)
124
+ end
125
+
126
+ # Provides a human-readable string representation of the object.
127
+ def to_s
128
+ class_name = self.class.name.split('::').last
129
+ "<#{class_name} environment: #{@environment}, timestamp: #{@timestamp}, request_id:"\
130
+ " #{@request_id}, ignored_chain_count: #{@ignored_chain_count}, valid_chain_count:"\
131
+ " #{@valid_chain_count}, search_query: #{@search_query}, search_type: #{@search_type},"\
132
+ " additional_properties: #{@additional_properties}>"
133
+ end
134
+
135
+ # Provides a debugging-friendly string with detailed object information.
136
+ def inspect
137
+ class_name = self.class.name.split('::').last
138
+ "<#{class_name} environment: #{@environment.inspect}, timestamp: #{@timestamp.inspect},"\
139
+ " request_id: #{@request_id.inspect}, ignored_chain_count: #{@ignored_chain_count.inspect},"\
140
+ " valid_chain_count: #{@valid_chain_count.inspect}, search_query: #{@search_query.inspect},"\
141
+ " search_type: #{@search_type.inspect}, additional_properties: #{@additional_properties}>"
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,64 @@
1
+ # ccip_directory_and_configuration_rest_api_v1
2
+ #
3
+ # This file was automatically
4
+ # generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module CcipDirectoryAndConfigurationRestApiV1
7
+ # Type of blockchain
8
+ class ChainType
9
+ CHAIN_TYPE = [
10
+ # TODO: Write general description for EVM
11
+ EVM = 'evm'.freeze,
12
+
13
+ # TODO: Write general description for SOLANA
14
+ SOLANA = 'solana'.freeze,
15
+
16
+ # TODO: Write general description for APTOS
17
+ APTOS = 'aptos'.freeze,
18
+
19
+ # TODO: Write general description for SUI
20
+ SUI = 'sui'.freeze,
21
+
22
+ # TODO: Write general description for CANTON
23
+ CANTON = 'canton'.freeze,
24
+
25
+ # TODO: Write general description for TON
26
+ TON = 'ton'.freeze,
27
+
28
+ # TODO: Write general description for TRON
29
+ TRON = 'tron'.freeze,
30
+
31
+ # TODO: Write general description for STELLAR
32
+ STELLAR = 'stellar'.freeze,
33
+
34
+ # TODO: Write general description for STARKNET
35
+ STARKNET = 'starknet'.freeze
36
+ ].freeze
37
+
38
+ def self.validate(value)
39
+ return false if value.nil?
40
+
41
+ CHAIN_TYPE.include?(value)
42
+ end
43
+
44
+ def self.from_value(value, default_value = EVM)
45
+ return default_value if value.nil?
46
+
47
+ str = value.to_s.strip
48
+
49
+ case str.downcase
50
+ when 'evm' then EVM
51
+ when 'solana' then SOLANA
52
+ when 'aptos' then APTOS
53
+ when 'sui' then SUI
54
+ when 'canton' then CANTON
55
+ when 'ton' then TON
56
+ when 'tron' then TRON
57
+ when 'stellar' then STELLAR
58
+ when 'starknet' then STARKNET
59
+ else
60
+ default_value
61
+ end
62
+ end
63
+ end
64
+ end