5
5
import { SpeakeasyMetadata } from "../../internal/utils" ;
6
6
import { classToPlain , Expose } from "class-transformer" ;
7
7
8
+ /**
9
+ * A machine-readable code that describes the error. Possible values are:
10
+ *
11
+ * @remarks
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 customer UUID you provided 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 authentication UUID you provided is invalid.
20
+ * * `blocked_number` - The phone number you provided is in the blocklist.
21
+ * * `invalid_app_version` - The app version you provided is invalid.
22
+ * * `invalid_os_version` - The OS version you provided is invalid.
23
+ * * `invalid_device_model` - The device model you provided is invalid.
24
+ * * `invalid_device_id` - The device ID you provided is invalid.
25
+ *
26
+ */
8
27
export enum Code {
9
28
InvalidPhoneNumber = "invalid_phone_number" ,
10
29
InternalServerError = "internal_server_error" ,
@@ -25,6 +44,25 @@ export enum Code {
25
44
}
26
45
27
46
export class ErrorResponse extends Error {
47
+ /**
48
+ * A machine-readable code that describes the error. Possible values are:
49
+ *
50
+ * @remarks
51
+ * * `invalid_phone_number` - This is not a valid E.164 number.
52
+ * * `internal_server_error` - An internal server error occurred.
53
+ * * `bad_request` - The request was malformed.
54
+ * * `account_invalid` - The customer UUID you provided is invalid.
55
+ * * `negative_balance` - You have a negative balance.
56
+ * * `invalid_line` - Ding does not support this type of phone number.
57
+ * * `unsupported_region` - Ding does not support this region yet.
58
+ * * `invalid_auth_uuid` - The authentication UUID you provided is invalid.
59
+ * * `blocked_number` - The phone number you provided is in the blocklist.
60
+ * * `invalid_app_version` - The app version you provided is invalid.
61
+ * * `invalid_os_version` - The OS version you provided is invalid.
62
+ * * `invalid_device_model` - The device model you provided is invalid.
63
+ * * `invalid_device_id` - The device ID you provided is invalid.
64
+ *
65
+ */
28
66
@SpeakeasyMetadata ( )
29
67
@Expose ( { name : "code" } )
30
68
code ?: Code ;
@@ -36,6 +74,9 @@ export class ErrorResponse extends Error {
36
74
@Expose ( { name : "doc_url" } )
37
75
docUrl ?: string ;
38
76
77
+ /**
78
+ * A human-readable message that describes the error.
79
+ */
39
80
@SpeakeasyMetadata ( )
40
81
@Expose ( { name : "message" } )
41
82
message : string ;
0 commit comments