ding_sdk 0.5.2 → 0.6.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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/{ding/sdk.rb → ding_sdk/ding.rb} +1 -1
  3. data/lib/{ding → ding_sdk}/lookup.rb +9 -7
  4. data/lib/{ding/models/operations/check.rb → ding_sdk/models/operations/check_response.rb} +7 -10
  5. data/lib/{ding/models/operations/create_autentication.rb → ding_sdk/models/operations/create_autentication_response.rb} +7 -10
  6. data/lib/ding_sdk/models/operations/lookup_request.rb +27 -0
  7. data/lib/ding_sdk/models/operations/lookup_response.rb +36 -0
  8. data/lib/{ding/models/operations/retry_.rb → ding_sdk/models/operations/retry_response.rb} +7 -10
  9. data/lib/ding_sdk/models/operations.rb +14 -0
  10. data/lib/{ding/models/shared/errorresponse.rb → ding_sdk/models/shared/code.rb} +1 -36
  11. data/lib/ding_sdk/models/shared/createauthenticationrequest.rb +54 -0
  12. data/lib/ding_sdk/models/shared/createauthenticationresponse.rb +37 -0
  13. data/lib/{ding → ding_sdk}/models/shared/createcheckrequest.rb +5 -6
  14. data/lib/ding_sdk/models/shared/createcheckresponse.rb +34 -0
  15. data/lib/ding_sdk/models/shared/createcheckresponse_status.rb +30 -0
  16. data/lib/ding_sdk/models/shared/device_type.rb +20 -0
  17. data/lib/ding_sdk/models/shared/errorresponse.rb +44 -0
  18. data/lib/ding_sdk/models/shared/line_type.rb +28 -0
  19. data/lib/ding_sdk/models/shared/lookupresponse.rb +42 -0
  20. data/lib/{ding → ding_sdk}/models/shared/retryauthenticationrequest.rb +4 -5
  21. data/lib/ding_sdk/models/shared/retryauthenticationresponse.rb +43 -0
  22. data/lib/ding_sdk/models/shared/retryauthenticationresponse_status.rb +30 -0
  23. data/lib/{ding → ding_sdk}/models/shared/security.rb +3 -4
  24. data/lib/ding_sdk/models/shared/status.rb +24 -0
  25. data/lib/ding_sdk/models/shared.rb +24 -0
  26. data/lib/{ding → ding_sdk}/otp.rb +17 -13
  27. data/lib/{ding → ding_sdk}/sdkconfiguration.rb +5 -5
  28. data/lib/{ding → ding_sdk}/utils/utils.rb +2 -2
  29. data/lib/ding_sdk.rb +8 -20
  30. metadata +30 -21
  31. data/lib/ding/models/operations/lookup.rb +0 -56
  32. data/lib/ding/models/shared/createauthenticationrequest.rb +0 -65
  33. data/lib/ding/models/shared/createauthenticationresponse.rb +0 -52
  34. data/lib/ding/models/shared/createcheckresponse.rb +0 -55
  35. data/lib/ding/models/shared/lookupresponse.rb +0 -61
  36. data/lib/ding/models/shared/retryauthenticationresponse.rb +0 -64
  37. /data/lib/{ding → ding_sdk}/utils/metadata_fields.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb69849fbc805057aebafadda603ae7bae993ce59d1952a5b38d347302fc9371
4
- data.tar.gz: 0e48cc411f768539ff266cc03a9abe8c051b1ce87fdde470e38ba8be13810c92
3
+ metadata.gz: fe6243d612c59cc553c62339c822520671efa8c5ee4b47df1844f0cae99572ac
4
+ data.tar.gz: bfccf263211c686f9c53e9aadddf26b79eb62743948a60f31e1232a374c8ce51
5
5
  SHA512:
6
- metadata.gz: 356b5f24b64f9b232792f007849fa8f7c12b3fdedd340061a5648da62f7d256ee196078678b492118c28a775848b5c5edbfe9b781d7a686dd139c498336268e3
7
- data.tar.gz: d003aa8e82c0db9539d953687dee9219d6d9a75cb3e0866df78cb4b628d0d70cbbaaecc59c4e926f951ddd0a88d8b8ecc3df5bf0fdb58c0f4ee06c8ed9bcb84c
6
+ metadata.gz: 583984a23fdb77f20f35a0ec8c49726f891647696c53361f6e1ca48141e3e2d0ffee8c71ef714187041de1a4ff8fa1bce5eace435c661e84db3e97f5477c2f13
7
+ data.tar.gz: 6ba811ed065f5d3f72f65c5183af48a2d9e9f183068cdbe6aa4adf0fae0ab64e03c4b327fb7eec2c2f581e588492d17a9cd12031d6aef2690ef5ff777040e1d7
@@ -74,7 +74,7 @@ module DingSDK
74
74
  init_sdks
75
75
  end
76
76
 
77
- sig { params(security: Shared::Security).void }
77
+ sig { params(security: ::DingSDK::Shared::Security).void }
78
78
  def config_security(security)
79
79
  @security = security
80
80
  @sdk_configuration.security = security
@@ -10,17 +10,19 @@ require 'sorbet-runtime'
10
10
  module DingSDK
11
11
  extend T::Sig
12
12
  class Lookup
13
- # Retrieve up-to-date metadata about a specific phone number
14
13
  extend T::Sig
14
+ # Retrieve up-to-date metadata about a specific phone number
15
+
15
16
  sig { params(sdk_config: SDKConfiguration).void }
16
17
  def initialize(sdk_config)
17
18
  @sdk_configuration = sdk_config
18
19
  end
19
20
 
20
- sig { params(customer_uuid: String, phone_number: String).returns(Utils::FieldAugmented) }
21
+
22
+ sig { params(customer_uuid: ::String, phone_number: ::String).returns(Utils::FieldAugmented) }
21
23
  def lookup(customer_uuid, phone_number)
22
24
  # lookup - Perform a phone number lookup
23
- request = Operations::LookupRequest.new(
25
+ request = ::DingSDK::Operations::LookupRequest.new(
24
26
 
25
27
  customer_uuid: customer_uuid,
26
28
  phone_number: phone_number
@@ -28,7 +30,7 @@ module DingSDK
28
30
  url, params = @sdk_configuration.get_server_details
29
31
  base_url = Utils.template_url(url, params)
30
32
  url = Utils.generate_url(
31
- Operations::LookupRequest,
33
+ ::DingSDK::Operations::LookupRequest,
32
34
  base_url,
33
35
  '/lookup/{phone_number}',
34
36
  request
@@ -44,17 +46,17 @@ module DingSDK
44
46
 
45
47
  content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
46
48
 
47
- res = Operations::LookupResponse.new(
49
+ res = ::DingSDK::Operations::LookupResponse.new(
48
50
  status_code: r.status, content_type: content_type, raw_response: r
49
51
  )
50
52
  if r.status == 200
51
53
  if Utils.match_content_type(content_type, 'application/json')
52
- out = Utils.unmarshal_complex(r.env.response_body, Shared::LookupResponse)
54
+ out = Utils.unmarshal_complex(r.env.response_body, ::DingSDK::Shared::LookupResponse)
53
55
  res.lookup_response = out
54
56
  end
55
57
  elsif r.status == 400
56
58
  if Utils.match_content_type(content_type, 'application/json')
57
- out = Utils.unmarshal_complex(r.env.response_body, Shared::ErrorResponse)
59
+ out = Utils.unmarshal_complex(r.env.response_body, ::DingSDK::Shared::ErrorResponse)
58
60
  res.error_response = out
59
61
  end
60
62
  end
@@ -3,30 +3,27 @@
3
3
  # typed: true
4
4
  # frozen_string_literal: true
5
5
 
6
- require 'sorbet-runtime'
7
- require 'faraday'
8
- require_relative '../shared/createcheckresponse'
9
- require_relative '../shared/errorresponse'
10
6
 
11
7
  module DingSDK
12
8
  module Operations
9
+
13
10
 
14
11
  class CheckResponse < ::DingSDK::Utils::FieldAugmented
15
12
  extend T::Sig
16
13
 
17
14
  # HTTP response content type for this operation
18
- field :content_type, String
15
+ field :content_type, ::String
19
16
  # Raw HTTP response; suitable for custom response parsing
20
- field :raw_response, Faraday::Response
17
+ field :raw_response, ::Faraday::Response
21
18
  # HTTP response status code for this operation
22
- field :status_code, Integer
19
+ field :status_code, ::Integer
23
20
  # OK
24
- field :create_check_response, T.nilable(Shared::CreateCheckResponse)
21
+ field :create_check_response, T.nilable(::DingSDK::Shared::CreateCheckResponse)
25
22
  # Bad Request
26
- field :error_response, T.nilable(Shared::ErrorResponse)
23
+ field :error_response, T.nilable(::DingSDK::Shared::ErrorResponse)
27
24
 
28
25
 
29
- sig { params(content_type: String, raw_response: Faraday::Response, status_code: Integer, create_check_response: T.nilable(Shared::CreateCheckResponse), error_response: T.nilable(Shared::ErrorResponse)).void }
26
+ sig { params(content_type: ::String, raw_response: ::Faraday::Response, status_code: ::Integer, create_check_response: T.nilable(::DingSDK::Shared::CreateCheckResponse), error_response: T.nilable(::DingSDK::Shared::ErrorResponse)).void }
30
27
  def initialize(content_type: nil, raw_response: nil, status_code: nil, create_check_response: nil, error_response: nil)
31
28
  @content_type = content_type
32
29
  @raw_response = raw_response
@@ -3,30 +3,27 @@
3
3
  # typed: true
4
4
  # frozen_string_literal: true
5
5
 
6
- require 'sorbet-runtime'
7
- require 'faraday'
8
- require_relative '../shared/createauthenticationresponse'
9
- require_relative '../shared/errorresponse'
10
6
 
11
7
  module DingSDK
12
8
  module Operations
9
+
13
10
 
14
11
  class CreateAutenticationResponse < ::DingSDK::Utils::FieldAugmented
15
12
  extend T::Sig
16
13
 
17
14
  # HTTP response content type for this operation
18
- field :content_type, String
15
+ field :content_type, ::String
19
16
  # Raw HTTP response; suitable for custom response parsing
20
- field :raw_response, Faraday::Response
17
+ field :raw_response, ::Faraday::Response
21
18
  # HTTP response status code for this operation
22
- field :status_code, Integer
19
+ field :status_code, ::Integer
23
20
  # OK
24
- field :create_authentication_response, T.nilable(Shared::CreateAuthenticationResponse)
21
+ field :create_authentication_response, T.nilable(::DingSDK::Shared::CreateAuthenticationResponse)
25
22
  # Bad Request
26
- field :error_response, T.nilable(Shared::ErrorResponse)
23
+ field :error_response, T.nilable(::DingSDK::Shared::ErrorResponse)
27
24
 
28
25
 
29
- sig { params(content_type: String, raw_response: Faraday::Response, status_code: Integer, create_authentication_response: T.nilable(Shared::CreateAuthenticationResponse), error_response: T.nilable(Shared::ErrorResponse)).void }
26
+ sig { params(content_type: ::String, raw_response: ::Faraday::Response, status_code: ::Integer, create_authentication_response: T.nilable(::DingSDK::Shared::CreateAuthenticationResponse), error_response: T.nilable(::DingSDK::Shared::ErrorResponse)).void }
30
27
  def initialize(content_type: nil, raw_response: nil, status_code: nil, create_authentication_response: nil, error_response: nil)
31
28
  @content_type = content_type
32
29
  @raw_response = raw_response
@@ -0,0 +1,27 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Operations
9
+
10
+
11
+ class LookupRequest < ::DingSDK::Utils::FieldAugmented
12
+ extend T::Sig
13
+
14
+
15
+ field :customer_uuid, ::String, { 'header': { 'field_name': 'customer-uuid', 'style': 'simple', 'explode': false } }
16
+
17
+ field :phone_number, ::String, { 'path_param': { 'field_name': 'phone_number', 'style': 'simple', 'explode': false } }
18
+
19
+
20
+ sig { params(customer_uuid: ::String, phone_number: ::String).void }
21
+ def initialize(customer_uuid: nil, phone_number: nil)
22
+ @customer_uuid = customer_uuid
23
+ @phone_number = phone_number
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,36 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Operations
9
+
10
+
11
+ class LookupResponse < ::DingSDK::Utils::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # HTTP response content type for this operation
15
+ field :content_type, ::String
16
+ # Raw HTTP response; suitable for custom response parsing
17
+ field :raw_response, ::Faraday::Response
18
+ # HTTP response status code for this operation
19
+ field :status_code, ::Integer
20
+ # Bad Request
21
+ field :error_response, T.nilable(::DingSDK::Shared::ErrorResponse)
22
+ # OK
23
+ field :lookup_response, T.nilable(::DingSDK::Shared::LookupResponse)
24
+
25
+
26
+ sig { params(content_type: ::String, raw_response: ::Faraday::Response, status_code: ::Integer, error_response: T.nilable(::DingSDK::Shared::ErrorResponse), lookup_response: T.nilable(::DingSDK::Shared::LookupResponse)).void }
27
+ def initialize(content_type: nil, raw_response: nil, status_code: nil, error_response: nil, lookup_response: nil)
28
+ @content_type = content_type
29
+ @raw_response = raw_response
30
+ @status_code = status_code
31
+ @error_response = error_response
32
+ @lookup_response = lookup_response
33
+ end
34
+ end
35
+ end
36
+ end
@@ -3,30 +3,27 @@
3
3
  # typed: true
4
4
  # frozen_string_literal: true
5
5
 
6
- require 'sorbet-runtime'
7
- require 'faraday'
8
- require_relative '../shared/errorresponse'
9
- require_relative '../shared/retryauthenticationresponse'
10
6
 
11
7
  module DingSDK
12
8
  module Operations
9
+
13
10
 
14
11
  class RetryResponse < ::DingSDK::Utils::FieldAugmented
15
12
  extend T::Sig
16
13
 
17
14
  # HTTP response content type for this operation
18
- field :content_type, String
15
+ field :content_type, ::String
19
16
  # Raw HTTP response; suitable for custom response parsing
20
- field :raw_response, Faraday::Response
17
+ field :raw_response, ::Faraday::Response
21
18
  # HTTP response status code for this operation
22
- field :status_code, Integer
19
+ field :status_code, ::Integer
23
20
  # Bad Request
24
- field :error_response, T.nilable(Shared::ErrorResponse)
21
+ field :error_response, T.nilable(::DingSDK::Shared::ErrorResponse)
25
22
  # OK
26
- field :retry_authentication_response, T.nilable(Shared::RetryAuthenticationResponse)
23
+ field :retry_authentication_response, T.nilable(::DingSDK::Shared::RetryAuthenticationResponse)
27
24
 
28
25
 
29
- sig { params(content_type: String, raw_response: Faraday::Response, status_code: Integer, error_response: T.nilable(Shared::ErrorResponse), retry_authentication_response: T.nilable(Shared::RetryAuthenticationResponse)).void }
26
+ sig { params(content_type: ::String, raw_response: ::Faraday::Response, status_code: ::Integer, error_response: T.nilable(::DingSDK::Shared::ErrorResponse), retry_authentication_response: T.nilable(::DingSDK::Shared::RetryAuthenticationResponse)).void }
30
27
  def initialize(content_type: nil, raw_response: nil, status_code: nil, error_response: nil, retry_authentication_response: nil)
31
28
  @content_type = content_type
32
29
  @raw_response = raw_response
@@ -0,0 +1,14 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+ module DingSDK
7
+ module Operations
8
+ autoload :CheckResponse, 'ding_sdk/models/operations/check_response.rb'
9
+ autoload :CreateAutenticationResponse, 'ding_sdk/models/operations/create_autentication_response.rb'
10
+ autoload :RetryResponse, 'ding_sdk/models/operations/retry_response.rb'
11
+ autoload :LookupRequest, 'ding_sdk/models/operations/lookup_request.rb'
12
+ autoload :LookupResponse, 'ding_sdk/models/operations/lookup_response.rb'
13
+ end
14
+ end
@@ -3,11 +3,10 @@
3
3
  # typed: true
4
4
  # frozen_string_literal: true
5
5
 
6
- require 'sorbet-runtime'
7
- require 'faraday'
8
6
 
9
7
  module DingSDK
10
8
  module Shared
9
+
11
10
  # Code - A machine-readable code that describes the error. Possible values are:
12
11
  # * `invalid_phone_number` - This is not a valid E.164 number.
13
12
  # * `internal_server_error` - An internal server error occurred.
@@ -44,39 +43,5 @@ module DingSDK
44
43
  end
45
44
  end
46
45
 
47
-
48
-
49
- class ErrorResponse < ::DingSDK::Utils::FieldAugmented
50
- extend T::Sig
51
-
52
- # A machine-readable code that describes the error. Possible values are:
53
- # * `invalid_phone_number` - This is not a valid E.164 number.
54
- # * `internal_server_error` - An internal server error occurred.
55
- # * `bad_request` - The request was malformed.
56
- # * `account_invalid` - The provided customer UUID is invalid.
57
- # * `negative_balance` - You have a negative balance.
58
- # * `invalid_line` - Ding does not support this type of phone number.
59
- # * `unsupported_region` - Ding does not support this region yet.
60
- # * `invalid_auth_uuid` - The provided authentication UUID is invalid.
61
- # * `blocked_number` - The phone number is in the blocklist.
62
- # * `invalid_app_version` - The provided application version is invalid.
63
- # * `invalid_os_version` - The provided OS version is invalid.
64
- # * `invalid_device_model` - The provided device model is invalid.
65
- # * `invalid_device_id` - The provided device ID is invalid.
66
- #
67
- field :code, T.nilable(Shared::Code), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('code'), 'decoder': Utils.enum_from_string(Shared::Code, true) } }
68
- # A link to the documentation that describes the error.
69
- field :doc_url, T.nilable(String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('doc_url') } }
70
- # A human-readable message that describes the error.
71
- field :message, T.nilable(String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('message') } }
72
-
73
-
74
- sig { params(code: T.nilable(Shared::Code), doc_url: T.nilable(String), message: T.nilable(String)).void }
75
- def initialize(code: nil, doc_url: nil, message: nil)
76
- @code = code
77
- @doc_url = doc_url
78
- @message = message
79
- end
80
- end
81
46
  end
82
47
  end
@@ -0,0 +1,54 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+
11
+ class CreateAuthenticationRequest < ::DingSDK::Utils::FieldAugmented
12
+ extend T::Sig
13
+
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
+ # Unique identifier for the user's device. For Android, this corresponds to the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`.
25
+ field :device_id, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('device_id') } }
26
+ # The model of the user's device.
27
+ field :device_model, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('device_model') } }
28
+ # The type of device the user is using.
29
+ 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) } }
30
+ # The IP address of the user's device.
31
+ field :ip, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('ip') } }
32
+ # Whether the user is a returning user on your app.
33
+ field :is_returning_user, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('is_returning_user') } }
34
+ # The version of the user's device operating system.
35
+ field :os_version, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('os_version') } }
36
+
37
+
38
+ sig { params(customer_uuid: ::String, phone_number: ::String, app_realm: T.nilable(::String), app_version: T.nilable(::String), callback_url: 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), os_version: T.nilable(::String)).void }
39
+ def initialize(customer_uuid: nil, phone_number: nil, app_realm: nil, app_version: nil, callback_url: nil, device_id: nil, device_model: nil, device_type: nil, ip: nil, is_returning_user: nil, os_version: nil)
40
+ @customer_uuid = customer_uuid
41
+ @phone_number = phone_number
42
+ @app_realm = app_realm
43
+ @app_version = app_version
44
+ @callback_url = callback_url
45
+ @device_id = device_id
46
+ @device_model = device_model
47
+ @device_type = device_type
48
+ @ip = ip
49
+ @is_returning_user = is_returning_user
50
+ @os_version = os_version
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,37 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+ # A successful response to an authentication creation request.
11
+ class CreateAuthenticationResponse < ::DingSDK::Utils::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # A unique identifier for the authentication that you can use on the /check and /retry endpoints.
15
+ field :authentication_uuid, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('authentication_uuid') } }
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 time at which the authentication expires and can no longer be checked or retried.
19
+ field :expires_at, T.nilable(::DateTime), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('expires_at'), 'decoder': Utils.datetime_from_iso_format(true) } }
20
+ # The status of the authentication. Possible values are:
21
+ # * `pending` - The OTP code is being sent.
22
+ # * `rate_limited` - This user is rate-limited and cannot receive another code.
23
+ # * `spam_detected` - This attempt is flagged as spam. Go to the dashboard for more details.
24
+ #
25
+ field :status, T.nilable(::DingSDK::Shared::Status), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('status'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::Status, true) } }
26
+
27
+
28
+ sig { params(authentication_uuid: T.nilable(::String), created_at: T.nilable(::DateTime), expires_at: T.nilable(::DateTime), status: T.nilable(::DingSDK::Shared::Status)).void }
29
+ def initialize(authentication_uuid: nil, created_at: nil, expires_at: nil, status: nil)
30
+ @authentication_uuid = authentication_uuid
31
+ @created_at = created_at
32
+ @expires_at = expires_at
33
+ @status = status
34
+ end
35
+ end
36
+ end
37
+ end
@@ -3,24 +3,23 @@
3
3
  # typed: true
4
4
  # frozen_string_literal: true
5
5
 
6
- require 'sorbet-runtime'
7
- require 'faraday'
8
6
 
9
7
  module DingSDK
10
8
  module Shared
9
+
11
10
 
12
11
  class CreateCheckRequest < ::DingSDK::Utils::FieldAugmented
13
12
  extend T::Sig
14
13
 
15
14
  # The authentication UUID that was returned when you created the authentication.
16
- field :authentication_uuid, String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('authentication_uuid') } }
15
+ field :authentication_uuid, ::String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('authentication_uuid') } }
17
16
  # The code that the user entered.
18
- field :check_code, String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('check_code') } }
17
+ field :check_code, ::String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('check_code') } }
19
18
  # Your customer UUID, which can be found in the API settings in the dashboard.
20
- field :customer_uuid, String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('customer_uuid') } }
19
+ field :customer_uuid, ::String, { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('customer_uuid') } }
21
20
 
22
21
 
23
- sig { params(authentication_uuid: String, check_code: String, customer_uuid: String).void }
22
+ sig { params(authentication_uuid: ::String, check_code: ::String, customer_uuid: ::String).void }
24
23
  def initialize(authentication_uuid: nil, check_code: nil, customer_uuid: nil)
25
24
  @authentication_uuid = authentication_uuid
26
25
  @check_code = check_code
@@ -0,0 +1,34 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+
11
+ class CreateCheckResponse < ::DingSDK::Utils::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # The UUID of the corresponding authentication.
15
+ field :authentication_uuid, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('authentication_uuid') } }
16
+ # The status of the check. Possible values are:
17
+ # * `valid` - The code is valid.
18
+ # * `invalid` - The code is invalid.
19
+ # * `without_attempt` - No attempt was sent yet, so a check cannot be completed.
20
+ # * `rate_limited` - The authentication was rate limited and cannot be checked.
21
+ # * `already_validated` - The authentication has already been validated.
22
+ # * `expired_auth` - The authentication has expired and cannot be checked.
23
+ #
24
+ field :status, T.nilable(::DingSDK::Shared::CreateCheckResponseStatus), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('status'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::CreateCheckResponseStatus, true) } }
25
+
26
+
27
+ sig { params(authentication_uuid: T.nilable(::String), status: T.nilable(::DingSDK::Shared::CreateCheckResponseStatus)).void }
28
+ def initialize(authentication_uuid: nil, status: nil)
29
+ @authentication_uuid = authentication_uuid
30
+ @status = status
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,30 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+ # CreateCheckResponseStatus - The status of the check. Possible values are:
11
+ # * `valid` - The code is valid.
12
+ # * `invalid` - The code is invalid.
13
+ # * `without_attempt` - No attempt was sent yet, so a check cannot be completed.
14
+ # * `rate_limited` - The authentication was rate limited and cannot be checked.
15
+ # * `already_validated` - The authentication has already been validated.
16
+ # * `expired_auth` - The authentication has expired and cannot be checked.
17
+ #
18
+ class CreateCheckResponseStatus < T::Enum
19
+ enums do
20
+ VALID = new('valid')
21
+ INVALID = new('invalid')
22
+ WITHOUT_ATTEMPT = new('without_attempt')
23
+ RATE_LIMITED = new('rate_limited')
24
+ ALREADY_VALIDATED = new('already_validated')
25
+ EXPIRED_AUTH = new('expired_auth')
26
+ end
27
+ end
28
+
29
+ end
30
+ end
@@ -0,0 +1,20 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+ # DeviceType - The type of device the user is using.
11
+ class DeviceType < T::Enum
12
+ enums do
13
+ IOS = new('IOS')
14
+ ANDROID = new('ANDROID')
15
+ WEB = new('WEB')
16
+ end
17
+ end
18
+
19
+ end
20
+ end
@@ -0,0 +1,44 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+
11
+ class ErrorResponse < ::DingSDK::Utils::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # A machine-readable code that describes the error. Possible values are:
15
+ # * `invalid_phone_number` - This is not a valid E.164 number.
16
+ # * `internal_server_error` - An internal server error occurred.
17
+ # * `bad_request` - The request was malformed.
18
+ # * `account_invalid` - The provided customer UUID is invalid.
19
+ # * `negative_balance` - You have a negative balance.
20
+ # * `invalid_line` - Ding does not support this type of phone number.
21
+ # * `unsupported_region` - Ding does not support this region yet.
22
+ # * `invalid_auth_uuid` - The provided authentication UUID is invalid.
23
+ # * `blocked_number` - The phone number is in the blocklist.
24
+ # * `invalid_app_version` - The provided application version is invalid.
25
+ # * `invalid_os_version` - The provided OS version is invalid.
26
+ # * `invalid_device_model` - The provided device model is invalid.
27
+ # * `invalid_device_id` - The provided device ID is invalid.
28
+ #
29
+ field :code, T.nilable(::DingSDK::Shared::Code), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('code'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::Code, true) } }
30
+ # A link to the documentation that describes the error.
31
+ field :doc_url, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('doc_url') } }
32
+ # A human-readable message that describes the error.
33
+ field :message, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('message') } }
34
+
35
+
36
+ sig { params(code: T.nilable(::DingSDK::Shared::Code), doc_url: T.nilable(::String), message: T.nilable(::String)).void }
37
+ def initialize(code: nil, doc_url: nil, message: nil)
38
+ @code = code
39
+ @doc_url = doc_url
40
+ @message = message
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,28 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+ # LineType - The type of phone line.
11
+ class LineType < T::Enum
12
+ enums do
13
+ FIXED_LINE = new('FixedLine')
14
+ MOBILE = new('Mobile')
15
+ TOLL_FREE = new('TollFree')
16
+ PREMIUM_RATE = new('PremiumRate')
17
+ SHARED_COST = new('SharedCost')
18
+ VOIP = new('Voip')
19
+ PAGER = new('Pager')
20
+ VOICE_MAIL = new('VoiceMail')
21
+ UNIVERSAL_ACCESS = new('UniversalAccess')
22
+ SERVICE = new('Service')
23
+ UNKNOWN = new('Unknown')
24
+ end
25
+ end
26
+
27
+ end
28
+ end
@@ -0,0 +1,42 @@
1
+ # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module DingSDK
8
+ module Shared
9
+
10
+
11
+ class LookupResponse < ::DingSDK::Utils::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # The carrier of the phone number.
15
+ field :carrier, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('carrier') } }
16
+ # The ISO 3166-1 alpha-2 country code of the phone number.
17
+ field :country_code, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('country_code') } }
18
+ # The type of phone line.
19
+ field :line_type, T.nilable(::DingSDK::Shared::LineType), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('line_type'), 'decoder': Utils.enum_from_string(::DingSDK::Shared::LineType, true) } }
20
+ # The mobile country code of the phone number.
21
+ field :mcc, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('mcc') } }
22
+ # The mobile network code of the phone number.
23
+ field :mnc, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('mnc') } }
24
+ # Whether the phone number has been ported.
25
+ field :number_ported, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('number_ported') } }
26
+ # An E.164 formatted phone number.
27
+ field :phone_number, T.nilable(::String), { 'format_json': { 'letter_case': ::DingSDK::Utils.field_name('phone_number') } }
28
+
29
+
30
+ sig { params(carrier: T.nilable(::String), country_code: T.nilable(::String), line_type: T.nilable(::DingSDK::Shared::LineType), mcc: T.nilable(::String), mnc: T.nilable(::String), number_ported: T.nilable(T::Boolean), phone_number: T.nilable(::String)).void }
31
+ def initialize(carrier: nil, country_code: nil, line_type: nil, mcc: nil, mnc: nil, number_ported: nil, phone_number: nil)
32
+ @carrier = carrier
33
+ @country_code = country_code
34
+ @line_type = line_type
35
+ @mcc = mcc
36
+ @mnc = mnc
37
+ @number_ported = number_ported
38
+ @phone_number = phone_number
39
+ end
40
+ end
41
+ end
42
+ end