Sha256: 902da773ecbc463ec6b1e5d5f213dac71841daf689d0a5143056306389b27d32

Contents?: true

Size: 1.54 KB

Versions: 1

Compression:

Stored size: 1.54 KB

Contents

# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.

# typed: true
# frozen_string_literal: true

require 'faraday'
require 'faraday/multipart'
require 'sorbet-runtime'

module OpenApiSDK
  extend T::Sig


  SERVER_PRODUCTION = 'production' # The production Ding API server
  SERVERS = {
    SERVER_PRODUCTION: 'https://api.ding.live/v1',
  }.freeze
  # Contains the list of servers available to the SDK


  class SDKConfiguration < OpenApiSDK::Utils::FieldAugmented
    extend T::Sig

    field :client, T.nilable(Faraday::Connection)
    field :security, Shared::Security
    field :server_url, T.nilable(String)
    field :server, T.nilable(String)
    field :language, String
    field :openapi_doc_version, String
    field :sdk_version, String
    field :gen_version, String
    field :user_agent, String
  
    
    sig { params(client: Faraday::Connection, security: T.nilable(Shared::Security), server_url: T.nilable(String), server_idx: T.nilable(Integer)).void }
    def initialize(client, security, server_url, server_idx)
      @client = client
      @server = server_url.nil? ? '' : server_url
      @language = 'ruby'
      @openapi_doc_version = '1.0.0'
      @sdk_version = '0.5.1'
      @gen_version = '2.231.0'
      @user_agent = 'speakeasy-sdk/ruby 0.5.1 2.231.0 1.0.0 ding_sdk'
    end

    sig { returns([String, T::Hash[Symbol, String]]) }
    def get_server_details
      return [@server_url.delete_suffix('/'), {}] if !@server_url.nil?
      @server = SERVER_PRODUCTION if @server.nil?

      [SERVERS[@server], {}]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ding_sdk-0.5.1 lib/ding/sdkconfiguration.rb