wesley-key-sdk 0.1.2 → 0.1.6

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 +65 -57
  3. data/bin/console +15 -0
  4. data/lib/{swagger_petstore → cypress_test_api}/api_helper.rb +2 -2
  5. data/lib/cypress_test_api/client.rb +58 -0
  6. data/lib/cypress_test_api/configuration.rb +156 -0
  7. data/lib/cypress_test_api/controllers/api_controller.rb +102 -0
  8. data/lib/{swagger_petstore → cypress_test_api}/controllers/base_controller.rb +2 -2
  9. data/lib/{swagger_petstore → cypress_test_api}/exceptions/api_exception.rb +2 -2
  10. data/lib/{swagger_petstore → cypress_test_api}/http/http_call_back.rb +2 -2
  11. data/lib/{swagger_petstore → cypress_test_api}/http/http_method_enum.rb +2 -2
  12. data/lib/{swagger_petstore → cypress_test_api}/http/http_request.rb +2 -2
  13. data/lib/{swagger_petstore → cypress_test_api}/http/http_response.rb +2 -2
  14. data/lib/cypress_test_api/http/proxy_settings.rb +22 -0
  15. data/lib/{swagger_petstore → cypress_test_api}/models/base_model.rb +2 -2
  16. data/lib/cypress_test_api/models/custom_enum.rb +40 -0
  17. data/lib/{swagger_petstore/models/category.rb → cypress_test_api/models/deer.rb} +18 -21
  18. data/lib/cypress_test_api/models/item.rb +166 -0
  19. data/lib/{swagger_petstore/models/category2.rb → cypress_test_api/models/item_response.rb} +19 -10
  20. data/lib/cypress_test_api/models/lion.rb +68 -0
  21. data/lib/cypress_test_api/models/message.rb +68 -0
  22. data/lib/{swagger_petstore/models/api_response.rb → cypress_test_api/models/message2.rb} +14 -24
  23. data/lib/cypress_test_api/models/multiple_arrays_request.rb +70 -0
  24. data/lib/cypress_test_api/models/nac_tag.rb +265 -0
  25. data/lib/cypress_test_api/models/o_auth_scope_o_auth_acg_enum.rb +44 -0
  26. data/lib/cypress_test_api/models/response_http400.rb +62 -0
  27. data/lib/{swagger_petstore/models/tag.rb → cypress_test_api/models/response_http404.rb} +9 -18
  28. data/lib/cypress_test_api/models/status11_enum.rb +40 -0
  29. data/lib/cypress_test_api/models/status1_enum.rb +40 -0
  30. data/lib/cypress_test_api/models/status_enum.rb +40 -0
  31. data/lib/cypress_test_api/models/tokens_request.rb +60 -0
  32. data/lib/{swagger_petstore → cypress_test_api}/utilities/date_time_helper.rb +2 -2
  33. data/lib/{swagger_petstore → cypress_test_api}/utilities/file_wrapper.rb +2 -2
  34. data/lib/cypress_test_api.rb +55 -0
  35. data/test/controllers/controller_test_base.rb +5 -19
  36. data/test/controllers/test_api_controller.rb +40 -0
  37. data/test/http_response_catcher.rb +2 -2
  38. metadata +39 -45
  39. data/lib/swagger_petstore/client.rb +0 -84
  40. data/lib/swagger_petstore/configuration.rb +0 -127
  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 -42
  46. data/lib/swagger_petstore/http/auth/http_basic.rb +0 -50
  47. data/lib/swagger_petstore/http/auth/petstore_auth.rb +0 -98
  48. data/lib/swagger_petstore/http/proxy_settings.rb +0 -13
  49. data/lib/swagger_petstore/models/content_type_enum.rb +0 -20
  50. data/lib/swagger_petstore/models/o_auth_provider_error_enum.rb +0 -45
  51. data/lib/swagger_petstore/models/o_auth_scope_petstore_auth_enum.rb +0 -23
  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 -26
  57. data/lib/swagger_petstore/models/status2_enum.rb +0 -26
  58. data/lib/swagger_petstore/models/status_enum.rb +0 -26
  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
@@ -0,0 +1,55 @@
1
+ # cypress_test_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ require 'json'
8
+
9
+ require 'apimatic_core_interfaces'
10
+ require 'apimatic_core'
11
+ require 'apimatic_faraday_client_adapter'
12
+
13
+ require_relative 'cypress_test_api/api_helper'
14
+ require_relative 'cypress_test_api/client'
15
+
16
+ # Utilities
17
+ require_relative 'cypress_test_api/utilities/file_wrapper'
18
+ require_relative 'cypress_test_api/utilities/date_time_helper'
19
+
20
+ # Http
21
+ require_relative 'cypress_test_api/http/http_call_back'
22
+ require_relative 'cypress_test_api/http/http_method_enum'
23
+ require_relative 'cypress_test_api/http/http_request'
24
+ require_relative 'cypress_test_api/http/http_response'
25
+ require_relative 'cypress_test_api/http/proxy_settings'
26
+
27
+
28
+
29
+ # Models
30
+ require_relative 'cypress_test_api/models/base_model'
31
+ require_relative 'cypress_test_api/models/multiple_arrays_request'
32
+ require_relative 'cypress_test_api/models/lion'
33
+ require_relative 'cypress_test_api/models/deer'
34
+ require_relative 'cypress_test_api/models/item'
35
+ require_relative 'cypress_test_api/models/response_http400'
36
+ require_relative 'cypress_test_api/models/message'
37
+ require_relative 'cypress_test_api/models/response_http404'
38
+ require_relative 'cypress_test_api/models/nac_tag'
39
+ require_relative 'cypress_test_api/models/item_response'
40
+ require_relative 'cypress_test_api/models/message2'
41
+ require_relative 'cypress_test_api/models/tokens_request'
42
+ require_relative 'cypress_test_api/models/o_auth_scope_o_auth_acg_enum'
43
+ require_relative 'cypress_test_api/models/status_enum'
44
+ require_relative 'cypress_test_api/models/status11_enum'
45
+ require_relative 'cypress_test_api/models/custom_enum'
46
+ require_relative 'cypress_test_api/models/status1_enum'
47
+
48
+ # Exceptions
49
+ require_relative 'cypress_test_api/exceptions/api_exception'
50
+
51
+ require_relative 'cypress_test_api/configuration'
52
+
53
+ # Controllers
54
+ require_relative 'cypress_test_api/controllers/base_controller'
55
+ require_relative 'cypress_test_api/controllers/api_controller'
@@ -1,4 +1,4 @@
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 ).
@@ -8,30 +8,16 @@ require 'minitest/autorun'
8
8
  require 'minitest/hell'
9
9
  require 'minitest/pride'
10
10
  require 'minitest/proveit'
11
- require 'swagger_petstore'
11
+ require 'cypress_test_api'
12
12
  require_relative '../http_response_catcher'
13
13
 
14
14
  class ControllerTestBase < Minitest::Test
15
15
  parallelize_me!
16
- include SwaggerPetstore
16
+ include CypressTestApi
17
17
  include CoreLibrary
18
18
 
19
- # Create configuration and set any test parameters
20
- def create_configuration
21
- Configuration.new(
22
- http_basic_credentials: HttpBasicCredentials.new(username: 'test',
23
- passwprd: 'testPassword'),
24
- http_callback: HttpResponseCatcher.new
25
- )
26
- end
27
-
28
19
  # Initializes the base test controller
29
20
  def setup_class
30
- _config = create_configuration
31
- @client = Client.new(config: _config)
32
-
33
- petstore_auth_token = @client.petstore_auth.fetch_token()
34
- petstore_auth_credentials = _config.petstore_auth_credentials.clone_with(o_auth_token: petstore_auth_token)
35
- _config = _config.clone_with(petstore_auth_credentials: petstore_auth_credentials)
36
- @client = Client.new(config: _config)
37
21
  end
22
+ @client = Client.from_env(http_callback: HttpResponseCatcher.new)
23
+ end
38
24
  end
@@ -0,0 +1,40 @@
1
+ # cypress_test_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0
4
+ # ( https://www.apimatic.io ).
5
+
6
+ require_relative 'controller_test_base'
7
+
8
+ class APIControllerTest < ControllerTestBase
9
+ # Called only once for the class before any test has executed
10
+ def setup
11
+ setup_class
12
+ @controller = @client.client
13
+ @response_catcher = @controller.http_call_back
14
+ end
15
+
16
+ # Generates a new OAuth token with the specified scopes.
17
+ def test_create_o_auth_token
18
+ # Parameters for the API call
19
+ body = nil
20
+
21
+ # Perform the API call through the SDK function
22
+ @controller.create_o_auth_token(body: body)
23
+
24
+ # Test response code
25
+ assert_equal(201, @response_catcher.response.status_code)
26
+ end
27
+
28
+ # This endpoint accepts a complex structure with multiple arrays.
29
+ def test_test_endpointwith_arrays
30
+ # Parameters for the API call
31
+ body = nil
32
+
33
+ # Perform the API call through the SDK function
34
+ @controller.test_endpointwith_arrays(body: body)
35
+
36
+ # Test response code
37
+ assert_equal(200, @response_catcher.response.status_code)
38
+ end
39
+
40
+ 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
- class HttpResponseCatcher < SwaggerPetstore::HttpCallBack
6
+ class HttpResponseCatcher < CypressTestApi::HttpCallBack
7
7
  attr_reader :response
8
8
 
9
9
  def on_before_request(request)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wesley-key-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenyon Jacobs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-18 00:00:00.000000000 Z
11
+ date: 2025-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apimatic_core_interfaces
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.2
19
+ version: 0.2.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.2
26
+ version: 0.2.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: apimatic_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.19
33
+ version: 0.3.20
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.3.19
40
+ version: 0.3.20
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: apimatic_faraday_client_adapter
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -89,46 +89,40 @@ extra_rdoc_files: []
89
89
  files:
90
90
  - LICENSE
91
91
  - README.md
92
- - lib/swagger_petstore.rb
93
- - lib/swagger_petstore/api_helper.rb
94
- - lib/swagger_petstore/client.rb
95
- - lib/swagger_petstore/configuration.rb
96
- - lib/swagger_petstore/controllers/base_controller.rb
97
- - lib/swagger_petstore/controllers/pet_controller.rb
98
- - lib/swagger_petstore/controllers/store_controller.rb
99
- - lib/swagger_petstore/controllers/user_controller.rb
100
- - lib/swagger_petstore/exceptions/api_exception.rb
101
- - lib/swagger_petstore/exceptions/o_auth_provider_exception.rb
102
- - lib/swagger_petstore/http/auth/api_key.rb
103
- - lib/swagger_petstore/http/auth/http_basic.rb
104
- - lib/swagger_petstore/http/auth/petstore_auth.rb
105
- - lib/swagger_petstore/http/http_call_back.rb
106
- - lib/swagger_petstore/http/http_method_enum.rb
107
- - lib/swagger_petstore/http/http_request.rb
108
- - lib/swagger_petstore/http/http_response.rb
109
- - lib/swagger_petstore/http/proxy_settings.rb
110
- - lib/swagger_petstore/models/api_response.rb
111
- - lib/swagger_petstore/models/base_model.rb
112
- - lib/swagger_petstore/models/category.rb
113
- - lib/swagger_petstore/models/category2.rb
114
- - lib/swagger_petstore/models/content_type_enum.rb
115
- - lib/swagger_petstore/models/o_auth_provider_error_enum.rb
116
- - lib/swagger_petstore/models/o_auth_scope_petstore_auth_enum.rb
117
- - lib/swagger_petstore/models/o_auth_token.rb
118
- - lib/swagger_petstore/models/order.rb
119
- - lib/swagger_petstore/models/pet.rb
120
- - lib/swagger_petstore/models/pet_request.rb
121
- - lib/swagger_petstore/models/status1_enum.rb
122
- - lib/swagger_petstore/models/status2_enum.rb
123
- - lib/swagger_petstore/models/status_enum.rb
124
- - lib/swagger_petstore/models/store_order_request.rb
125
- - lib/swagger_petstore/models/tag.rb
126
- - lib/swagger_petstore/models/user.rb
127
- - lib/swagger_petstore/models/user_request.rb
128
- - lib/swagger_petstore/utilities/date_time_helper.rb
129
- - lib/swagger_petstore/utilities/file_wrapper.rb
92
+ - bin/console
93
+ - lib/cypress_test_api.rb
94
+ - lib/cypress_test_api/api_helper.rb
95
+ - lib/cypress_test_api/client.rb
96
+ - lib/cypress_test_api/configuration.rb
97
+ - lib/cypress_test_api/controllers/api_controller.rb
98
+ - lib/cypress_test_api/controllers/base_controller.rb
99
+ - lib/cypress_test_api/exceptions/api_exception.rb
100
+ - lib/cypress_test_api/http/http_call_back.rb
101
+ - lib/cypress_test_api/http/http_method_enum.rb
102
+ - lib/cypress_test_api/http/http_request.rb
103
+ - lib/cypress_test_api/http/http_response.rb
104
+ - lib/cypress_test_api/http/proxy_settings.rb
105
+ - lib/cypress_test_api/models/base_model.rb
106
+ - lib/cypress_test_api/models/custom_enum.rb
107
+ - lib/cypress_test_api/models/deer.rb
108
+ - lib/cypress_test_api/models/item.rb
109
+ - lib/cypress_test_api/models/item_response.rb
110
+ - lib/cypress_test_api/models/lion.rb
111
+ - lib/cypress_test_api/models/message.rb
112
+ - lib/cypress_test_api/models/message2.rb
113
+ - lib/cypress_test_api/models/multiple_arrays_request.rb
114
+ - lib/cypress_test_api/models/nac_tag.rb
115
+ - lib/cypress_test_api/models/o_auth_scope_o_auth_acg_enum.rb
116
+ - lib/cypress_test_api/models/response_http400.rb
117
+ - lib/cypress_test_api/models/response_http404.rb
118
+ - lib/cypress_test_api/models/status11_enum.rb
119
+ - lib/cypress_test_api/models/status1_enum.rb
120
+ - lib/cypress_test_api/models/status_enum.rb
121
+ - lib/cypress_test_api/models/tokens_request.rb
122
+ - lib/cypress_test_api/utilities/date_time_helper.rb
123
+ - lib/cypress_test_api/utilities/file_wrapper.rb
130
124
  - test/controllers/controller_test_base.rb
131
- - test/controllers/test_store_controller.rb
125
+ - test/controllers/test_api_controller.rb
132
126
  - test/http_response_catcher.rb
133
127
  homepage: https://www.halefokodaqiby.com
134
128
  licenses:
@@ -1,84 +0,0 @@
1
- # swagger_petstore
2
- #
3
- # This file was automatically generated by APIMATIC v3.0
4
- # ( https://www.apimatic.io ).
5
-
6
- module SwaggerPetstore
7
- # swagger_petstore client class.
8
- class Client
9
- include CoreLibrary
10
- attr_reader :config, :auth_managers
11
-
12
- # Returns the configured authentication petstore_auth instance.
13
- def petstore_auth
14
- @auth_managers['petstore_auth']
15
- end
16
-
17
- # Access to pet controller.
18
- # @return [PetController] Returns the controller instance.
19
- def pet
20
- @pet ||= PetController.new @global_configuration
21
- end
22
-
23
- # Access to store controller.
24
- # @return [StoreController] Returns the controller instance.
25
- def store
26
- @store ||= StoreController.new @global_configuration
27
- end
28
-
29
- # Access to user controller.
30
- # @return [UserController] Returns the controller instance.
31
- def user
32
- @user ||= UserController.new @global_configuration
33
- end
34
-
35
- def initialize(
36
- connection: nil, adapter: :net_http_persistent, timeout: 60,
37
- max_retries: 0, retry_interval: 1, backoff_factor: 2,
38
- retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
39
- retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
40
- environment: Environment::PRODUCTION, api_key_credentials: nil,
41
- http_basic_credentials: nil, petstore_auth_credentials: nil,
42
- test_header: 'TestHeaderDefaultValue', config: nil
43
- )
44
- @config = if config.nil?
45
- Configuration.new(
46
- connection: connection, adapter: adapter, timeout: timeout,
47
- max_retries: max_retries, retry_interval: retry_interval,
48
- backoff_factor: backoff_factor,
49
- retry_statuses: retry_statuses,
50
- retry_methods: retry_methods, http_callback: http_callback,
51
- proxy_settings: proxy_settings, environment: environment,
52
- api_key_credentials: api_key_credentials,
53
- http_basic_credentials: http_basic_credentials,
54
- petstore_auth_credentials: petstore_auth_credentials,
55
- test_header: test_header
56
- )
57
- else
58
- config
59
- end
60
-
61
- @global_configuration = GlobalConfiguration.new(client_configuration: @config)
62
- .base_uri_executor(@config.method(:get_base_uri))
63
- .global_errors(BaseController::GLOBAL_ERRORS)
64
- .user_agent(BaseController.user_agent)
65
- .global_header('TestHeader', @config.test_header)
66
-
67
- initialize_auth_managers(@global_configuration)
68
- @global_configuration = @global_configuration.auth_managers(@auth_managers)
69
- end
70
-
71
- # Initializes the auth managers hash used for authenticating API calls.
72
- # @param [GlobalConfiguration] global_config The global configuration of the SDK)
73
- def initialize_auth_managers(global_config)
74
- @auth_managers = {}
75
- http_client_config = global_config.client_configuration
76
- %w[api_key httpBasic petstore_auth].each { |auth| @auth_managers[auth] = nil }
77
- @auth_managers['api_key'] = ApiKey.new(http_client_config.api_key_credentials)
78
- @auth_managers['httpBasic'] = HttpBasic.new(http_client_config.http_basic_credentials)
79
- @auth_managers['petstore_auth'] = PetstoreAuth.new(
80
- http_client_config.petstore_auth_credentials, global_config
81
- )
82
- end
83
- end
84
- end
@@ -1,127 +0,0 @@
1
- # swagger_petstore
2
- #
3
- # This file was automatically generated by APIMATIC v3.0
4
- # ( https://www.apimatic.io ).
5
-
6
- module SwaggerPetstore
7
- # An enum for SDK environments.
8
- class Environment
9
- ENVIRONMENT = [
10
- PRODUCTION = 'production'.freeze,
11
- ENVIRONMENT2 = 'environment2'.freeze,
12
- ENVIRONMENT3 = 'environment3'.freeze
13
- ].freeze
14
- end
15
-
16
- # An enum for API servers.
17
- class Server
18
- SERVER = [
19
- DEFAULT = 'default'.freeze
20
- ].freeze
21
- end
22
-
23
- # All configuration including auth info and base URI for the API access
24
- # are configured in this class.
25
- class Configuration < CoreLibrary::HttpClientConfiguration
26
- # The attribute readers for properties.
27
- attr_reader :environment, :api_key_credentials, :http_basic_credentials,
28
- :petstore_auth_credentials, :test_header
29
-
30
- class << self
31
- attr_reader :environments
32
- end
33
-
34
- def initialize(
35
- connection: nil, adapter: :net_http_persistent, timeout: 60,
36
- max_retries: 0, retry_interval: 1, backoff_factor: 2,
37
- retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
38
- 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'
42
- )
43
- super connection: connection, adapter: adapter, timeout: timeout,
44
- max_retries: max_retries, retry_interval: retry_interval,
45
- backoff_factor: backoff_factor, retry_statuses: retry_statuses,
46
- retry_methods: retry_methods, http_callback: http_callback,
47
- proxy_settings: proxy_settings
48
-
49
- # Current API environment
50
- @environment = String(environment)
51
-
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
63
-
64
- # The Http Client to use for making requests.
65
- set_http_client CoreLibrary::FaradayClient.new(self)
66
- end
67
-
68
- def clone_with(connection: nil, adapter: nil, timeout: nil,
69
- max_retries: nil, retry_interval: nil, backoff_factor: nil,
70
- 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)
74
- connection ||= self.connection
75
- adapter ||= self.adapter
76
- timeout ||= self.timeout
77
- max_retries ||= self.max_retries
78
- retry_interval ||= self.retry_interval
79
- backoff_factor ||= self.backoff_factor
80
- retry_statuses ||= self.retry_statuses
81
- retry_methods ||= self.retry_methods
82
- http_callback ||= self.http_callback
83
- proxy_settings ||= self.proxy_settings
84
- 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
89
-
90
- Configuration.new(connection: connection, adapter: adapter,
91
- timeout: timeout, max_retries: max_retries,
92
- retry_interval: retry_interval,
93
- backoff_factor: backoff_factor,
94
- retry_statuses: retry_statuses,
95
- retry_methods: retry_methods,
96
- http_callback: http_callback,
97
- 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)
103
- end
104
-
105
-
106
- # All the environments the SDK can run in.
107
- ENVIRONMENTS = {
108
- 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'
116
- }
117
- }.freeze
118
-
119
- # Generates the appropriate base URI for the environment and the server.
120
- # @param [Configuration::Server] server The server enum for which the base URI is
121
- # required.
122
- # @return [String] The base URI.
123
- def get_base_uri(server = Server::DEFAULT)
124
- ENVIRONMENTS[environment][server].clone
125
- end
126
- end
127
- end