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