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
@@ -1,43 +1,45 @@
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
  # An enum for SDK environments.
8
8
  class Environment
9
+ # PRODUCTION: Production server
10
+ # ENVIRONMENT2: Development server
9
11
  ENVIRONMENT = [
10
- PRODUCTION = 'production'.freeze
12
+ PRODUCTION = 'production'.freeze,
13
+ ENVIRONMENT2 = 'environment2'.freeze
11
14
  ].freeze
12
15
 
13
16
  # Converts a string or symbol into a valid Environment constant.
14
17
  def self.from_value(value, default_value = PRODUCTION)
15
18
  return default_value if value.nil?
16
19
 
17
- default_value
20
+ str = value.to_s.strip.downcase
21
+ case str
22
+ when 'production' then PRODUCTION
23
+ when 'environment2' then ENVIRONMENT2
24
+
25
+ else
26
+ warn "[Environment] Unknown environment '#{value}', falling back to #{default_value} "
27
+ default_value
28
+ end
18
29
  end
19
30
  end
20
31
 
21
32
  # An enum for API servers.
22
33
  class Server
23
34
  SERVER = [
24
- DEFAULT = 'default'.freeze,
25
- AUTH_SERVER = 'auth server'.freeze
35
+ DEFAULT = 'default'.freeze
26
36
  ].freeze
27
37
 
28
38
  # Converts a string or symbol into a valid Server constant.
29
39
  def self.from_value(value, default_value = DEFAULT)
30
40
  return default_value if value.nil?
31
41
 
32
- str = value.to_s.strip.downcase
33
- case str
34
- when 'default' then DEFAULT
35
- when 'auth_server' then AUTH_SERVER
36
-
37
- else
38
- warn "[Server] Unknown server '#{value}', falling back to #{default_value} "
39
- default_value
40
- end
42
+ default_value
41
43
  end
42
44
  end
43
45
 
@@ -45,7 +47,7 @@ module SwaggerPetstoreOpenApi30
45
47
  # are configured in this class.
46
48
  class Configuration < CoreLibrary::HttpClientConfiguration
47
49
  # The attribute readers for properties.
48
- attr_reader :environment, :petstore_auth_credentials, :api_key_credentials
50
+ attr_reader :environment
49
51
 
50
52
  class << self
51
53
  attr_reader :environments
@@ -56,8 +58,7 @@ module SwaggerPetstoreOpenApi30
56
58
  max_retries: 0, retry_interval: 1, backoff_factor: 2,
57
59
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
58
60
  retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
59
- logging_configuration: nil, environment: Environment::PRODUCTION,
60
- petstore_auth_credentials: nil, api_key_credentials: nil
61
+ logging_configuration: nil, environment: Environment::PRODUCTION
61
62
  )
62
63
  super connection: connection, adapter: adapter, timeout: timeout,
63
64
  max_retries: max_retries, retry_interval: retry_interval,
@@ -69,12 +70,6 @@ module SwaggerPetstoreOpenApi30
69
70
  # Current API environment
70
71
  @environment = String(environment)
71
72
 
72
- # The object holding OAuth 2 Implicit Grant credentials
73
- @petstore_auth_credentials = petstore_auth_credentials
74
-
75
- # The object holding Custom Header Signature credentials
76
- @api_key_credentials = api_key_credentials
77
-
78
73
  # The Http Client to use for making requests.
79
74
  set_http_client CoreLibrary::FaradayClient.new(self)
80
75
  end
@@ -83,8 +78,7 @@ module SwaggerPetstoreOpenApi30
83
78
  max_retries: nil, retry_interval: nil, backoff_factor: nil,
84
79
  retry_statuses: nil, retry_methods: nil, http_callback: nil,
85
80
  proxy_settings: nil, logging_configuration: nil,
86
- environment: nil, petstore_auth_credentials: nil,
87
- api_key_credentials: nil)
81
+ environment: nil)
88
82
  connection ||= self.connection
89
83
  adapter ||= self.adapter
90
84
  timeout ||= self.timeout
@@ -97,8 +91,6 @@ module SwaggerPetstoreOpenApi30
97
91
  proxy_settings ||= self.proxy_settings
98
92
  logging_configuration ||= self.logging_configuration
99
93
  environment ||= self.environment
100
- petstore_auth_credentials ||= self.petstore_auth_credentials
101
- api_key_credentials ||= self.api_key_credentials
102
94
 
103
95
  Configuration.new(connection: connection, adapter: adapter,
104
96
  timeout: timeout, max_retries: max_retries,
@@ -109,17 +101,17 @@ module SwaggerPetstoreOpenApi30
109
101
  http_callback: http_callback,
110
102
  proxy_settings: proxy_settings,
111
103
  logging_configuration: logging_configuration,
112
- environment: environment,
113
- petstore_auth_credentials: petstore_auth_credentials,
114
- api_key_credentials: api_key_credentials)
104
+ environment: environment)
115
105
  end
116
106
 
117
107
 
118
108
  # All the environments the SDK can run in.
119
109
  ENVIRONMENTS = {
120
110
  Environment::PRODUCTION => {
121
- Server::DEFAULT => 'https://petstore3.swagger.io/api/v3',
122
- Server::AUTH_SERVER => 'https://petstore3.swagger.io/oauth'
111
+ Server::DEFAULT => 'https://docs.chain.link/api/ccip/v1'
112
+ },
113
+ Environment::ENVIRONMENT2 => {
114
+ Server::DEFAULT => 'http://localhost:4321/api/ccip/v1'
123
115
  }
124
116
  }.freeze
125
117
 
@@ -153,10 +145,6 @@ module SwaggerPetstoreOpenApi30
153
145
  item.match?(/\A\d+\z/) ? item.to_i : item.downcase
154
146
  end
155
147
 
156
- # === Authentication credentials ===
157
- petstore_auth_credentials = PetstoreAuthCredentials.from_env
158
- api_key_credentials = ApiKeyCredentials.from_env
159
-
160
148
  # === Proxy settings ===
161
149
  proxy_settings = ProxySettings.from_env
162
150
  # === Logging Configuration ===
@@ -170,8 +158,6 @@ module SwaggerPetstoreOpenApi30
170
158
  backoff_factor: backoff_factor,
171
159
  retry_statuses: retry_statuses,
172
160
  retry_methods: retry_methods,
173
- petstore_auth_credentials: petstore_auth_credentials,
174
- api_key_credentials: api_key_credentials,
175
161
  proxy_settings: proxy_settings,
176
162
  logging_configuration: logging_configuration
177
163
  )
@@ -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
  # Class for exceptions when there is a network error, status code error, etc.
8
8
  class APIException < CoreLibrary::ApiException
9
9
  # Provides a human-readable string representation of the object.
@@ -0,0 +1,57 @@
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
+ # ErrorResponse class.
8
+ class ErrorResponseException < APIException
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Error type identifier
13
+ # @return [String]
14
+ attr_accessor :error
15
+
16
+ # Human-readable error message
17
+ # @return [String]
18
+ attr_accessor :message
19
+
20
+ # Unique identifier for the request, useful for debugging and support
21
+ # @return [UUID | String]
22
+ attr_accessor :request_id
23
+
24
+ # The constructor.
25
+ # @param [String] reason The reason for raising an exception.
26
+ # @param [HttpResponse] response The HttpReponse of the API call.
27
+ def initialize(reason, response)
28
+ super(reason, response)
29
+ hash = APIHelper.json_deserialize(@response.raw_body)
30
+ unbox(hash)
31
+ end
32
+
33
+ # Populates this object by extracting properties from a hash.
34
+ # @param [Hash] hash The deserialized response sent by the server in the
35
+ # response body.
36
+ def unbox(hash)
37
+ return nil unless hash
38
+
39
+ @error = hash.key?('error') ? hash['error'] : nil
40
+ @message = hash.key?('message') ? hash['message'] : nil
41
+ @request_id = hash.key?('requestId') ? hash['requestId'] : SKIP
42
+ end
43
+
44
+ # Provides a human-readable string representation of the object.
45
+ def to_s
46
+ class_name = self.class.name.split('::').last
47
+ "<#{class_name} error: #{@error}, message: #{@message}, request_id: #{@request_id}>"
48
+ end
49
+
50
+ # Provides a debugging-friendly string with detailed object information.
51
+ def inspect
52
+ class_name = self.class.name.split('::').last
53
+ "<#{class_name} error: #{@error.inspect}, message: #{@message.inspect}, request_id:"\
54
+ " #{@request_id.inspect}>"
55
+ end
56
+ end
57
+ 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
  # Http response received.
8
8
  class ApiResponse < CoreLibrary::ApiResponse
9
9
  # The constructor
@@ -0,0 +1,10 @@
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
+ # HttpCallBack allows defining callables for pre and post API calls.
8
+ class HttpCallBack < CoreLibrary::HttpCallback
9
+ end
10
+ end
@@ -0,0 +1,10 @@
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
+ # HTTP Methods Enumeration.
8
+ class HttpMethodEnum < CoreLibrary::HttpMethod
9
+ end
10
+ end
@@ -0,0 +1,10 @@
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
+ # Represents a single Http Request.
8
+ class HttpRequest < CoreLibrary::HttpRequest
9
+ end
10
+ end
@@ -0,0 +1,10 @@
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
+ # Http response received.
8
+ class HttpResponse < CoreLibrary::HttpResponse
9
+ end
10
+ 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
  ##
8
8
  # ProxySettings encapsulates HTTP proxy configuration for Faraday,
9
9
  # including optional basic authentication.
@@ -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
  # Initializes a new instance of RequestLoggingConfiguration.
8
8
  class RequestLoggingConfiguration < CoreLibrary::ApiRequestLoggingConfiguration
9
9
  # @param log_body [Boolean] Indicates whether the message body should be logged. Default is false.
@@ -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
  # Represents the generic logger facade
8
8
  class AbstractLogger < Logger
9
9
  # Logs a message with a specified log level and additional parameters.
@@ -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
  # Base model.
8
8
  # rubocop:disable all
9
9
  class BaseModel < CoreLibrary::BaseModel
@@ -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
+ # ChainApiResponse Model.
8
+ class ChainApiResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [ChainMetadata]
14
+ attr_accessor :metadata
15
+
16
+ # Chain details grouped by chain family
17
+ # @return [Data]
18
+ attr_accessor :data
19
+
20
+ # List of chains that could not be configured
21
+ # @return [Array[ChainConfigError]]
22
+ attr_accessor :ignored
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['metadata'] = 'metadata'
28
+ @_hash['data'] = 'data'
29
+ @_hash['ignored'] = 'ignored'
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(metadata:, data:, ignored:, additional_properties: nil)
44
+ # Add additional model properties to the instance
45
+ additional_properties = {} if additional_properties.nil?
46
+
47
+ @metadata = metadata
48
+ @data = data
49
+ @ignored = ignored
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
+ metadata = ChainMetadata.from_hash(hash['metadata']) if hash['metadata']
59
+ data = Data.from_hash(hash['data']) if hash['data']
60
+ # Parameter is an array, so we need to iterate through it
61
+ ignored = nil
62
+ unless hash['ignored'].nil?
63
+ ignored = []
64
+ hash['ignored'].each do |structure|
65
+ ignored << (ChainConfigError.from_hash(structure) if structure)
66
+ end
67
+ end
68
+
69
+ ignored = nil unless hash.key?('ignored')
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
+ ChainApiResponse.new(metadata: metadata,
80
+ data: data,
81
+ ignored: ignored,
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} metadata: #{@metadata}, data: #{@data}, ignored: #{@ignored},"\
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} metadata: #{@metadata.inspect}, data: #{@data.inspect}, ignored:"\
96
+ " #{@ignored.inspect}, additional_properties: #{@additional_properties}>"
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,100 @@
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
+ # ChainConfigError Model.
8
+ class ChainConfigError < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Chain ID of the failed configuration
13
+ # @return [Integer]
14
+ attr_accessor :chain_id
15
+
16
+ # Network identifier of the failed configuration
17
+ # @return [String]
18
+ attr_accessor :network_id
19
+
20
+ # Reason for the configuration failure
21
+ # @return [String]
22
+ attr_accessor :reason
23
+
24
+ # List of missing required fields
25
+ # @return [Array[String]]
26
+ attr_accessor :missing_fields
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['chain_id'] = 'chainId'
32
+ @_hash['network_id'] = 'networkId'
33
+ @_hash['reason'] = 'reason'
34
+ @_hash['missing_fields'] = 'missingFields'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ []
41
+ end
42
+
43
+ # An array for nullable fields
44
+ def self.nullables
45
+ []
46
+ end
47
+
48
+ def initialize(chain_id:, network_id:, reason:, missing_fields:,
49
+ additional_properties: nil)
50
+ # Add additional model properties to the instance
51
+ additional_properties = {} if additional_properties.nil?
52
+
53
+ @chain_id = chain_id
54
+ @network_id = network_id
55
+ @reason = reason
56
+ @missing_fields = missing_fields
57
+ @additional_properties = additional_properties
58
+ end
59
+
60
+ # Creates an instance of the object from a hash.
61
+ def self.from_hash(hash)
62
+ return nil unless hash
63
+
64
+ # Extract variables from the hash.
65
+ chain_id = hash.key?('chainId') ? hash['chainId'] : nil
66
+ network_id = hash.key?('networkId') ? hash['networkId'] : nil
67
+ reason = hash.key?('reason') ? hash['reason'] : nil
68
+ missing_fields = hash.key?('missingFields') ? hash['missingFields'] : nil
69
+
70
+ # Create a new hash for additional properties, removing known properties.
71
+ new_hash = hash.reject { |k, _| names.value?(k) }
72
+
73
+ additional_properties = APIHelper.get_additional_properties(
74
+ new_hash, proc { |value| value }
75
+ )
76
+
77
+ # Create object from extracted values.
78
+ ChainConfigError.new(chain_id: chain_id,
79
+ network_id: network_id,
80
+ reason: reason,
81
+ missing_fields: missing_fields,
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} chain_id: #{@chain_id}, network_id: #{@network_id}, reason: #{@reason},"\
89
+ " missing_fields: #{@missing_fields}, 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} chain_id: #{@chain_id.inspect}, network_id: #{@network_id.inspect}, reason:"\
96
+ " #{@reason.inspect}, missing_fields: #{@missing_fields.inspect}, additional_properties:"\
97
+ " #{@additional_properties}>"
98
+ end
99
+ end
100
+ end