Class: CldProvisioning::SDKConfiguration
- Inherits:
-
Object
- Object
- CldProvisioning::SDKConfiguration
- Extended by:
- T::Sig
- Defined in:
- lib/cld_provisioning/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_idx ⇒ Object
Returns the value of attribute server_idx.
-
#server_params ⇒ Object
Returns the value of attribute server_params.
-
#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_idx, server_params, globals) ⇒ SDKConfiguration
constructor
A new instance of SDKConfiguration.
Constructor Details
#initialize(client, hooks, retry_config, timeout_ms, security, security_source, server_url, server_idx, server_params, globals) ⇒ SDKConfiguration
Returns a new instance of SDKConfiguration.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 89 def initialize( client, hooks, retry_config, timeout_ms, security, security_source, server_url, server_idx, server_params, globals ) @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 if @server_idx.negative? || @server_idx >= SERVERS.length raise StandardError, "Invalid server index #{server_idx}" end @server_params = server_params if !security_source.nil? @security_source = security_source elsif !security.nil? @security_source = -> { security } end @globals = globals.nil? ? {} : globals @language = "ruby" @openapi_doc_version = "0.2.1" @sdk_version = "0.1.0" @gen_version = "2.881.17" @user_agent = "speakeasy-sdk/ruby 0.1.0 2.881.17 0.2.1 cloudinary-account-provisioning" end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
33 34 35 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 33 def client @client end |
#gen_version ⇒ Object
Returns the value of attribute gen_version.
69 70 71 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 69 def gen_version @gen_version end |
#globals ⇒ Object
Returns the value of attribute globals.
57 58 59 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 57 def globals @globals end |
#hooks ⇒ Object
Returns the value of attribute hooks.
36 37 38 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 36 def hooks @hooks end |
#language ⇒ Object
Returns the value of attribute language.
60 61 62 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 60 def language @language end |
#openapi_doc_version ⇒ Object
Returns the value of attribute openapi_doc_version.
63 64 65 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 63 def openapi_doc_version @openapi_doc_version end |
#retry_config ⇒ Object
Returns the value of attribute retry_config.
39 40 41 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 39 def retry_config @retry_config end |
#sdk_version ⇒ Object
Returns the value of attribute sdk_version.
66 67 68 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 66 def sdk_version @sdk_version end |
#security_source ⇒ Object
Returns the value of attribute security_source.
45 46 47 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 45 def security_source @security_source end |
#server_idx ⇒ Object
Returns the value of attribute server_idx.
51 52 53 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 51 def server_idx @server_idx end |
#server_params ⇒ Object
Returns the value of attribute server_params.
54 55 56 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 54 def server_params @server_params end |
#server_url ⇒ Object
Returns the value of attribute server_url.
48 49 50 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 48 def server_url @server_url end |
#timeout ⇒ Object
Returns the value of attribute timeout.
42 43 44 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 42 def timeout @timeout end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
72 73 74 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 72 def user_agent @user_agent end |
Instance Method Details
#get_server_details ⇒ Object
127 128 129 130 131 |
# File 'lib/cld_provisioning/sdkconfiguration.rb', line 127 def get_server_details return [@server_url.delete_suffix("/"), {}] if !@server_url.nil? @server_idx = T.must(@server_idx) [T.must(SERVERS[@server_idx]), T.must(@server_params[@server_idx])] end |