emailagent-sdk 0.1.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 (44) hide show
  1. package/README.md +41 -0
  2. package/dist/index.d.ts +93 -0
  3. package/dist/index.js +95 -0
  4. package/generated/.openapi-generator/FILES +41 -0
  5. package/generated/.openapi-generator/VERSION +1 -0
  6. package/generated/.openapi-generator-ignore +23 -0
  7. package/generated/package.json +21 -0
  8. package/generated/src/apis/APIKeysApi.ts +314 -0
  9. package/generated/src/apis/DomainsApi.ts +314 -0
  10. package/generated/src/apis/EmailsApi.ts +350 -0
  11. package/generated/src/apis/InboxesApi.ts +329 -0
  12. package/generated/src/apis/MetricsApi.ts +93 -0
  13. package/generated/src/apis/index.ts +7 -0
  14. package/generated/src/index.ts +5 -0
  15. package/generated/src/models/ApiKeyCreated.ts +123 -0
  16. package/generated/src/models/ApiKeyCreatedResponse.ts +74 -0
  17. package/generated/src/models/ApiKeyListItem.ts +121 -0
  18. package/generated/src/models/ApiKeyListResponse.ts +74 -0
  19. package/generated/src/models/CreateApiKeyRequest.ts +82 -0
  20. package/generated/src/models/CreateApiKeyRequestScopes.ts +45 -0
  21. package/generated/src/models/CreateDomainRequest.ts +66 -0
  22. package/generated/src/models/CreateInboxRequest.ts +82 -0
  23. package/generated/src/models/Domain.ts +152 -0
  24. package/generated/src/models/DomainListResponse.ts +74 -0
  25. package/generated/src/models/DomainResponse.ts +74 -0
  26. package/generated/src/models/Email.ts +222 -0
  27. package/generated/src/models/EmailListResponse.ts +74 -0
  28. package/generated/src/models/EmailResponse.ts +74 -0
  29. package/generated/src/models/ErrorResponse.ts +66 -0
  30. package/generated/src/models/Inbox.ts +159 -0
  31. package/generated/src/models/InboxListResponse.ts +74 -0
  32. package/generated/src/models/InboxResponse.ts +74 -0
  33. package/generated/src/models/MetricsData.ts +139 -0
  34. package/generated/src/models/MetricsResponse.ts +74 -0
  35. package/generated/src/models/OkResponse.ts +66 -0
  36. package/generated/src/models/PlanLimits.ts +93 -0
  37. package/generated/src/models/SendEmailRequest.ts +91 -0
  38. package/generated/src/models/UpdateEmailReadRequest.ts +66 -0
  39. package/generated/src/models/UpdateInboxRequest.ts +66 -0
  40. package/generated/src/models/index.ts +27 -0
  41. package/generated/src/runtime.ts +432 -0
  42. package/generated/tsconfig.esm.json +7 -0
  43. package/generated/tsconfig.json +16 -0
  44. package/package.json +27 -0
@@ -0,0 +1,121 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EmailAgent API
5
+ * API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface ApiKeyListItem
20
+ */
21
+ export interface ApiKeyListItem {
22
+ [key: string]: any | any;
23
+ /**
24
+ *
25
+ * @type {string}
26
+ * @memberof ApiKeyListItem
27
+ */
28
+ id: string;
29
+ /**
30
+ *
31
+ * @type {string}
32
+ * @memberof ApiKeyListItem
33
+ */
34
+ name: string;
35
+ /**
36
+ *
37
+ * @type {string}
38
+ * @memberof ApiKeyListItem
39
+ */
40
+ keyPrefix: string;
41
+ /**
42
+ *
43
+ * @type {Array<string>}
44
+ * @memberof ApiKeyListItem
45
+ */
46
+ scopes: Array<string>;
47
+ /**
48
+ *
49
+ * @type {Date}
50
+ * @memberof ApiKeyListItem
51
+ */
52
+ lastUsedAt?: Date | null;
53
+ /**
54
+ *
55
+ * @type {Date}
56
+ * @memberof ApiKeyListItem
57
+ */
58
+ revokedAt?: Date | null;
59
+ /**
60
+ *
61
+ * @type {Date}
62
+ * @memberof ApiKeyListItem
63
+ */
64
+ createdAt: Date;
65
+ }
66
+
67
+ /**
68
+ * Check if a given object implements the ApiKeyListItem interface.
69
+ */
70
+ export function instanceOfApiKeyListItem(value: object): value is ApiKeyListItem {
71
+ if (!('id' in value) || value['id'] === undefined) return false;
72
+ if (!('name' in value) || value['name'] === undefined) return false;
73
+ if (!('keyPrefix' in value) || value['keyPrefix'] === undefined) return false;
74
+ if (!('scopes' in value) || value['scopes'] === undefined) return false;
75
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
76
+ return true;
77
+ }
78
+
79
+ export function ApiKeyListItemFromJSON(json: any): ApiKeyListItem {
80
+ return ApiKeyListItemFromJSONTyped(json, false);
81
+ }
82
+
83
+ export function ApiKeyListItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiKeyListItem {
84
+ if (json == null) {
85
+ return json;
86
+ }
87
+ return {
88
+
89
+ ...json,
90
+ 'id': json['id'],
91
+ 'name': json['name'],
92
+ 'keyPrefix': json['key_prefix'],
93
+ 'scopes': json['scopes'],
94
+ 'lastUsedAt': json['last_used_at'] == null ? undefined : (new Date(json['last_used_at'])),
95
+ 'revokedAt': json['revoked_at'] == null ? undefined : (new Date(json['revoked_at'])),
96
+ 'createdAt': (new Date(json['created_at'])),
97
+ };
98
+ }
99
+
100
+ export function ApiKeyListItemToJSON(json: any): ApiKeyListItem {
101
+ return ApiKeyListItemToJSONTyped(json, false);
102
+ }
103
+
104
+ export function ApiKeyListItemToJSONTyped(value?: ApiKeyListItem | null, ignoreDiscriminator: boolean = false): any {
105
+ if (value == null) {
106
+ return value;
107
+ }
108
+
109
+ return {
110
+
111
+ ...value,
112
+ 'id': value['id'],
113
+ 'name': value['name'],
114
+ 'key_prefix': value['keyPrefix'],
115
+ 'scopes': value['scopes'],
116
+ 'last_used_at': value['lastUsedAt'] === null ? null : ((value['lastUsedAt'] as any)?.toISOString()),
117
+ 'revoked_at': value['revokedAt'] === null ? null : ((value['revokedAt'] as any)?.toISOString()),
118
+ 'created_at': ((value['createdAt']).toISOString()),
119
+ };
120
+ }
121
+
@@ -0,0 +1,74 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EmailAgent API
5
+ * API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { ApiKeyListItem } from './ApiKeyListItem';
17
+ import {
18
+ ApiKeyListItemFromJSON,
19
+ ApiKeyListItemFromJSONTyped,
20
+ ApiKeyListItemToJSON,
21
+ ApiKeyListItemToJSONTyped,
22
+ } from './ApiKeyListItem';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface ApiKeyListResponse
28
+ */
29
+ export interface ApiKeyListResponse {
30
+ /**
31
+ *
32
+ * @type {Array<ApiKeyListItem>}
33
+ * @memberof ApiKeyListResponse
34
+ */
35
+ data: Array<ApiKeyListItem>;
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the ApiKeyListResponse interface.
40
+ */
41
+ export function instanceOfApiKeyListResponse(value: object): value is ApiKeyListResponse {
42
+ if (!('data' in value) || value['data'] === undefined) return false;
43
+ return true;
44
+ }
45
+
46
+ export function ApiKeyListResponseFromJSON(json: any): ApiKeyListResponse {
47
+ return ApiKeyListResponseFromJSONTyped(json, false);
48
+ }
49
+
50
+ export function ApiKeyListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiKeyListResponse {
51
+ if (json == null) {
52
+ return json;
53
+ }
54
+ return {
55
+
56
+ 'data': ((json['data'] as Array<any>).map(ApiKeyListItemFromJSON)),
57
+ };
58
+ }
59
+
60
+ export function ApiKeyListResponseToJSON(json: any): ApiKeyListResponse {
61
+ return ApiKeyListResponseToJSONTyped(json, false);
62
+ }
63
+
64
+ export function ApiKeyListResponseToJSONTyped(value?: ApiKeyListResponse | null, ignoreDiscriminator: boolean = false): any {
65
+ if (value == null) {
66
+ return value;
67
+ }
68
+
69
+ return {
70
+
71
+ 'data': ((value['data'] as Array<any>).map(ApiKeyListItemToJSON)),
72
+ };
73
+ }
74
+
@@ -0,0 +1,82 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EmailAgent API
5
+ * API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { CreateApiKeyRequestScopes } from './CreateApiKeyRequestScopes';
17
+ import {
18
+ CreateApiKeyRequestScopesFromJSON,
19
+ CreateApiKeyRequestScopesFromJSONTyped,
20
+ CreateApiKeyRequestScopesToJSON,
21
+ CreateApiKeyRequestScopesToJSONTyped,
22
+ } from './CreateApiKeyRequestScopes';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface CreateApiKeyRequest
28
+ */
29
+ export interface CreateApiKeyRequest {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof CreateApiKeyRequest
34
+ */
35
+ name: string;
36
+ /**
37
+ *
38
+ * @type {CreateApiKeyRequestScopes}
39
+ * @memberof CreateApiKeyRequest
40
+ */
41
+ scopes?: CreateApiKeyRequestScopes;
42
+ }
43
+
44
+ /**
45
+ * Check if a given object implements the CreateApiKeyRequest interface.
46
+ */
47
+ export function instanceOfCreateApiKeyRequest(value: object): value is CreateApiKeyRequest {
48
+ if (!('name' in value) || value['name'] === undefined) return false;
49
+ return true;
50
+ }
51
+
52
+ export function CreateApiKeyRequestFromJSON(json: any): CreateApiKeyRequest {
53
+ return CreateApiKeyRequestFromJSONTyped(json, false);
54
+ }
55
+
56
+ export function CreateApiKeyRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateApiKeyRequest {
57
+ if (json == null) {
58
+ return json;
59
+ }
60
+ return {
61
+
62
+ 'name': json['name'],
63
+ 'scopes': json['scopes'] == null ? undefined : CreateApiKeyRequestScopesFromJSON(json['scopes']),
64
+ };
65
+ }
66
+
67
+ export function CreateApiKeyRequestToJSON(json: any): CreateApiKeyRequest {
68
+ return CreateApiKeyRequestToJSONTyped(json, false);
69
+ }
70
+
71
+ export function CreateApiKeyRequestToJSONTyped(value?: CreateApiKeyRequest | null, ignoreDiscriminator: boolean = false): any {
72
+ if (value == null) {
73
+ return value;
74
+ }
75
+
76
+ return {
77
+
78
+ 'name': value['name'],
79
+ 'scopes': CreateApiKeyRequestScopesToJSON(value['scopes']),
80
+ };
81
+ }
82
+
@@ -0,0 +1,45 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EmailAgent API
5
+ * API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ /**
16
+ * @type CreateApiKeyRequestScopes
17
+ * Comma-separated scopes string or array of scopes
18
+ * @export
19
+ */
20
+ export type CreateApiKeyRequestScopes = Array<string> | string;
21
+
22
+ export function CreateApiKeyRequestScopesFromJSON(json: any): CreateApiKeyRequestScopes {
23
+ return CreateApiKeyRequestScopesFromJSONTyped(json, false);
24
+ }
25
+
26
+ export function CreateApiKeyRequestScopesFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateApiKeyRequestScopes {
27
+ if (json == null) {
28
+ return json;
29
+ }
30
+
31
+ return {} as any;
32
+ }
33
+
34
+ export function CreateApiKeyRequestScopesToJSON(json: any): any {
35
+ return CreateApiKeyRequestScopesToJSONTyped(json, false);
36
+ }
37
+
38
+ export function CreateApiKeyRequestScopesToJSONTyped(value?: CreateApiKeyRequestScopes | null, ignoreDiscriminator: boolean = false): any {
39
+ if (value == null) {
40
+ return value;
41
+ }
42
+
43
+ return {};
44
+ }
45
+
@@ -0,0 +1,66 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EmailAgent API
5
+ * API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface CreateDomainRequest
20
+ */
21
+ export interface CreateDomainRequest {
22
+ /**
23
+ * Domain to onboard, e.g. mail.example.com
24
+ * @type {string}
25
+ * @memberof CreateDomainRequest
26
+ */
27
+ name: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the CreateDomainRequest interface.
32
+ */
33
+ export function instanceOfCreateDomainRequest(value: object): value is CreateDomainRequest {
34
+ if (!('name' in value) || value['name'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function CreateDomainRequestFromJSON(json: any): CreateDomainRequest {
39
+ return CreateDomainRequestFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function CreateDomainRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateDomainRequest {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'name': json['name'],
49
+ };
50
+ }
51
+
52
+ export function CreateDomainRequestToJSON(json: any): CreateDomainRequest {
53
+ return CreateDomainRequestToJSONTyped(json, false);
54
+ }
55
+
56
+ export function CreateDomainRequestToJSONTyped(value?: CreateDomainRequest | null, ignoreDiscriminator: boolean = false): any {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+
61
+ return {
62
+
63
+ 'name': value['name'],
64
+ };
65
+ }
66
+
@@ -0,0 +1,82 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EmailAgent API
5
+ * API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface CreateInboxRequest
20
+ */
21
+ export interface CreateInboxRequest {
22
+ /**
23
+ * Local part only (e.g. `agent-1`)
24
+ * @type {string}
25
+ * @memberof CreateInboxRequest
26
+ */
27
+ localPart: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof CreateInboxRequest
32
+ */
33
+ displayName?: string;
34
+ /**
35
+ * Optional domain. Defaults to shared app domain.
36
+ * @type {string}
37
+ * @memberof CreateInboxRequest
38
+ */
39
+ domainName?: string;
40
+ }
41
+
42
+ /**
43
+ * Check if a given object implements the CreateInboxRequest interface.
44
+ */
45
+ export function instanceOfCreateInboxRequest(value: object): value is CreateInboxRequest {
46
+ if (!('localPart' in value) || value['localPart'] === undefined) return false;
47
+ return true;
48
+ }
49
+
50
+ export function CreateInboxRequestFromJSON(json: any): CreateInboxRequest {
51
+ return CreateInboxRequestFromJSONTyped(json, false);
52
+ }
53
+
54
+ export function CreateInboxRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateInboxRequest {
55
+ if (json == null) {
56
+ return json;
57
+ }
58
+ return {
59
+
60
+ 'localPart': json['localPart'],
61
+ 'displayName': json['displayName'] == null ? undefined : json['displayName'],
62
+ 'domainName': json['domainName'] == null ? undefined : json['domainName'],
63
+ };
64
+ }
65
+
66
+ export function CreateInboxRequestToJSON(json: any): CreateInboxRequest {
67
+ return CreateInboxRequestToJSONTyped(json, false);
68
+ }
69
+
70
+ export function CreateInboxRequestToJSONTyped(value?: CreateInboxRequest | null, ignoreDiscriminator: boolean = false): any {
71
+ if (value == null) {
72
+ return value;
73
+ }
74
+
75
+ return {
76
+
77
+ 'localPart': value['localPart'],
78
+ 'displayName': value['displayName'],
79
+ 'domainName': value['domainName'],
80
+ };
81
+ }
82
+
@@ -0,0 +1,152 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EmailAgent API
5
+ * API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface Domain
20
+ */
21
+ export interface Domain {
22
+ [key: string]: any | any;
23
+ /**
24
+ *
25
+ * @type {string}
26
+ * @memberof Domain
27
+ */
28
+ id: string;
29
+ /**
30
+ *
31
+ * @type {string}
32
+ * @memberof Domain
33
+ */
34
+ orgId: string;
35
+ /**
36
+ *
37
+ * @type {string}
38
+ * @memberof Domain
39
+ */
40
+ name: string;
41
+ /**
42
+ *
43
+ * @type {string}
44
+ * @memberof Domain
45
+ */
46
+ providerDomainId?: string | null;
47
+ /**
48
+ *
49
+ * @type {string}
50
+ * @memberof Domain
51
+ */
52
+ providerRouteId?: string | null;
53
+ /**
54
+ *
55
+ * @type {string}
56
+ * @memberof Domain
57
+ */
58
+ status: DomainStatusEnum;
59
+ /**
60
+ *
61
+ * @type {Array<{ [key: string]: any; }>}
62
+ * @memberof Domain
63
+ */
64
+ dnsRecordsJson: Array<{ [key: string]: any; }>;
65
+ /**
66
+ *
67
+ * @type {Date}
68
+ * @memberof Domain
69
+ */
70
+ createdAt: Date;
71
+ /**
72
+ *
73
+ * @type {Date}
74
+ * @memberof Domain
75
+ */
76
+ updatedAt: Date;
77
+ }
78
+
79
+
80
+ /**
81
+ * @export
82
+ */
83
+ export const DomainStatusEnum = {
84
+ Pending: 'pending',
85
+ Active: 'active',
86
+ Failed: 'failed',
87
+ Deleted: 'deleted'
88
+ } as const;
89
+ export type DomainStatusEnum = typeof DomainStatusEnum[keyof typeof DomainStatusEnum];
90
+
91
+
92
+ /**
93
+ * Check if a given object implements the Domain interface.
94
+ */
95
+ export function instanceOfDomain(value: object): value is Domain {
96
+ if (!('id' in value) || value['id'] === undefined) return false;
97
+ if (!('orgId' in value) || value['orgId'] === undefined) return false;
98
+ if (!('name' in value) || value['name'] === undefined) return false;
99
+ if (!('status' in value) || value['status'] === undefined) return false;
100
+ if (!('dnsRecordsJson' in value) || value['dnsRecordsJson'] === undefined) return false;
101
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
102
+ if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
103
+ return true;
104
+ }
105
+
106
+ export function DomainFromJSON(json: any): Domain {
107
+ return DomainFromJSONTyped(json, false);
108
+ }
109
+
110
+ export function DomainFromJSONTyped(json: any, ignoreDiscriminator: boolean): Domain {
111
+ if (json == null) {
112
+ return json;
113
+ }
114
+ return {
115
+
116
+ ...json,
117
+ 'id': json['id'],
118
+ 'orgId': json['org_id'],
119
+ 'name': json['name'],
120
+ 'providerDomainId': json['provider_domain_id'] == null ? undefined : json['provider_domain_id'],
121
+ 'providerRouteId': json['provider_route_id'] == null ? undefined : json['provider_route_id'],
122
+ 'status': json['status'],
123
+ 'dnsRecordsJson': json['dns_records_json'],
124
+ 'createdAt': (new Date(json['created_at'])),
125
+ 'updatedAt': (new Date(json['updated_at'])),
126
+ };
127
+ }
128
+
129
+ export function DomainToJSON(json: any): Domain {
130
+ return DomainToJSONTyped(json, false);
131
+ }
132
+
133
+ export function DomainToJSONTyped(value?: Domain | null, ignoreDiscriminator: boolean = false): any {
134
+ if (value == null) {
135
+ return value;
136
+ }
137
+
138
+ return {
139
+
140
+ ...value,
141
+ 'id': value['id'],
142
+ 'org_id': value['orgId'],
143
+ 'name': value['name'],
144
+ 'provider_domain_id': value['providerDomainId'],
145
+ 'provider_route_id': value['providerRouteId'],
146
+ 'status': value['status'],
147
+ 'dns_records_json': value['dnsRecordsJson'],
148
+ 'created_at': ((value['createdAt']).toISOString()),
149
+ 'updated_at': ((value['updatedAt']).toISOString()),
150
+ };
151
+ }
152
+
@@ -0,0 +1,74 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EmailAgent API
5
+ * API for creating agent inboxes, sending emails, managing custom domains, managing API keys, and reading usage metrics. Authentication uses API keys via `Authorization: Bearer <api_key>`. For mutating endpoints, send an optional `Idempotency-Key` header. - Replaying the same key with the same payload returns the original response. - Reusing a key with a different payload returns `409`.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { Domain } from './Domain';
17
+ import {
18
+ DomainFromJSON,
19
+ DomainFromJSONTyped,
20
+ DomainToJSON,
21
+ DomainToJSONTyped,
22
+ } from './Domain';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface DomainListResponse
28
+ */
29
+ export interface DomainListResponse {
30
+ /**
31
+ *
32
+ * @type {Array<Domain>}
33
+ * @memberof DomainListResponse
34
+ */
35
+ data: Array<Domain>;
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the DomainListResponse interface.
40
+ */
41
+ export function instanceOfDomainListResponse(value: object): value is DomainListResponse {
42
+ if (!('data' in value) || value['data'] === undefined) return false;
43
+ return true;
44
+ }
45
+
46
+ export function DomainListResponseFromJSON(json: any): DomainListResponse {
47
+ return DomainListResponseFromJSONTyped(json, false);
48
+ }
49
+
50
+ export function DomainListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DomainListResponse {
51
+ if (json == null) {
52
+ return json;
53
+ }
54
+ return {
55
+
56
+ 'data': ((json['data'] as Array<any>).map(DomainFromJSON)),
57
+ };
58
+ }
59
+
60
+ export function DomainListResponseToJSON(json: any): DomainListResponse {
61
+ return DomainListResponseToJSONTyped(json, false);
62
+ }
63
+
64
+ export function DomainListResponseToJSONTyped(value?: DomainListResponse | null, ignoreDiscriminator: boolean = false): any {
65
+ if (value == null) {
66
+ return value;
67
+ }
68
+
69
+ return {
70
+
71
+ 'data': ((value['data'] as Array<any>).map(DomainToJSON)),
72
+ };
73
+ }
74
+