sdksio-apimatic-sdk 3.0.0 → 3.0.1
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.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +165 -77
- data/bin/console +15 -0
- data/lib/apimatic_api/api_helper.rb +10 -10
- data/lib/apimatic_api/client.rb +108 -96
- data/lib/apimatic_api/configuration.rb +198 -125
- data/lib/apimatic_api/controllers/api_validation_external_apis_controller.rb +90 -84
- data/lib/apimatic_api/controllers/api_validation_v2_external_apis_controller.rb +89 -0
- data/lib/apimatic_api/controllers/base_controller.rb +55 -66
- data/lib/apimatic_api/controllers/code_generation_external_apis_controller.rb +201 -178
- data/lib/apimatic_api/controllers/docs_portal_generation_async_controller.rb +110 -0
- data/lib/apimatic_api/controllers/docs_portal_management_controller.rb +56 -198
- data/lib/apimatic_api/controllers/sdk_generation_async_controller.rb +112 -0
- data/lib/apimatic_api/controllers/transformation_controller.rb +180 -174
- data/lib/apimatic_api/exceptions/api_exception.rb +21 -10
- data/lib/apimatic_api/exceptions/bad_request_response_sdk_exception.rb +46 -0
- data/lib/apimatic_api/exceptions/internal_server_error_response_exception.rb +46 -0
- data/lib/apimatic_api/exceptions/problem_details_exception.rb +74 -0
- data/lib/apimatic_api/exceptions/unauthorized_response_exception.rb +46 -0
- data/lib/apimatic_api/http/api_response.rb +19 -0
- data/lib/apimatic_api/http/auth/custom_header_authentication.rb +48 -38
- data/lib/apimatic_api/http/http_call_back.rb +10 -10
- data/lib/apimatic_api/http/http_method_enum.rb +10 -10
- data/lib/apimatic_api/http/http_request.rb +10 -10
- data/lib/apimatic_api/http/http_response.rb +10 -10
- data/lib/apimatic_api/http/proxy_settings.rb +22 -0
- data/lib/apimatic_api/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/apimatic_api/logging/sdk_logger.rb +17 -0
- data/lib/apimatic_api/models/accept.rb +26 -0
- data/lib/apimatic_api/models/api_validation_summary.rb +100 -75
- data/lib/apimatic_api/models/base_model.rb +110 -62
- data/lib/apimatic_api/models/content_type.rb +26 -0
- data/lib/apimatic_api/models/export_formats.rb +85 -60
- data/lib/apimatic_api/models/generate_sdk_via_url_request.rb +85 -59
- data/lib/apimatic_api/models/line_info.rb +105 -0
- data/lib/apimatic_api/models/links.rb +82 -0
- data/lib/apimatic_api/models/platforms.rb +57 -39
- data/lib/apimatic_api/models/portal_generation_async_response.rb +68 -0
- data/lib/apimatic_api/models/portal_generation_status_response.rb +70 -0
- data/lib/apimatic_api/models/sdk_generation_async_response.rb +68 -0
- data/lib/apimatic_api/models/sdk_generation_status_response.rb +70 -0
- data/lib/apimatic_api/models/sdk_languages.rb +56 -0
- data/lib/apimatic_api/models/status.rb +48 -0
- data/lib/apimatic_api/models/transform_via_url_request.rb +85 -60
- data/lib/apimatic_api/models/transformation.rb +180 -152
- data/lib/apimatic_api/models/user_code_generation.rb +167 -140
- data/lib/apimatic_api/models/validate_api_result.rb +82 -0
- data/lib/apimatic_api/models/validation_entry.rb +143 -0
- data/lib/apimatic_api/models/validation_summary.rb +145 -0
- data/lib/apimatic_api/utilities/date_time_helper.rb +11 -11
- data/lib/apimatic_api/utilities/file_wrapper.rb +28 -16
- data/lib/apimatic_api.rb +79 -86
- metadata +39 -89
- data/lib/apimatic_api/controllers/api_validation_imported_apis_controller.rb +0 -74
- data/lib/apimatic_api/controllers/apis_management_controller.rb +0 -260
- data/lib/apimatic_api/controllers/code_generation_imported_apis_controller.rb +0 -136
- data/lib/apimatic_api/models/api_entity.rb +0 -220
- data/lib/apimatic_api/models/api_entity_code_generation.rb +0 -131
- data/lib/apimatic_api/models/api_entity_identifier.rb +0 -48
- data/lib/apimatic_api/models/attributes.rb +0 -48
- data/lib/apimatic_api/models/auth_scope.rb +0 -75
- data/lib/apimatic_api/models/authentication.rb +0 -112
- data/lib/apimatic_api/models/code_gen_settings.rb +0 -541
- data/lib/apimatic_api/models/code_generation.rb +0 -122
- data/lib/apimatic_api/models/docs_validation_summary.rb +0 -75
- data/lib/apimatic_api/models/endpoints_group.rb +0 -57
- data/lib/apimatic_api/models/environment.rb +0 -79
- data/lib/apimatic_api/models/field.rb +0 -156
- data/lib/apimatic_api/models/generate_on_prem_portal_via_build_input_request_body.rb +0 -48
- data/lib/apimatic_api/models/generate_sdk_via_file_request_body.rb +0 -61
- data/lib/apimatic_api/models/import_api_version_via_url_request.rb +0 -64
- data/lib/apimatic_api/models/import_api_via_file_request_body.rb +0 -51
- data/lib/apimatic_api/models/import_api_via_url_request.rb +0 -49
- data/lib/apimatic_api/models/import_new_api_version_via_file_request_body.rb +0 -66
- data/lib/apimatic_api/models/import_validation_summary.rb +0 -75
- data/lib/apimatic_api/models/inplace_api_import_binary_file.rb +0 -51
- data/lib/apimatic_api/models/inplace_import_api_via_url_request.rb +0 -49
- data/lib/apimatic_api/models/meta_data.rb +0 -70
- data/lib/apimatic_api/models/parameter.rb +0 -165
- data/lib/apimatic_api/models/paramter_format_details.rb +0 -48
- data/lib/apimatic_api/models/platforms_template.rb +0 -49
- data/lib/apimatic_api/models/server.rb +0 -69
- data/lib/apimatic_api/models/server_configuration.rb +0 -105
- data/lib/apimatic_api/models/test_gen_settings.rb +0 -70
- data/lib/apimatic_api/models/transform_via_file_request_body.rb +0 -61
- data/lib/apimatic_api/models/user_code_generation_requirements.rb +0 -57
- data/lib/apimatic_api/models/validate_api_via_file_request_body.rb +0 -51
- data/test/controllers/controller_test_base.rb +0 -29
- data/test/controllers/test_api_validation_external_apis_controller.rb +0 -144
- data/test/controllers/test_api_validation_imported_apis_controller.rb +0 -2971
- data/test/controllers/test_code_generation_external_apis_controller.rb +0 -32
- data/test/controllers/test_docs_portal_management_controller.rb +0 -94
- data/test/controllers/test_transformation_controller.rb +0 -32
- data/test/http_response_catcher.rb +0 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8129eb3385df7f8066e51031ece95d07e22a0d2afb1aa2dfaa1b112283e998df
|
|
4
|
+
data.tar.gz: 0c34e9abaf8f7a0bc49fab7eba8670ab8d471fd5f9270d3a418de221e81470a8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cb16204712f10ff483a1bea2f45f4d1ddab16d123eb18172ff5074e3833ba8c4aac2af9bf15300813976a43ee779227adb422d189c0ff4459ec63cb980bbb350
|
|
7
|
+
data.tar.gz: a356db56d011becdb19e688525b1972aa1453644b648a1ecf6ee79110d8ddb30210c45eb2642616b420b98c119b152b068b586e0d92a6bb7ab3884866d6e247c
|
data/LICENSE
CHANGED
|
@@ -3,7 +3,7 @@ License:
|
|
|
3
3
|
The MIT License (MIT)
|
|
4
4
|
http://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
|
-
Copyright (c) 2014 -
|
|
6
|
+
Copyright (c) 2014 - 2026 APIMATIC Limited
|
|
7
7
|
|
|
8
8
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
9
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
|
@@ -1,82 +1,170 @@
|
|
|
1
|
-
|
|
2
|
-
# Getting Started with Apimatic API
|
|
3
|
-
|
|
4
|
-
## Introduction
|
|
5
|
-
|
|
6
|
-
This API gives you programmatic access to APIMatic's Code Generation, Docs Generation and Transformation Engine
|
|
7
|
-
|
|
8
|
-
## Install the Package
|
|
9
|
-
|
|
10
|
-
Install the gem from the command line:
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
gem install sdksio-apimatic-sdk -v 3.0.
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Or add the gem to your Gemfile and run `bundle`:
|
|
17
|
-
|
|
18
|
-
```ruby
|
|
19
|
-
gem 'sdksio-apimatic-sdk', '3.0.
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
For additional gem details, see the [RubyGems page for the sdksio-apimatic-sdk gem](https://rubygems.org/gems/sdksio-apimatic-sdk/versions/3.0.
|
|
23
|
-
|
|
24
|
-
##
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
|
|
1
|
+
|
|
2
|
+
# Getting Started with Apimatic API
|
|
3
|
+
|
|
4
|
+
## Introduction
|
|
5
|
+
|
|
6
|
+
This API gives you programmatic access to APIMatic's Code Generation, Docs Generation and Transformation Engine
|
|
7
|
+
|
|
8
|
+
## Install the Package
|
|
9
|
+
|
|
10
|
+
Install the gem from the command line:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
gem install sdksio-apimatic-sdk -v 3.0.1
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Or add the gem to your Gemfile and run `bundle`:
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
gem 'sdksio-apimatic-sdk', '3.0.1'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For additional gem details, see the [RubyGems page for the sdksio-apimatic-sdk gem](https://rubygems.org/gems/sdksio-apimatic-sdk/versions/3.0.1).
|
|
23
|
+
|
|
24
|
+
## IRB Console Usage
|
|
25
|
+
|
|
26
|
+
You can explore the SDK interactively using IRB in two ways
|
|
27
|
+
|
|
28
|
+
### 1. Use IRB with Installed Gem
|
|
29
|
+
|
|
30
|
+
Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and type the following command to start the irb console.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
irb
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Now you can load the SDK in the IRB
|
|
37
|
+
|
|
38
|
+
```ruby
|
|
39
|
+
require 'apimatic_api'
|
|
40
|
+
include ApimaticApi
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 2. Use IRB within SDK
|
|
44
|
+
|
|
45
|
+
Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and navigate to the root folder of SDK.
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
cd path/to/apimatic_api
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Now you can start the preconfigured irb console by running the following command
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
ruby bin/console
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**_Note:_** This automatically loads the SDK from lib/
|
|
58
|
+
|
|
59
|
+
## Initialize the API Client
|
|
60
|
+
|
|
61
|
+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/client.md)
|
|
62
|
+
|
|
63
|
+
The following parameters are configurable for the API Client:
|
|
64
|
+
|
|
65
|
+
| Parameter | Type | Description |
|
|
66
|
+
| --- | --- | --- |
|
|
67
|
+
| user_agent | `String` | |
|
|
68
|
+
| custom_url | `String` | The testing domain for the API<br>*Default*: `'https://localhost:44301/api'` |
|
|
69
|
+
| environment | [`Environment`](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/README.md#environments) | The API environment. <br> **Default: `Environment.PRODUCTION`** |
|
|
70
|
+
| connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
|
|
71
|
+
| adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
|
|
72
|
+
| timeout | `Float` | The value to use for connection timeout. <br> **Default: 30** |
|
|
73
|
+
| max_retries | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
|
|
74
|
+
| retry_interval | `Float` | Pause in seconds between retries. <br> **Default: 1** |
|
|
75
|
+
| backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
|
|
76
|
+
| retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
|
77
|
+
| retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
|
|
78
|
+
| http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
|
|
79
|
+
| proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
|
|
80
|
+
| logging_configuration | [`LoggingConfiguration`](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/logging-configuration.md) | The SDK logging configuration for API calls |
|
|
81
|
+
| custom_header_authentication_credentials | [`CustomHeaderAuthenticationCredentials`](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/auth/custom-header-signature.md) | The credential object for Custom Header Signature |
|
|
82
|
+
|
|
83
|
+
The API client can be initialized as follows:
|
|
84
|
+
|
|
85
|
+
### Code-Based Client Initialization
|
|
86
|
+
|
|
87
|
+
```ruby
|
|
88
|
+
require 'apimatic_api'
|
|
89
|
+
include ApimaticApi
|
|
90
|
+
|
|
91
|
+
client = Client.new(
|
|
92
|
+
user_agent: 'user-agent',
|
|
55
93
|
custom_header_authentication_credentials: CustomHeaderAuthenticationCredentials.new(
|
|
56
94
|
authorization: 'Authorization'
|
|
95
|
+
),
|
|
96
|
+
environment: Environment::PRODUCTION,
|
|
97
|
+
custom_url: 'https://localhost:44301/api',
|
|
98
|
+
logging_configuration: LoggingConfiguration.new(
|
|
99
|
+
log_level: Logger::INFO,
|
|
100
|
+
request_logging_config: RequestLoggingConfiguration.new(
|
|
101
|
+
log_body: true
|
|
102
|
+
),
|
|
103
|
+
response_logging_config: ResponseLoggingConfiguration.new(
|
|
104
|
+
log_headers: true
|
|
105
|
+
)
|
|
57
106
|
)
|
|
58
|
-
)
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
107
|
+
)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Environment-Based Client Initialization
|
|
111
|
+
|
|
112
|
+
```ruby
|
|
113
|
+
require 'apimatic_api'
|
|
114
|
+
include ApimaticApi
|
|
115
|
+
|
|
116
|
+
# Create client from environment
|
|
117
|
+
client = Client.from_env
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/environment-based-client-initialization.md) section for details.
|
|
121
|
+
|
|
122
|
+
## Environments
|
|
123
|
+
|
|
124
|
+
The SDK can be configured to use a different environment for making API calls. Available environments are:
|
|
125
|
+
|
|
126
|
+
### Fields
|
|
127
|
+
|
|
128
|
+
| Name | Description |
|
|
129
|
+
| --- | --- |
|
|
130
|
+
| PRODUCTION | **Default** |
|
|
131
|
+
| TESTING | - |
|
|
132
|
+
|
|
133
|
+
## Authorization
|
|
134
|
+
|
|
63
135
|
This API uses the following authentication schemes.
|
|
64
136
|
|
|
65
|
-
* [`Authorization (Custom Header Signature)`](
|
|
66
|
-
|
|
67
|
-
## List of APIs
|
|
68
|
-
|
|
69
|
-
* [APIs
|
|
70
|
-
* [
|
|
71
|
-
* [
|
|
72
|
-
* [
|
|
73
|
-
* [API Validation-
|
|
74
|
-
* [
|
|
75
|
-
* [Transformation](doc/controllers/transformation.md)
|
|
76
|
-
|
|
77
|
-
##
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
* [
|
|
82
|
-
|
|
137
|
+
* [`Authorization (Custom Header Signature)`](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/auth/custom-header-signature.md)
|
|
138
|
+
|
|
139
|
+
## List of APIs
|
|
140
|
+
|
|
141
|
+
* [Code Generation-External APIs](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/controllers/code-generation-external-apis.md)
|
|
142
|
+
* [Docs Portal Management](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/controllers/docs-portal-management.md)
|
|
143
|
+
* [Docs Portal Generation-Async](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/controllers/docs-portal-generation-async.md)
|
|
144
|
+
* [API Validation-External APIs](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/controllers/api-validation-external-apis.md)
|
|
145
|
+
* [API Validation V2-External APIs](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/controllers/api-validation-v2-external-apis.md)
|
|
146
|
+
* [SDK Generation-Async](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/controllers/sdk-generation-async.md)
|
|
147
|
+
* [Transformation](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/controllers/transformation.md)
|
|
148
|
+
|
|
149
|
+
## SDK Infrastructure
|
|
150
|
+
|
|
151
|
+
### Configuration
|
|
152
|
+
|
|
153
|
+
* [ProxySettings](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/proxy-settings.md)
|
|
154
|
+
* [Environment-Based Client Initialization](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/environment-based-client-initialization.md)
|
|
155
|
+
* [AbstractLogger](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/abstract-logger.md)
|
|
156
|
+
* [LoggingConfiguration](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/logging-configuration.md)
|
|
157
|
+
* [RequestLoggingConfiguration](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/request-logging-configuration.md)
|
|
158
|
+
* [ResponseLoggingConfiguration](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/response-logging-configuration.md)
|
|
159
|
+
|
|
160
|
+
### HTTP
|
|
161
|
+
|
|
162
|
+
* [HttpResponse](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/http-response.md)
|
|
163
|
+
* [HttpRequest](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/http-request.md)
|
|
164
|
+
|
|
165
|
+
### Utilities
|
|
166
|
+
|
|
167
|
+
* [ApiResponse](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/api-response.md)
|
|
168
|
+
* [ApiHelper](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/api-helper.md)
|
|
169
|
+
* [DateTimeHelper](https://www.github.com/sdks-io/apimatic-ruby-sdk/tree/3.0.1/doc/date-time-helper.md)
|
|
170
|
+
|
data/bin/console
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# Load the lib folder into Ruby's load path
|
|
4
|
+
$LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
|
|
5
|
+
|
|
6
|
+
# Require the gem
|
|
7
|
+
require 'apimatic_api'
|
|
8
|
+
|
|
9
|
+
puts 'ApimaticApi SDK loaded!'
|
|
10
|
+
puts 'You can now create a client with: client = ApimaticApi::Client.new'
|
|
11
|
+
puts 'Or use from_env: client = ApimaticApi::Client.from_env'
|
|
12
|
+
|
|
13
|
+
# Start an interactive IRB session
|
|
14
|
+
require 'irb'
|
|
15
|
+
IRB.start
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# apimatic_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
module ApimaticApi
|
|
7
|
-
# API utility class
|
|
8
|
-
class APIHelper < CoreLibrary::ApiHelper
|
|
9
|
-
end
|
|
10
|
-
end
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# API utility class
|
|
8
|
+
class APIHelper < CoreLibrary::ApiHelper
|
|
9
|
+
end
|
|
10
|
+
end
|
data/lib/apimatic_api/client.rb
CHANGED
|
@@ -1,96 +1,108 @@
|
|
|
1
|
-
# apimatic_api
|
|
2
|
-
#
|
|
3
|
-
# This file was automatically generated by APIMATIC
|
|
4
|
-
#
|
|
5
|
-
|
|
6
|
-
module ApimaticApi
|
|
7
|
-
# apimatic_api client class.
|
|
8
|
-
class Client
|
|
9
|
-
include CoreLibrary
|
|
10
|
-
attr_reader :config, :auth_managers
|
|
11
|
-
|
|
12
|
-
# Access to
|
|
13
|
-
# @return [
|
|
14
|
-
def
|
|
15
|
-
@
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# Access to
|
|
19
|
-
# @return [
|
|
20
|
-
def
|
|
21
|
-
@
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
# Access to
|
|
25
|
-
# @return [
|
|
26
|
-
def
|
|
27
|
-
@
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# Access to
|
|
31
|
-
# @return [
|
|
32
|
-
def
|
|
33
|
-
@
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# Access to
|
|
37
|
-
# @return [
|
|
38
|
-
def
|
|
39
|
-
@
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
# Access to
|
|
43
|
-
# @return [
|
|
44
|
-
def
|
|
45
|
-
@
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# Access to
|
|
49
|
-
# @return [
|
|
50
|
-
def
|
|
51
|
-
@
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def initialize(
|
|
55
|
-
connection: nil, adapter: :net_http_persistent, timeout:
|
|
56
|
-
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
|
57
|
-
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524
|
|
58
|
-
retry_methods: %i[get put
|
|
59
|
-
environment: Environment::PRODUCTION,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
1
|
+
# apimatic_api
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ApimaticApi
|
|
7
|
+
# apimatic_api client class.
|
|
8
|
+
class Client
|
|
9
|
+
include CoreLibrary
|
|
10
|
+
attr_reader :config, :auth_managers
|
|
11
|
+
|
|
12
|
+
# Access to code_generation_external_apis controller.
|
|
13
|
+
# @return [CodeGenerationExternalApisController] Returns the controller instance.
|
|
14
|
+
def code_generation_external_apis
|
|
15
|
+
@code_generation_external_apis ||= CodeGenerationExternalApisController.new @global_configuration
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Access to transformation controller.
|
|
19
|
+
# @return [TransformationController] Returns the controller instance.
|
|
20
|
+
def transformation
|
|
21
|
+
@transformation ||= TransformationController.new @global_configuration
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Access to docs_portal_management controller.
|
|
25
|
+
# @return [DocsPortalManagementController] Returns the controller instance.
|
|
26
|
+
def docs_portal_management
|
|
27
|
+
@docs_portal_management ||= DocsPortalManagementController.new @global_configuration
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Access to docs_portal_generation_async controller.
|
|
31
|
+
# @return [DocsPortalGenerationAsyncController] Returns the controller instance.
|
|
32
|
+
def docs_portal_generation_async
|
|
33
|
+
@docs_portal_generation_async ||= DocsPortalGenerationAsyncController.new @global_configuration
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Access to api_validation_external_apis controller.
|
|
37
|
+
# @return [ApiValidationExternalApisController] Returns the controller instance.
|
|
38
|
+
def api_validation_external_apis
|
|
39
|
+
@api_validation_external_apis ||= ApiValidationExternalApisController.new @global_configuration
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Access to api_validation_v2_external_apis controller.
|
|
43
|
+
# @return [ApiValidationV2ExternalApisController] Returns the controller instance.
|
|
44
|
+
def api_validation_v2_external_apis
|
|
45
|
+
@api_validation_v2_external_apis ||= ApiValidationV2ExternalApisController.new @global_configuration
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Access to sdk_generation_async controller.
|
|
49
|
+
# @return [SdkGenerationAsyncController] Returns the controller instance.
|
|
50
|
+
def sdk_generation_async
|
|
51
|
+
@sdk_generation_async ||= SdkGenerationAsyncController.new @global_configuration
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def initialize(
|
|
55
|
+
connection: nil, adapter: :net_http_persistent, timeout: 30,
|
|
56
|
+
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
|
57
|
+
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
|
58
|
+
retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
|
|
59
|
+
logging_configuration: nil, environment: Environment::PRODUCTION,
|
|
60
|
+
custom_url: 'https://localhost:44301/api',
|
|
61
|
+
custom_header_authentication_credentials: nil,
|
|
62
|
+
user_agent: 'TODO: Replace', config: nil
|
|
63
|
+
)
|
|
64
|
+
@config = if config.nil?
|
|
65
|
+
Configuration.new(
|
|
66
|
+
connection: connection, adapter: adapter, timeout: timeout,
|
|
67
|
+
max_retries: max_retries, retry_interval: retry_interval,
|
|
68
|
+
backoff_factor: backoff_factor,
|
|
69
|
+
retry_statuses: retry_statuses,
|
|
70
|
+
retry_methods: retry_methods, http_callback: http_callback,
|
|
71
|
+
proxy_settings: proxy_settings,
|
|
72
|
+
logging_configuration: logging_configuration,
|
|
73
|
+
environment: environment, custom_url: custom_url,
|
|
74
|
+
custom_header_authentication_credentials: custom_header_authentication_credentials,
|
|
75
|
+
user_agent: user_agent
|
|
76
|
+
)
|
|
77
|
+
else
|
|
78
|
+
config
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
@global_configuration = GlobalConfiguration.new(client_configuration: @config)
|
|
82
|
+
.base_uri_executor(@config.method(:get_base_uri))
|
|
83
|
+
.global_errors(BaseController::GLOBAL_ERRORS)
|
|
84
|
+
.global_header('user-agent', @config.user_agent)
|
|
85
|
+
|
|
86
|
+
initialize_auth_managers(@global_configuration)
|
|
87
|
+
@global_configuration = @global_configuration.auth_managers(@auth_managers)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Initializes the auth managers hash used for authenticating API calls.
|
|
91
|
+
# @param [GlobalConfiguration] global_config The global configuration of the SDK)
|
|
92
|
+
def initialize_auth_managers(global_config)
|
|
93
|
+
@auth_managers = {}
|
|
94
|
+
http_client_config = global_config.client_configuration
|
|
95
|
+
%w[Authorization].each { |auth| @auth_managers[auth] = nil }
|
|
96
|
+
@auth_managers['Authorization'] = CustomHeaderAuthentication.new(
|
|
97
|
+
http_client_config.custom_header_authentication_credentials
|
|
98
|
+
)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Creates a client directly from environment variables.
|
|
102
|
+
def self.from_env(**overrides)
|
|
103
|
+
default_config = Configuration.build_default_config_from_env
|
|
104
|
+
new_config = default_config.clone_with(**overrides)
|
|
105
|
+
new(config: new_config)
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|