Class: Kombo::SDKConfiguration
- Inherits:
-
Object
- Object
- Kombo::SDKConfiguration
- Extended by:
- T::Sig
- Defined in:
- lib/kombo/sdkconfiguration.rb
Overview
Contains the list of servers available to the SDK
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#gen_version ⇒ Object
Returns the value of attribute gen_version.
-
#globals ⇒ Object
Returns the value of attribute globals.
-
#hooks ⇒ Object
Returns the value of attribute hooks.
-
#language ⇒ Object
Returns the value of attribute language.
-
#openapi_doc_version ⇒ Object
Returns the value of attribute openapi_doc_version.
-
#retry_config ⇒ Object
Returns the value of attribute retry_config.
-
#sdk_version ⇒ Object
Returns the value of attribute sdk_version.
-
#security_source ⇒ Object
Returns the value of attribute security_source.
-
#server ⇒ Object
Returns the value of attribute server.
-
#server_url ⇒ Object
Returns the value of attribute server_url.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
- #get_server_details ⇒ Object
-
#initialize(client, hooks, retry_config, timeout_ms, security, security_source, server_url, server, globals) ⇒ SDKConfiguration
constructor
A new instance of SDKConfiguration.
Constructor Details
#initialize(client, hooks, retry_config, timeout_ms, security, security_source, server_url, server, globals) ⇒ SDKConfiguration
Returns a new instance of SDKConfiguration.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/kombo/sdkconfiguration.rb', line 85 def initialize(client, hooks, retry_config, timeout_ms, security, security_source, server_url, server, globals) @client = client @hooks = hooks @retry_config = retry_config @server_url = server_url @timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? @server = server.nil? ? SERVER_EU : server raise StandardError, "Invalid server \"#{server}\"" if !SERVERS.key?(@server) if !security_source.nil? @security_source = security_source elsif !security.nil? @security_source = -> { security } end @globals = globals.nil? ? {} : globals @language = 'ruby' @openapi_doc_version = '1.0.0' @sdk_version = '1.1.0' @gen_version = '2.801.2' @user_agent = 'speakeasy-sdk/ruby 1.1.0 2.801.2 1.0.0 kombo' end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
29 30 31 |
# File 'lib/kombo/sdkconfiguration.rb', line 29 def client @client end |
#gen_version ⇒ Object
Returns the value of attribute gen_version.
67 68 69 |
# File 'lib/kombo/sdkconfiguration.rb', line 67 def gen_version @gen_version end |
#globals ⇒ Object
Returns the value of attribute globals.
54 55 56 |
# File 'lib/kombo/sdkconfiguration.rb', line 54 def globals @globals end |
#hooks ⇒ Object
Returns the value of attribute hooks.
32 33 34 |
# File 'lib/kombo/sdkconfiguration.rb', line 32 def hooks @hooks end |
#language ⇒ Object
Returns the value of attribute language.
58 59 60 |
# File 'lib/kombo/sdkconfiguration.rb', line 58 def language @language end |
#openapi_doc_version ⇒ Object
Returns the value of attribute openapi_doc_version.
61 62 63 |
# File 'lib/kombo/sdkconfiguration.rb', line 61 def openapi_doc_version @openapi_doc_version end |
#retry_config ⇒ Object
Returns the value of attribute retry_config.
35 36 37 |
# File 'lib/kombo/sdkconfiguration.rb', line 35 def retry_config @retry_config end |
#sdk_version ⇒ Object
Returns the value of attribute sdk_version.
64 65 66 |
# File 'lib/kombo/sdkconfiguration.rb', line 64 def sdk_version @sdk_version end |
#security_source ⇒ Object
Returns the value of attribute security_source.
42 43 44 |
# File 'lib/kombo/sdkconfiguration.rb', line 42 def security_source @security_source end |
#server ⇒ Object
Returns the value of attribute server.
50 51 52 |
# File 'lib/kombo/sdkconfiguration.rb', line 50 def server @server end |
#server_url ⇒ Object
Returns the value of attribute server_url.
46 47 48 |
# File 'lib/kombo/sdkconfiguration.rb', line 46 def server_url @server_url end |
#timeout ⇒ Object
Returns the value of attribute timeout.
38 39 40 |
# File 'lib/kombo/sdkconfiguration.rb', line 38 def timeout @timeout end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
70 71 72 |
# File 'lib/kombo/sdkconfiguration.rb', line 70 def user_agent @user_agent end |
Instance Method Details
#get_server_details ⇒ Object
107 108 109 110 111 |
# File 'lib/kombo/sdkconfiguration.rb', line 107 def get_server_details return [@server_url.delete_suffix('/'), {}] if !@server_url.nil? @server = T.must(@server) [T.must(SERVERS[@server]), {}] end |