ding_sdk 0.7.2 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ding_sdk/lookup.rb +1 -1
- data/lib/ding_sdk/otp.rb +3 -3
- data/lib/ding_sdk/sdkconfiguration.rb +3 -3
- data/lib/ding_sdk/utils/metadata_fields.rb +8 -12
- data/lib/ding_sdk/utils/t.rb +59 -0
- data/lib/ding_sdk/utils/utils.rb +8 -13
- data/lib/ding_sdk.rb +1 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b12ff403f0d6e4b62773c740528c3da60f938e3118355db1b6e6d9d9a3d8289b
|
4
|
+
data.tar.gz: 97f847aa40d469b426e64f84253a94ba20a8a26050473df0e11a64dc48f7d560
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eca6163e0fa1c90d95d57b4dcb4c1dd8e59088132589755ca0a09a675f9b7373821b48f83136ab7733d4559fe5a11cde756bf2c0b4d6979ae9c3c0464f9a6db4
|
7
|
+
data.tar.gz: 5db64e5d3d0db62691ea62adad65bf505faeee4dd4b4dc242021d307b34e03999e3639e5d070f39547bba00fcf28e570f3e60eea19c4b13bef91f515c01439bb
|
data/lib/ding_sdk/lookup.rb
CHANGED
@@ -19,7 +19,7 @@ module DingSDK
|
|
19
19
|
end
|
20
20
|
|
21
21
|
|
22
|
-
sig { params(customer_uuid: ::String, phone_number: ::String).returns(
|
22
|
+
sig { params(customer_uuid: ::String, phone_number: ::String).returns(::DingSDK::Operations::LookupResponse) }
|
23
23
|
def lookup(customer_uuid, phone_number)
|
24
24
|
# lookup - Perform a phone number lookup
|
25
25
|
request = ::DingSDK::Operations::LookupRequest.new(
|
data/lib/ding_sdk/otp.rb
CHANGED
@@ -19,7 +19,7 @@ module DingSDK
|
|
19
19
|
end
|
20
20
|
|
21
21
|
|
22
|
-
sig { params(request: T.nilable(::DingSDK::Shared::CreateCheckRequest)).returns(
|
22
|
+
sig { params(request: T.nilable(::DingSDK::Shared::CreateCheckRequest)).returns(::DingSDK::Operations::CheckResponse) }
|
23
23
|
def check(request)
|
24
24
|
# check - Check a code
|
25
25
|
url, params = @sdk_configuration.get_server_details
|
@@ -63,7 +63,7 @@ module DingSDK
|
|
63
63
|
end
|
64
64
|
|
65
65
|
|
66
|
-
sig { params(request: T.nilable(::DingSDK::Shared::CreateAuthenticationRequest)).returns(
|
66
|
+
sig { params(request: T.nilable(::DingSDK::Shared::CreateAuthenticationRequest)).returns(::DingSDK::Operations::CreateAutenticationResponse) }
|
67
67
|
def create_autentication(request)
|
68
68
|
# create_autentication - Send a code
|
69
69
|
url, params = @sdk_configuration.get_server_details
|
@@ -107,7 +107,7 @@ module DingSDK
|
|
107
107
|
end
|
108
108
|
|
109
109
|
|
110
|
-
sig { params(request: T.nilable(::DingSDK::Shared::RetryAuthenticationRequest)).returns(
|
110
|
+
sig { params(request: T.nilable(::DingSDK::Shared::RetryAuthenticationRequest)).returns(::DingSDK::Operations::RetryResponse) }
|
111
111
|
def retry(request)
|
112
112
|
# retry - Perform a retry
|
113
113
|
url, params = @sdk_configuration.get_server_details
|
@@ -38,9 +38,9 @@ module DingSDK
|
|
38
38
|
@server = ''
|
39
39
|
@language = 'ruby'
|
40
40
|
@openapi_doc_version = '1.0.0'
|
41
|
-
@sdk_version = '0.7.
|
42
|
-
@gen_version = '2.
|
43
|
-
@user_agent = 'speakeasy-sdk/ruby 0.7.
|
41
|
+
@sdk_version = '0.7.4'
|
42
|
+
@gen_version = '2.263.3'
|
43
|
+
@user_agent = 'speakeasy-sdk/ruby 0.7.4 2.263.3 1.0.0 ding_sdk'
|
44
44
|
end
|
45
45
|
|
46
46
|
sig { returns([String, T::Hash[Symbol, String]]) }
|
@@ -62,28 +62,24 @@ module DingSDK
|
|
62
62
|
end
|
63
63
|
fields.each do |field|
|
64
64
|
field_type = field.type
|
65
|
-
if
|
66
|
-
|
67
|
-
if type2.raw_type == NilClass
|
68
|
-
field_type = field.type.types[0]
|
69
|
-
field_type = field_type.raw_type if field_type.respond_to? :raw_type
|
70
|
-
end
|
65
|
+
if T.nilable? field_type
|
66
|
+
field_type = T.nilable_of(field_type)
|
71
67
|
end
|
72
68
|
|
73
|
-
|
74
69
|
key = "#{field.name}="
|
75
70
|
lookup = field.metadata.fetch(:format_json, {}).fetch(:letter_case, nil).call
|
76
71
|
value = d[lookup]
|
77
72
|
next if value.nil?
|
78
73
|
|
79
|
-
if
|
80
|
-
inner_type = field_type
|
74
|
+
if T.arr? field_type
|
75
|
+
inner_type = T.arr_of(field_type)
|
81
76
|
unmarshalled_array = value.map { |f| unmarshal_single(inner_type, f) }
|
82
77
|
to_build.send(key, unmarshalled_array)
|
83
|
-
elsif
|
84
|
-
|
78
|
+
elsif T.hash? field_type
|
79
|
+
val_type = T.hash_of(field_type)
|
80
|
+
|
85
81
|
# rubocop:disable Style/HashTransformValues
|
86
|
-
unmarshalled_hash = value.map { |k, v| [k, unmarshal_single(val_type
|
82
|
+
unmarshalled_hash = value.map { |k, v| [k, unmarshal_single(val_type, v)] }.to_h
|
87
83
|
# rubocop:enable Style/HashTransformValues
|
88
84
|
to_build.send(key, unmarshalled_hash)
|
89
85
|
else
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
module T
|
7
|
+
def self.arr?(t)
|
8
|
+
if t.respond_to? :underlying_class
|
9
|
+
return t.underlying_class == ::Array
|
10
|
+
end
|
11
|
+
false
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.arr_of(t)
|
15
|
+
get_raw_type(t.type)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.hash?(t)
|
19
|
+
if t.respond_to? :underlying_class
|
20
|
+
return t.underlying_class == ::Hash
|
21
|
+
end
|
22
|
+
false
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.hash_of(t)
|
26
|
+
get_raw_type(t.values)
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.nilable?(t)
|
30
|
+
t.respond_to? :unwrap_nilable
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.nilable_of(t)
|
34
|
+
if t.respond_to? :unwrap_nilable
|
35
|
+
return simplify_type t.unwrap_nilable
|
36
|
+
end
|
37
|
+
nil
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.simplifiable?(t)
|
41
|
+
return t.is_a? T::Types::Simple
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.simplify_type(t)
|
45
|
+
if t.is_a? T::Types::Simple
|
46
|
+
return t.raw_type
|
47
|
+
end
|
48
|
+
t
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.get_raw_type(t)
|
52
|
+
if t.respond_to? :raw_type
|
53
|
+
return t.raw_type
|
54
|
+
elsif t.respond_to? :raw_a
|
55
|
+
return T::Boolean if t.raw_a in [TrueClass, FalseClass]
|
56
|
+
end
|
57
|
+
t
|
58
|
+
end
|
59
|
+
end
|
data/lib/ding_sdk/utils/utils.rb
CHANGED
@@ -742,7 +742,7 @@ module DingSDK
|
|
742
742
|
end
|
743
743
|
end
|
744
744
|
|
745
|
-
sig { params(data:
|
745
|
+
sig { params(data: Object, type: Object).returns(Object) }
|
746
746
|
def self.unmarshal_complex(data, type)
|
747
747
|
begin
|
748
748
|
value = unmarshal_json(JSON.parse(data), type)
|
@@ -754,20 +754,15 @@ module DingSDK
|
|
754
754
|
|
755
755
|
sig { params(data: Object, type: Object).returns(Object) }
|
756
756
|
def self.unmarshal_json(data, type)
|
757
|
+
if T.simplifiable? type
|
758
|
+
type = T.simplify_type type
|
759
|
+
end
|
757
760
|
if type.respond_to? :unmarshal_json
|
758
761
|
type.unmarshal_json(data)
|
759
|
-
elsif
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
data.map { |v| Utils.unmarshal_complex(v, type.type) }
|
764
|
-
end
|
765
|
-
elsif type.to_s.start_with? 'T::Hash'
|
766
|
-
if type.type.types[1].respond_to? :raw_type
|
767
|
-
data.transform_values { |v| Utils.unmarshal_complex(v, type.type.types[1].raw_type) }
|
768
|
-
else
|
769
|
-
data.transform_values { |v| Utils.unmarshal_complex(v, type.type.types[1]) }
|
770
|
-
end
|
762
|
+
elsif T.arr? type
|
763
|
+
data.map { |v| Utils.unmarshal_complex(v, T.arr_of(type)) }
|
764
|
+
elsif T.hash? type
|
765
|
+
data.transform_values { |v| Utils.unmarshal_complex(v, T.hash_of(type)) }
|
771
766
|
else
|
772
767
|
data
|
773
768
|
end
|
data/lib/ding_sdk.rb
CHANGED
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.7.
|
4
|
+
version: 0.7.4
|
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-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -170,14 +170,15 @@ files:
|
|
170
170
|
- lib/ding_sdk/otp.rb
|
171
171
|
- lib/ding_sdk/sdkconfiguration.rb
|
172
172
|
- lib/ding_sdk/utils/metadata_fields.rb
|
173
|
+
- lib/ding_sdk/utils/t.rb
|
173
174
|
- lib/ding_sdk/utils/utils.rb
|
174
|
-
homepage: https://github.com/
|
175
|
+
homepage: https://github.com/ding-live/ding-ruby.git
|
175
176
|
licenses:
|
176
177
|
- Apache-2.0
|
177
178
|
metadata:
|
178
|
-
homepage_uri: https://github.com/
|
179
|
-
documentation_uri: https://github.com/
|
180
|
-
source_code_uri: https://github.com/
|
179
|
+
homepage_uri: https://github.com/ding-live/ding-ruby.git
|
180
|
+
documentation_uri: https://github.com/ding-live/ding-ruby.git
|
181
|
+
source_code_uri: https://github.com/ding-live/ding-ruby.git
|
181
182
|
post_install_message:
|
182
183
|
rdoc_options: []
|
183
184
|
require_paths:
|