ding_sdk 0.12.17 → 0.13.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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/crystalline/metadata_fields.rb +33 -0
  3. data/lib/crystalline/t.rb +21 -2
  4. data/lib/crystalline/utils.rb +29 -13
  5. data/lib/ding_sdk/lookup.rb +1 -1
  6. data/lib/ding_sdk/models/operations/check_response.rb +10 -0
  7. data/lib/ding_sdk/models/operations/create_authentication_response.rb +10 -0
  8. data/lib/ding_sdk/models/operations/feedback_response.rb +10 -0
  9. data/lib/ding_sdk/models/operations/getauthenticationstatus_request.rb +6 -0
  10. data/lib/ding_sdk/models/operations/getauthenticationstatus_response.rb +10 -0
  11. data/lib/ding_sdk/models/operations/lookup_request.rb +8 -0
  12. data/lib/ding_sdk/models/operations/lookup_response.rb +10 -0
  13. data/lib/ding_sdk/models/operations/retry_response.rb +10 -0
  14. data/lib/ding_sdk/models/operations.rb +2 -2
  15. data/lib/ding_sdk/models/shared/attempt.rb +64 -0
  16. data/lib/ding_sdk/models/shared/authenticationstatusresponse.rb +14 -2
  17. data/lib/ding_sdk/models/shared/authenticationstatusresponse_schemas_events_type.rb +20 -0
  18. data/lib/ding_sdk/models/shared/authenticationstatusresponse_schemas_status.rb +27 -0
  19. data/lib/ding_sdk/models/shared/authenticationstatusresponse_schemas_type.rb +20 -0
  20. data/lib/ding_sdk/models/shared/authenticationstatusresponse_status.rb +27 -0
  21. data/lib/ding_sdk/models/shared/authenticationstatusresponse_type.rb +20 -0
  22. data/lib/ding_sdk/models/shared/balance_update.rb +42 -0
  23. data/lib/ding_sdk/models/shared/balance_update_type.rb +23 -0
  24. data/lib/ding_sdk/models/shared/capability.rb +20 -0
  25. data/lib/ding_sdk/models/shared/check.rb +46 -0
  26. data/lib/ding_sdk/models/shared/createauthenticationrequest.rb +20 -0
  27. data/lib/ding_sdk/models/shared/createauthenticationresponse.rb +9 -0
  28. data/lib/ding_sdk/models/shared/createcheckrequest.rb +8 -0
  29. data/lib/ding_sdk/models/shared/createcheckresponse.rb +7 -0
  30. data/lib/ding_sdk/models/shared/delivery_status.rb +56 -0
  31. data/lib/ding_sdk/models/shared/errorresponse.rb +8 -0
  32. data/lib/ding_sdk/models/shared/events.rb +25 -0
  33. data/lib/ding_sdk/models/shared/feedbackrequest.rb +8 -0
  34. data/lib/ding_sdk/models/shared/feedbackresponse.rb +6 -0
  35. data/lib/ding_sdk/models/shared/lookupresponse.rb +14 -0
  36. data/lib/ding_sdk/models/shared/retryauthenticationrequest.rb +7 -0
  37. data/lib/ding_sdk/models/shared/retryauthenticationresponse.rb +10 -0
  38. data/lib/ding_sdk/models/shared/security.rb +6 -0
  39. data/lib/ding_sdk/models/shared/signals.rb +13 -0
  40. data/lib/ding_sdk/models/shared/type.rb +20 -0
  41. data/lib/ding_sdk/models/shared.rb +29 -16
  42. data/lib/ding_sdk/otp.rb +5 -5
  43. data/lib/ding_sdk/sdkconfiguration.rb +3 -3
  44. data/lib/ding_sdk/utils/utils.rb +3 -3
  45. metadata +15 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6a816772f8e188d2ed032498ed11755ad5f8a213538cab782fb8e6234bf0c13
4
- data.tar.gz: 8953a9ba8479c91ed6bd08f36028199eea52bed9a13a0235b9194e57bedbd5a9
3
+ metadata.gz: 84fef8b8ffe786e075eb181dc6bd636332f3637e30a863db0f8790b4f48cb556
4
+ data.tar.gz: a9ffc8e8f8c45093917eec5444dcea76813ccb099fd85f7038041f69839a295a
5
5
  SHA512:
6
- metadata.gz: 742681a34392c876c18ff7313b6053ca6a81fe86a10d2df9bd67e9424c99c8db2d1ec8f7cb6b531b32b8241cb010bddf1738ff98af9e0b1ab9c255a575e29090
7
- data.tar.gz: d317ae530eb8ee588a2fd77b97ceeeca9d52fe8ecf2d8336377f042c99d7c0d3b07c2bf1248a1a2da3660806187c64336bd435336f592d666fb25c0fc2f49cdc
6
+ metadata.gz: 3f4fc67784683540d6ea9c412e7974dcdc05ff55860616d43cf74fc4466977731e1a072bb0671b1726efed3c09d10c53f872b1dc82bbb9b95d1b8079710d5e9a
7
+ data.tar.gz: e07b15c7045f5f93f7857fd40bc6fbb29081d045d22dc554e0c5d18ab19398a5cb050d84a3cbd449c1b03115c58d282270ba450edaefe4e43a3ccf8fec7f0244
@@ -80,6 +80,10 @@ module Crystalline
80
80
  key = "#{field.name}="
81
81
  lookup = field.metadata.fetch(:format_json, {}).fetch(:letter_case, nil).call
82
82
  value = d[lookup]
83
+
84
+ # If field is not nilable, and the value is not in the dict, raise a KeyError
85
+ raise KeyError, "key #{lookup} not found in hash" if value.nil? && !T.nilable?(field.type)
86
+ # If field is nilable, and the value is not in the dict, just move to the next field
83
87
  next if value.nil?
84
88
 
85
89
  if T.arr? field_type
@@ -93,12 +97,41 @@ module Crystalline
93
97
  unmarshalled_hash = value.map { |k, v| [k, unmarshal_single(val_type, v)] }.to_h
94
98
  # rubocop:enable Style/HashTransformValues
95
99
  to_build.send(key, unmarshalled_hash)
100
+ elsif T.union? field_type
101
+ discriminator = field.metadata.fetch(:discriminator, nil)
102
+ if !discriminator.nil?
103
+ type_to_deserialize = value.fetch(discriminator)
104
+ type_to_deserialize = T.get_union_types(field_type).find { |t| t.name.split('::').last == type_to_deserialize }
105
+ unmarshalled_val = Crystalline.unmarshal_json(value, type_to_deserialize)
106
+ to_build.send(key, unmarshalled_val)
107
+ else
108
+ union_types = T.get_union_types(field_type)
109
+ union_types = union_types.sort_by { |klass| Crystalline.non_nilable_attr_count(klass) }
110
+
111
+ union_types.each do |union_type|
112
+ begin
113
+ unmarshalled_val = Crystalline.unmarshal_json(value, union_type)
114
+ to_build.send(key, unmarshalled_val)
115
+ rescue TypeError
116
+ next
117
+ rescue NoMethodError
118
+ next
119
+ rescue KeyError
120
+ next
121
+ end
122
+ break
123
+ end
124
+ end
125
+ elsif field_type.instance_of?(Class) && field_type < ::Crystalline::FieldAugmented
126
+ unmarshalled = Crystalline.unmarshal_json(value, field_type)
127
+ to_build.send(key, unmarshalled)
96
128
  else
97
129
  decoder = field.metadata.fetch(:format_json, {}).fetch(:decoder, nil)
98
130
  final_value = unmarshal_single(field_type, value, decoder)
99
131
  to_build.send(key, final_value)
100
132
  end
101
133
  end
134
+
102
135
  to_build
103
136
  end
104
137
  end
data/lib/crystalline/t.rb CHANGED
@@ -27,11 +27,17 @@ module T
27
27
  end
28
28
 
29
29
  def self.nilable?(t)
30
- t.respond_to? :unwrap_nilable
30
+ # in sorbet all `T.any` types provide unwrap_nilable for some reason
31
+ # So, in order to make this check more robust, we check if the type responds to the `types` method, and if so, whether
32
+ # one of those types is NilClass. For non-nilable unions, `types` will return a valid list that does not include NilClass
33
+ return false unless t.respond_to?(:unwrap_nilable)
34
+ return true unless t.respond_to?(:types)
35
+ t.types.map { |tt| simplify_type(tt) }.include?(NilClass)
31
36
  end
32
37
 
33
38
  def self.nilable_of(t)
34
- if t.respond_to? :unwrap_nilable
39
+
40
+ if nilable t
35
41
  return simplify_type t.unwrap_nilable
36
42
  end
37
43
  nil
@@ -48,6 +54,19 @@ module T
48
54
  t
49
55
  end
50
56
 
57
+
58
+ def self.union?(t)
59
+ return false unless t.respond_to? :types
60
+ return false if t.types.any? { |tt| get_raw_type(tt) == TrueClass }
61
+ return false if t.types.length == 2 && t.types.any? { |tt| get_raw_type(tt) == NilClass }
62
+ t.types.length > 1
63
+ end
64
+
65
+ def self.get_union_types(t)
66
+ t.types.map { |tt| get_raw_type(tt) }
67
+ end
68
+
69
+
51
70
  def self.get_raw_type(t)
52
71
  if t.respond_to? :raw_type
53
72
  return t.raw_type
@@ -13,25 +13,20 @@ module Crystalline
13
13
  end
14
14
 
15
15
  sig { params(complex: Object).returns(Object) }
16
- def self.marshal_dict_complex(complex)
16
+ def self.to_dict(complex)
17
17
  if complex.is_a? Array
18
- complex.map { |v| Crystalline.marshal_dict_complex(v) }
18
+ complex.map { |v| Crystalline.to_dict(v) }
19
19
  elsif complex.is_a? Hash
20
- complex.transform_values { |v| Crystalline.marshal_dict_complex(v) }
20
+ complex.transform_values { |v| Crystalline.to_dict(v) }
21
21
  elsif complex.is_a? Crystalline::FieldAugmented
22
22
  complex.to_dict
23
23
  else
24
- complex
24
+ val_to_string complex, primitives: false
25
25
  end
26
26
  end
27
27
 
28
- def self.marshal_json_complex(complex)
29
- JSON.dump(marshal_dict_complex(complex))
30
- end
31
-
32
- sig { params(data: Object, type: Object).returns(Object) }
33
- def self.unmarshal_complex(data, type)
34
- unmarshal_json(data, type)
28
+ def self.to_json(complex)
29
+ JSON.dump(to_dict(complex))
35
30
  end
36
31
 
37
32
  sig { params(data: Object, type: Object).returns(Object) }
@@ -42,9 +37,9 @@ module Crystalline
42
37
  if type.instance_of?(Class) && type < ::Crystalline::FieldAugmented
43
38
  type.from_dict(data)
44
39
  elsif T.arr? type
45
- data.map { |v| Crystalline.unmarshal_complex(v, T.arr_of(type)) }
40
+ data.map { |v| Crystalline.unmarshal_json(v, T.arr_of(type)) }
46
41
  elsif T.hash? type
47
- data.transform_values { |v| Crystalline.unmarshal_complex(v, T.hash_of(type)) }
42
+ data.transform_values { |v| Crystalline.unmarshal_json(v, T.hash_of(type)) }
48
43
  else
49
44
  data
50
45
  end
@@ -62,4 +57,25 @@ module Crystalline
62
57
  val
63
58
  end
64
59
  end
60
+
61
+ sig { params(klass: T.any(Class, T::Types::TypedArray, T::Types::TypedHash)).returns(Integer) }
62
+ def self.non_nilable_attr_count(klass)
63
+ # somewhat sane sort ordering for Union deserialization.
64
+ # All Crystalline objects return the number of non-nilable fields
65
+ # All non-string primitives return 2
66
+ # All arrays and hashes return 1
67
+ # Strings return 0 (since any data can deserialize to a string, it should be our last attempt)
68
+ if klass.respond_to? :fields
69
+ return -1 * klass.fields.count do |field|
70
+ !T.nilable? field.type
71
+ end
72
+ else
73
+ if klass == String
74
+ return 0
75
+ elsif klass.is_a?(T::Types::TypedArray) || klass.is_a?(T::Types::TypedHash)
76
+ return 1
77
+ end
78
+ return 2
79
+ end
80
+ end
65
81
  end
@@ -53,7 +53,7 @@ module DingSDK
53
53
 
54
54
  hook_ctx = SDKHooks::HookContext.new(
55
55
  base_url: base_url,
56
- oauth2_scopes: nil,
56
+ oauth2_scopes: [],
57
57
  operation_id: 'lookup',
58
58
  security_source: @sdk_configuration.security_source
59
59
  )
@@ -31,6 +31,16 @@ module DingSDK
31
31
  @create_check_response = create_check_response
32
32
  @error_response = error_response
33
33
  end
34
+
35
+ def ==(other)
36
+ return false unless other.is_a? self.class
37
+ return false unless @content_type == other.content_type
38
+ return false unless @raw_response == other.raw_response
39
+ return false unless @status_code == other.status_code
40
+ return false unless @create_check_response == other.create_check_response
41
+ return false unless @error_response == other.error_response
42
+ true
43
+ end
34
44
  end
35
45
  end
36
46
  end
@@ -31,6 +31,16 @@ module DingSDK
31
31
  @create_authentication_response = create_authentication_response
32
32
  @error_response = error_response
33
33
  end
34
+
35
+ def ==(other)
36
+ return false unless other.is_a? self.class
37
+ return false unless @content_type == other.content_type
38
+ return false unless @raw_response == other.raw_response
39
+ return false unless @status_code == other.status_code
40
+ return false unless @create_authentication_response == other.create_authentication_response
41
+ return false unless @error_response == other.error_response
42
+ true
43
+ end
34
44
  end
35
45
  end
36
46
  end
@@ -31,6 +31,16 @@ module DingSDK
31
31
  @error_response = error_response
32
32
  @feedback_response = feedback_response
33
33
  end
34
+
35
+ def ==(other)
36
+ return false unless other.is_a? self.class
37
+ return false unless @content_type == other.content_type
38
+ return false unless @raw_response == other.raw_response
39
+ return false unless @status_code == other.status_code
40
+ return false unless @error_response == other.error_response
41
+ return false unless @feedback_response == other.feedback_response
42
+ true
43
+ end
34
44
  end
35
45
  end
36
46
  end
@@ -19,6 +19,12 @@ module DingSDK
19
19
  def initialize(auth_uuid: nil)
20
20
  @auth_uuid = auth_uuid
21
21
  end
22
+
23
+ def ==(other)
24
+ return false unless other.is_a? self.class
25
+ return false unless @auth_uuid == other.auth_uuid
26
+ true
27
+ end
22
28
  end
23
29
  end
24
30
  end
@@ -31,6 +31,16 @@ module DingSDK
31
31
  @authentication_status_response = authentication_status_response
32
32
  @error_response = error_response
33
33
  end
34
+
35
+ def ==(other)
36
+ return false unless other.is_a? self.class
37
+ return false unless @content_type == other.content_type
38
+ return false unless @raw_response == other.raw_response
39
+ return false unless @status_code == other.status_code
40
+ return false unless @authentication_status_response == other.authentication_status_response
41
+ return false unless @error_response == other.error_response
42
+ true
43
+ end
34
44
  end
35
45
  end
36
46
  end
@@ -25,6 +25,14 @@ module DingSDK
25
25
  @phone_number = phone_number
26
26
  @type = type
27
27
  end
28
+
29
+ def ==(other)
30
+ return false unless other.is_a? self.class
31
+ return false unless @customer_uuid == other.customer_uuid
32
+ return false unless @phone_number == other.phone_number
33
+ return false unless @type == other.type
34
+ true
35
+ end
28
36
  end
29
37
  end
30
38
  end
@@ -31,6 +31,16 @@ module DingSDK
31
31
  @error_response = error_response
32
32
  @lookup_response = lookup_response
33
33
  end
34
+
35
+ def ==(other)
36
+ return false unless other.is_a? self.class
37
+ return false unless @content_type == other.content_type
38
+ return false unless @raw_response == other.raw_response
39
+ return false unless @status_code == other.status_code
40
+ return false unless @error_response == other.error_response
41
+ return false unless @lookup_response == other.lookup_response
42
+ true
43
+ end
34
44
  end
35
45
  end
36
46
  end
@@ -31,6 +31,16 @@ module DingSDK
31
31
  @error_response = error_response
32
32
  @retry_authentication_response = retry_authentication_response
33
33
  end
34
+
35
+ def ==(other)
36
+ return false unless other.is_a? self.class
37
+ return false unless @content_type == other.content_type
38
+ return false unless @raw_response == other.raw_response
39
+ return false unless @status_code == other.status_code
40
+ return false unless @error_response == other.error_response
41
+ return false unless @retry_authentication_response == other.retry_authentication_response
42
+ true
43
+ end
34
44
  end
35
45
  end
36
46
  end
@@ -10,9 +10,9 @@ module DingSDK
10
10
  autoload :FeedbackResponse, 'ding_sdk/models/operations/feedback_response.rb'
11
11
  autoload :GetAuthenticationStatusRequest, 'ding_sdk/models/operations/getauthenticationstatus_request.rb'
12
12
  autoload :GetAuthenticationStatusResponse, 'ding_sdk/models/operations/getauthenticationstatus_response.rb'
13
- autoload :RetryResponse, 'ding_sdk/models/operations/retry_response.rb'
14
- autoload :Type, 'ding_sdk/models/operations/type.rb'
15
13
  autoload :LookupRequest, 'ding_sdk/models/operations/lookup_request.rb'
16
14
  autoload :LookupResponse, 'ding_sdk/models/operations/lookup_response.rb'
15
+ autoload :RetryResponse, 'ding_sdk/models/operations/retry_response.rb'
16
+ autoload :Type, 'ding_sdk/models/operations/type.rb'
17
17
  end
18
18
  end
@@ -0,0 +1,64 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+
11
+ class Attempt < ::Crystalline::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # The attempt number.
15
+ field :attempt_number, T.nilable(::Integer), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('attempt_number') } }
16
+ # The capability of the attempt.
17
+ field :capability, T.nilable(::DingSDK::Shared::Capability), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('capability'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::Capability, true) } }
18
+ # The content of the attempt.
19
+ field :content, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('content') } }
20
+
21
+ field :created_at, T.nilable(::DateTime), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('created_at'), 'decoder': Utils.datetime_from_iso_format(true) } }
22
+ # The ID of the attempt.
23
+ field :id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('id') } }
24
+ # The sender ID of the attempt.
25
+ field :sender_id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('sender_id') } }
26
+ # The status of the attempt. Possible values are:
27
+ # * `pending` - The attempt is pending.
28
+ # * `delivered` - The attempt was delivered.
29
+ # * `failed` - The attempt failed.
30
+ # * `rate_limited` - The authentication was rate limited and cannot be retried.
31
+ # * `expired` - The authentication has expired and cannot be retried.
32
+ #
33
+ field :status, T.nilable(::DingSDK::Shared::AuthenticationStatusResponseSchemasStatus), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('status'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::AuthenticationStatusResponseSchemasStatus, true) } }
34
+ # The type of the event.
35
+ field :type, T.nilable(::DingSDK::Shared::Type), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('type'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::Type, true) } }
36
+
37
+
38
+ sig { params(attempt_number: T.nilable(::Integer), capability: T.nilable(::DingSDK::Shared::Capability), content: T.nilable(::String), created_at: T.nilable(::DateTime), id: T.nilable(::String), sender_id: T.nilable(::String), status: T.nilable(::DingSDK::Shared::AuthenticationStatusResponseSchemasStatus), type: T.nilable(::DingSDK::Shared::Type)).void }
39
+ def initialize(attempt_number: nil, capability: nil, content: nil, created_at: nil, id: nil, sender_id: nil, status: nil, type: nil)
40
+ @attempt_number = attempt_number
41
+ @capability = capability
42
+ @content = content
43
+ @created_at = created_at
44
+ @id = id
45
+ @sender_id = sender_id
46
+ @status = status
47
+ @type = type
48
+ end
49
+
50
+ def ==(other)
51
+ return false unless other.is_a? self.class
52
+ return false unless @attempt_number == other.attempt_number
53
+ return false unless @capability == other.capability
54
+ return false unless @content == other.content
55
+ return false unless @created_at == other.created_at
56
+ return false unless @id == other.id
57
+ return false unless @sender_id == other.sender_id
58
+ return false unless @status == other.status
59
+ return false unless @type == other.type
60
+ true
61
+ end
62
+ end
63
+ end
64
+ end
@@ -16,7 +16,7 @@ module DingSDK
16
16
 
17
17
  field :created_at, T.nilable(::DateTime), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('created_at'), 'decoder': Utils.datetime_from_iso_format(true) } }
18
18
  # Represents a collection of events that occur during the authentication process. Each event captures specific actions and outcomes related to the authentication attempts, checks, delivery statuses, and balance updates. The array can contain different types of events, each with its own structure and properties.
19
- field :events, T.nilable(T::Array[::Object]), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('events') } }
19
+ field :events, T.nilable(T::Array[T.any(::DingSDK::Shared::Attempt, ::DingSDK::Shared::Check, ::DingSDK::Shared::DeliveryStatus, ::DingSDK::Shared::BalanceUpdate)]), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('events') } }
20
20
  # An E.164 formatted phone number.
21
21
  field :phone_number, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('phone_number') } }
22
22
  # [Signals](/guides/prevent-fraud#signals) are data points used to distinguish between fraudulent and legitimate users.
@@ -27,7 +27,7 @@ module DingSDK
27
27
  field :uuid, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('uuid') } }
28
28
 
29
29
 
30
- sig { params(correlation_id: T.nilable(::String), created_at: T.nilable(::DateTime), events: T.nilable(T::Array[::Object]), phone_number: T.nilable(::String), signals: T.nilable(::DingSDK::Shared::Signals), template_id: T.nilable(::String), uuid: T.nilable(::String)).void }
30
+ sig { params(correlation_id: T.nilable(::String), created_at: T.nilable(::DateTime), events: T.nilable(T::Array[T.any(::DingSDK::Shared::Attempt, ::DingSDK::Shared::Check, ::DingSDK::Shared::DeliveryStatus, ::DingSDK::Shared::BalanceUpdate)]), phone_number: T.nilable(::String), signals: T.nilable(::DingSDK::Shared::Signals), template_id: T.nilable(::String), uuid: T.nilable(::String)).void }
31
31
  def initialize(correlation_id: nil, created_at: nil, events: nil, phone_number: nil, signals: nil, template_id: nil, uuid: nil)
32
32
  @correlation_id = correlation_id
33
33
  @created_at = created_at
@@ -37,6 +37,18 @@ module DingSDK
37
37
  @template_id = template_id
38
38
  @uuid = uuid
39
39
  end
40
+
41
+ def ==(other)
42
+ return false unless other.is_a? self.class
43
+ return false unless @correlation_id == other.correlation_id
44
+ return false unless @created_at == other.created_at
45
+ return false unless @events == other.events
46
+ return false unless @phone_number == other.phone_number
47
+ return false unless @signals == other.signals
48
+ return false unless @template_id == other.template_id
49
+ return false unless @uuid == other.uuid
50
+ true
51
+ end
40
52
  end
41
53
  end
42
54
  end
@@ -0,0 +1,20 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+ # AuthenticationStatusResponseSchemasEventsType - The type of the event.
11
+ class AuthenticationStatusResponseSchemasEventsType < T::Enum
12
+ enums do
13
+ ATTEMPT = new('attempt')
14
+ CHECK = new('check')
15
+ DELIVERY_STATUS = new('delivery_status')
16
+ BALANCE_UPDATE = new('balance_update')
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,27 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+ # AuthenticationStatusResponseSchemasStatus - The status of the attempt. Possible values are:
11
+ # * `pending` - The attempt is pending.
12
+ # * `delivered` - The attempt was delivered.
13
+ # * `failed` - The attempt failed.
14
+ # * `rate_limited` - The authentication was rate limited and cannot be retried.
15
+ # * `expired` - The authentication has expired and cannot be retried.
16
+ #
17
+ class AuthenticationStatusResponseSchemasStatus < T::Enum
18
+ enums do
19
+ PENDING = new('pending')
20
+ DELIVERED = new('delivered')
21
+ FAILED = new('failed')
22
+ RATE_LIMITED = new('rate_limited')
23
+ EXPIRED = new('expired')
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,20 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+ # AuthenticationStatusResponseSchemasType - The type of the event.
11
+ class AuthenticationStatusResponseSchemasType < T::Enum
12
+ enums do
13
+ ATTEMPT = new('attempt')
14
+ CHECK = new('check')
15
+ DELIVERY_STATUS = new('delivery_status')
16
+ BALANCE_UPDATE = new('balance_update')
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,27 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+ # AuthenticationStatusResponseStatus - The status of the delivery. Possible values are:
11
+ # * `unknown` - The status of the delivery is unknown.
12
+ # * `submitted` - The message has been submitted to the carrier.
13
+ # * `in_transit` - The message is in transit to the recipient.
14
+ # * `delivered` - The message has been delivered to the recipient.
15
+ # * `undeliverable` - The message could not be delivered to the recipient.
16
+ #
17
+ class AuthenticationStatusResponseStatus < T::Enum
18
+ enums do
19
+ UNKNOWN = new('unknown')
20
+ SUBMITTED = new('submitted')
21
+ IN_TRANSIT = new('in_transit')
22
+ DELIVERED = new('delivered')
23
+ UNDELIVERABLE = new('undeliverable')
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,20 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+ # AuthenticationStatusResponseType - The type of the event.
11
+ class AuthenticationStatusResponseType < T::Enum
12
+ enums do
13
+ ATTEMPT = new('attempt')
14
+ CHECK = new('check')
15
+ DELIVERY_STATUS = new('delivery_status')
16
+ BALANCE_UPDATE = new('balance_update')
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,42 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+
11
+ class BalanceUpdate < ::Crystalline::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # The amount of the balance update.
15
+ field :amount, T.nilable(::Float), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('amount') } }
16
+
17
+ field :balance_update_type, T.nilable(::DingSDK::Shared::BalanceUpdateType), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('balance_update_type'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::BalanceUpdateType, true) } }
18
+
19
+ field :created_at, T.nilable(::DateTime), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('created_at'), 'decoder': Utils.datetime_from_iso_format(true) } }
20
+ # The type of the event.
21
+ field :type, T.nilable(::DingSDK::Shared::AuthenticationStatusResponseSchemasEventsType), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('type'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::AuthenticationStatusResponseSchemasEventsType, true) } }
22
+
23
+
24
+ sig { params(amount: T.nilable(::Float), balance_update_type: T.nilable(::DingSDK::Shared::BalanceUpdateType), created_at: T.nilable(::DateTime), type: T.nilable(::DingSDK::Shared::AuthenticationStatusResponseSchemasEventsType)).void }
25
+ def initialize(amount: nil, balance_update_type: nil, created_at: nil, type: nil)
26
+ @amount = amount
27
+ @balance_update_type = balance_update_type
28
+ @created_at = created_at
29
+ @type = type
30
+ end
31
+
32
+ def ==(other)
33
+ return false unless other.is_a? self.class
34
+ return false unless @amount == other.amount
35
+ return false unless @balance_update_type == other.balance_update_type
36
+ return false unless @created_at == other.created_at
37
+ return false unless @type == other.type
38
+ true
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,23 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+
11
+ class BalanceUpdateType < T::Enum
12
+ enums do
13
+ UNKNOWN = new('unknown')
14
+ AUTHENTICATION = new('authentication')
15
+ ATTEMPT = new('attempt')
16
+ ATTEMPT_PENDING = new('attempt_pending')
17
+ ATTEMPT_SUCCESS = new('attempt_success')
18
+ AUTHENTICATION_PENDING = new('authentication_pending')
19
+ AUTHENTICATION_SUCCESS = new('authentication_success')
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,20 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+ # Capability - The capability of the attempt.
11
+ class Capability < T::Enum
12
+ enums do
13
+ RCS = new('rcs')
14
+ TEXT = new('text')
15
+ WHATSAPP = new('whatsapp')
16
+ VIBER = new('viber')
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,46 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+
11
+ class Check < ::Crystalline::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # The code that was checked.
15
+ field :code, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('code') } }
16
+
17
+ field :created_at, T.nilable(::DateTime), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('created_at'), 'decoder': Utils.datetime_from_iso_format(true) } }
18
+ # The ID of the check.
19
+ field :id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('id') } }
20
+
21
+ field :status, T.nilable(::DingSDK::Shared::CheckStatus), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('status'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::CheckStatus, true) } }
22
+ # The type of the event.
23
+ field :type, T.nilable(::DingSDK::Shared::AuthenticationStatusResponseType), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('type'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::AuthenticationStatusResponseType, true) } }
24
+
25
+
26
+ sig { params(code: T.nilable(::String), created_at: T.nilable(::DateTime), id: T.nilable(::String), status: T.nilable(::DingSDK::Shared::CheckStatus), type: T.nilable(::DingSDK::Shared::AuthenticationStatusResponseType)).void }
27
+ def initialize(code: nil, created_at: nil, id: nil, status: nil, type: nil)
28
+ @code = code
29
+ @created_at = created_at
30
+ @id = id
31
+ @status = status
32
+ @type = type
33
+ end
34
+
35
+ def ==(other)
36
+ return false unless other.is_a? self.class
37
+ return false unless @code == other.code
38
+ return false unless @created_at == other.created_at
39
+ return false unless @id == other.id
40
+ return false unless @status == other.status
41
+ return false unless @type == other.type
42
+ true
43
+ end
44
+ end
45
+ end
46
+ end
@@ -61,6 +61,26 @@ module DingSDK
61
61
  @sender_id = sender_id
62
62
  @template_id = template_id
63
63
  end
64
+
65
+ def ==(other)
66
+ return false unless other.is_a? self.class
67
+ return false unless @customer_uuid == other.customer_uuid
68
+ return false unless @phone_number == other.phone_number
69
+ return false unless @app_realm == other.app_realm
70
+ return false unless @app_version == other.app_version
71
+ return false unless @callback_url == other.callback_url
72
+ return false unless @correlation_id == other.correlation_id
73
+ return false unless @device_id == other.device_id
74
+ return false unless @device_model == other.device_model
75
+ return false unless @device_type == other.device_type
76
+ return false unless @ip == other.ip
77
+ return false unless @is_returning_user == other.is_returning_user
78
+ return false unless @locale == other.locale
79
+ return false unless @os_version == other.os_version
80
+ return false unless @sender_id == other.sender_id
81
+ return false unless @template_id == other.template_id
82
+ true
83
+ end
64
84
  end
65
85
  end
66
86
  end
@@ -32,6 +32,15 @@ module DingSDK
32
32
  @expires_at = expires_at
33
33
  @status = status
34
34
  end
35
+
36
+ def ==(other)
37
+ return false unless other.is_a? self.class
38
+ return false unless @authentication_uuid == other.authentication_uuid
39
+ return false unless @created_at == other.created_at
40
+ return false unless @expires_at == other.expires_at
41
+ return false unless @status == other.status
42
+ true
43
+ end
35
44
  end
36
45
  end
37
46
  end
@@ -25,6 +25,14 @@ module DingSDK
25
25
  @check_code = check_code
26
26
  @customer_uuid = customer_uuid
27
27
  end
28
+
29
+ def ==(other)
30
+ return false unless other.is_a? self.class
31
+ return false unless @authentication_uuid == other.authentication_uuid
32
+ return false unless @check_code == other.check_code
33
+ return false unless @customer_uuid == other.customer_uuid
34
+ true
35
+ end
28
36
  end
29
37
  end
30
38
  end
@@ -22,6 +22,13 @@ module DingSDK
22
22
  @authentication_uuid = authentication_uuid
23
23
  @status = status
24
24
  end
25
+
26
+ def ==(other)
27
+ return false unless other.is_a? self.class
28
+ return false unless @authentication_uuid == other.authentication_uuid
29
+ return false unless @status == other.status
30
+ true
31
+ end
25
32
  end
26
33
  end
27
34
  end
@@ -0,0 +1,56 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+
11
+ class DeliveryStatus < ::Crystalline::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # The ID of the attempt.
15
+ field :attempt_id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('attempt_id') } }
16
+ # The attempt number.
17
+ field :attempt_number, T.nilable(::Integer), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('attempt_number') } }
18
+
19
+ field :created_at, T.nilable(::DateTime), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('created_at'), 'decoder': Utils.datetime_from_iso_format(true) } }
20
+ # The date and time from the provider.
21
+ field :originated_at, T.nilable(::DateTime), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('originated_at'), 'decoder': Utils.datetime_from_iso_format(true) } }
22
+ # The status of the delivery. Possible values are:
23
+ # * `unknown` - The status of the delivery is unknown.
24
+ # * `submitted` - The message has been submitted to the carrier.
25
+ # * `in_transit` - The message is in transit to the recipient.
26
+ # * `delivered` - The message has been delivered to the recipient.
27
+ # * `undeliverable` - The message could not be delivered to the recipient.
28
+ #
29
+ field :status, T.nilable(::DingSDK::Shared::AuthenticationStatusResponseStatus), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('status'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::AuthenticationStatusResponseStatus, true) } }
30
+ # The type of the event.
31
+ field :type, T.nilable(::DingSDK::Shared::AuthenticationStatusResponseSchemasType), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('type'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::AuthenticationStatusResponseSchemasType, true) } }
32
+
33
+
34
+ sig { params(attempt_id: T.nilable(::String), attempt_number: T.nilable(::Integer), created_at: T.nilable(::DateTime), originated_at: T.nilable(::DateTime), status: T.nilable(::DingSDK::Shared::AuthenticationStatusResponseStatus), type: T.nilable(::DingSDK::Shared::AuthenticationStatusResponseSchemasType)).void }
35
+ def initialize(attempt_id: nil, attempt_number: nil, created_at: nil, originated_at: nil, status: nil, type: nil)
36
+ @attempt_id = attempt_id
37
+ @attempt_number = attempt_number
38
+ @created_at = created_at
39
+ @originated_at = originated_at
40
+ @status = status
41
+ @type = type
42
+ end
43
+
44
+ def ==(other)
45
+ return false unless other.is_a? self.class
46
+ return false unless @attempt_id == other.attempt_id
47
+ return false unless @attempt_number == other.attempt_number
48
+ return false unless @created_at == other.created_at
49
+ return false unless @originated_at == other.originated_at
50
+ return false unless @status == other.status
51
+ return false unless @type == other.type
52
+ true
53
+ end
54
+ end
55
+ end
56
+ end
@@ -25,6 +25,14 @@ module DingSDK
25
25
  @doc_url = doc_url
26
26
  @message = message
27
27
  end
28
+
29
+ def ==(other)
30
+ return false unless other.is_a? self.class
31
+ return false unless @code == other.code
32
+ return false unless @doc_url == other.doc_url
33
+ return false unless @message == other.message
34
+ true
35
+ end
28
36
  end
29
37
  end
30
38
  end
@@ -0,0 +1,25 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+
11
+ class Events < ::Crystalline::FieldAugmented
12
+ extend T::Sig
13
+
14
+
15
+
16
+
17
+ def initialize; end
18
+
19
+ def ==(other)
20
+ return false unless other.is_a? self.class
21
+ true
22
+ end
23
+ end
24
+ end
25
+ end
@@ -25,6 +25,14 @@ module DingSDK
25
25
  @phone_number = phone_number
26
26
  @status = status
27
27
  end
28
+
29
+ def ==(other)
30
+ return false unless other.is_a? self.class
31
+ return false unless @customer_uuid == other.customer_uuid
32
+ return false unless @phone_number == other.phone_number
33
+ return false unless @status == other.status
34
+ true
35
+ end
28
36
  end
29
37
  end
30
38
  end
@@ -19,6 +19,12 @@ module DingSDK
19
19
  def initialize(uuid: nil)
20
20
  @uuid = uuid
21
21
  end
22
+
23
+ def ==(other)
24
+ return false unless other.is_a? self.class
25
+ return false unless @uuid == other.uuid
26
+ true
27
+ end
22
28
  end
23
29
  end
24
30
  end
@@ -63,6 +63,20 @@ module DingSDK
63
63
  @phone_number = phone_number
64
64
  @temporary_phone_number = temporary_phone_number
65
65
  end
66
+
67
+ def ==(other)
68
+ return false unless other.is_a? self.class
69
+ return false unless @caller_name == other.caller_name
70
+ return false unless @carrier == other.carrier
71
+ return false unless @country_code == other.country_code
72
+ return false unless @line_type == other.line_type
73
+ return false unless @mcc == other.mcc
74
+ return false unless @mnc == other.mnc
75
+ return false unless @number_ported == other.number_ported
76
+ return false unless @phone_number == other.phone_number
77
+ return false unless @temporary_phone_number == other.temporary_phone_number
78
+ true
79
+ end
66
80
  end
67
81
  end
68
82
  end
@@ -22,6 +22,13 @@ module DingSDK
22
22
  @authentication_uuid = authentication_uuid
23
23
  @customer_uuid = customer_uuid
24
24
  end
25
+
26
+ def ==(other)
27
+ return false unless other.is_a? self.class
28
+ return false unless @authentication_uuid == other.authentication_uuid
29
+ return false unless @customer_uuid == other.customer_uuid
30
+ true
31
+ end
25
32
  end
26
33
  end
27
34
  end
@@ -38,6 +38,16 @@ module DingSDK
38
38
  @remaining_retry = remaining_retry
39
39
  @status = status
40
40
  end
41
+
42
+ def ==(other)
43
+ return false unless other.is_a? self.class
44
+ return false unless @authentication_uuid == other.authentication_uuid
45
+ return false unless @created_at == other.created_at
46
+ return false unless @next_retry_at == other.next_retry_at
47
+ return false unless @remaining_retry == other.remaining_retry
48
+ return false unless @status == other.status
49
+ true
50
+ end
41
51
  end
42
52
  end
43
53
  end
@@ -19,6 +19,12 @@ module DingSDK
19
19
  def initialize(api_key: nil)
20
20
  @api_key = api_key
21
21
  end
22
+
23
+ def ==(other)
24
+ return false unless other.is_a? self.class
25
+ return false unless @api_key == other.api_key
26
+ true
27
+ end
22
28
  end
23
29
  end
24
30
  end
@@ -40,6 +40,19 @@ module DingSDK
40
40
  @is_returning_user = is_returning_user
41
41
  @os_version = os_version
42
42
  end
43
+
44
+ def ==(other)
45
+ return false unless other.is_a? self.class
46
+ return false unless @app_realm == other.app_realm
47
+ return false unless @app_version == other.app_version
48
+ return false unless @device_id == other.device_id
49
+ return false unless @device_model == other.device_model
50
+ return false unless @device_type == other.device_type
51
+ return false unless @ip == other.ip
52
+ return false unless @is_returning_user == other.is_returning_user
53
+ return false unless @os_version == other.os_version
54
+ true
55
+ end
43
56
  end
44
57
  end
45
58
  end
@@ -0,0 +1,20 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+ # Type - The type of the event.
11
+ class Type < T::Enum
12
+ enums do
13
+ ATTEMPT = new('attempt')
14
+ CHECK = new('check')
15
+ DELIVERY_STATUS = new('delivery_status')
16
+ BALANCE_UPDATE = new('balance_update')
17
+ end
18
+ end
19
+ end
20
+ end
@@ -5,26 +5,39 @@
5
5
 
6
6
  module DingSDK
7
7
  module Shared
8
- autoload :Code, 'ding_sdk/models/shared/code.rb'
9
- autoload :ErrorResponse, 'ding_sdk/models/shared/errorresponse.rb'
10
- autoload :CreateCheckResponse, 'ding_sdk/models/shared/createcheckresponse.rb'
8
+ autoload :Attempt, 'ding_sdk/models/shared/attempt.rb'
9
+ autoload :AuthenticationStatusResponse, 'ding_sdk/models/shared/authenticationstatusresponse.rb'
10
+ autoload :AuthenticationStatusResponseSchemasEventsType, 'ding_sdk/models/shared/authenticationstatusresponse_schemas_events_type.rb'
11
+ autoload :AuthenticationStatusResponseSchemasStatus, 'ding_sdk/models/shared/authenticationstatusresponse_schemas_status.rb'
12
+ autoload :AuthenticationStatusResponseSchemasType, 'ding_sdk/models/shared/authenticationstatusresponse_schemas_type.rb'
13
+ autoload :AuthenticationStatusResponseDeviceType, 'ding_sdk/models/shared/authenticationstatusresponse_device_type.rb'
14
+ autoload :AuthenticationStatusResponseStatus, 'ding_sdk/models/shared/authenticationstatusresponse_status.rb'
15
+ autoload :AuthenticationStatusResponseType, 'ding_sdk/models/shared/authenticationstatusresponse_type.rb'
16
+ autoload :BalanceUpdate, 'ding_sdk/models/shared/balance_update.rb'
17
+ autoload :Check, 'ding_sdk/models/shared/check.rb'
11
18
  autoload :CheckStatus, 'ding_sdk/models/shared/checkstatus.rb'
12
- autoload :CreateCheckRequest, 'ding_sdk/models/shared/createcheckrequest.rb'
13
- autoload :Status, 'ding_sdk/models/shared/status.rb'
14
- autoload :CreateAuthenticationResponse, 'ding_sdk/models/shared/createauthenticationresponse.rb'
15
- autoload :DeviceType, 'ding_sdk/models/shared/device_type.rb'
16
19
  autoload :CreateAuthenticationRequest, 'ding_sdk/models/shared/createauthenticationrequest.rb'
17
- autoload :FeedbackResponse, 'ding_sdk/models/shared/feedbackresponse.rb'
18
- autoload :FeedbackRequestStatus, 'ding_sdk/models/shared/feedbackrequest_status.rb'
20
+ autoload :CreateAuthenticationResponse, 'ding_sdk/models/shared/createauthenticationresponse.rb'
21
+ autoload :CreateCheckRequest, 'ding_sdk/models/shared/createcheckrequest.rb'
22
+ autoload :CreateCheckResponse, 'ding_sdk/models/shared/createcheckresponse.rb'
23
+ autoload :DeliveryStatus, 'ding_sdk/models/shared/delivery_status.rb'
24
+ autoload :ErrorResponse, 'ding_sdk/models/shared/errorresponse.rb'
19
25
  autoload :FeedbackRequest, 'ding_sdk/models/shared/feedbackrequest.rb'
20
- autoload :AuthenticationStatusResponseDeviceType, 'ding_sdk/models/shared/authenticationstatusresponse_device_type.rb'
21
- autoload :Signals, 'ding_sdk/models/shared/signals.rb'
22
- autoload :AuthenticationStatusResponse, 'ding_sdk/models/shared/authenticationstatusresponse.rb'
23
- autoload :RetryAuthenticationResponseStatus, 'ding_sdk/models/shared/retryauthenticationresponse_status.rb'
24
- autoload :RetryAuthenticationResponse, 'ding_sdk/models/shared/retryauthenticationresponse.rb'
25
- autoload :RetryAuthenticationRequest, 'ding_sdk/models/shared/retryauthenticationrequest.rb'
26
- autoload :LineType, 'ding_sdk/models/shared/line_type.rb'
26
+ autoload :FeedbackRequestStatus, 'ding_sdk/models/shared/feedbackrequest_status.rb'
27
+ autoload :FeedbackResponse, 'ding_sdk/models/shared/feedbackresponse.rb'
27
28
  autoload :LookupResponse, 'ding_sdk/models/shared/lookupresponse.rb'
29
+ autoload :RetryAuthenticationRequest, 'ding_sdk/models/shared/retryauthenticationrequest.rb'
30
+ autoload :RetryAuthenticationResponse, 'ding_sdk/models/shared/retryauthenticationresponse.rb'
31
+ autoload :RetryAuthenticationResponseStatus, 'ding_sdk/models/shared/retryauthenticationresponse_status.rb'
28
32
  autoload :Security, 'ding_sdk/models/shared/security.rb'
33
+ autoload :BalanceUpdateType, 'ding_sdk/models/shared/balance_update_type.rb'
34
+ autoload :Capability, 'ding_sdk/models/shared/capability.rb'
35
+ autoload :Code, 'ding_sdk/models/shared/code.rb'
36
+ autoload :DeviceType, 'ding_sdk/models/shared/device_type.rb'
37
+ autoload :Events, 'ding_sdk/models/shared/events.rb'
38
+ autoload :LineType, 'ding_sdk/models/shared/line_type.rb'
39
+ autoload :Signals, 'ding_sdk/models/shared/signals.rb'
40
+ autoload :Status, 'ding_sdk/models/shared/status.rb'
41
+ autoload :Type, 'ding_sdk/models/shared/type.rb'
29
42
  end
30
43
  end
data/lib/ding_sdk/otp.rb CHANGED
@@ -51,7 +51,7 @@ module DingSDK
51
51
 
52
52
  hook_ctx = SDKHooks::HookContext.new(
53
53
  base_url: base_url,
54
- oauth2_scopes: nil,
54
+ oauth2_scopes: [],
55
55
  operation_id: 'check',
56
56
  security_source: @sdk_configuration.security_source
57
57
  )
@@ -149,7 +149,7 @@ module DingSDK
149
149
 
150
150
  hook_ctx = SDKHooks::HookContext.new(
151
151
  base_url: base_url,
152
- oauth2_scopes: nil,
152
+ oauth2_scopes: [],
153
153
  operation_id: 'create-authentication',
154
154
  security_source: @sdk_configuration.security_source
155
155
  )
@@ -247,7 +247,7 @@ module DingSDK
247
247
 
248
248
  hook_ctx = SDKHooks::HookContext.new(
249
249
  base_url: base_url,
250
- oauth2_scopes: nil,
250
+ oauth2_scopes: [],
251
251
  operation_id: 'feedback',
252
252
  security_source: @sdk_configuration.security_source
253
253
  )
@@ -344,7 +344,7 @@ module DingSDK
344
344
 
345
345
  hook_ctx = SDKHooks::HookContext.new(
346
346
  base_url: base_url,
347
- oauth2_scopes: nil,
347
+ oauth2_scopes: [],
348
348
  operation_id: 'getAuthenticationStatus',
349
349
  security_source: @sdk_configuration.security_source
350
350
  )
@@ -441,7 +441,7 @@ module DingSDK
441
441
 
442
442
  hook_ctx = SDKHooks::HookContext.new(
443
443
  base_url: base_url,
444
- oauth2_scopes: nil,
444
+ oauth2_scopes: [],
445
445
  operation_id: 'retry',
446
446
  security_source: @sdk_configuration.security_source
447
447
  )
@@ -61,9 +61,9 @@ module DingSDK
61
61
  end
62
62
  @language = 'ruby'
63
63
  @openapi_doc_version = '1.0.0'
64
- @sdk_version = '0.12.17'
65
- @gen_version = '2.565.1'
66
- @user_agent = 'speakeasy-sdk/ruby 0.12.17 2.565.1 1.0.0 ding_sdk'
64
+ @sdk_version = '0.13.0'
65
+ @gen_version = '2.566.5'
66
+ @user_agent = 'speakeasy-sdk/ruby 0.13.0 2.566.5 1.0.0 ding_sdk'
67
67
  end
68
68
 
69
69
  sig { returns([String, T::Hash[Symbol, String]]) }
@@ -564,7 +564,7 @@ module DingSDK
564
564
  .returns([String, Object, T.nilable(T::Array[T::Array[Object]])])
565
565
  end
566
566
  def self.serialize_content_type(field_name, media_type, request)
567
- return media_type, ::Crystalline.marshal_json_complex(request), nil if media_type.match('(application|text)\/.*?\+*json.*')
567
+ return media_type, ::Crystalline.to_json(request), nil if media_type.match('(application|text)\/.*?\+*json.*')
568
568
  return serialize_multipart_form(media_type, request) if media_type.match('multipart\/.*')
569
569
  return media_type, serialize_form_data(field_name, request), nil if media_type.match('application\/x-www-form-urlencoded.*')
570
570
  return media_type, request, nil if request.is_a?(String) || request.is_a?(Array)
@@ -617,7 +617,7 @@ module DingSDK
617
617
  elsif field_metadata[:json] == true
618
618
  to_append = [
619
619
  field_metadata.fetch(:field_name, field.name), [
620
- nil, ::Crystalline.marshal_json_complex(val), 'application/json'
620
+ nil, ::Crystalline.to_json(val), 'application/json'
621
621
  ]
622
622
  ]
623
623
  form.append(to_append)
@@ -687,7 +687,7 @@ module DingSDK
687
687
  field_name = metadata.fetch(:field_name, field.name)
688
688
 
689
689
  if metadata[:json]
690
- form[field_name] = ::Crystalline.marshal_json_complex(val)
690
+ form[field_name] = ::Crystalline.to_json(val)
691
691
  else
692
692
  if metadata.fetch(:style, 'form') == 'form'
693
693
  form = form.merge(
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.12.17
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ding
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-04 00:00:00.000000000 Z
11
+ date: 2025-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -202,16 +202,28 @@ files:
202
202
  - lib/ding_sdk/models/operations/retry_response.rb
203
203
  - lib/ding_sdk/models/operations/type.rb
204
204
  - lib/ding_sdk/models/shared.rb
205
+ - lib/ding_sdk/models/shared/attempt.rb
205
206
  - lib/ding_sdk/models/shared/authenticationstatusresponse.rb
206
207
  - lib/ding_sdk/models/shared/authenticationstatusresponse_device_type.rb
208
+ - lib/ding_sdk/models/shared/authenticationstatusresponse_schemas_events_type.rb
209
+ - lib/ding_sdk/models/shared/authenticationstatusresponse_schemas_status.rb
210
+ - lib/ding_sdk/models/shared/authenticationstatusresponse_schemas_type.rb
211
+ - lib/ding_sdk/models/shared/authenticationstatusresponse_status.rb
212
+ - lib/ding_sdk/models/shared/authenticationstatusresponse_type.rb
213
+ - lib/ding_sdk/models/shared/balance_update.rb
214
+ - lib/ding_sdk/models/shared/balance_update_type.rb
215
+ - lib/ding_sdk/models/shared/capability.rb
216
+ - lib/ding_sdk/models/shared/check.rb
207
217
  - lib/ding_sdk/models/shared/checkstatus.rb
208
218
  - lib/ding_sdk/models/shared/code.rb
209
219
  - lib/ding_sdk/models/shared/createauthenticationrequest.rb
210
220
  - lib/ding_sdk/models/shared/createauthenticationresponse.rb
211
221
  - lib/ding_sdk/models/shared/createcheckrequest.rb
212
222
  - lib/ding_sdk/models/shared/createcheckresponse.rb
223
+ - lib/ding_sdk/models/shared/delivery_status.rb
213
224
  - lib/ding_sdk/models/shared/device_type.rb
214
225
  - lib/ding_sdk/models/shared/errorresponse.rb
226
+ - lib/ding_sdk/models/shared/events.rb
215
227
  - lib/ding_sdk/models/shared/feedbackrequest.rb
216
228
  - lib/ding_sdk/models/shared/feedbackrequest_status.rb
217
229
  - lib/ding_sdk/models/shared/feedbackresponse.rb
@@ -223,6 +235,7 @@ files:
223
235
  - lib/ding_sdk/models/shared/security.rb
224
236
  - lib/ding_sdk/models/shared/signals.rb
225
237
  - lib/ding_sdk/models/shared/status.rb
238
+ - lib/ding_sdk/models/shared/type.rb
226
239
  - lib/ding_sdk/otp.rb
227
240
  - lib/ding_sdk/sdk_hooks/hooks.rb
228
241
  - lib/ding_sdk/sdk_hooks/types.rb