Class: Clerk::SDKConfiguration
- Inherits:
-
Object
- Object
- Clerk::SDKConfiguration
- Defined in:
- lib/clerk/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.
-
#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_idx ⇒ Object
Returns the value of attribute server_idx.
-
#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, bearer_auth, security_source, server_url, server_idx) ⇒ SDKConfiguration
constructor
A new instance of SDKConfiguration.
Constructor Details
#initialize(client, hooks, retry_config, timeout_ms, bearer_auth, security_source, server_url, server_idx) ⇒ SDKConfiguration
Returns a new instance of SDKConfiguration.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/clerk/sdkconfiguration.rb', line 65 def initialize(client, hooks, retry_config, timeout_ms, bearer_auth, security_source, server_url, server_idx) @client = client @hooks = hooks @retry_config = retry_config @server_url = server_url @timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? @server_idx = server_idx.nil? ? 0 : server_idx raise StandardError, "Invalid server index #{server_idx}" if @server_idx.negative? || @server_idx >= SERVERS.length if !security_source.nil? @security_source = security_source elsif !bearer_auth.nil? @security_source = -> { Models::Components::Security.new(bearer_auth: bearer_auth) } end @language = 'ruby' @openapi_doc_version = '2025-11-10' @sdk_version = '5.0.3' @gen_version = '2.806.4' @user_agent = 'speakeasy-sdk/ruby 5.0.3 2.806.4 2025-11-10 dctest-sdk-ruby' end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
25 26 27 |
# File 'lib/clerk/sdkconfiguration.rb', line 25 def client @client end |
#gen_version ⇒ Object
Returns the value of attribute gen_version.
59 60 61 |
# File 'lib/clerk/sdkconfiguration.rb', line 59 def gen_version @gen_version end |
#hooks ⇒ Object
Returns the value of attribute hooks.
28 29 30 |
# File 'lib/clerk/sdkconfiguration.rb', line 28 def hooks @hooks end |
#language ⇒ Object
Returns the value of attribute language.
50 51 52 |
# File 'lib/clerk/sdkconfiguration.rb', line 50 def language @language end |
#openapi_doc_version ⇒ Object
Returns the value of attribute openapi_doc_version.
53 54 55 |
# File 'lib/clerk/sdkconfiguration.rb', line 53 def openapi_doc_version @openapi_doc_version end |
#retry_config ⇒ Object
Returns the value of attribute retry_config.
31 32 33 |
# File 'lib/clerk/sdkconfiguration.rb', line 31 def retry_config @retry_config end |
#sdk_version ⇒ Object
Returns the value of attribute sdk_version.
56 57 58 |
# File 'lib/clerk/sdkconfiguration.rb', line 56 def sdk_version @sdk_version end |
#security_source ⇒ Object
Returns the value of attribute security_source.
38 39 40 |
# File 'lib/clerk/sdkconfiguration.rb', line 38 def security_source @security_source end |
#server_idx ⇒ Object
Returns the value of attribute server_idx.
46 47 48 |
# File 'lib/clerk/sdkconfiguration.rb', line 46 def server_idx @server_idx end |
#server_url ⇒ Object
Returns the value of attribute server_url.
42 43 44 |
# File 'lib/clerk/sdkconfiguration.rb', line 42 def server_url @server_url end |
#timeout ⇒ Object
Returns the value of attribute timeout.
34 35 36 |
# File 'lib/clerk/sdkconfiguration.rb', line 34 def timeout @timeout end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
62 63 64 |
# File 'lib/clerk/sdkconfiguration.rb', line 62 def user_agent @user_agent end |
Instance Method Details
#get_server_details ⇒ Object
86 87 88 89 90 |
# File 'lib/clerk/sdkconfiguration.rb', line 86 def get_server_details return [@server_url.delete_suffix('/'), {}] if !@server_url.nil? [SERVERS[@server_idx], {}] end |