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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +168 -131
  3. data/bin/console +4 -4
  4. data/lib/swagger_petstore_open_api30/api_helper.rb +10 -0
  5. data/lib/{cypress_test_api/controllers/base_controller.rb → swagger_petstore_open_api30/apis/base_api.rb} +17 -10
  6. data/lib/swagger_petstore_open_api30/apis/pet_api.rb +287 -0
  7. data/lib/swagger_petstore_open_api30/apis/store_api.rb +131 -0
  8. data/lib/swagger_petstore_open_api30/apis/user_api.rb +233 -0
  9. data/lib/swagger_petstore_open_api30/client.rb +95 -0
  10. data/lib/{cypress_test_api → swagger_petstore_open_api30}/configuration.rb +72 -47
  11. data/lib/{cypress_test_api → swagger_petstore_open_api30}/exceptions/api_exception.rb +4 -4
  12. data/lib/swagger_petstore_open_api30/exceptions/oauth_provider_exception.rb +64 -0
  13. data/lib/swagger_petstore_open_api30/http/api_response.rb +19 -0
  14. data/lib/swagger_petstore_open_api30/http/auth/api_key.rb +52 -0
  15. data/lib/swagger_petstore_open_api30/http/auth/petstore_auth.rb +112 -0
  16. data/lib/swagger_petstore_open_api30/http/http_call_back.rb +10 -0
  17. data/lib/swagger_petstore_open_api30/http/http_method_enum.rb +10 -0
  18. data/lib/swagger_petstore_open_api30/http/http_request.rb +10 -0
  19. data/lib/swagger_petstore_open_api30/http/http_response.rb +10 -0
  20. data/lib/{cypress_test_api → swagger_petstore_open_api30}/http/proxy_settings.rb +4 -4
  21. data/lib/swagger_petstore_open_api30/logging/configuration/api_logging_configuration.rb +186 -0
  22. data/lib/swagger_petstore_open_api30/logging/sdk_logger.rb +17 -0
  23. data/lib/swagger_petstore_open_api30/models/api_response.rb +118 -0
  24. data/lib/{cypress_test_api → swagger_petstore_open_api30}/models/base_model.rb +4 -4
  25. data/lib/swagger_petstore_open_api30/models/category.rb +105 -0
  26. data/lib/swagger_petstore_open_api30/models/oauth_provider_error.rb +62 -0
  27. data/lib/swagger_petstore_open_api30/models/oauth_scope_petstore_auth.rb +36 -0
  28. data/lib/swagger_petstore_open_api30/models/oauth_token.rb +125 -0
  29. data/lib/swagger_petstore_open_api30/models/order.rb +167 -0
  30. data/lib/swagger_petstore_open_api30/models/order_status.rb +40 -0
  31. data/lib/swagger_petstore_open_api30/models/pet.rb +168 -0
  32. data/lib/swagger_petstore_open_api30/models/pet_status.rb +40 -0
  33. data/lib/swagger_petstore_open_api30/models/tag.rb +105 -0
  34. data/lib/swagger_petstore_open_api30/models/user.rb +182 -0
  35. data/lib/swagger_petstore_open_api30/utilities/date_time_helper.rb +11 -0
  36. data/lib/{cypress_test_api → swagger_petstore_open_api30}/utilities/file_wrapper.rb +4 -4
  37. data/lib/swagger_petstore_open_api30/utilities/xml_utilities.rb +12 -0
  38. data/lib/swagger_petstore_open_api30.rb +62 -0
  39. metadata +37 -64
  40. data/lib/cypress_test_api/api_helper.rb +0 -10
  41. data/lib/cypress_test_api/client.rb +0 -58
  42. data/lib/cypress_test_api/controllers/api_controller.rb +0 -102
  43. data/lib/cypress_test_api/http/http_call_back.rb +0 -10
  44. data/lib/cypress_test_api/http/http_method_enum.rb +0 -10
  45. data/lib/cypress_test_api/http/http_request.rb +0 -10
  46. data/lib/cypress_test_api/http/http_response.rb +0 -10
  47. data/lib/cypress_test_api/models/custom_enum.rb +0 -40
  48. data/lib/cypress_test_api/models/deer.rb +0 -68
  49. data/lib/cypress_test_api/models/item.rb +0 -166
  50. data/lib/cypress_test_api/models/item_response.rb +0 -80
  51. data/lib/cypress_test_api/models/lion.rb +0 -68
  52. data/lib/cypress_test_api/models/message.rb +0 -68
  53. data/lib/cypress_test_api/models/message2.rb +0 -71
  54. data/lib/cypress_test_api/models/multiple_arrays_request.rb +0 -70
  55. data/lib/cypress_test_api/models/nac_tag.rb +0 -265
  56. data/lib/cypress_test_api/models/o_auth_scope_o_auth_acg_enum.rb +0 -44
  57. data/lib/cypress_test_api/models/response_http400.rb +0 -62
  58. data/lib/cypress_test_api/models/response_http404.rb +0 -62
  59. data/lib/cypress_test_api/models/status11_enum.rb +0 -40
  60. data/lib/cypress_test_api/models/status1_enum.rb +0 -40
  61. data/lib/cypress_test_api/models/status_enum.rb +0 -40
  62. data/lib/cypress_test_api/models/tokens_request.rb +0 -60
  63. data/lib/cypress_test_api/utilities/date_time_helper.rb +0 -11
  64. data/lib/cypress_test_api.rb +0 -55
  65. data/test/controllers/controller_test_base.rb +0 -23
  66. data/test/controllers/test_api_controller.rb +0 -40
  67. data/test/http_response_catcher.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 784656e06493786bdbd19fb9edb6c3937440703f401e611933de3aa5974cd64e
4
- data.tar.gz: ef76250bba23b0a785aaca63c02cf83dc271fc29fd7346f83a248e24221ff13a
3
+ metadata.gz: f22b22395a8452f239db0c529bcd4bd9c4d209bc42dece0aa51ccda0794bf274
4
+ data.tar.gz: 646a929e08b140f97c9ff50c7aa9e052d087e5880f5b13b0f045d84dfa6a4bb4
5
5
  SHA512:
6
- metadata.gz: fc1de4713f9f89bc8dd517e1350676182f963069cf431639e87ab5befc55cdf39fbedec5bc37db700ffdfabac478ba15ebd107df8e94c8dc5da45085102f5021
7
- data.tar.gz: 955843f36310a6a95479a3a7eb523c41c0acba470583c4d259eb3f6cd40e4e607bef83c33f8a81e7f1fe9ae8bfd772e6b9cd160ff2bb0579e784d5bf8cce79a2
6
+ metadata.gz: 8b841fcc3575323415331051808a172ab7b2f10380c9292190d122a6912b6e68ab655654905faa41949e252c2b1aa9ba9923146dab8c32bb85eb24b8cee1d241
7
+ data.tar.gz: e7865b424ea16c05604c1ed249dcc4665279c35b890ea60736597b6c0476889121b9a662e67f40956192fc8e372c496fe1920e43ddf75cf1e0101462a53783bd
data/README.md CHANGED
@@ -1,144 +1,181 @@
1
-
2
- # Getting Started with Cypress Test API
3
-
4
- ## Introduction
5
-
6
- This is a sample API to demonstrate an OpenAPI spec with multiple endpoints and a custom model.
7
-
8
- ## Install the Package
9
-
10
- Install the gem from the command line:
11
-
12
- ```bash
13
- gem install wesley-key-sdk -v 3.0.7
14
- ```
15
-
16
- Or add the gem to your Gemfile and run `bundle`:
17
-
18
- ```ruby
19
- gem 'wesley-key-sdk', '3.0.7'
20
- ```
21
-
22
- For additional gem details, see the [RubyGems page for the wesley-key-sdk gem](https://rubygems.org/gems/wesley-key-sdk/versions/3.0.7).
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 'cypress_test_api'
40
- include CypressTestApi
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/cypress_test_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
- ## Test the SDK
60
-
61
- To run the tests, navigate to the root directory of the SDK in your terminal and execute the following command:
62
-
63
- ```
64
- rake
65
- ```
66
-
67
- ## Initialize the API Client
68
-
69
- **_Note:_** Documentation for the client can be found [here.](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/client.md)
70
-
71
- The following parameters are configurable for the API Client:
72
-
73
- | Parameter | Type | Description |
74
- | --- | --- | --- |
75
- | default_host | `String` | *Default*: `'www.example.com'` |
76
- | environment | [`Environment`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/README.md#environments) | The API environment. <br> **Default: `Environment.PRODUCTION`** |
77
- | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
78
- | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
79
- | timeout | `Float` | The value to use for connection timeout. <br> **Default: 60** |
80
- | max_retries | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
81
- | retry_interval | `Float` | Pause in seconds between retries. <br> **Default: 1** |
82
- | backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
83
- | retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
84
- | retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
85
- | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
86
- | proxy_settings | [`ProxySettings`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
87
-
88
- The API client can be initialized as follows:
89
-
90
- ### Code-Based Client Initialization
91
-
92
- ```ruby
93
- require 'cypress_test_api'
94
- include CypressTestApi
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
- default_host: 'www.example.com'
99
- )
100
- ```
101
-
102
- ### Environment-Based Client Initialization
103
-
104
- ```ruby
105
- require 'cypress_test_api'
106
- include CypressTestApi
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`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/environment-based-client-initialization.md) section for details.
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
- ## List of APIs
125
-
126
- * [API](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/controllers/api.md)
127
-
128
- ## SDK Infrastructure
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](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/proxy-settings.md)
133
- * [Environment-Based Client Initialization](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/environment-based-client-initialization.md)
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](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/http-response.md)
138
- * [HttpRequest](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/http-request.md)
173
+ * [HttpResponse](doc/http-response.md)
174
+ * [HttpRequest](doc/http-request.md)
139
175
 
140
176
  ### Utilities
141
177
 
142
- * [ApiHelper](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/api-helper.md)
143
- * [DateTimeHelper](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/3.0.7/doc/date-time-helper.md)
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 'cypress_test_api'
7
+ require 'swagger_petstore_open_api30'
8
8
 
9
- puts 'CypressTestApi SDK loaded!'
10
- puts 'You can now create a client with: client = CypressTestApi::Client.new'
11
- puts 'Or use from_env: client = CypressTestApi::Client.from_env'
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'
@@ -0,0 +1,10 @@
1
+ # swagger_petstore_open_api30
2
+ #
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module SwaggerPetstoreOpenApi30
7
+ # API utility class
8
+ class APIHelper < CoreLibrary::ApiHelper
9
+ end
10
+ end
@@ -1,23 +1,30 @@
1
- # cypress_test_api
1
+ # swagger_petstore_open_api30
2
2
  #
3
- # This file was automatically generated by APIMATIC v3.0
4
- # ( https://www.apimatic.io ).
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
5
 
6
- module CypressTestApi
7
- # BaseController.
8
- class BaseController
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
- 'APIMATIC 3.0'
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.