wesley-key-sdk 0.1.7 → 1.1.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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -110
  3. data/lib/{swagger_petstore → cypress_test_api}/api_helper.rb +2 -2
  4. data/lib/cypress_test_api/client.rb +47 -0
  5. data/lib/cypress_test_api/configuration.rb +103 -0
  6. data/lib/cypress_test_api/controllers/api_controller.rb +102 -0
  7. data/lib/{swagger_petstore → cypress_test_api}/controllers/base_controller.rb +2 -2
  8. data/lib/{swagger_petstore → cypress_test_api}/exceptions/api_exception.rb +2 -2
  9. data/lib/{swagger_petstore → cypress_test_api}/http/http_call_back.rb +2 -2
  10. data/lib/{swagger_petstore → cypress_test_api}/http/http_method_enum.rb +2 -2
  11. data/lib/{swagger_petstore → cypress_test_api}/http/http_request.rb +2 -2
  12. data/lib/{swagger_petstore → cypress_test_api}/http/http_response.rb +2 -2
  13. data/lib/cypress_test_api/http/proxy_settings.rb +13 -0
  14. data/lib/{swagger_petstore → cypress_test_api}/models/base_model.rb +2 -2
  15. data/lib/cypress_test_api/models/custom_enum.rb +26 -0
  16. data/lib/{swagger_petstore/models/category2.rb → cypress_test_api/models/deer.rb} +18 -21
  17. data/lib/cypress_test_api/models/item.rb +166 -0
  18. data/lib/{swagger_petstore/models/category.rb → cypress_test_api/models/item_response.rb} +19 -10
  19. data/lib/cypress_test_api/models/lion.rb +68 -0
  20. data/lib/cypress_test_api/models/message.rb +68 -0
  21. data/lib/{swagger_petstore/models/api_response.rb → cypress_test_api/models/message2.rb} +14 -24
  22. data/lib/cypress_test_api/models/multiple_arrays_request.rb +70 -0
  23. data/lib/cypress_test_api/models/nac_tag.rb +265 -0
  24. data/lib/cypress_test_api/models/o_auth_scope_o_auth_acg_enum.rb +29 -0
  25. data/lib/cypress_test_api/models/response_http400.rb +62 -0
  26. data/lib/{swagger_petstore/models/tag.rb → cypress_test_api/models/response_http404.rb} +9 -18
  27. data/lib/cypress_test_api/models/status11_enum.rb +26 -0
  28. data/lib/cypress_test_api/models/status1_enum.rb +26 -0
  29. data/lib/cypress_test_api/models/status_enum.rb +26 -0
  30. data/lib/cypress_test_api/models/tokens_request.rb +60 -0
  31. data/lib/{swagger_petstore → cypress_test_api}/utilities/date_time_helper.rb +2 -2
  32. data/lib/{swagger_petstore → cypress_test_api}/utilities/file_wrapper.rb +2 -2
  33. data/lib/cypress_test_api.rb +55 -0
  34. data/test/controllers/controller_test_base.rb +11 -14
  35. data/test/controllers/test_api_controller.rb +40 -0
  36. data/test/http_response_catcher.rb +2 -2
  37. metadata +38 -46
  38. data/bin/console +0 -15
  39. data/lib/swagger_petstore/client.rb +0 -95
  40. data/lib/swagger_petstore/configuration.rb +0 -197
  41. data/lib/swagger_petstore/controllers/pet_controller.rb +0 -206
  42. data/lib/swagger_petstore/controllers/store_controller.rb +0 -94
  43. data/lib/swagger_petstore/controllers/user_controller.rb +0 -165
  44. data/lib/swagger_petstore/exceptions/o_auth_provider_exception.rb +0 -64
  45. data/lib/swagger_petstore/http/auth/api_key.rb +0 -52
  46. data/lib/swagger_petstore/http/auth/http_basic.rb +0 -62
  47. data/lib/swagger_petstore/http/auth/petstore_auth.rb +0 -113
  48. data/lib/swagger_petstore/http/proxy_settings.rb +0 -22
  49. data/lib/swagger_petstore/models/content_type_enum.rb +0 -26
  50. data/lib/swagger_petstore/models/o_auth_provider_error_enum.rb +0 -62
  51. data/lib/swagger_petstore/models/o_auth_scope_petstore_auth_enum.rb +0 -36
  52. data/lib/swagger_petstore/models/o_auth_token.rb +0 -96
  53. data/lib/swagger_petstore/models/order.rb +0 -120
  54. data/lib/swagger_petstore/models/pet.rb +0 -117
  55. data/lib/swagger_petstore/models/pet_request.rb +0 -117
  56. data/lib/swagger_petstore/models/status1_enum.rb +0 -40
  57. data/lib/swagger_petstore/models/status2_enum.rb +0 -40
  58. data/lib/swagger_petstore/models/status_enum.rb +0 -40
  59. data/lib/swagger_petstore/models/store_order_request.rb +0 -120
  60. data/lib/swagger_petstore/models/user.rb +0 -132
  61. data/lib/swagger_petstore/models/user_request.rb +0 -132
  62. data/lib/swagger_petstore.rb +0 -62
  63. data/test/controllers/test_store_controller.rb +0 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b32f263fc60a62f3e0f46b9eee4275f72dbcfcb13790f5ba79bad8cfdb1bc660
4
- data.tar.gz: 2d482091fdb4bf25fa3d6d375775c493b19cca519b5d626cd334359d32d3a9a1
3
+ metadata.gz: 987a43498857664572a8228264bc2b63580e6120df139eb5087bbc800d9fa469
4
+ data.tar.gz: 68ea1ecd67713a031a8f71d67542aa076efe3754c26b1960b2de8f61ccda73f1
5
5
  SHA512:
6
- metadata.gz: d6c6219a7f98f45784f43b1bbb4efe716c219fac7fb3cb4a68e7d3dc4848c95cd254aaf813da791b0e86bd6630a42d75f77619a2a62156defde759452853830d
7
- data.tar.gz: 8e7eea8e9bafa69b3010ae4899b6ac1c302a8356bbd6ad3c98baaeb548e4f249b5b0730e887e1475030c38efbbbbbea17138726af43cced87bd0274d8cbe5c5e
6
+ metadata.gz: 8713b6f446cc6593942de3d498ab6696700324137cfe784f9fd8526cb6e0cdf17354c21d353bf7b54ce61f0282508ef75f11e458d6ad36000bb262caec367842
7
+ data.tar.gz: ca0e97d5a2dfaf407b8b44d040889723212ff67260575075290f90b8a1ac3e94b2132b9aaf3683045fc50479dc145396f896e56501204e90c05a5f1167043fdf
data/README.md CHANGED
@@ -1,62 +1,25 @@
1
1
 
2
- # Getting Started with Swagger Petstore
2
+ # Getting Started with Cypress Test API
3
3
 
4
4
  ## Introduction
5
5
 
6
- This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
7
-
8
- Find out more about Swagger: [http://swagger.io](http://swagger.io)
6
+ This is a sample API to demonstrate an OpenAPI spec with multiple endpoints and a custom model.
9
7
 
10
8
  ## Install the Package
11
9
 
12
10
  Install the gem from the command line:
13
11
 
14
12
  ```bash
15
- gem install wesley-key-sdk -v 0.1.7
13
+ gem install wesley-key-sdk -v 1.1.1
16
14
  ```
17
15
 
18
16
  Or add the gem to your Gemfile and run `bundle`:
19
17
 
20
18
  ```ruby
21
- gem 'wesley-key-sdk', '0.1.7'
22
- ```
23
-
24
- For additional gem details, see the [RubyGems page for the wesley-key-sdk gem](https://rubygems.org/gems/wesley-key-sdk/versions/0.1.7).
25
-
26
- ## IRB Console Usage
27
-
28
- You can explore the SDK interactively using IRB in two ways
29
-
30
- ### 1. Use IRB with Installed Gem
31
-
32
- Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and type the following command to start the irb console.
33
-
34
- ```bash
35
- irb
36
- ```
37
-
38
- Now you can load the SDK in the IRB
39
-
40
- ```ruby
41
- require 'swagger_petstore'
42
- include SwaggerPetstore
43
- ```
44
-
45
- ### 2. Use IRB within SDK
46
-
47
- Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and navigate to the root folder of SDK.
48
-
49
- ```
50
- cd path/to/swagger_petstore
19
+ gem 'wesley-key-sdk', '1.1.1'
51
20
  ```
52
21
 
53
- Now you can start the preconfigured irb console by running the following command
54
-
55
- ```bash
56
- ruby bin/console
57
- ```
58
-
59
- **_Note:_** This automatically loads the SDK from lib/
22
+ For additional gem details, see the [RubyGems page for the wesley-key-sdk gem](https://rubygems.org/gems/wesley-key-sdk/versions/1.1.1).
60
23
 
61
24
  ## Test the SDK
62
25
 
@@ -68,13 +31,13 @@ rake
68
31
 
69
32
  ## Initialize the API Client
70
33
 
71
- **_Note:_** Documentation for the client can be found [here.](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/client.md)
34
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/1.1.1/doc/client.md)
72
35
 
73
36
  The following parameters are configurable for the API Client:
74
37
 
75
38
  | Parameter | Type | Description |
76
39
  | --- | --- | --- |
77
- | test_header | `String` | This is a test header<br>*Default*: `'TestHeaderDefaultValue'` |
40
+ | default_host | `String` | *Default*: `'www.example.com'` |
78
41
  | environment | `Environment` | The API environment. <br> **Default: `Environment.PRODUCTION`** |
79
42
  | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
80
43
  | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
@@ -85,92 +48,37 @@ The following parameters are configurable for the API Client:
85
48
  | retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
86
49
  | retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
87
50
  | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
88
- | proxy_settings | [`ProxySettings`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
89
- | api_key_credentials | [`ApiKeyCredentials`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/auth/custom-header-signature.md) | The credential object for Custom Header Signature |
90
- | http_basic_credentials | [`HttpBasicCredentials`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/auth/basic-authentication.md) | The credential object for Basic Authentication |
91
- | petstore_auth_credentials | [`PetstoreAuthCredentials`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/auth/oauth-2-implicit-grant.md) | The credential object for OAuth 2 Implicit Grant |
51
+ | proxy_settings | [`ProxySettings`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/1.1.1/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
92
52
 
93
53
  The API client can be initialized as follows:
94
54
 
95
- ### Code-Based Client Initialization
96
-
97
55
  ```ruby
98
- require 'swagger_petstore'
99
- include SwaggerPetstore
56
+ require 'cypress_test_api'
57
+ include CypressTestApi
100
58
 
101
59
  client = Client.new(
102
- test_header: 'TestHeaderDefaultValue',
103
- api_key_credentials: ApiKeyCredentials.new(
104
- api_key: 'api_key'
105
- ),
106
- http_basic_credentials: HttpBasicCredentials.new(
107
- username: 'username',
108
- passwprd: 'passwprd'
109
- ),
110
- petstore_auth_credentials: PetstoreAuthCredentials.new(
111
- o_auth_client_id: 'OAuthClientId',
112
- o_auth_redirect_uri: 'OAuthRedirectUri',
113
- o_auth_scopes: [
114
- OAuthScopePetstoreAuthEnum::READPETS,
115
- OAuthScopePetstoreAuthEnum::WRITEPETS
116
- ]
117
- ),
118
- environment: Environment::PRODUCTION
60
+ environment: Environment::PRODUCTION,
61
+ default_host: 'www.example.com'
119
62
  )
120
63
  ```
121
64
 
122
- ### Environment-Based Client Initialization
123
-
124
- ```ruby
125
- require 'swagger_petstore'
126
- include SwaggerPetstore
127
-
128
- # Create client from environment
129
- client = Client.from_env
130
- ```
131
-
132
- See the [`Environment-Based Client Initialization`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/environment-based-client-initialization.md) section for details.
133
-
134
- ## Environments
135
-
136
- The SDK can be configured to use a different environment for making API calls. Available environments are:
137
-
138
- ### Fields
139
-
140
- | Name | Description |
141
- | --- | --- |
142
- | production | **Default** |
143
- | environment2 | - |
144
- | environment3 | - |
145
-
146
- ## Authorization
147
-
148
- This API uses the following authentication schemes.
149
-
150
- * [`api_key (Custom Header Signature)`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/auth/custom-header-signature.md)
151
- * [`httpBasic (Basic Authentication)`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/auth/basic-authentication.md)
152
- * [`petstore_auth (OAuth 2 Implicit Grant)`](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/auth/oauth-2-implicit-grant.md)
153
-
154
65
  ## List of APIs
155
66
 
156
- * [Pet](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/controllers/pet.md)
157
- * [Store](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/controllers/store.md)
158
- * [User](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/controllers/user.md)
67
+ * [API](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/1.1.1/doc/controllers/api.md)
159
68
 
160
69
  ## SDK Infrastructure
161
70
 
162
71
  ### Configuration
163
72
 
164
- * [ProxySettings](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/proxy-settings.md)
165
- * [Environment-Based Client Initialization](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/environment-based-client-initialization.md)
73
+ * [ProxySettings](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/1.1.1/doc/proxy-settings.md)
166
74
 
167
75
  ### HTTP
168
76
 
169
- * [HttpResponse](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/http-response.md)
170
- * [HttpRequest](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/http-request.md)
77
+ * [HttpResponse](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/1.1.1/doc/http-response.md)
78
+ * [HttpRequest](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/1.1.1/doc/http-request.md)
171
79
 
172
80
  ### Utilities
173
81
 
174
- * [ApiHelper](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/api-helper.md)
175
- * [DateTimeHelper](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/0.1.7/doc/date-time-helper.md)
82
+ * [ApiHelper](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/1.1.1/doc/api-helper.md)
83
+ * [DateTimeHelper](https://www.github.com/ZahraN444/wesley-key-ruby-sdk/tree/1.1.1/doc/date-time-helper.md)
176
84
 
@@ -1,9 +1,9 @@
1
- # swagger_petstore
1
+ # cypress_test_api
2
2
  #
3
3
  # This file was automatically generated by APIMATIC v3.0
4
4
  # ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstore
6
+ module CypressTestApi
7
7
  # API utility class
8
8
  class APIHelper < CoreLibrary::ApiHelper
9
9
  end
@@ -0,0 +1,47 @@
1
+ # cypress_test_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module CypressTestApi
7
+ # cypress_test_api client class.
8
+ class Client
9
+ include CoreLibrary
10
+ attr_reader :config
11
+
12
+ # Access to client controller.
13
+ # @return [APIController] Returns the controller instance.
14
+ def client
15
+ @client ||= APIController.new @global_configuration
16
+ end
17
+
18
+ def initialize(
19
+ connection: nil, adapter: :net_http_persistent, timeout: 60,
20
+ max_retries: 0, retry_interval: 1, backoff_factor: 2,
21
+ retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
22
+ retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
23
+ environment: Environment::PRODUCTION, default_host: 'www.example.com',
24
+ config: nil
25
+ )
26
+ @config = if config.nil?
27
+ Configuration.new(connection: connection, adapter: adapter,
28
+ timeout: timeout, max_retries: max_retries,
29
+ retry_interval: retry_interval,
30
+ backoff_factor: backoff_factor,
31
+ retry_statuses: retry_statuses,
32
+ retry_methods: retry_methods,
33
+ http_callback: http_callback,
34
+ proxy_settings: proxy_settings,
35
+ environment: environment,
36
+ default_host: default_host)
37
+ else
38
+ config
39
+ end
40
+
41
+ @global_configuration = GlobalConfiguration.new(client_configuration: @config)
42
+ .base_uri_executor(@config.method(:get_base_uri))
43
+ .global_errors(BaseController::GLOBAL_ERRORS)
44
+ .user_agent(BaseController.user_agent)
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,103 @@
1
+ # cypress_test_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module CypressTestApi
7
+ # An enum for SDK environments.
8
+ class Environment
9
+ ENVIRONMENT = [
10
+ PRODUCTION = 'production'.freeze
11
+ ].freeze
12
+ end
13
+
14
+ # An enum for API servers.
15
+ class Server
16
+ SERVER = [
17
+ DEFAULT = 'default'.freeze
18
+ ].freeze
19
+ end
20
+
21
+ # All configuration including auth info and base URI for the API access
22
+ # are configured in this class.
23
+ class Configuration < CoreLibrary::HttpClientConfiguration
24
+ # The attribute readers for properties.
25
+ attr_reader :environment, :default_host
26
+
27
+ class << self
28
+ attr_reader :environments
29
+ end
30
+
31
+ def initialize(
32
+ connection: nil, adapter: :net_http_persistent, timeout: 60,
33
+ max_retries: 0, retry_interval: 1, backoff_factor: 2,
34
+ retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
35
+ retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
36
+ environment: Environment::PRODUCTION, default_host: 'www.example.com'
37
+ )
38
+ super connection: connection, adapter: adapter, timeout: timeout,
39
+ max_retries: max_retries, retry_interval: retry_interval,
40
+ backoff_factor: backoff_factor, retry_statuses: retry_statuses,
41
+ retry_methods: retry_methods, http_callback: http_callback,
42
+ proxy_settings: proxy_settings
43
+
44
+ # Current API environment
45
+ @environment = String(environment)
46
+
47
+ # defaultHost value
48
+ @default_host = default_host
49
+
50
+ # The Http Client to use for making requests.
51
+ set_http_client CoreLibrary::FaradayClient.new(self)
52
+ end
53
+
54
+ def clone_with(connection: nil, adapter: nil, timeout: nil,
55
+ max_retries: nil, retry_interval: nil, backoff_factor: nil,
56
+ retry_statuses: nil, retry_methods: nil, http_callback: nil,
57
+ proxy_settings: nil, environment: nil, default_host: nil)
58
+ connection ||= self.connection
59
+ adapter ||= self.adapter
60
+ timeout ||= self.timeout
61
+ max_retries ||= self.max_retries
62
+ retry_interval ||= self.retry_interval
63
+ backoff_factor ||= self.backoff_factor
64
+ retry_statuses ||= self.retry_statuses
65
+ retry_methods ||= self.retry_methods
66
+ http_callback ||= self.http_callback
67
+ proxy_settings ||= self.proxy_settings
68
+ environment ||= self.environment
69
+ default_host ||= self.default_host
70
+
71
+ Configuration.new(connection: connection, adapter: adapter,
72
+ timeout: timeout, max_retries: max_retries,
73
+ retry_interval: retry_interval,
74
+ backoff_factor: backoff_factor,
75
+ retry_statuses: retry_statuses,
76
+ retry_methods: retry_methods,
77
+ http_callback: http_callback,
78
+ proxy_settings: proxy_settings,
79
+ environment: environment, default_host: default_host)
80
+ end
81
+
82
+
83
+ # All the environments the SDK can run in.
84
+ ENVIRONMENTS = {
85
+ Environment::PRODUCTION => {
86
+ Server::DEFAULT => 'https://{defaultHost}'
87
+ }
88
+ }.freeze
89
+
90
+ # Generates the appropriate base URI for the environment and the server.
91
+ # @param [Configuration::Server] server The server enum for which the base URI is
92
+ # required.
93
+ # @return [String] The base URI.
94
+ def get_base_uri(server = Server::DEFAULT)
95
+ parameters = {
96
+ 'defaultHost' => { 'value' => default_host, 'encode' => false }
97
+ }
98
+ APIHelper.append_url_with_template_parameters(
99
+ ENVIRONMENTS[environment][server], parameters
100
+ )
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,102 @@
1
+ # cypress_test_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module CypressTestApi
7
+ # APIController
8
+ class APIController < BaseController
9
+ # Creates a new resource in the system.
10
+ # @param [Status11Enum] status Required parameter: The status of the items
11
+ # to filter by.
12
+ # @param [Item] body Optional parameter: Custom model with additional
13
+ # properties
14
+ # @return [Object] Response from the API call.
15
+ def createanitem(status,
16
+ body: nil)
17
+ @api_call
18
+ .request(new_request_builder(HttpMethodEnum::POST,
19
+ '/items/{status}',
20
+ Server::DEFAULT)
21
+ .template_param(new_parameter(status, key: 'status')
22
+ .should_encode(true))
23
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
24
+ .body_param(new_parameter(body))
25
+ .header_param(new_parameter('application/json', key: 'accept'))
26
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
27
+ .response(new_response_handler
28
+ .deserializer(APIHelper.method(:json_deserialize))
29
+ .local_error('400',
30
+ 'Bad Syntax',
31
+ APIException)
32
+ .local_error('401',
33
+ 'Unauthorized',
34
+ APIException)
35
+ .local_error('403',
36
+ 'Permission Denied',
37
+ APIException))
38
+ .execute
39
+ end
40
+
41
+ # TODO: type endpoint description here
42
+ # @param [String] id Required parameter: The ID of the item to retrieve
43
+ # @param [String] value Required parameter: The value of the item to
44
+ # retrieve
45
+ # @return [Item] Response from the API call.
46
+ def getanitemby_id(id,
47
+ value)
48
+ @api_call
49
+ .request(new_request_builder(HttpMethodEnum::GET,
50
+ '/items/{id}',
51
+ Server::DEFAULT)
52
+ .template_param(new_parameter(id, key: 'id')
53
+ .should_encode(true))
54
+ .query_param(new_parameter(value, key: 'value'))
55
+ .header_param(new_parameter('application/json', key: 'accept')))
56
+ .response(new_response_handler
57
+ .deserializer(APIHelper.method(:custom_type_deserializer))
58
+ .deserialize_into(Item.method(:from_hash)))
59
+ .execute
60
+ end
61
+
62
+ # Generates a new OAuth token with the specified scopes.
63
+ # @param [TokensRequest] body Optional parameter: TODO: type description
64
+ # here
65
+ # @return [void] Response from the API call.
66
+ def create_o_auth_token(body: nil)
67
+ @api_call
68
+ .request(new_request_builder(HttpMethodEnum::POST,
69
+ '/tokens',
70
+ Server::DEFAULT)
71
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
72
+ .body_param(new_parameter(body))
73
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
74
+ .response(new_response_handler
75
+ .is_response_void(true)
76
+ .local_error('400',
77
+ 'Bad request',
78
+ APIException))
79
+ .execute
80
+ end
81
+
82
+ # This endpoint accepts a complex structure with multiple arrays.
83
+ # @param [MultipleArraysRequest] body Optional parameter: TODO: type
84
+ # description here
85
+ # @return [void] Response from the API call.
86
+ def test_endpointwith_arrays(body: nil)
87
+ @api_call
88
+ .request(new_request_builder(HttpMethodEnum::POST,
89
+ '/multiple-arrays',
90
+ Server::DEFAULT)
91
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
92
+ .body_param(new_parameter(body))
93
+ .body_serializer(proc do |param| param.to_json unless param.nil? end))
94
+ .response(new_response_handler
95
+ .is_response_void(true)
96
+ .local_error('400',
97
+ 'Bad request',
98
+ APIException))
99
+ .execute
100
+ end
101
+ end
102
+ end
@@ -1,9 +1,9 @@
1
- # swagger_petstore
1
+ # cypress_test_api
2
2
  #
3
3
  # This file was automatically generated by APIMATIC v3.0
4
4
  # ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstore
6
+ module CypressTestApi
7
7
  # BaseController.
8
8
  class BaseController
9
9
  include CoreLibrary
@@ -1,9 +1,9 @@
1
- # swagger_petstore
1
+ # cypress_test_api
2
2
  #
3
3
  # This file was automatically generated by APIMATIC v3.0
4
4
  # ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstore
6
+ module CypressTestApi
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.
@@ -1,9 +1,9 @@
1
- # swagger_petstore
1
+ # cypress_test_api
2
2
  #
3
3
  # This file was automatically generated by APIMATIC v3.0
4
4
  # ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstore
6
+ module CypressTestApi
7
7
  # HttpCallBack allows defining callables for pre and post API calls.
8
8
  class HttpCallBack < CoreLibrary::HttpCallback
9
9
  end
@@ -1,9 +1,9 @@
1
- # swagger_petstore
1
+ # cypress_test_api
2
2
  #
3
3
  # This file was automatically generated by APIMATIC v3.0
4
4
  # ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstore
6
+ module CypressTestApi
7
7
  # HTTP Methods Enumeration.
8
8
  class HttpMethodEnum < CoreLibrary::HttpMethod
9
9
  end
@@ -1,9 +1,9 @@
1
- # swagger_petstore
1
+ # cypress_test_api
2
2
  #
3
3
  # This file was automatically generated by APIMATIC v3.0
4
4
  # ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstore
6
+ module CypressTestApi
7
7
  # Represents a single Http Request.
8
8
  class HttpRequest < CoreLibrary::HttpRequest
9
9
  end
@@ -1,9 +1,9 @@
1
- # swagger_petstore
1
+ # cypress_test_api
2
2
  #
3
3
  # This file was automatically generated by APIMATIC v3.0
4
4
  # ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstore
6
+ module CypressTestApi
7
7
  # Http response received.
8
8
  class HttpResponse < CoreLibrary::HttpResponse
9
9
  end
@@ -0,0 +1,13 @@
1
+ # cypress_test_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module CypressTestApi
7
+ ##
8
+ # ProxySettings encapsulates HTTP proxy configuration for Faraday,
9
+ # including optional basic authentication.
10
+ #
11
+ class ProxySettings < CoreLibrary::ProxySettings
12
+ end
13
+ end
@@ -1,9 +1,9 @@
1
- # swagger_petstore
1
+ # cypress_test_api
2
2
  #
3
3
  # This file was automatically generated by APIMATIC v3.0
4
4
  # ( https://www.apimatic.io ).
5
5
 
6
- module SwaggerPetstore
6
+ module CypressTestApi
7
7
  # Base model.
8
8
  # rubocop:disable all
9
9
  class BaseModel < CoreLibrary::BaseModel
@@ -0,0 +1,26 @@
1
+ # cypress_test_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ module CypressTestApi
7
+ # CustomEnum.
8
+ class CustomEnum
9
+ CUSTOM_ENUM = [
10
+ # TODO: Write general description for VALUE1
11
+ VALUE1 = 'VALUE1'.freeze,
12
+
13
+ # TODO: Write general description for VALUE2
14
+ VALUE2 = 'VALUE2'.freeze,
15
+
16
+ # TODO: Write general description for VALUE3
17
+ VALUE3 = 'VALUE3'.freeze
18
+ ].freeze
19
+
20
+ def self.validate(value)
21
+ return false if value.nil?
22
+
23
+ CUSTOM_ENUM.include?(value)
24
+ end
25
+ end
26
+ end