rose-nielsen-sdk 0.0.3 → 0.0.7

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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -60
  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/{swagger_petstore → cypress_test_api}/configuration.rb +17 -41
  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/{swagger_petstore → cypress_test_api}/http/proxy_settings.rb +2 -2
  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/category.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/category2.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/{swagger_petstore → cypress_test_api}/models/status_enum.rb +9 -9
  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 +5 -13
  35. data/test/controllers/test_api_controller.rb +40 -0
  36. data/test/http_response_catcher.rb +2 -2
  37. metadata +33 -40
  38. data/lib/swagger_petstore/client.rb +0 -84
  39. data/lib/swagger_petstore/controllers/pet_controller.rb +0 -206
  40. data/lib/swagger_petstore/controllers/store_controller.rb +0 -94
  41. data/lib/swagger_petstore/controllers/user_controller.rb +0 -165
  42. data/lib/swagger_petstore/exceptions/o_auth_provider_exception.rb +0 -64
  43. data/lib/swagger_petstore/http/auth/api_key.rb +0 -42
  44. data/lib/swagger_petstore/http/auth/http_basic.rb +0 -50
  45. data/lib/swagger_petstore/http/auth/petstore_auth.rb +0 -98
  46. data/lib/swagger_petstore/models/content_type_enum.rb +0 -20
  47. data/lib/swagger_petstore/models/o_auth_provider_error_enum.rb +0 -45
  48. data/lib/swagger_petstore/models/o_auth_scope_petstore_auth_enum.rb +0 -23
  49. data/lib/swagger_petstore/models/o_auth_token.rb +0 -96
  50. data/lib/swagger_petstore/models/order.rb +0 -120
  51. data/lib/swagger_petstore/models/pet.rb +0 -117
  52. data/lib/swagger_petstore/models/pet_request.rb +0 -117
  53. data/lib/swagger_petstore/models/status1_enum.rb +0 -26
  54. data/lib/swagger_petstore/models/status2_enum.rb +0 -26
  55. data/lib/swagger_petstore/models/store_order_request.rb +0 -120
  56. data/lib/swagger_petstore/models/user.rb +0 -132
  57. data/lib/swagger_petstore/models/user_request.rb +0 -132
  58. data/lib/swagger_petstore.rb +0 -62
  59. data/test/controllers/test_store_controller.rb +0 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 213bf3b7f8ef26e7acdb1cab8d7ed903a2570b476b60809b611cb03cf5be125b
4
- data.tar.gz: 26fdaf45ce261cee58649cfddab4c8b3646e009d2b935197bc701fecfe0b2cb0
3
+ metadata.gz: 2f05c43da5a8ba8829eca6122645991887bbde44ef9a414f57976008816190d2
4
+ data.tar.gz: 7d1c21a5ca13cb0e7609a9a1163f04bbacaaa63a4b2b557d44f18a2a8f8f1900
5
5
  SHA512:
6
- metadata.gz: c6c7a9a98b27020c3fcdf09e6812e503416f024d8fd44a649a765e7fdf0aac9fa12aa93788a4f148366719e1b746220c15589b365231f561d58ce835a21ce6f4
7
- data.tar.gz: 5fe28102ce0841d4d57c73ab6ee6154c7a56d851afb71dc32b68febe7089dd2bb364c752645a9fcb0147cd6b5f52af52b7814b46ca18d01a548f8c970db3a365
6
+ metadata.gz: 1db72e28004e58bca7382a96f4fba81ebc15850d9aec618eaa32a524e802bb2a1d706995720a048ffefc9d499a02ecccade81c5bf52f171485dbcd0ddf767523
7
+ data.tar.gz: 67a7763940abdc468e93a0477b8ec747b5e30a1ae994a146f5e38316830c4dd097a44460213bf3391b4df4c4091db2c6578fba7ea6d944990073b1d4dfaafc70
data/README.md CHANGED
@@ -1,27 +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 rose-nielsen-sdk -v 0.0.3
13
+ gem install rose-nielsen-sdk -v 0.0.7
16
14
  ```
17
15
 
18
16
  Or add the gem to your Gemfile and run `bundle`:
19
17
 
20
18
  ```ruby
21
- gem 'rose-nielsen-sdk', '0.0.3'
19
+ gem 'rose-nielsen-sdk', '0.0.7'
22
20
  ```
23
21
 
24
- For additional gem details, see the [RubyGems page for the rose-nielsen-sdk gem](https://rubygems.org/gems/rose-nielsen-sdk/versions/0.0.3).
22
+ For additional gem details, see the [RubyGems page for the rose-nielsen-sdk gem](https://rubygems.org/gems/rose-nielsen-sdk/versions/0.0.7).
25
23
 
26
24
  ## Test the SDK
27
25
 
@@ -33,13 +31,13 @@ rake
33
31
 
34
32
  ## Initialize the API Client
35
33
 
36
- **_Note:_** Documentation for the client can be found [here.](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/client.md)
34
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.7/doc/client.md)
37
35
 
38
36
  The following parameters are configurable for the API Client:
39
37
 
40
38
  | Parameter | Type | Description |
41
39
  | --- | --- | --- |
42
- | test_header | `String` | This is a test header<br>*Default*: `'TestHeaderDefaultValue'` |
40
+ | default_host | `String` | *Default*: `'www.example.com'` |
43
41
  | environment | `Environment` | The API environment. <br> **Default: `Environment.PRODUCTION`** |
44
42
  | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
45
43
  | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
@@ -50,77 +48,37 @@ The following parameters are configurable for the API Client:
50
48
  | retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
51
49
  | retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
52
50
  | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
53
- | proxy_settings | [`ProxySettings`](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
54
- | api_key_credentials | [`ApiKeyCredentials`](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/auth/custom-header-signature.md) | The credential object for Custom Header Signature |
55
- | http_basic_credentials | [`HttpBasicCredentials`](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/auth/basic-authentication.md) | The credential object for Basic Authentication |
56
- | petstore_auth_credentials | [`PetstoreAuthCredentials`](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/auth/oauth-2-implicit-grant.md) | The credential object for OAuth 2 Implicit Grant |
51
+ | proxy_settings | [`ProxySettings`](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.7/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
57
52
 
58
53
  The API client can be initialized as follows:
59
54
 
60
55
  ```ruby
61
- require 'swagger_petstore'
62
- include SwaggerPetstore
56
+ require 'cypress_test_api'
57
+ include CypressTestApi
63
58
 
64
59
  client = Client.new(
65
- test_header: 'TestHeaderDefaultValue',
66
- api_key_credentials: ApiKeyCredentials.new(
67
- api_key: 'api_key'
68
- ),
69
- http_basic_credentials: HttpBasicCredentials.new(
70
- username: 'username',
71
- passwprd: 'passwprd'
72
- ),
73
- petstore_auth_credentials: PetstoreAuthCredentials.new(
74
- o_auth_client_id: 'OAuthClientId',
75
- o_auth_redirect_uri: 'OAuthRedirectUri',
76
- o_auth_scopes: [
77
- OAuthScopePetstoreAuthEnum::READPETS,
78
- OAuthScopePetstoreAuthEnum::WRITEPETS
79
- ]
80
- ),
81
- environment: Environment::PRODUCTION
60
+ environment: Environment::PRODUCTION,
61
+ default_host: 'www.example.com'
82
62
  )
83
63
  ```
84
64
 
85
- ## Environments
86
-
87
- The SDK can be configured to use a different environment for making API calls. Available environments are:
88
-
89
- ### Fields
90
-
91
- | Name | Description |
92
- | --- | --- |
93
- | production | **Default** |
94
- | environment2 | - |
95
- | environment3 | - |
96
-
97
- ## Authorization
98
-
99
- This API uses the following authentication schemes.
100
-
101
- * [`api_key (Custom Header Signature)`](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/auth/custom-header-signature.md)
102
- * [`httpBasic (Basic Authentication)`](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/auth/basic-authentication.md)
103
- * [`petstore_auth (OAuth 2 Implicit Grant)`](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/auth/oauth-2-implicit-grant.md)
104
-
105
65
  ## List of APIs
106
66
 
107
- * [Pet](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/controllers/pet.md)
108
- * [Store](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/controllers/store.md)
109
- * [User](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/controllers/user.md)
67
+ * [API](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.7/doc/controllers/api.md)
110
68
 
111
69
  ## SDK Infrastructure
112
70
 
113
71
  ### Configuration
114
72
 
115
- * [ProxySettings](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/proxy-settings.md)
73
+ * [ProxySettings](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.7/doc/proxy-settings.md)
116
74
 
117
75
  ### HTTP
118
76
 
119
- * [HttpResponse](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/http-response.md)
120
- * [HttpRequest](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/http-request.md)
77
+ * [HttpResponse](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.7/doc/http-response.md)
78
+ * [HttpRequest](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.7/doc/http-request.md)
121
79
 
122
80
  ### Utilities
123
81
 
124
- * [ApiHelper](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/api-helper.md)
125
- * [DateTimeHelper](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.3/doc/date-time-helper.md)
82
+ * [ApiHelper](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.7/doc/api-helper.md)
83
+ * [DateTimeHelper](https://www.github.com/ZahraN444/rose-nielsen-ruby-sdk/tree/0.0.7/doc/date-time-helper.md)
126
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
@@ -1,15 +1,13 @@
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
  # An enum for SDK environments.
8
8
  class Environment
9
9
  ENVIRONMENT = [
10
- PRODUCTION = 'production'.freeze,
11
- ENVIRONMENT2 = 'environment2'.freeze,
12
- ENVIRONMENT3 = 'environment3'.freeze
10
+ PRODUCTION = 'production'.freeze
13
11
  ].freeze
14
12
  end
15
13
 
@@ -24,8 +22,7 @@ module SwaggerPetstore
24
22
  # are configured in this class.
25
23
  class Configuration < CoreLibrary::HttpClientConfiguration
26
24
  # The attribute readers for properties.
27
- attr_reader :environment, :api_key_credentials, :http_basic_credentials,
28
- :petstore_auth_credentials, :test_header
25
+ attr_reader :environment, :default_host
29
26
 
30
27
  class << self
31
28
  attr_reader :environments
@@ -36,9 +33,7 @@ module SwaggerPetstore
36
33
  max_retries: 0, retry_interval: 1, backoff_factor: 2,
37
34
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
38
35
  retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
39
- environment: Environment::PRODUCTION, api_key_credentials: nil,
40
- http_basic_credentials: nil, petstore_auth_credentials: nil,
41
- test_header: 'TestHeaderDefaultValue'
36
+ environment: Environment::PRODUCTION, default_host: 'www.example.com'
42
37
  )
43
38
  super connection: connection, adapter: adapter, timeout: timeout,
44
39
  max_retries: max_retries, retry_interval: retry_interval,
@@ -49,17 +44,8 @@ module SwaggerPetstore
49
44
  # Current API environment
50
45
  @environment = String(environment)
51
46
 
52
- # The object holding Custom Header Signature credentials
53
- @api_key_credentials = api_key_credentials
54
-
55
- # The object holding Basic Authentication credentials
56
- @http_basic_credentials = http_basic_credentials
57
-
58
- # The object holding OAuth 2 Implicit Grant credentials
59
- @petstore_auth_credentials = petstore_auth_credentials
60
-
61
- # This is a test header
62
- @test_header = test_header
47
+ # defaultHost value
48
+ @default_host = default_host
63
49
 
64
50
  # The Http Client to use for making requests.
65
51
  set_http_client CoreLibrary::FaradayClient.new(self)
@@ -68,9 +54,7 @@ module SwaggerPetstore
68
54
  def clone_with(connection: nil, adapter: nil, timeout: nil,
69
55
  max_retries: nil, retry_interval: nil, backoff_factor: nil,
70
56
  retry_statuses: nil, retry_methods: nil, http_callback: nil,
71
- proxy_settings: nil, environment: nil,
72
- api_key_credentials: nil, http_basic_credentials: nil,
73
- petstore_auth_credentials: nil, test_header: nil)
57
+ proxy_settings: nil, environment: nil, default_host: nil)
74
58
  connection ||= self.connection
75
59
  adapter ||= self.adapter
76
60
  timeout ||= self.timeout
@@ -82,10 +66,7 @@ module SwaggerPetstore
82
66
  http_callback ||= self.http_callback
83
67
  proxy_settings ||= self.proxy_settings
84
68
  environment ||= self.environment
85
- api_key_credentials ||= self.api_key_credentials
86
- http_basic_credentials ||= self.http_basic_credentials
87
- petstore_auth_credentials ||= self.petstore_auth_credentials
88
- test_header ||= self.test_header
69
+ default_host ||= self.default_host
89
70
 
90
71
  Configuration.new(connection: connection, adapter: adapter,
91
72
  timeout: timeout, max_retries: max_retries,
@@ -95,24 +76,14 @@ module SwaggerPetstore
95
76
  retry_methods: retry_methods,
96
77
  http_callback: http_callback,
97
78
  proxy_settings: proxy_settings,
98
- environment: environment,
99
- api_key_credentials: api_key_credentials,
100
- http_basic_credentials: http_basic_credentials,
101
- petstore_auth_credentials: petstore_auth_credentials,
102
- test_header: test_header)
79
+ environment: environment, default_host: default_host)
103
80
  end
104
81
 
105
82
 
106
83
  # All the environments the SDK can run in.
107
84
  ENVIRONMENTS = {
108
85
  Environment::PRODUCTION => {
109
- Server::DEFAULT => 'https://petstore.swagger.io/v2'
110
- },
111
- Environment::ENVIRONMENT2 => {
112
- Server::DEFAULT => 'http://petstore.swagger.io/v2'
113
- },
114
- Environment::ENVIRONMENT3 => {
115
- Server::DEFAULT => 'https://petstore.swagger.io/oauth'
86
+ Server::DEFAULT => 'https://{defaultHost}'
116
87
  }
117
88
  }.freeze
118
89
 
@@ -121,7 +92,12 @@ module SwaggerPetstore
121
92
  # required.
122
93
  # @return [String] The base URI.
123
94
  def get_base_uri(server = Server::DEFAULT)
124
- ENVIRONMENTS[environment][server].clone
95
+ parameters = {
96
+ 'defaultHost' => { 'value' => default_host, 'encode' => false }
97
+ }
98
+ APIHelper.append_url_with_template_parameters(
99
+ ENVIRONMENTS[environment][server], parameters
100
+ )
125
101
  end
126
102
  end
127
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
@@ -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
  ##
8
8
  # ProxySettings encapsulates HTTP proxy configuration for Faraday,
9
9
  # including optional basic authentication.
@@ -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
@@ -1,36 +1,33 @@
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
7
- # Category Model.
8
- class Category < BaseModel
6
+ module CypressTestApi
7
+ # Deer Model.
8
+ class Deer < BaseModel
9
9
  SKIP = Object.new
10
10
  private_constant :SKIP
11
11
 
12
12
  # TODO: Write general description for this method
13
- # @return [Integer]
14
- attr_accessor :id
13
+ # @return [String]
14
+ attr_accessor :name
15
15
 
16
16
  # TODO: Write general description for this method
17
17
  # @return [String]
18
- attr_accessor :name
18
+ attr_accessor :type
19
19
 
20
20
  # A mapping from model property names to API property names.
21
21
  def self.names
22
22
  @_hash = {} if @_hash.nil?
23
- @_hash['id'] = 'id'
24
23
  @_hash['name'] = 'name'
24
+ @_hash['type'] = 'type'
25
25
  @_hash
26
26
  end
27
27
 
28
28
  # An array for optional fields
29
29
  def self.optionals
30
- %w[
31
- id
32
- name
33
- ]
30
+ []
34
31
  end
35
32
 
36
33
  # An array for nullable fields
@@ -38,9 +35,9 @@ module SwaggerPetstore
38
35
  []
39
36
  end
40
37
 
41
- def initialize(id = SKIP, name = SKIP)
42
- @id = id unless id == SKIP
43
- @name = name unless name == SKIP
38
+ def initialize(name = nil, type = nil)
39
+ @name = name
40
+ @type = type
44
41
  end
45
42
 
46
43
  # Creates an instance of the object from a hash.
@@ -48,24 +45,24 @@ module SwaggerPetstore
48
45
  return nil unless hash
49
46
 
50
47
  # Extract variables from the hash.
51
- id = hash.key?('id') ? hash['id'] : SKIP
52
- name = hash.key?('name') ? hash['name'] : SKIP
48
+ name = hash.key?('name') ? hash['name'] : nil
49
+ type = hash.key?('type') ? hash['type'] : nil
53
50
 
54
51
  # Create object from extracted values.
55
- Category.new(id,
56
- name)
52
+ Deer.new(name,
53
+ type)
57
54
  end
58
55
 
59
56
  # Provides a human-readable string representation of the object.
60
57
  def to_s
61
58
  class_name = self.class.name.split('::').last
62
- "<#{class_name} id: #{@id}, name: #{@name}>"
59
+ "<#{class_name} name: #{@name}, type: #{@type}>"
63
60
  end
64
61
 
65
62
  # Provides a debugging-friendly string with detailed object information.
66
63
  def inspect
67
64
  class_name = self.class.name.split('::').last
68
- "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}>"
65
+ "<#{class_name} name: #{@name.inspect}, type: #{@type.inspect}>"
69
66
  end
70
67
  end
71
68
  end