wesley-key-sdk 3.0.7 → 4.2.0
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/README.md +168 -131
- data/bin/console +4 -4
- data/lib/swagger_petstore_open_api30/api_helper.rb +10 -0
- data/lib/{cypress_test_api/controllers/base_controller.rb → swagger_petstore_open_api30/apis/base_api.rb} +17 -10
- data/lib/swagger_petstore_open_api30/apis/pet_api.rb +287 -0
- data/lib/swagger_petstore_open_api30/apis/store_api.rb +131 -0
- data/lib/swagger_petstore_open_api30/apis/user_api.rb +233 -0
- data/lib/swagger_petstore_open_api30/client.rb +95 -0
- data/lib/{cypress_test_api → swagger_petstore_open_api30}/configuration.rb +72 -47
- data/lib/{cypress_test_api → swagger_petstore_open_api30}/exceptions/api_exception.rb +4 -4
- data/lib/swagger_petstore_open_api30/exceptions/oauth_provider_exception.rb +64 -0
- data/lib/swagger_petstore_open_api30/http/api_response.rb +19 -0
- data/lib/swagger_petstore_open_api30/http/auth/api_key.rb +52 -0
- data/lib/swagger_petstore_open_api30/http/auth/petstore_auth.rb +112 -0
- data/lib/swagger_petstore_open_api30/http/http_call_back.rb +10 -0
- data/lib/swagger_petstore_open_api30/http/http_method_enum.rb +10 -0
- data/lib/swagger_petstore_open_api30/http/http_request.rb +10 -0
- data/lib/swagger_petstore_open_api30/http/http_response.rb +10 -0
- data/lib/{cypress_test_api → swagger_petstore_open_api30}/http/proxy_settings.rb +4 -4
- data/lib/swagger_petstore_open_api30/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/swagger_petstore_open_api30/logging/sdk_logger.rb +17 -0
- data/lib/swagger_petstore_open_api30/models/api_response.rb +118 -0
- data/lib/{cypress_test_api → swagger_petstore_open_api30}/models/base_model.rb +4 -4
- data/lib/swagger_petstore_open_api30/models/category.rb +105 -0
- data/lib/swagger_petstore_open_api30/models/oauth_provider_error.rb +62 -0
- data/lib/swagger_petstore_open_api30/models/oauth_scope_petstore_auth.rb +36 -0
- data/lib/swagger_petstore_open_api30/models/oauth_token.rb +125 -0
- data/lib/swagger_petstore_open_api30/models/order.rb +167 -0
- data/lib/swagger_petstore_open_api30/models/order_status.rb +40 -0
- data/lib/swagger_petstore_open_api30/models/pet.rb +168 -0
- data/lib/swagger_petstore_open_api30/models/pet_status.rb +40 -0
- data/lib/swagger_petstore_open_api30/models/tag.rb +105 -0
- data/lib/swagger_petstore_open_api30/models/user.rb +182 -0
- data/lib/swagger_petstore_open_api30/utilities/date_time_helper.rb +11 -0
- data/lib/{cypress_test_api → swagger_petstore_open_api30}/utilities/file_wrapper.rb +4 -4
- data/lib/swagger_petstore_open_api30/utilities/xml_utilities.rb +12 -0
- data/lib/swagger_petstore_open_api30.rb +62 -0
- metadata +37 -64
- data/lib/cypress_test_api/api_helper.rb +0 -10
- data/lib/cypress_test_api/client.rb +0 -58
- data/lib/cypress_test_api/controllers/api_controller.rb +0 -102
- data/lib/cypress_test_api/http/http_call_back.rb +0 -10
- data/lib/cypress_test_api/http/http_method_enum.rb +0 -10
- data/lib/cypress_test_api/http/http_request.rb +0 -10
- data/lib/cypress_test_api/http/http_response.rb +0 -10
- data/lib/cypress_test_api/models/custom_enum.rb +0 -40
- data/lib/cypress_test_api/models/deer.rb +0 -68
- data/lib/cypress_test_api/models/item.rb +0 -166
- data/lib/cypress_test_api/models/item_response.rb +0 -80
- data/lib/cypress_test_api/models/lion.rb +0 -68
- data/lib/cypress_test_api/models/message.rb +0 -68
- data/lib/cypress_test_api/models/message2.rb +0 -71
- data/lib/cypress_test_api/models/multiple_arrays_request.rb +0 -70
- data/lib/cypress_test_api/models/nac_tag.rb +0 -265
- data/lib/cypress_test_api/models/o_auth_scope_o_auth_acg_enum.rb +0 -44
- data/lib/cypress_test_api/models/response_http400.rb +0 -62
- data/lib/cypress_test_api/models/response_http404.rb +0 -62
- data/lib/cypress_test_api/models/status11_enum.rb +0 -40
- data/lib/cypress_test_api/models/status1_enum.rb +0 -40
- data/lib/cypress_test_api/models/status_enum.rb +0 -40
- data/lib/cypress_test_api/models/tokens_request.rb +0 -60
- data/lib/cypress_test_api/utilities/date_time_helper.rb +0 -11
- data/lib/cypress_test_api.rb +0 -55
- data/test/controllers/controller_test_base.rb +0 -23
- data/test/controllers/test_api_controller.rb +0 -40
- 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: f22b22395a8452f239db0c529bcd4bd9c4d209bc42dece0aa51ccda0794bf274
|
|
4
|
+
data.tar.gz: 646a929e08b140f97c9ff50c7aa9e052d087e5880f5b13b0f045d84dfa6a4bb4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8b841fcc3575323415331051808a172ab7b2f10380c9292190d122a6912b6e68ab655654905faa41949e252c2b1aa9ba9923146dab8c32bb85eb24b8cee1d241
|
|
7
|
+
data.tar.gz: e7865b424ea16c05604c1ed249dcc4665279c35b890ea60736597b6c0476889121b9a662e67f40956192fc8e372c496fe1920e43ddf75cf1e0101462a53783bd
|
data/README.md
CHANGED
|
@@ -1,144 +1,181 @@
|
|
|
1
|
-
|
|
2
|
-
# Getting Started with
|
|
3
|
-
|
|
4
|
-
## Introduction
|
|
5
|
-
|
|
6
|
-
This is a sample
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
The
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
1
|
+
|
|
2
|
+
# Getting Started with Swagger Petstore - OpenAPI 3.0
|
|
3
|
+
|
|
4
|
+
## Introduction
|
|
5
|
+
|
|
6
|
+
This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about
|
|
7
|
+
Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!
|
|
8
|
+
You can now help us improve the API whether it's by making changes to the definition itself or to the code.
|
|
9
|
+
That way, with time, we can improve the API in general, and expose some of the new features in OAS3.
|
|
10
|
+
|
|
11
|
+
Some useful links:
|
|
12
|
+
|
|
13
|
+
- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)
|
|
14
|
+
- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
|
|
15
|
+
|
|
16
|
+
Find out more about Swagger: [https://swagger.io](https://swagger.io)
|
|
17
|
+
|
|
18
|
+
## Install the Package
|
|
19
|
+
|
|
20
|
+
Install the gem from the command line:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
gem install wesley-key-sdk -v 4.2.0
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or add the gem to your Gemfile and run `bundle`:
|
|
27
|
+
|
|
28
|
+
```ruby
|
|
29
|
+
gem 'wesley-key-sdk', '4.2.0'
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For additional gem details, see the [RubyGems page for the wesley-key-sdk gem](https://rubygems.org/gems/wesley-key-sdk/versions/4.2.0).
|
|
33
|
+
|
|
34
|
+
## IRB Console Usage
|
|
35
|
+
|
|
36
|
+
You can explore the SDK interactively using IRB in two ways
|
|
37
|
+
|
|
38
|
+
### 1. Use IRB with Installed Gem
|
|
39
|
+
|
|
40
|
+
Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and type the following command to start the irb console.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
irb
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Now you can load the SDK in the IRB
|
|
47
|
+
|
|
48
|
+
```ruby
|
|
49
|
+
require 'swagger_petstore_open_api30'
|
|
50
|
+
include SwaggerPetstoreOpenApi30
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. Use IRB within SDK
|
|
54
|
+
|
|
55
|
+
Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and navigate to the root folder of SDK.
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
cd path/to/swagger_petstore_open_api30
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Now you can start the preconfigured irb console by running the following command
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
ruby bin/console
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**_Note:_** This automatically loads the SDK from lib/
|
|
68
|
+
|
|
69
|
+
## Initialize the API Client
|
|
70
|
+
|
|
71
|
+
**_Note:_** Documentation for the client can be found [here.](doc/client.md)
|
|
72
|
+
|
|
73
|
+
The following parameters are configurable for the API Client:
|
|
74
|
+
|
|
75
|
+
| Parameter | Type | Description |
|
|
76
|
+
| --- | --- | --- |
|
|
77
|
+
| environment | [`Environment`](README.md#environments) | The API environment. <br> **Default: `Environment.PRODUCTION`** |
|
|
78
|
+
| connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
|
|
79
|
+
| adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
|
|
80
|
+
| timeout | `Float` | The value to use for connection timeout. <br> **Default: 30** |
|
|
81
|
+
| max_retries | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
|
|
82
|
+
| retry_interval | `Float` | Pause in seconds between retries. <br> **Default: 1** |
|
|
83
|
+
| backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
|
|
84
|
+
| retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
|
85
|
+
| retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put get put]** |
|
|
86
|
+
| http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
|
|
87
|
+
| proxy_settings | [`ProxySettings`](doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
|
|
88
|
+
| logging_configuration | [`LoggingConfiguration`](doc/logging-configuration.md) | The SDK logging configuration for API calls |
|
|
89
|
+
| petstore_auth_credentials | [`PetstoreAuthCredentials`](doc/auth/oauth-2-implicit-grant.md) | The credential object for OAuth 2 Implicit Grant |
|
|
90
|
+
| api_key_credentials | [`ApiKeyCredentials`](doc/auth/custom-header-signature.md) | The credential object for Custom Header Signature |
|
|
91
|
+
|
|
92
|
+
The API client can be initialized as follows:
|
|
93
|
+
|
|
94
|
+
### Code-Based Client Initialization
|
|
95
|
+
|
|
96
|
+
```ruby
|
|
97
|
+
require 'swagger_petstore_open_api30'
|
|
98
|
+
include SwaggerPetstoreOpenApi30
|
|
95
99
|
|
|
96
100
|
client = Client.new(
|
|
101
|
+
petstore_auth_credentials: PetstoreAuthCredentials.new(
|
|
102
|
+
oauth_client_id: 'OAuthClientId',
|
|
103
|
+
oauth_redirect_uri: 'OAuthRedirectUri',
|
|
104
|
+
oauth_scopes: [
|
|
105
|
+
OauthScopePetstoreAuth::WRITEPETS,
|
|
106
|
+
OauthScopePetstoreAuth::READPETS
|
|
107
|
+
]
|
|
108
|
+
),
|
|
109
|
+
api_key_credentials: ApiKeyCredentials.new(
|
|
110
|
+
api_key: 'api_key'
|
|
111
|
+
),
|
|
97
112
|
environment: Environment::PRODUCTION,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
logging_configuration: LoggingConfiguration.new(
|
|
114
|
+
log_level: Logger::INFO,
|
|
115
|
+
request_logging_config: RequestLoggingConfiguration.new(
|
|
116
|
+
log_body: true
|
|
117
|
+
),
|
|
118
|
+
response_logging_config: ResponseLoggingConfiguration.new(
|
|
119
|
+
log_headers: true
|
|
120
|
+
)
|
|
121
|
+
)
|
|
122
|
+
)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Environment-Based Client Initialization
|
|
126
|
+
|
|
127
|
+
```ruby
|
|
128
|
+
require 'swagger_petstore_open_api30'
|
|
129
|
+
include SwaggerPetstoreOpenApi30
|
|
107
130
|
|
|
108
131
|
# Create client from environment
|
|
109
|
-
client = Client.from_env
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
See the [`Environment-Based Client Initialization`](
|
|
113
|
-
|
|
114
|
-
## Environments
|
|
115
|
-
|
|
116
|
-
The SDK can be configured to use a different environment for making API calls. Available environments are:
|
|
117
|
-
|
|
118
|
-
### Fields
|
|
119
|
-
|
|
120
|
-
| Name | Description |
|
|
121
|
-
| --- | --- |
|
|
122
|
-
| PRODUCTION | **Default** |
|
|
123
|
-
|
|
124
|
-
##
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
132
|
+
client = Client.from_env
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
See the [`Environment-Based Client Initialization`](doc/environment-based-client-initialization.md) section for details.
|
|
136
|
+
|
|
137
|
+
## Environments
|
|
138
|
+
|
|
139
|
+
The SDK can be configured to use a different environment for making API calls. Available environments are:
|
|
140
|
+
|
|
141
|
+
### Fields
|
|
142
|
+
|
|
143
|
+
| Name | Description |
|
|
144
|
+
| --- | --- |
|
|
145
|
+
| PRODUCTION | **Default** |
|
|
146
|
+
|
|
147
|
+
## Authorization
|
|
148
|
+
|
|
149
|
+
This API uses the following authentication schemes.
|
|
150
|
+
|
|
151
|
+
* [`petstore_auth (OAuth 2 Implicit Grant)`](doc/auth/oauth-2-implicit-grant.md)
|
|
152
|
+
* [`api_key (Custom Header Signature)`](doc/auth/custom-header-signature.md)
|
|
153
|
+
|
|
154
|
+
## List of APIs
|
|
155
|
+
|
|
156
|
+
* [Pet](doc/controllers/pet.md)
|
|
157
|
+
* [Store](doc/controllers/store.md)
|
|
158
|
+
* [User](doc/controllers/user.md)
|
|
159
|
+
|
|
160
|
+
## SDK Infrastructure
|
|
161
|
+
|
|
130
162
|
### Configuration
|
|
131
163
|
|
|
132
|
-
* [ProxySettings](
|
|
133
|
-
* [Environment-Based Client Initialization](
|
|
164
|
+
* [ProxySettings](doc/proxy-settings.md)
|
|
165
|
+
* [Environment-Based Client Initialization](doc/environment-based-client-initialization.md)
|
|
166
|
+
* [AbstractLogger](doc/abstract-logger.md)
|
|
167
|
+
* [LoggingConfiguration](doc/logging-configuration.md)
|
|
168
|
+
* [RequestLoggingConfiguration](doc/request-logging-configuration.md)
|
|
169
|
+
* [ResponseLoggingConfiguration](doc/response-logging-configuration.md)
|
|
134
170
|
|
|
135
171
|
### HTTP
|
|
136
172
|
|
|
137
|
-
* [HttpResponse](
|
|
138
|
-
* [HttpRequest](
|
|
173
|
+
* [HttpResponse](doc/http-response.md)
|
|
174
|
+
* [HttpRequest](doc/http-request.md)
|
|
139
175
|
|
|
140
176
|
### Utilities
|
|
141
177
|
|
|
142
|
-
* [
|
|
143
|
-
* [
|
|
144
|
-
|
|
178
|
+
* [ApiResponse](doc/api-response.md)
|
|
179
|
+
* [ApiHelper](doc/api-helper.md)
|
|
180
|
+
* [DateTimeHelper](doc/date-time-helper.md)
|
|
181
|
+
|
data/bin/console
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
$LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
|
|
5
5
|
|
|
6
6
|
# Require the gem
|
|
7
|
-
require '
|
|
7
|
+
require 'swagger_petstore_open_api30'
|
|
8
8
|
|
|
9
|
-
puts '
|
|
10
|
-
puts 'You can now create a client with: client =
|
|
11
|
-
puts 'Or use from_env: client =
|
|
9
|
+
puts 'SwaggerPetstoreOpenApi30 SDK loaded!'
|
|
10
|
+
puts 'You can now create a client with: client = SwaggerPetstoreOpenApi30::Client.new'
|
|
11
|
+
puts 'Or use from_env: client = SwaggerPetstoreOpenApi30::Client.from_env'
|
|
12
12
|
|
|
13
13
|
# Start an interactive IRB session
|
|
14
14
|
require 'irb'
|
|
@@ -1,23 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# swagger_petstore_open_api30
|
|
2
2
|
#
|
|
3
|
-
# This file was automatically generated by
|
|
4
|
-
# ( https://www.apimatic.io ).
|
|
3
|
+
# This file was automatically generated by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
5
|
|
|
6
|
-
module
|
|
7
|
-
#
|
|
8
|
-
class
|
|
6
|
+
module SwaggerPetstoreOpenApi30
|
|
7
|
+
# BaseApi.
|
|
8
|
+
class BaseApi
|
|
9
9
|
include CoreLibrary
|
|
10
10
|
attr_accessor :config, :http_call_back
|
|
11
11
|
|
|
12
|
-
def self.user_agent
|
|
13
|
-
'
|
|
12
|
+
def self.user_agent
|
|
13
|
+
'Ruby-SDK/4.2.0 (OS: {os-info}, Engine: {engine}/{engine-version})'
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
+
def self.user_agent_parameters
|
|
17
|
+
{
|
|
18
|
+
'{engine}' => { 'value' => RUBY_ENGINE, 'encode' => false },
|
|
19
|
+
'{engine-version}' => { 'value' => RUBY_ENGINE_VERSION, 'encode' => false },
|
|
20
|
+
'{os-info}' => { 'value' => RUBY_PLATFORM, 'encode' => false }
|
|
21
|
+
}
|
|
22
|
+
end
|
|
16
23
|
|
|
17
|
-
GLOBAL_ERRORS = {
|
|
24
|
+
GLOBAL_ERRORS = {
|
|
18
25
|
'default' => ErrorCase.new
|
|
19
26
|
.error_message('HTTP response not OK.')
|
|
20
|
-
.exception_type(APIException)
|
|
27
|
+
.exception_type(APIException)
|
|
21
28
|
}.freeze
|
|
22
29
|
|
|
23
30
|
# Initialization constructor.
|