ding_sdk 0.7.5 → 0.8.1
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 +4 -4
- data/lib/ding_sdk/ding.rb +12 -20
- data/lib/ding_sdk/models/shared/createcheckrequest.rb +1 -1
- data/lib/ding_sdk/sdkconfiguration.rb +13 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cdca78c379e55096fd5b7b876fe949834196b5eb7136c19df8c27ae208b93f0
|
4
|
+
data.tar.gz: 6e3217e895807fa52b4d2486cfcc9a9754187ef0e3dd2fe5d839cfa914ca955b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1ab312b3926985c7ee98beca73bbc4939ca5ac6aa5d7af0aa562b4f1aab217248f82e70a066bdaf8185307adb4e610df62aab884e82a3e1ff4b3cdc06117bd4
|
7
|
+
data.tar.gz: 0c4417449e068aa1eb64fcf4140ee17047718da1af17cdeea5cfaf1e5257a226bbbafda3b74b2c16028dc2cbd5551166505d62e6dbdbeef361fe077e7242b1ee
|
data/lib/ding_sdk/ding.rb
CHANGED
@@ -17,24 +17,24 @@ module DingSDK
|
|
17
17
|
attr_accessor :security, :language, :sdk_version, :gen_version
|
18
18
|
|
19
19
|
sig do
|
20
|
-
params(
|
21
|
-
|
20
|
+
params(client: Faraday::Request,
|
21
|
+
security: T.nilable(Shared::Security),
|
22
|
+
server_idx: Integer,
|
22
23
|
server_url: String,
|
23
|
-
url_params: T::Hash[Symbol, String]
|
24
|
-
client: Faraday::Request).void
|
24
|
+
url_params: T::Hash[Symbol, String]).void
|
25
25
|
end
|
26
|
-
def initialize(
|
27
|
-
|
26
|
+
def initialize(client: nil,
|
27
|
+
security: nil,
|
28
|
+
server_idx: nil,
|
28
29
|
server_url: nil,
|
29
|
-
url_params: nil
|
30
|
-
client: nil)
|
30
|
+
url_params: nil)
|
31
31
|
|
32
32
|
## Instantiates the SDK configuring it with the provided parameters.
|
33
|
+
# @param [Faraday::Request] client The faraday HTTP client to use for all operations
|
33
34
|
# @param [Shared::Security] security The security details required for authentication
|
34
|
-
# @param [
|
35
|
+
# @param [Integer] server_idx The index of the server to use for all operations
|
35
36
|
# @param [String] server_url The server URL to use for all operations
|
36
37
|
# @param [Hash<Symbol, String>] url_params Parameters to optionally template the server URL with
|
37
|
-
# @param [Faraday::Request] client The faraday HTTP client to use for all operations
|
38
38
|
|
39
39
|
if client.nil?
|
40
40
|
client = Faraday.new(request: {
|
@@ -50,11 +50,11 @@ module DingSDK
|
|
50
50
|
server_url = Utils.template_url(server_url, url_params)
|
51
51
|
end
|
52
52
|
end
|
53
|
-
|
53
|
+
server_idx = 0 if server_idx.nil?
|
54
54
|
|
55
55
|
|
56
56
|
|
57
|
-
@sdk_configuration = SDKConfiguration.new(client, security, server_url,
|
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
|
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
|
-
|
15
|
-
|
16
|
-
|
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
|
|
@@ -29,26 +27,28 @@ module DingSDK
|
|
29
27
|
field :sdk_version, String
|
30
28
|
field :gen_version, String
|
31
29
|
field :user_agent, String
|
32
|
-
|
33
|
-
|
30
|
+
|
31
|
+
|
34
32
|
sig { params(client: Faraday::Connection, security: T.nilable(Shared::Security), server_url: T.nilable(String), server_idx: T.nilable(Integer)).void }
|
35
33
|
def initialize(client, security, server_url, server_idx)
|
36
34
|
@client = client
|
37
35
|
@server_url = server_url
|
38
|
-
@
|
36
|
+
@server_idx = server_idx.nil? ? 0 : server_idx
|
37
|
+
@security = security
|
39
38
|
@language = 'ruby'
|
40
39
|
@openapi_doc_version = '1.0.0'
|
41
|
-
@sdk_version = '0.
|
42
|
-
@gen_version = '2.
|
43
|
-
@user_agent = 'speakeasy-sdk/ruby 0.
|
40
|
+
@sdk_version = '0.8.1'
|
41
|
+
@gen_version = '2.272.7'
|
42
|
+
@user_agent = 'speakeasy-sdk/ruby 0.8.1 2.272.7 1.0.0 ding_sdk'
|
44
43
|
end
|
45
44
|
|
46
45
|
sig { returns([String, T::Hash[Symbol, String]]) }
|
47
46
|
def get_server_details
|
48
47
|
return [@server_url.delete_suffix('/'), {}] if !@server_url.nil?
|
49
|
-
@
|
48
|
+
@server_idx = 0 if @server_idx.nil?
|
49
|
+
|
50
50
|
|
51
|
-
[SERVERS[@
|
51
|
+
[SERVERS[@server_idx], {}]
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ding_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ding
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|