ding_sdk 0.7.5 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6778824929e44b871bbfc03c191b20e0b088539c1e9a5754ee6bdc8ebfa574bd
4
- data.tar.gz: 2e05203beac18e575cc449302f7a85761e1efbbc38ceed531edfac52699d64ca
3
+ metadata.gz: f84533f98bbf0d9cf87836ab11e3a24ce0773e0a3d503739a5bf5f7fe256012a
4
+ data.tar.gz: '084262380d11fb6407c3fd71b696cc4d019eba1aaa533a0d7365564cf9569a5f'
5
5
  SHA512:
6
- metadata.gz: 86cd2d1d769b87c96f07b011f71bf4cafc37dcebfa007a9d8d748257a48c6b5b7dc91c239f6f9f86e3a187da5926b8ffb6faef4eb51caa6971c9f82bac639271
7
- data.tar.gz: 500f0572a1b6ba122f17b7440f1fdcb6527fbdc4c2148a9e95afe493202c4e75e877ee75149d486c38d79f2308691bf466dbcec2c5b3d9f6fc2ab597697cf34a
6
+ metadata.gz: 47654bc4e1df81efd6d37166e441a00cf9f90dac5e606064dd6bfe88888ad2f2b01d5bfd49fed7c34d1865864e50d7b894b8da8496dff16c7a879eabbd839ccd
7
+ data.tar.gz: 7850b3c8e3421e5cb593d9930f83aa0409d486988a19d59579dde367eaa940bc3cef1b355ed77987e410c164dd83ec9a0586ae14c207d1980eaef83c626ab1ff
data/lib/ding_sdk/ding.rb CHANGED
@@ -18,20 +18,20 @@ module DingSDK
18
18
 
19
19
  sig do
20
20
  params(security: T.nilable(Shared::Security),
21
- server: String,
21
+ server_idx: Integer,
22
22
  server_url: String,
23
23
  url_params: T::Hash[Symbol, String],
24
24
  client: Faraday::Request).void
25
25
  end
26
26
  def initialize(security: nil,
27
- server: nil,
27
+ server_idx: nil,
28
28
  server_url: nil,
29
29
  url_params: nil,
30
30
  client: nil)
31
31
 
32
32
  ## Instantiates the SDK configuring it with the provided parameters.
33
33
  # @param [Shared::Security] security The security details required for authentication
34
- # @param [String] server The server by name to use for all operations
34
+ # @param [Integer] server_idx The index of the server to use for all operations
35
35
  # @param [String] server_url The server URL to use for all operations
36
36
  # @param [Hash<Symbol, String>] url_params Parameters to optionally template the server URL with
37
37
  # @param [Faraday::Request] client The faraday HTTP client to use for all operations
@@ -50,11 +50,11 @@ module DingSDK
50
50
  server_url = Utils.template_url(server_url, url_params)
51
51
  end
52
52
  end
53
- server = SERVER_PRODUCTION if server.nil?
53
+ server_idx = 0 if server_idx.nil?
54
54
 
55
55
 
56
56
 
57
- @sdk_configuration = SDKConfiguration.new(client, security, server_url, server)
57
+ @sdk_configuration = SDKConfiguration.new(client, security, server_url, server_idx)
58
58
  init_sdks
59
59
  end
60
60
 
@@ -66,14 +66,6 @@ module DingSDK
66
66
  init_sdks
67
67
  end
68
68
 
69
- sig { params(server: String, params: T.nilable(T::Hash[Symbol, String])).void }
70
- def config_server(params)
71
- raise StandardError, 'Invalid server' if !SERVERS.include? server
72
-
73
- config_server_url(params)
74
- init_sdks
75
- end
76
-
77
69
  sig { params(security: ::DingSDK::Shared::Security).void }
78
70
  def config_security(security)
79
71
  @security = security
@@ -15,7 +15,7 @@ module DingSDK
15
15
  field :authentication_uuid, ::String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('authentication_uuid') } }
16
16
  # The code that the user entered.
17
17
  field :check_code, ::String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('check_code') } }
18
- # Your customer UUID, which can be found in the API settings in the dashboard.
18
+ # Your customer UUID, which can be found in the API settings in the Dashboard.
19
19
  field :customer_uuid, ::String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('customer_uuid') } }
20
20
 
21
21
 
@@ -11,13 +11,11 @@ module DingSDK
11
11
  extend T::Sig
12
12
 
13
13
 
14
- SERVER_PRODUCTION = 'production' # The production Ding API server
15
- SERVERS = {
16
- SERVER_PRODUCTION: 'https://api.ding.live/v1',
17
- }.freeze
14
+ SERVERS = [
15
+ 'https://api.ding.live/v1', # 1 - The production Ding API server
16
+ ].freeze
18
17
  # Contains the list of servers available to the SDK
19
18
 
20
-
21
19
  class SDKConfiguration < ::DingSDK::Utils::FieldAugmented
22
20
  extend T::Sig
23
21
 
@@ -35,20 +33,21 @@ module DingSDK
35
33
  def initialize(client, security, server_url, server_idx)
36
34
  @client = client
37
35
  @server_url = server_url
38
- @server = ''
36
+ @server_idx = server_idx.nil? ? 0 : server_idx
39
37
  @language = 'ruby'
40
38
  @openapi_doc_version = '1.0.0'
41
- @sdk_version = '0.7.5'
39
+ @sdk_version = '0.8.0'
42
40
  @gen_version = '2.263.3'
43
- @user_agent = 'speakeasy-sdk/ruby 0.7.5 2.263.3 1.0.0 ding_sdk'
41
+ @user_agent = 'speakeasy-sdk/ruby 0.8.0 2.263.3 1.0.0 ding_sdk'
44
42
  end
45
43
 
46
44
  sig { returns([String, T::Hash[Symbol, String]]) }
47
45
  def get_server_details
48
46
  return [@server_url.delete_suffix('/'), {}] if !@server_url.nil?
49
- @server = SERVER_PRODUCTION if @server.nil?
47
+ @server_idx = 0 if @server_idx.nil?
48
+
50
49
 
51
- [SERVERS[@server], {}]
50
+ [SERVERS[@server_idx], {}]
52
51
  end
53
52
  end
54
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ding_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ding