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,190 @@
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
+ # TokenChainData Model.
8
+ class TokenChainData < 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
18
+ # @return [String]
19
+ attr_accessor :chain_name
20
+
21
+ # Token contract address on this chain
22
+ # @return [String]
23
+ attr_accessor :token_address
24
+
25
+ # Number of decimals used for the token
26
+ # @return [Integer]
27
+ attr_accessor :decimals
28
+
29
+ # Type of pool for this token
30
+ # @return [PoolType]
31
+ attr_accessor :pool_type
32
+
33
+ # Token pool contract address (if applicable)
34
+ # @return [String]
35
+ attr_accessor :pool_address
36
+
37
+ # Name of the token
38
+ # @return [String]
39
+ attr_accessor :name
40
+
41
+ # Symbol of the token
42
+ # @return [String]
43
+ attr_accessor :symbol
44
+
45
+ # Destination chains this token can be sent to
46
+ # @return [Array[String]]
47
+ attr_accessor :destinations
48
+
49
+ # A mapping from model property names to API property names.
50
+ def self.names
51
+ @_hash = {} if @_hash.nil?
52
+ @_hash['chain_id'] = 'chainId'
53
+ @_hash['chain_name'] = 'chainName'
54
+ @_hash['token_address'] = 'tokenAddress'
55
+ @_hash['decimals'] = 'decimals'
56
+ @_hash['pool_type'] = 'poolType'
57
+ @_hash['pool_address'] = 'poolAddress'
58
+ @_hash['name'] = 'name'
59
+ @_hash['symbol'] = 'symbol'
60
+ @_hash['destinations'] = 'destinations'
61
+ @_hash
62
+ end
63
+
64
+ # An array for optional fields
65
+ def self.optionals
66
+ %w[
67
+ name
68
+ symbol
69
+ destinations
70
+ ]
71
+ end
72
+
73
+ # An array for nullable fields
74
+ def self.nullables
75
+ []
76
+ end
77
+
78
+ def initialize(chain_id:, chain_name:, token_address:, decimals:,
79
+ pool_type:, pool_address:, name: SKIP, symbol: SKIP,
80
+ destinations: SKIP, additional_properties: nil)
81
+ # Add additional model properties to the instance
82
+ additional_properties = {} if additional_properties.nil?
83
+
84
+ @chain_id = chain_id
85
+ @chain_name = chain_name
86
+ @token_address = token_address
87
+ @decimals = decimals
88
+ @pool_type = pool_type
89
+ @pool_address = pool_address
90
+ @name = name unless name == SKIP
91
+ @symbol = symbol unless symbol == SKIP
92
+ @destinations = destinations unless destinations == SKIP
93
+ @additional_properties = additional_properties
94
+ end
95
+
96
+ # Creates an instance of the object from a hash.
97
+ def self.from_hash(hash)
98
+ return nil unless hash
99
+
100
+ # Extract variables from the hash.
101
+ chain_id = hash.key?('chainId') ? APIHelper.deserialize_union_type(
102
+ UnionTypeLookUp.get(:TokenChainDataChainId), hash['chainId']
103
+ ) : nil
104
+ chain_name = hash.key?('chainName') ? hash['chainName'] : nil
105
+ token_address = hash.key?('tokenAddress') ? hash['tokenAddress'] : nil
106
+ decimals = hash.key?('decimals') ? hash['decimals'] : nil
107
+ pool_type = hash.key?('poolType') ? hash['poolType'] : nil
108
+ pool_address = hash.key?('poolAddress') ? hash['poolAddress'] : nil
109
+ name = hash.key?('name') ? hash['name'] : SKIP
110
+ symbol = hash.key?('symbol') ? hash['symbol'] : SKIP
111
+ destinations = hash.key?('destinations') ? hash['destinations'] : SKIP
112
+
113
+ # Create a new hash for additional properties, removing known properties.
114
+ new_hash = hash.reject { |k, _| names.value?(k) }
115
+
116
+ additional_properties = APIHelper.get_additional_properties(
117
+ new_hash, proc { |value| value }
118
+ )
119
+
120
+ # Create object from extracted values.
121
+ TokenChainData.new(chain_id: chain_id,
122
+ chain_name: chain_name,
123
+ token_address: token_address,
124
+ decimals: decimals,
125
+ pool_type: pool_type,
126
+ pool_address: pool_address,
127
+ name: name,
128
+ symbol: symbol,
129
+ destinations: destinations,
130
+ additional_properties: additional_properties)
131
+ end
132
+
133
+ # Validates an instance of the object from a given value.
134
+ # @param [TokenChainData | Hash] The value against the validation is performed.
135
+ def self.validate(value)
136
+ if value.instance_of? self
137
+ return (
138
+ UnionTypeLookUp.get(:TokenChainDataChainId)
139
+ .validate(value.chain_id) and
140
+ APIHelper.valid_type?(value.chain_name,
141
+ ->(val) { val.instance_of? String }) and
142
+ APIHelper.valid_type?(value.token_address,
143
+ ->(val) { val.instance_of? String }) and
144
+ APIHelper.valid_type?(value.decimals,
145
+ ->(val) { val.instance_of? Integer }) and
146
+ APIHelper.valid_type?(value.pool_type,
147
+ ->(val) { PoolType.validate(val) }) and
148
+ APIHelper.valid_type?(value.pool_address,
149
+ ->(val) { val.instance_of? String })
150
+ )
151
+ end
152
+
153
+ return false unless value.instance_of? Hash
154
+
155
+ (
156
+ UnionTypeLookUp.get(:TokenChainDataChainId)
157
+ .validate(value['chainId']) and
158
+ APIHelper.valid_type?(value['chainName'],
159
+ ->(val) { val.instance_of? String }) and
160
+ APIHelper.valid_type?(value['tokenAddress'],
161
+ ->(val) { val.instance_of? String }) and
162
+ APIHelper.valid_type?(value['decimals'],
163
+ ->(val) { val.instance_of? Integer }) and
164
+ APIHelper.valid_type?(value['poolType'],
165
+ ->(val) { PoolType.validate(val) }) and
166
+ APIHelper.valid_type?(value['poolAddress'],
167
+ ->(val) { val.instance_of? String })
168
+ )
169
+ end
170
+
171
+ # Provides a human-readable string representation of the object.
172
+ def to_s
173
+ class_name = self.class.name.split('::').last
174
+ "<#{class_name} chain_id: #{@chain_id}, chain_name: #{@chain_name}, token_address:"\
175
+ " #{@token_address}, decimals: #{@decimals}, pool_type: #{@pool_type}, pool_address:"\
176
+ " #{@pool_address}, name: #{@name}, symbol: #{@symbol}, destinations: #{@destinations},"\
177
+ " additional_properties: #{@additional_properties}>"
178
+ end
179
+
180
+ # Provides a debugging-friendly string with detailed object information.
181
+ def inspect
182
+ class_name = self.class.name.split('::').last
183
+ "<#{class_name} chain_id: #{@chain_id.inspect}, chain_name: #{@chain_name.inspect},"\
184
+ " token_address: #{@token_address.inspect}, decimals: #{@decimals.inspect}, pool_type:"\
185
+ " #{@pool_type.inspect}, pool_address: #{@pool_address.inspect}, name: #{@name.inspect},"\
186
+ " symbol: #{@symbol.inspect}, destinations: #{@destinations.inspect}, additional_properties:"\
187
+ " #{@additional_properties}>"
188
+ end
189
+ end
190
+ end
@@ -0,0 +1,159 @@
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
+ # TokenChainInfo Model.
8
+ class TokenChainInfo < 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
18
+ # @return [String]
19
+ attr_accessor :chain_name
20
+
21
+ # Token contract address on this chain
22
+ # @return [String]
23
+ attr_accessor :token_address
24
+
25
+ # Number of decimals used for the token
26
+ # @return [Integer]
27
+ attr_accessor :decimals
28
+
29
+ # Type of pool for this token
30
+ # @return [PoolType]
31
+ attr_accessor :pool_type
32
+
33
+ # Token pool contract address (if applicable)
34
+ # @return [String]
35
+ attr_accessor :pool_address
36
+
37
+ # A mapping from model property names to API property names.
38
+ def self.names
39
+ @_hash = {} if @_hash.nil?
40
+ @_hash['chain_id'] = 'chainId'
41
+ @_hash['chain_name'] = 'chainName'
42
+ @_hash['token_address'] = 'tokenAddress'
43
+ @_hash['decimals'] = 'decimals'
44
+ @_hash['pool_type'] = 'poolType'
45
+ @_hash['pool_address'] = 'poolAddress'
46
+ @_hash
47
+ end
48
+
49
+ # An array for optional fields
50
+ def self.optionals
51
+ []
52
+ end
53
+
54
+ # An array for nullable fields
55
+ def self.nullables
56
+ []
57
+ end
58
+
59
+ def initialize(chain_id:, chain_name:, token_address:, decimals:,
60
+ pool_type:, pool_address:, additional_properties: nil)
61
+ # Add additional model properties to the instance
62
+ additional_properties = {} if additional_properties.nil?
63
+
64
+ @chain_id = chain_id
65
+ @chain_name = chain_name
66
+ @token_address = token_address
67
+ @decimals = decimals
68
+ @pool_type = pool_type
69
+ @pool_address = pool_address
70
+ @additional_properties = additional_properties
71
+ end
72
+
73
+ # Creates an instance of the object from a hash.
74
+ def self.from_hash(hash)
75
+ return nil unless hash
76
+
77
+ # Extract variables from the hash.
78
+ chain_id = hash.key?('chainId') ? APIHelper.deserialize_union_type(
79
+ UnionTypeLookUp.get(:TokenChainInfoChainId), hash['chainId']
80
+ ) : nil
81
+ chain_name = hash.key?('chainName') ? hash['chainName'] : nil
82
+ token_address = hash.key?('tokenAddress') ? hash['tokenAddress'] : nil
83
+ decimals = hash.key?('decimals') ? hash['decimals'] : nil
84
+ pool_type = hash.key?('poolType') ? hash['poolType'] : nil
85
+ pool_address = hash.key?('poolAddress') ? hash['poolAddress'] : nil
86
+
87
+ # Create a new hash for additional properties, removing known properties.
88
+ new_hash = hash.reject { |k, _| names.value?(k) }
89
+
90
+ additional_properties = APIHelper.get_additional_properties(
91
+ new_hash, proc { |value| value }
92
+ )
93
+
94
+ # Create object from extracted values.
95
+ TokenChainInfo.new(chain_id: chain_id,
96
+ chain_name: chain_name,
97
+ token_address: token_address,
98
+ decimals: decimals,
99
+ pool_type: pool_type,
100
+ pool_address: pool_address,
101
+ additional_properties: additional_properties)
102
+ end
103
+
104
+ # Validates an instance of the object from a given value.
105
+ # @param [TokenChainInfo | Hash] The value against the validation is performed.
106
+ def self.validate(value)
107
+ if value.instance_of? self
108
+ return (
109
+ UnionTypeLookUp.get(:TokenChainInfoChainId)
110
+ .validate(value.chain_id) and
111
+ APIHelper.valid_type?(value.chain_name,
112
+ ->(val) { val.instance_of? String }) and
113
+ APIHelper.valid_type?(value.token_address,
114
+ ->(val) { val.instance_of? String }) and
115
+ APIHelper.valid_type?(value.decimals,
116
+ ->(val) { val.instance_of? Integer }) and
117
+ APIHelper.valid_type?(value.pool_type,
118
+ ->(val) { PoolType.validate(val) }) and
119
+ APIHelper.valid_type?(value.pool_address,
120
+ ->(val) { val.instance_of? String })
121
+ )
122
+ end
123
+
124
+ return false unless value.instance_of? Hash
125
+
126
+ (
127
+ UnionTypeLookUp.get(:TokenChainInfoChainId)
128
+ .validate(value['chainId']) and
129
+ APIHelper.valid_type?(value['chainName'],
130
+ ->(val) { val.instance_of? String }) and
131
+ APIHelper.valid_type?(value['tokenAddress'],
132
+ ->(val) { val.instance_of? String }) and
133
+ APIHelper.valid_type?(value['decimals'],
134
+ ->(val) { val.instance_of? Integer }) and
135
+ APIHelper.valid_type?(value['poolType'],
136
+ ->(val) { PoolType.validate(val) }) and
137
+ APIHelper.valid_type?(value['poolAddress'],
138
+ ->(val) { val.instance_of? String })
139
+ )
140
+ end
141
+
142
+ # Provides a human-readable string representation of the object.
143
+ def to_s
144
+ class_name = self.class.name.split('::').last
145
+ "<#{class_name} chain_id: #{@chain_id}, chain_name: #{@chain_name}, token_address:"\
146
+ " #{@token_address}, decimals: #{@decimals}, pool_type: #{@pool_type}, pool_address:"\
147
+ " #{@pool_address}, additional_properties: #{@additional_properties}>"
148
+ end
149
+
150
+ # Provides a debugging-friendly string with detailed object information.
151
+ def inspect
152
+ class_name = self.class.name.split('::').last
153
+ "<#{class_name} chain_id: #{@chain_id.inspect}, chain_name: #{@chain_name.inspect},"\
154
+ " token_address: #{@token_address.inspect}, decimals: #{@decimals.inspect}, pool_type:"\
155
+ " #{@pool_type.inspect}, pool_address: #{@pool_address.inspect}, additional_properties:"\
156
+ " #{@additional_properties}>"
157
+ end
158
+ end
159
+ end
@@ -0,0 +1,91 @@
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
+ # TokenConfigError Model.
8
+ class TokenConfigError < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Token symbol
13
+ # @return [String]
14
+ attr_accessor :symbol
15
+
16
+ # Reason for the configuration error
17
+ # @return [String]
18
+ attr_accessor :reason
19
+
20
+ # List of missing required fields
21
+ # @return [Array[String]]
22
+ attr_accessor :missing_fields
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['symbol'] = 'symbol'
28
+ @_hash['reason'] = 'reason'
29
+ @_hash['missing_fields'] = 'missingFields'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ []
36
+ end
37
+
38
+ # An array for nullable fields
39
+ def self.nullables
40
+ []
41
+ end
42
+
43
+ def initialize(symbol:, reason:, missing_fields:,
44
+ additional_properties: nil)
45
+ # Add additional model properties to the instance
46
+ additional_properties = {} if additional_properties.nil?
47
+
48
+ @symbol = symbol
49
+ @reason = reason
50
+ @missing_fields = missing_fields
51
+ @additional_properties = additional_properties
52
+ end
53
+
54
+ # Creates an instance of the object from a hash.
55
+ def self.from_hash(hash)
56
+ return nil unless hash
57
+
58
+ # Extract variables from the hash.
59
+ symbol = hash.key?('symbol') ? hash['symbol'] : nil
60
+ reason = hash.key?('reason') ? hash['reason'] : nil
61
+ missing_fields = hash.key?('missingFields') ? hash['missingFields'] : nil
62
+
63
+ # Create a new hash for additional properties, removing known properties.
64
+ new_hash = hash.reject { |k, _| names.value?(k) }
65
+
66
+ additional_properties = APIHelper.get_additional_properties(
67
+ new_hash, proc { |value| value }
68
+ )
69
+
70
+ # Create object from extracted values.
71
+ TokenConfigError.new(symbol: symbol,
72
+ reason: reason,
73
+ missing_fields: missing_fields,
74
+ additional_properties: additional_properties)
75
+ end
76
+
77
+ # Provides a human-readable string representation of the object.
78
+ def to_s
79
+ class_name = self.class.name.split('::').last
80
+ "<#{class_name} symbol: #{@symbol}, reason: #{@reason}, missing_fields: #{@missing_fields},"\
81
+ " additional_properties: #{@additional_properties}>"
82
+ end
83
+
84
+ # Provides a debugging-friendly string with detailed object information.
85
+ def inspect
86
+ class_name = self.class.name.split('::').last
87
+ "<#{class_name} symbol: #{@symbol.inspect}, reason: #{@reason.inspect}, missing_fields:"\
88
+ " #{@missing_fields.inspect}, additional_properties: #{@additional_properties}>"
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,99 @@
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
+ # TokenDetails Model.
8
+ class TokenDetails < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Token symbol identifier
13
+ # @return [String]
14
+ attr_accessor :symbol
15
+
16
+ # Available token lanes: source chain to array of destination chains
17
+ # @return [Hash[String, Object]]
18
+ attr_accessor :lanes
19
+
20
+ # Detailed information about the token on each chain
21
+ # @return [Array[TokenChainInfo]]
22
+ attr_accessor :chains
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['symbol'] = 'symbol'
28
+ @_hash['lanes'] = 'lanes'
29
+ @_hash['chains'] = 'chains'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ []
36
+ end
37
+
38
+ # An array for nullable fields
39
+ def self.nullables
40
+ []
41
+ end
42
+
43
+ def initialize(symbol:, lanes:, chains:, additional_properties: nil)
44
+ # Add additional model properties to the instance
45
+ additional_properties = {} if additional_properties.nil?
46
+
47
+ @symbol = symbol
48
+ @lanes = lanes
49
+ @chains = chains
50
+ @additional_properties = additional_properties
51
+ end
52
+
53
+ # Creates an instance of the object from a hash.
54
+ def self.from_hash(hash)
55
+ return nil unless hash
56
+
57
+ # Extract variables from the hash.
58
+ symbol = hash.key?('symbol') ? hash['symbol'] : nil
59
+ lanes = hash.key?('lanes') ? hash['lanes'] : nil
60
+ # Parameter is an array, so we need to iterate through it
61
+ chains = nil
62
+ unless hash['chains'].nil?
63
+ chains = []
64
+ hash['chains'].each do |structure|
65
+ chains << (TokenChainInfo.from_hash(structure) if structure)
66
+ end
67
+ end
68
+
69
+ chains = nil unless hash.key?('chains')
70
+
71
+ # Create a new hash for additional properties, removing known properties.
72
+ new_hash = hash.reject { |k, _| names.value?(k) }
73
+
74
+ additional_properties = APIHelper.get_additional_properties(
75
+ new_hash, proc { |value| value }
76
+ )
77
+
78
+ # Create object from extracted values.
79
+ TokenDetails.new(symbol: symbol,
80
+ lanes: lanes,
81
+ chains: chains,
82
+ additional_properties: additional_properties)
83
+ end
84
+
85
+ # Provides a human-readable string representation of the object.
86
+ def to_s
87
+ class_name = self.class.name.split('::').last
88
+ "<#{class_name} symbol: #{@symbol}, lanes: #{@lanes}, chains: #{@chains},"\
89
+ " additional_properties: #{@additional_properties}>"
90
+ end
91
+
92
+ # Provides a debugging-friendly string with detailed object information.
93
+ def inspect
94
+ class_name = self.class.name.split('::').last
95
+ "<#{class_name} symbol: #{@symbol.inspect}, lanes: #{@lanes.inspect}, chains:"\
96
+ " #{@chains.inspect}, additional_properties: #{@additional_properties}>"
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,119 @@
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
+ # TokenMetadata Model.
9
+ class TokenMetadata < 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 tokens ignored due to configuration issues
26
+ # @return [Integer]
27
+ attr_accessor :ignored_token_count
28
+
29
+ # Number of valid tokens in the response
30
+ # @return [Integer]
31
+ attr_accessor :valid_token_count
32
+
33
+ # A mapping from model property names to API property names.
34
+ def self.names
35
+ @_hash = {} if @_hash.nil?
36
+ @_hash['environment'] = 'environment'
37
+ @_hash['timestamp'] = 'timestamp'
38
+ @_hash['request_id'] = 'requestId'
39
+ @_hash['ignored_token_count'] = 'ignoredTokenCount'
40
+ @_hash['valid_token_count'] = 'validTokenCount'
41
+ @_hash
42
+ end
43
+
44
+ # An array for optional fields
45
+ def self.optionals
46
+ []
47
+ end
48
+
49
+ # An array for nullable fields
50
+ def self.nullables
51
+ []
52
+ end
53
+
54
+ def initialize(environment:, timestamp:, request_id:, ignored_token_count:,
55
+ valid_token_count:, additional_properties: nil)
56
+ # Add additional model properties to the instance
57
+ additional_properties = {} if additional_properties.nil?
58
+
59
+ @environment = environment
60
+ @timestamp = timestamp
61
+ @request_id = request_id
62
+ @ignored_token_count = ignored_token_count
63
+ @valid_token_count = valid_token_count
64
+ @additional_properties = additional_properties
65
+ end
66
+
67
+ # Creates an instance of the object from a hash.
68
+ def self.from_hash(hash)
69
+ return nil unless hash
70
+
71
+ # Extract variables from the hash.
72
+ environment = hash.key?('environment') ? hash['environment'] : nil
73
+ timestamp = if hash.key?('timestamp')
74
+ (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
75
+ end
76
+ request_id = hash.key?('requestId') ? hash['requestId'] : nil
77
+ ignored_token_count =
78
+ hash.key?('ignoredTokenCount') ? hash['ignoredTokenCount'] : nil
79
+ valid_token_count =
80
+ hash.key?('validTokenCount') ? hash['validTokenCount'] : nil
81
+
82
+ # Create a new hash for additional properties, removing known properties.
83
+ new_hash = hash.reject { |k, _| names.value?(k) }
84
+
85
+ additional_properties = APIHelper.get_additional_properties(
86
+ new_hash, proc { |value| value }
87
+ )
88
+
89
+ # Create object from extracted values.
90
+ TokenMetadata.new(environment: environment,
91
+ timestamp: timestamp,
92
+ request_id: request_id,
93
+ ignored_token_count: ignored_token_count,
94
+ valid_token_count: valid_token_count,
95
+ additional_properties: additional_properties)
96
+ end
97
+
98
+ def to_custom_timestamp
99
+ DateTimeHelper.to_rfc3339(timestamp)
100
+ end
101
+
102
+ # Provides a human-readable string representation of the object.
103
+ def to_s
104
+ class_name = self.class.name.split('::').last
105
+ "<#{class_name} environment: #{@environment}, timestamp: #{@timestamp}, request_id:"\
106
+ " #{@request_id}, ignored_token_count: #{@ignored_token_count}, valid_token_count:"\
107
+ " #{@valid_token_count}, additional_properties: #{@additional_properties}>"
108
+ end
109
+
110
+ # Provides a debugging-friendly string with detailed object information.
111
+ def inspect
112
+ class_name = self.class.name.split('::').last
113
+ "<#{class_name} environment: #{@environment.inspect}, timestamp: #{@timestamp.inspect},"\
114
+ " request_id: #{@request_id.inspect}, ignored_token_count: #{@ignored_token_count.inspect},"\
115
+ " valid_token_count: #{@valid_token_count.inspect}, additional_properties:"\
116
+ " #{@additional_properties}>"
117
+ end
118
+ end
119
+ end
@@ -0,0 +1,11 @@
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
+ # A utility that supports dateTime conversion to different formats
9
+ class DateTimeHelper < CoreLibrary::DateTimeHelper
10
+ end
11
+ end
@@ -1,9 +1,9 @@
1
- # swagger_petstore_open_api30
1
+ # ccip_directory_and_configuration_rest_api_v1
2
2
  #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
3
+ # This file was automatically
4
+ # generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstoreOpenApi30
6
+ module CcipDirectoryAndConfigurationRestApiV1
7
7
  # A utility to allow users to set the content-type for files
8
8
  class FileWrapper < CoreLibrary::FileWrapper
9
9
  # The constructor.