ding_sdk 0.14.2 → 0.14.4

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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/lib/crystalline/metadata_fields.rb +5 -5
  3. data/lib/crystalline/utils.rb +2 -6
  4. data/lib/ding_sdk/ding.rb +4 -4
  5. data/lib/ding_sdk/lookup.rb +17 -18
  6. data/lib/ding_sdk/models/errors/apierror.rb +38 -0
  7. data/lib/ding_sdk/models/errors/code.rb +41 -0
  8. data/lib/ding_sdk/models/errors/errorresponse.rb +41 -0
  9. data/lib/ding_sdk/models/errors.rb +14 -0
  10. data/lib/ding_sdk/models/operations/check_response.rb +34 -35
  11. data/lib/ding_sdk/models/operations/create_authentication_response.rb +34 -35
  12. data/lib/ding_sdk/models/operations/feedback_response.rb +34 -35
  13. data/lib/ding_sdk/models/operations/getauthenticationstatus_request.rb +16 -13
  14. data/lib/ding_sdk/models/operations/getauthenticationstatus_response.rb +34 -35
  15. data/lib/ding_sdk/models/operations/lookup_request.rb +22 -19
  16. data/lib/ding_sdk/models/operations/lookup_response.rb +34 -35
  17. data/lib/ding_sdk/models/operations/retry_response.rb +34 -35
  18. data/lib/ding_sdk/models/operations/type.rb +7 -5
  19. data/lib/ding_sdk/models/operations.rb +12 -10
  20. data/lib/ding_sdk/models/shared/attempt.rb +50 -47
  21. data/lib/ding_sdk/models/shared/authenticationstatusresponse.rb +46 -43
  22. data/lib/ding_sdk/models/shared/authenticationstatusresponse_device_type.rb +12 -10
  23. data/lib/ding_sdk/models/shared/authenticationstatusresponse_schemas_events_type.rb +11 -9
  24. data/lib/ding_sdk/models/shared/authenticationstatusresponse_schemas_status.rb +18 -16
  25. data/lib/ding_sdk/models/shared/authenticationstatusresponse_schemas_type.rb +11 -9
  26. data/lib/ding_sdk/models/shared/authenticationstatusresponse_status.rb +18 -16
  27. data/lib/ding_sdk/models/shared/authenticationstatusresponse_type.rb +11 -9
  28. data/lib/ding_sdk/models/shared/balance_update.rb +34 -31
  29. data/lib/ding_sdk/models/shared/balance_update_type.rb +13 -11
  30. data/lib/ding_sdk/models/shared/capability.rb +11 -9
  31. data/lib/ding_sdk/models/shared/check.rb +38 -35
  32. data/lib/ding_sdk/models/shared/checkstatus.rb +22 -20
  33. data/lib/ding_sdk/models/shared/createauthenticationrequest.rb +73 -70
  34. data/lib/ding_sdk/models/shared/createauthenticationresponse.rb +38 -35
  35. data/lib/ding_sdk/models/shared/createcheckrequest.rb +30 -27
  36. data/lib/ding_sdk/models/shared/createcheckresponse.rb +20 -17
  37. data/lib/ding_sdk/models/shared/delivery_status.rb +48 -45
  38. data/lib/ding_sdk/models/shared/device_type.rb +10 -8
  39. data/lib/ding_sdk/models/shared/events.rb +12 -9
  40. data/lib/ding_sdk/models/shared/feedbackrequest.rb +30 -27
  41. data/lib/ding_sdk/models/shared/feedbackrequest_status.rb +9 -7
  42. data/lib/ding_sdk/models/shared/feedbackresponse.rb +17 -14
  43. data/lib/ding_sdk/models/shared/line_type.rb +46 -44
  44. data/lib/ding_sdk/models/shared/lookupresponse.rb +69 -66
  45. data/lib/ding_sdk/models/shared/retryauthenticationrequest.rb +26 -23
  46. data/lib/ding_sdk/models/shared/retryauthenticationresponse.rb +45 -42
  47. data/lib/ding_sdk/models/shared/retryauthenticationresponse_status.rb +20 -18
  48. data/lib/ding_sdk/models/shared/security.rb +16 -13
  49. data/lib/ding_sdk/models/shared/signals.rb +46 -43
  50. data/lib/ding_sdk/models/shared/status.rb +14 -12
  51. data/lib/ding_sdk/models/shared/type.rb +11 -9
  52. data/lib/ding_sdk/models/shared.rb +35 -35
  53. data/lib/ding_sdk/otp.rb +72 -77
  54. data/lib/ding_sdk/sdkconfiguration.rb +9 -7
  55. data/lib/ding_sdk/utils/utils.rb +7 -7
  56. data/lib/ding_sdk.rb +5 -2
  57. metadata +6 -4
  58. data/lib/ding_sdk/models/shared/code.rb +0 -39
  59. data/lib/ding_sdk/models/shared/errorresponse.rb +0 -38
@@ -5,22 +5,24 @@
5
5
 
6
6
 
7
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')
8
+ module Models
9
+ module Shared
10
+
11
+ # AuthenticationStatusResponseSchemasStatus - The status of the attempt. Possible values are:
12
+ # * `pending` - The attempt is pending.
13
+ # * `delivered` - The attempt was delivered.
14
+ # * `failed` - The attempt failed.
15
+ # * `rate_limited` - The authentication was rate limited and cannot be retried.
16
+ # * `expired` - The authentication has expired and cannot be retried.
17
+ #
18
+ class AuthenticationStatusResponseSchemasStatus < T::Enum
19
+ enums do
20
+ PENDING = new('pending')
21
+ DELIVERED = new('delivered')
22
+ FAILED = new('failed')
23
+ RATE_LIMITED = new('rate_limited')
24
+ EXPIRED = new('expired')
25
+ end
24
26
  end
25
27
  end
26
28
  end
@@ -5,15 +5,17 @@
5
5
 
6
6
 
7
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')
8
+ module Models
9
+ module Shared
10
+
11
+ # AuthenticationStatusResponseSchemasType - The type of the event.
12
+ class AuthenticationStatusResponseSchemasType < T::Enum
13
+ enums do
14
+ ATTEMPT = new('attempt')
15
+ CHECK = new('check')
16
+ DELIVERY_STATUS = new('delivery_status')
17
+ BALANCE_UPDATE = new('balance_update')
18
+ end
17
19
  end
18
20
  end
19
21
  end
@@ -5,22 +5,24 @@
5
5
 
6
6
 
7
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')
8
+ module Models
9
+ module Shared
10
+
11
+ # AuthenticationStatusResponseStatus - The status of the delivery. Possible values are:
12
+ # * `unknown` - The status of the delivery is unknown.
13
+ # * `submitted` - The message has been submitted to the carrier.
14
+ # * `in_transit` - The message is in transit to the recipient.
15
+ # * `delivered` - The message has been delivered to the recipient.
16
+ # * `undeliverable` - The message could not be delivered to the recipient.
17
+ #
18
+ class AuthenticationStatusResponseStatus < T::Enum
19
+ enums do
20
+ UNKNOWN = new('unknown')
21
+ SUBMITTED = new('submitted')
22
+ IN_TRANSIT = new('in_transit')
23
+ DELIVERED = new('delivered')
24
+ UNDELIVERABLE = new('undeliverable')
25
+ end
24
26
  end
25
27
  end
26
28
  end
@@ -5,15 +5,17 @@
5
5
 
6
6
 
7
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')
8
+ module Models
9
+ module Shared
10
+
11
+ # AuthenticationStatusResponseType - The type of the event.
12
+ class AuthenticationStatusResponseType < T::Enum
13
+ enums do
14
+ ATTEMPT = new('attempt')
15
+ CHECK = new('check')
16
+ DELIVERY_STATUS = new('delivery_status')
17
+ BALANCE_UPDATE = new('balance_update')
18
+ end
17
19
  end
18
20
  end
19
21
  end
@@ -5,37 +5,40 @@
5
5
 
6
6
 
7
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
8
+ module Models
9
+ module Shared
10
+
11
+
12
+ class BalanceUpdate
13
+ extend T::Sig
14
+ include Crystalline::MetadataFields
15
+
16
+ # The amount of the balance update.
17
+ field :amount, T.nilable(::Float), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('amount') } }
18
+
19
+ field :balance_update_type, T.nilable(Models::Shared::BalanceUpdateType), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('balance_update_type'), 'decoder': Utils.enum_from_string(Models::Shared::BalanceUpdateType, true) } }
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 type of the event.
23
+ field :type, T.nilable(Models::Shared::AuthenticationStatusResponseSchemasEventsType), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('type'), 'decoder': Utils.enum_from_string(Models::Shared::AuthenticationStatusResponseSchemasEventsType, true) } }
24
+
25
+
26
+ sig { params(amount: T.nilable(::Float), balance_update_type: T.nilable(Models::Shared::BalanceUpdateType), created_at: T.nilable(::DateTime), type: T.nilable(Models::Shared::AuthenticationStatusResponseSchemasEventsType)).void }
27
+ def initialize(amount: nil, balance_update_type: nil, created_at: nil, type: nil)
28
+ @amount = amount
29
+ @balance_update_type = balance_update_type
30
+ @created_at = created_at
31
+ @type = type
32
+ end
33
+
34
+ def ==(other)
35
+ return false unless other.is_a? self.class
36
+ return false unless @amount == other.amount
37
+ return false unless @balance_update_type == other.balance_update_type
38
+ return false unless @created_at == other.created_at
39
+ return false unless @type == other.type
40
+ true
41
+ end
39
42
  end
40
43
  end
41
44
  end
@@ -5,18 +5,20 @@
5
5
 
6
6
 
7
7
  module DingSDK
8
- module Shared
9
-
8
+ module Models
9
+ module Shared
10
+
10
11
 
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')
12
+ class BalanceUpdateType < T::Enum
13
+ enums do
14
+ UNKNOWN = new('unknown')
15
+ AUTHENTICATION = new('authentication')
16
+ ATTEMPT = new('attempt')
17
+ ATTEMPT_PENDING = new('attempt_pending')
18
+ ATTEMPT_SUCCESS = new('attempt_success')
19
+ AUTHENTICATION_PENDING = new('authentication_pending')
20
+ AUTHENTICATION_SUCCESS = new('authentication_success')
21
+ end
20
22
  end
21
23
  end
22
24
  end
@@ -5,15 +5,17 @@
5
5
 
6
6
 
7
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')
8
+ module Models
9
+ module Shared
10
+
11
+ # Capability - The capability of the attempt.
12
+ class Capability < T::Enum
13
+ enums do
14
+ RCS = new('rcs')
15
+ TEXT = new('text')
16
+ WHATSAPP = new('whatsapp')
17
+ VIBER = new('viber')
18
+ end
17
19
  end
18
20
  end
19
21
  end
@@ -5,41 +5,44 @@
5
5
 
6
6
 
7
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
8
+ module Models
9
+ module Shared
10
+
11
+
12
+ class Check
13
+ extend T::Sig
14
+ include Crystalline::MetadataFields
15
+
16
+ # The code that was checked.
17
+ field :code, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('code') } }
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 ID of the check.
21
+ field :id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('id') } }
22
+
23
+ field :status, T.nilable(Models::Shared::CheckStatus), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('status'), 'decoder': Utils.enum_from_string(Models::Shared::CheckStatus, true) } }
24
+ # The type of the event.
25
+ field :type, T.nilable(Models::Shared::AuthenticationStatusResponseType), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('type'), 'decoder': Utils.enum_from_string(Models::Shared::AuthenticationStatusResponseType, true) } }
26
+
27
+
28
+ sig { params(code: T.nilable(::String), created_at: T.nilable(::DateTime), id: T.nilable(::String), status: T.nilable(Models::Shared::CheckStatus), type: T.nilable(Models::Shared::AuthenticationStatusResponseType)).void }
29
+ def initialize(code: nil, created_at: nil, id: nil, status: nil, type: nil)
30
+ @code = code
31
+ @created_at = created_at
32
+ @id = id
33
+ @status = status
34
+ @type = type
35
+ end
36
+
37
+ def ==(other)
38
+ return false unless other.is_a? self.class
39
+ return false unless @code == other.code
40
+ return false unless @created_at == other.created_at
41
+ return false unless @id == other.id
42
+ return false unless @status == other.status
43
+ return false unless @type == other.type
44
+ true
45
+ end
43
46
  end
44
47
  end
45
48
  end
@@ -5,26 +5,28 @@
5
5
 
6
6
 
7
7
  module DingSDK
8
- module Shared
9
-
10
- # CheckStatus - The status of the check. Possible values are:
11
- # * `unknown` - The status is unknown.
12
- # * `valid` - The code is valid.
13
- # * `invalid` - The code is invalid.
14
- # * `without_attempt` - No attempt was sent yet, so a check cannot be completed.
15
- # * `rate_limited` - The authentication was rate limited and cannot be checked.
16
- # * `already_validated` - The authentication has already been validated.
17
- # * `expired_auth` - The authentication has expired and cannot be checked.
18
- #
19
- class CheckStatus < T::Enum
20
- enums do
21
- UNKNOWN = new('unknown')
22
- VALID = new('valid')
23
- INVALID = new('invalid')
24
- WITHOUT_ATTEMPT = new('without_attempt')
25
- RATE_LIMITED = new('rate_limited')
26
- ALREADY_VALIDATED = new('already_validated')
27
- EXPIRED_AUTH = new('expired_auth')
8
+ module Models
9
+ module Shared
10
+
11
+ # CheckStatus - The status of the check. Possible values are:
12
+ # * `unknown` - The status is unknown.
13
+ # * `valid` - The code is valid.
14
+ # * `invalid` - The code is invalid.
15
+ # * `without_attempt` - No attempt was sent yet, so a check cannot be completed.
16
+ # * `rate_limited` - The authentication was rate limited and cannot be checked.
17
+ # * `already_validated` - The authentication has already been validated.
18
+ # * `expired_auth` - The authentication has expired and cannot be checked.
19
+ #
20
+ class CheckStatus < T::Enum
21
+ enums do
22
+ UNKNOWN = new('unknown')
23
+ VALID = new('valid')
24
+ INVALID = new('invalid')
25
+ WITHOUT_ATTEMPT = new('without_attempt')
26
+ RATE_LIMITED = new('rate_limited')
27
+ ALREADY_VALIDATED = new('already_validated')
28
+ EXPIRED_AUTH = new('expired_auth')
29
+ end
28
30
  end
29
31
  end
30
32
  end
@@ -5,81 +5,84 @@
5
5
 
6
6
 
7
7
  module DingSDK
8
- module Shared
9
-
8
+ module Models
9
+ module Shared
10
+
10
11
 
11
- class CreateAuthenticationRequest < ::Crystalline::FieldAugmented
12
- extend T::Sig
12
+ class CreateAuthenticationRequest
13
+ extend T::Sig
14
+ include Crystalline::MetadataFields
13
15
 
14
- # Your customer UUID, which can be found in the API settings in the dashboard.
15
- field :customer_uuid, ::String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('customer_uuid') } }
16
- # An E.164 formatted phone number to send the OTP to.
17
- field :phone_number, ::String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('phone_number') } }
18
- # The Android SMS Retriever API hash code that identifies your app. This allows you to automatically retrieve and fill the OTP code on Android devices.
19
- field :app_realm, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('app_realm') } }
20
- # The version of your application.
21
- field :app_version, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('app_version') } }
22
- # A webhook URL to which delivery statuses will be sent.
23
- field :callback_url, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('callback_url') } }
24
- # A unique, user-defined identifier that will be included in webhook events
25
- field :correlation_id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('correlation_id') } }
26
- # Unique identifier for the user's device. For Android, this corresponds to the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
27
- field :device_id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('device_id') } }
28
- # The model of the user's device.
29
- field :device_model, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('device_model') } }
30
- # The type of device the user is using.
31
- field :device_type, T.nilable(::DingSDK::Shared::DeviceType), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('device_type'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::DeviceType, true) } }
32
- # The IP address of the user's device.
33
- field :ip, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('ip') } }
34
- # This signal should do more than just confirm if a user is returning to your app; it should provide a higher level of trust, indicating that the user is genuine. For more details, refer to [Signals](/guides/prevent-fraud#signals).
35
- field :is_returning_user, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('is_returning_user') } }
36
- # A BCP-47 locale indicating the language the SMS should be sent to; if this is not set, the SMS will be sent to the language specified by the country code of the message. If we don't support the language set, the message will be sent in US English (en-US).
37
- field :locale, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('locale') } }
38
- # The version of the user's device operating system.
39
- field :os_version, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('os_version') } }
40
- # The Sender ID to use when sending the message.
41
- field :sender_id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('sender_id') } }
42
- # The template id associated with the message content variant to be sent.
43
- field :template_id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('template_id') } }
16
+ # Your customer UUID, which can be found in the API settings in the dashboard.
17
+ field :customer_uuid, ::String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('customer_uuid') } }
18
+ # An E.164 formatted phone number to send the OTP to.
19
+ field :phone_number, ::String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('phone_number') } }
20
+ # The Android SMS Retriever API hash code that identifies your app. This allows you to automatically retrieve and fill the OTP code on Android devices.
21
+ field :app_realm, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('app_realm') } }
22
+ # The version of your application.
23
+ field :app_version, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('app_version') } }
24
+ # A webhook URL to which delivery statuses will be sent.
25
+ field :callback_url, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('callback_url') } }
26
+ # A unique, user-defined identifier that will be included in webhook events
27
+ field :correlation_id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('correlation_id') } }
28
+ # Unique identifier for the user's device. For Android, this corresponds to the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
29
+ field :device_id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('device_id') } }
30
+ # The model of the user's device.
31
+ field :device_model, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('device_model') } }
32
+ # The type of device the user is using.
33
+ field :device_type, T.nilable(Models::Shared::DeviceType), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('device_type'), 'decoder': Utils.enum_from_string(Models::Shared::DeviceType, true) } }
34
+ # The IP address of the user's device.
35
+ field :ip, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('ip') } }
36
+ # This signal should do more than just confirm if a user is returning to your app; it should provide a higher level of trust, indicating that the user is genuine.
37
+ field :is_returning_user, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('is_returning_user') } }
38
+ # A BCP-47 locale indicating the language the SMS should be sent to; if this is not set, the SMS will be sent to the language specified by the country code of the message. If we don't support the language set, the message will be sent in US English (en-US).
39
+ field :locale, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('locale') } }
40
+ # The version of the user's device operating system.
41
+ field :os_version, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('os_version') } }
42
+ # The Sender ID to use when sending the message.
43
+ field :sender_id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('sender_id') } }
44
+ # The template id associated with the message content variant to be sent.
45
+ field :template_id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('template_id') } }
44
46
 
45
47
 
46
- sig { params(customer_uuid: ::String, phone_number: ::String, app_realm: T.nilable(::String), app_version: T.nilable(::String), callback_url: T.nilable(::String), correlation_id: T.nilable(::String), device_id: T.nilable(::String), device_model: T.nilable(::String), device_type: T.nilable(::DingSDK::Shared::DeviceType), ip: T.nilable(::String), is_returning_user: T.nilable(T::Boolean), locale: T.nilable(::String), os_version: T.nilable(::String), sender_id: T.nilable(::String), template_id: T.nilable(::String)).void }
47
- def initialize(customer_uuid: nil, phone_number: nil, app_realm: nil, app_version: nil, callback_url: nil, correlation_id: nil, device_id: nil, device_model: nil, device_type: nil, ip: nil, is_returning_user: nil, locale: nil, os_version: nil, sender_id: nil, template_id: nil)
48
- @customer_uuid = customer_uuid
49
- @phone_number = phone_number
50
- @app_realm = app_realm
51
- @app_version = app_version
52
- @callback_url = callback_url
53
- @correlation_id = correlation_id
54
- @device_id = device_id
55
- @device_model = device_model
56
- @device_type = device_type
57
- @ip = ip
58
- @is_returning_user = is_returning_user
59
- @locale = locale
60
- @os_version = os_version
61
- @sender_id = sender_id
62
- @template_id = template_id
63
- end
48
+ sig { params(customer_uuid: ::String, phone_number: ::String, app_realm: T.nilable(::String), app_version: T.nilable(::String), callback_url: T.nilable(::String), correlation_id: T.nilable(::String), device_id: T.nilable(::String), device_model: T.nilable(::String), device_type: T.nilable(Models::Shared::DeviceType), ip: T.nilable(::String), is_returning_user: T.nilable(T::Boolean), locale: T.nilable(::String), os_version: T.nilable(::String), sender_id: T.nilable(::String), template_id: T.nilable(::String)).void }
49
+ def initialize(customer_uuid: nil, phone_number: nil, app_realm: nil, app_version: nil, callback_url: nil, correlation_id: nil, device_id: nil, device_model: nil, device_type: nil, ip: nil, is_returning_user: nil, locale: nil, os_version: nil, sender_id: nil, template_id: nil)
50
+ @customer_uuid = customer_uuid
51
+ @phone_number = phone_number
52
+ @app_realm = app_realm
53
+ @app_version = app_version
54
+ @callback_url = callback_url
55
+ @correlation_id = correlation_id
56
+ @device_id = device_id
57
+ @device_model = device_model
58
+ @device_type = device_type
59
+ @ip = ip
60
+ @is_returning_user = is_returning_user
61
+ @locale = locale
62
+ @os_version = os_version
63
+ @sender_id = sender_id
64
+ @template_id = template_id
65
+ end
64
66
 
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
67
+ def ==(other)
68
+ return false unless other.is_a? self.class
69
+ return false unless @customer_uuid == other.customer_uuid
70
+ return false unless @phone_number == other.phone_number
71
+ return false unless @app_realm == other.app_realm
72
+ return false unless @app_version == other.app_version
73
+ return false unless @callback_url == other.callback_url
74
+ return false unless @correlation_id == other.correlation_id
75
+ return false unless @device_id == other.device_id
76
+ return false unless @device_model == other.device_model
77
+ return false unless @device_type == other.device_type
78
+ return false unless @ip == other.ip
79
+ return false unless @is_returning_user == other.is_returning_user
80
+ return false unless @locale == other.locale
81
+ return false unless @os_version == other.os_version
82
+ return false unless @sender_id == other.sender_id
83
+ return false unless @template_id == other.template_id
84
+ true
85
+ end
83
86
  end
84
87
  end
85
88
  end