Class: Clerk::SDKConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/clerk/sdkconfiguration.rb

Overview

Contains the list of servers available to the SDK

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, hooks, retry_config, timeout_ms, bearer_auth, security_source, server_url, server_idx) ⇒ SDKConfiguration

Returns a new instance of SDKConfiguration.

Raises:

  • (StandardError)


64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/clerk/sdkconfiguration.rb', line 64

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 = '6.0.0'
  @gen_version = '2.900.1'
  @user_agent = 'speakeasy-sdk/ruby 6.0.0 2.900.1 2025-11-10 clerk-sdk-ruby'
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



24
25
26
# File 'lib/clerk/sdkconfiguration.rb', line 24

def client
  @client
end

#gen_versionObject

Returns the value of attribute gen_version.



58
59
60
# File 'lib/clerk/sdkconfiguration.rb', line 58

def gen_version
  @gen_version
end

#hooksObject

Returns the value of attribute hooks.



27
28
29
# File 'lib/clerk/sdkconfiguration.rb', line 27

def hooks
  @hooks
end

#languageObject

Returns the value of attribute language.



49
50
51
# File 'lib/clerk/sdkconfiguration.rb', line 49

def language
  @language
end

#openapi_doc_versionObject

Returns the value of attribute openapi_doc_version.



52
53
54
# File 'lib/clerk/sdkconfiguration.rb', line 52

def openapi_doc_version
  @openapi_doc_version
end

#retry_configObject

Returns the value of attribute retry_config.



30
31
32
# File 'lib/clerk/sdkconfiguration.rb', line 30

def retry_config
  @retry_config
end

#sdk_versionObject

Returns the value of attribute sdk_version.



55
56
57
# File 'lib/clerk/sdkconfiguration.rb', line 55

def sdk_version
  @sdk_version
end

#security_sourceObject

Returns the value of attribute security_source.



37
38
39
# File 'lib/clerk/sdkconfiguration.rb', line 37

def security_source
  @security_source
end

#server_idxObject

Returns the value of attribute server_idx.



45
46
47
# File 'lib/clerk/sdkconfiguration.rb', line 45

def server_idx
  @server_idx
end

#server_urlObject

Returns the value of attribute server_url.



41
42
43
# File 'lib/clerk/sdkconfiguration.rb', line 41

def server_url
  @server_url
end

#timeoutObject

Returns the value of attribute timeout.



33
34
35
# File 'lib/clerk/sdkconfiguration.rb', line 33

def timeout
  @timeout
end

#user_agentObject

Returns the value of attribute user_agent.



61
62
63
# File 'lib/clerk/sdkconfiguration.rb', line 61

def user_agent
  @user_agent
end

Instance Method Details

#get_server_detailsObject



85
86
87
88
89
# File 'lib/clerk/sdkconfiguration.rb', line 85

def get_server_details
  return [@server_url.delete_suffix('/'), {}] if !@server_url.nil?
  
  [SERVERS[@server_idx], {}]
end