Class: DingSDK::SDKConfiguration

Inherits:
Utils::FieldAugmented show all
Extended by:
T::Sig
Defined in:
lib/ding_sdk/sdkconfiguration.rb

Overview

Contains the list of servers available to the SDK

Instance Method Summary collapse

Methods included from MetadataFields

#field, #fields, included, #marshal_json, #marshal_single

Constructor Details

#initialize(client, security, server_url, server_idx) ⇒ SDKConfiguration

Returns a new instance of SDKConfiguration.

Raises:

  • (StandardError)


33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/ding_sdk/sdkconfiguration.rb', line 33

def initialize(client, security, server_url, server_idx)
  @client = client
  @server_url = server_url
  @server_idx = server_idx.nil? ? 0 : server_idx
  raise StandardError, "Invalid server index #{server_idx}" if @server_idx.negative? || @server_idx >= SERVERS.length
  @security = security
  @language = 'ruby'
  @openapi_doc_version = '1.0.0'
  @sdk_version = '0.8.18'
  @gen_version = '2.421.3'
  @user_agent = 'speakeasy-sdk/ruby 0.8.18 2.421.3 1.0.0 ding_sdk'
end

Instance Method Details

#get_server_detailsObject



47
48
49
50
# File 'lib/ding_sdk/sdkconfiguration.rb', line 47

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