@zyphr-dev/node-sdk 0.1.18 → 0.1.20

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 (53) hide show
  1. package/dist/index.cjs +2473 -200
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +4376 -1787
  4. package/dist/index.d.ts +4376 -1787
  5. package/dist/index.js +2274 -195
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/.openapi-generator/FILES +40 -1
  9. package/src/client.ts +3 -0
  10. package/src/src/apis/AuthEmailTemplatesApi.ts +734 -0
  11. package/src/src/apis/ExecutionsApi.ts +225 -0
  12. package/src/src/apis/SlackApi.ts +264 -0
  13. package/src/src/apis/index.ts +3 -0
  14. package/src/src/models/AuthEmailTemplate.ts +181 -0
  15. package/src/src/models/AuthEmailTemplateDefault.ts +107 -0
  16. package/src/src/models/AuthEmailTemplateDefaultResponse.ts +88 -0
  17. package/src/src/models/AuthEmailTemplateDeleteResponse.ts +88 -0
  18. package/src/src/models/{SuccessResultData.ts → AuthEmailTemplateDeleteResponseData.ts} +11 -11
  19. package/src/src/models/AuthEmailTemplateListResponse.ts +88 -0
  20. package/src/src/models/AuthEmailTemplatePreviewRequest.ts +65 -0
  21. package/src/src/models/AuthEmailTemplatePreviewResponse.ts +88 -0
  22. package/src/src/models/AuthEmailTemplatePreviewResult.ts +97 -0
  23. package/src/src/models/AuthEmailTemplateResponse.ts +88 -0
  24. package/src/src/models/AuthEmailTemplateTestRequest.ts +74 -0
  25. package/src/src/models/AuthEmailTemplateTestResponse.ts +88 -0
  26. package/src/src/models/AuthEmailTemplateTestResult.ts +73 -0
  27. package/src/src/models/AuthEmailTemplateVersion.ts +157 -0
  28. package/src/src/models/AuthEmailTemplateVersionsResponse.ts +88 -0
  29. package/src/src/models/AuthEmailType.ts +54 -0
  30. package/src/src/models/BulkUpsertAuthEmailTemplatesRequest.ts +91 -0
  31. package/src/src/models/BulkUpsertAuthEmailTemplatesResponse.ts +88 -0
  32. package/src/src/models/ExecutionCancelResponse.ts +88 -0
  33. package/src/src/models/ExecutionCancelResponseData.ts +83 -0
  34. package/src/src/models/ExecutionResponse.ts +88 -0
  35. package/src/src/models/ExecutionRetryResponse.ts +88 -0
  36. package/src/src/models/ExecutionRetryResponseData.ts +94 -0
  37. package/src/src/models/ResubscribeResponse.ts +10 -10
  38. package/src/src/models/SendSlackMessageRequest.ts +156 -0
  39. package/src/src/models/SendSlackMessageResponse.ts +88 -0
  40. package/src/src/models/SendSlackMessageResult.ts +115 -0
  41. package/src/src/models/SlackMessage.ts +203 -0
  42. package/src/src/models/SlackMessageListResponse.ts +88 -0
  43. package/src/src/models/SlackMessageListResponseMeta.ts +89 -0
  44. package/src/src/models/SlackMessageResponse.ts +88 -0
  45. package/src/src/models/SlackMessageStatus.ts +56 -0
  46. package/src/src/models/SlackMessageSummary.ts +155 -0
  47. package/src/src/models/SuccessResult.ts +10 -10
  48. package/src/src/models/UpsertAuthEmailTemplateRequest.ts +143 -0
  49. package/src/src/models/WorkflowExecution.ts +201 -0
  50. package/src/src/models/WorkflowExecutionStatus.ts +56 -0
  51. package/src/src/models/WorkflowStepExecution.ts +184 -0
  52. package/src/src/models/WorkflowStepExecutionStatus.ts +57 -0
  53. package/src/src/models/index.ts +37 -1
@@ -0,0 +1,89 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Zyphr API
5
+ * Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@zyphr.dev
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 SlackMessageListResponseMeta
20
+ */
21
+ export interface SlackMessageListResponseMeta {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof SlackMessageListResponseMeta
26
+ */
27
+ requestId?: string;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof SlackMessageListResponseMeta
32
+ */
33
+ total?: number;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof SlackMessageListResponseMeta
38
+ */
39
+ limit?: number;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof SlackMessageListResponseMeta
44
+ */
45
+ offset?: number;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the SlackMessageListResponseMeta interface.
50
+ */
51
+ export function instanceOfSlackMessageListResponseMeta(value: object): value is SlackMessageListResponseMeta {
52
+ return true;
53
+ }
54
+
55
+ export function SlackMessageListResponseMetaFromJSON(json: any): SlackMessageListResponseMeta {
56
+ return SlackMessageListResponseMetaFromJSONTyped(json, false);
57
+ }
58
+
59
+ export function SlackMessageListResponseMetaFromJSONTyped(json: any, ignoreDiscriminator: boolean): SlackMessageListResponseMeta {
60
+ if (json == null) {
61
+ return json;
62
+ }
63
+ return {
64
+
65
+ 'requestId': json['request_id'] == null ? undefined : json['request_id'],
66
+ 'total': json['total'] == null ? undefined : json['total'],
67
+ 'limit': json['limit'] == null ? undefined : json['limit'],
68
+ 'offset': json['offset'] == null ? undefined : json['offset'],
69
+ };
70
+ }
71
+
72
+ export function SlackMessageListResponseMetaToJSON(json: any): SlackMessageListResponseMeta {
73
+ return SlackMessageListResponseMetaToJSONTyped(json, false);
74
+ }
75
+
76
+ export function SlackMessageListResponseMetaToJSONTyped(value?: SlackMessageListResponseMeta | null, ignoreDiscriminator: boolean = false): any {
77
+ if (value == null) {
78
+ return value;
79
+ }
80
+
81
+ return {
82
+
83
+ 'request_id': value['requestId'],
84
+ 'total': value['total'],
85
+ 'limit': value['limit'],
86
+ 'offset': value['offset'],
87
+ };
88
+ }
89
+
@@ -0,0 +1,88 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Zyphr API
5
+ * Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@zyphr.dev
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 { RequestMeta } from './RequestMeta';
17
+ import {
18
+ RequestMetaFromJSON,
19
+ RequestMetaFromJSONTyped,
20
+ RequestMetaToJSON,
21
+ RequestMetaToJSONTyped,
22
+ } from './RequestMeta';
23
+ import type { SlackMessage } from './SlackMessage';
24
+ import {
25
+ SlackMessageFromJSON,
26
+ SlackMessageFromJSONTyped,
27
+ SlackMessageToJSON,
28
+ SlackMessageToJSONTyped,
29
+ } from './SlackMessage';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface SlackMessageResponse
35
+ */
36
+ export interface SlackMessageResponse {
37
+ /**
38
+ *
39
+ * @type {SlackMessage}
40
+ * @memberof SlackMessageResponse
41
+ */
42
+ data?: SlackMessage;
43
+ /**
44
+ *
45
+ * @type {RequestMeta}
46
+ * @memberof SlackMessageResponse
47
+ */
48
+ meta?: RequestMeta;
49
+ }
50
+
51
+ /**
52
+ * Check if a given object implements the SlackMessageResponse interface.
53
+ */
54
+ export function instanceOfSlackMessageResponse(value: object): value is SlackMessageResponse {
55
+ return true;
56
+ }
57
+
58
+ export function SlackMessageResponseFromJSON(json: any): SlackMessageResponse {
59
+ return SlackMessageResponseFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function SlackMessageResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SlackMessageResponse {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'data': json['data'] == null ? undefined : SlackMessageFromJSON(json['data']),
69
+ 'meta': json['meta'] == null ? undefined : RequestMetaFromJSON(json['meta']),
70
+ };
71
+ }
72
+
73
+ export function SlackMessageResponseToJSON(json: any): SlackMessageResponse {
74
+ return SlackMessageResponseToJSONTyped(json, false);
75
+ }
76
+
77
+ export function SlackMessageResponseToJSONTyped(value?: SlackMessageResponse | null, ignoreDiscriminator: boolean = false): any {
78
+ if (value == null) {
79
+ return value;
80
+ }
81
+
82
+ return {
83
+
84
+ 'data': SlackMessageToJSON(value['data']),
85
+ 'meta': RequestMetaToJSON(value['meta']),
86
+ };
87
+ }
88
+
@@ -0,0 +1,56 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Zyphr API
5
+ * Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@zyphr.dev
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
+ /**
17
+ *
18
+ * @export
19
+ */
20
+ export const SlackMessageStatus = {
21
+ QUEUED: 'queued',
22
+ SENDING: 'sending',
23
+ SENT: 'sent',
24
+ DELIVERED: 'delivered',
25
+ FAILED: 'failed'
26
+ } as const;
27
+ export type SlackMessageStatus = typeof SlackMessageStatus[keyof typeof SlackMessageStatus];
28
+
29
+
30
+ export function instanceOfSlackMessageStatus(value: any): boolean {
31
+ for (const key in SlackMessageStatus) {
32
+ if (Object.prototype.hasOwnProperty.call(SlackMessageStatus, key)) {
33
+ if (SlackMessageStatus[key as keyof typeof SlackMessageStatus] === value) {
34
+ return true;
35
+ }
36
+ }
37
+ }
38
+ return false;
39
+ }
40
+
41
+ export function SlackMessageStatusFromJSON(json: any): SlackMessageStatus {
42
+ return SlackMessageStatusFromJSONTyped(json, false);
43
+ }
44
+
45
+ export function SlackMessageStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): SlackMessageStatus {
46
+ return json as SlackMessageStatus;
47
+ }
48
+
49
+ export function SlackMessageStatusToJSON(value?: SlackMessageStatus | null): any {
50
+ return value as any;
51
+ }
52
+
53
+ export function SlackMessageStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): SlackMessageStatus {
54
+ return value as SlackMessageStatus;
55
+ }
56
+
@@ -0,0 +1,155 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Zyphr API
5
+ * Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@zyphr.dev
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 { SlackMessageStatus } from './SlackMessageStatus';
17
+ import {
18
+ SlackMessageStatusFromJSON,
19
+ SlackMessageStatusFromJSONTyped,
20
+ SlackMessageStatusToJSON,
21
+ SlackMessageStatusToJSONTyped,
22
+ } from './SlackMessageStatus';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface SlackMessageSummary
28
+ */
29
+ export interface SlackMessageSummary {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof SlackMessageSummary
34
+ */
35
+ id?: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof SlackMessageSummary
40
+ */
41
+ slackConnectionId?: string;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof SlackMessageSummary
46
+ */
47
+ channelId?: string;
48
+ /**
49
+ *
50
+ * @type {string}
51
+ * @memberof SlackMessageSummary
52
+ */
53
+ channelName?: string | null;
54
+ /**
55
+ *
56
+ * @type {string}
57
+ * @memberof SlackMessageSummary
58
+ */
59
+ text?: string | null;
60
+ /**
61
+ *
62
+ * @type {string}
63
+ * @memberof SlackMessageSummary
64
+ */
65
+ messageTs?: string | null;
66
+ /**
67
+ *
68
+ * @type {SlackMessageStatus}
69
+ * @memberof SlackMessageSummary
70
+ */
71
+ status?: SlackMessageStatus;
72
+ /**
73
+ *
74
+ * @type {string}
75
+ * @memberof SlackMessageSummary
76
+ */
77
+ statusReason?: string | null;
78
+ /**
79
+ *
80
+ * @type {Array<string>}
81
+ * @memberof SlackMessageSummary
82
+ */
83
+ tags?: Array<string> | null;
84
+ /**
85
+ *
86
+ * @type {Date}
87
+ * @memberof SlackMessageSummary
88
+ */
89
+ createdAt?: Date;
90
+ /**
91
+ *
92
+ * @type {Date}
93
+ * @memberof SlackMessageSummary
94
+ */
95
+ sentAt?: Date | null;
96
+ }
97
+
98
+
99
+
100
+ /**
101
+ * Check if a given object implements the SlackMessageSummary interface.
102
+ */
103
+ export function instanceOfSlackMessageSummary(value: object): value is SlackMessageSummary {
104
+ return true;
105
+ }
106
+
107
+ export function SlackMessageSummaryFromJSON(json: any): SlackMessageSummary {
108
+ return SlackMessageSummaryFromJSONTyped(json, false);
109
+ }
110
+
111
+ export function SlackMessageSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): SlackMessageSummary {
112
+ if (json == null) {
113
+ return json;
114
+ }
115
+ return {
116
+
117
+ 'id': json['id'] == null ? undefined : json['id'],
118
+ 'slackConnectionId': json['slack_connection_id'] == null ? undefined : json['slack_connection_id'],
119
+ 'channelId': json['channel_id'] == null ? undefined : json['channel_id'],
120
+ 'channelName': json['channel_name'] == null ? undefined : json['channel_name'],
121
+ 'text': json['text'] == null ? undefined : json['text'],
122
+ 'messageTs': json['message_ts'] == null ? undefined : json['message_ts'],
123
+ 'status': json['status'] == null ? undefined : SlackMessageStatusFromJSON(json['status']),
124
+ 'statusReason': json['status_reason'] == null ? undefined : json['status_reason'],
125
+ 'tags': json['tags'] == null ? undefined : json['tags'],
126
+ 'createdAt': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
127
+ 'sentAt': json['sent_at'] == null ? undefined : (new Date(json['sent_at'])),
128
+ };
129
+ }
130
+
131
+ export function SlackMessageSummaryToJSON(json: any): SlackMessageSummary {
132
+ return SlackMessageSummaryToJSONTyped(json, false);
133
+ }
134
+
135
+ export function SlackMessageSummaryToJSONTyped(value?: SlackMessageSummary | null, ignoreDiscriminator: boolean = false): any {
136
+ if (value == null) {
137
+ return value;
138
+ }
139
+
140
+ return {
141
+
142
+ 'id': value['id'],
143
+ 'slack_connection_id': value['slackConnectionId'],
144
+ 'channel_id': value['channelId'],
145
+ 'channel_name': value['channelName'],
146
+ 'text': value['text'],
147
+ 'message_ts': value['messageTs'],
148
+ 'status': SlackMessageStatusToJSON(value['status']),
149
+ 'status_reason': value['statusReason'],
150
+ 'tags': value['tags'],
151
+ 'created_at': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
152
+ 'sent_at': value['sentAt'] == null ? undefined : ((value['sentAt'] as any).toISOString()),
153
+ };
154
+ }
155
+
@@ -13,13 +13,13 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
- import type { SuccessResultData } from './SuccessResultData';
16
+ import type { AuthEmailTemplateDeleteResponseData } from './AuthEmailTemplateDeleteResponseData';
17
17
  import {
18
- SuccessResultDataFromJSON,
19
- SuccessResultDataFromJSONTyped,
20
- SuccessResultDataToJSON,
21
- SuccessResultDataToJSONTyped,
22
- } from './SuccessResultData';
18
+ AuthEmailTemplateDeleteResponseDataFromJSON,
19
+ AuthEmailTemplateDeleteResponseDataFromJSONTyped,
20
+ AuthEmailTemplateDeleteResponseDataToJSON,
21
+ AuthEmailTemplateDeleteResponseDataToJSONTyped,
22
+ } from './AuthEmailTemplateDeleteResponseData';
23
23
  import type { RequestMeta } from './RequestMeta';
24
24
  import {
25
25
  RequestMetaFromJSON,
@@ -36,10 +36,10 @@ import {
36
36
  export interface SuccessResult {
37
37
  /**
38
38
  *
39
- * @type {SuccessResultData}
39
+ * @type {AuthEmailTemplateDeleteResponseData}
40
40
  * @memberof SuccessResult
41
41
  */
42
- data?: SuccessResultData;
42
+ data?: AuthEmailTemplateDeleteResponseData;
43
43
  /**
44
44
  *
45
45
  * @type {RequestMeta}
@@ -65,7 +65,7 @@ export function SuccessResultFromJSONTyped(json: any, ignoreDiscriminator: boole
65
65
  }
66
66
  return {
67
67
 
68
- 'data': json['data'] == null ? undefined : SuccessResultDataFromJSON(json['data']),
68
+ 'data': json['data'] == null ? undefined : AuthEmailTemplateDeleteResponseDataFromJSON(json['data']),
69
69
  'meta': json['meta'] == null ? undefined : RequestMetaFromJSON(json['meta']),
70
70
  };
71
71
  }
@@ -81,7 +81,7 @@ export function SuccessResultToJSONTyped(value?: SuccessResult | null, ignoreDis
81
81
 
82
82
  return {
83
83
 
84
- 'data': SuccessResultDataToJSON(value['data']),
84
+ 'data': AuthEmailTemplateDeleteResponseDataToJSON(value['data']),
85
85
  'meta': RequestMetaToJSON(value['meta']),
86
86
  };
87
87
  }
@@ -0,0 +1,143 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Zyphr API
5
+ * Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@zyphr.dev
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
+ * Subject is required. Provide one of `html`, `mjml_source`, or `design_json`.
18
+ * MJML sources are compiled to HTML on save.
19
+ *
20
+ * @export
21
+ * @interface UpsertAuthEmailTemplateRequest
22
+ */
23
+ export interface UpsertAuthEmailTemplateRequest {
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof UpsertAuthEmailTemplateRequest
28
+ */
29
+ subject?: string;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof UpsertAuthEmailTemplateRequest
34
+ */
35
+ html?: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof UpsertAuthEmailTemplateRequest
40
+ */
41
+ text?: string | null;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof UpsertAuthEmailTemplateRequest
46
+ */
47
+ mjmlSource?: string | null;
48
+ /**
49
+ *
50
+ * @type {{ [key: string]: any; }}
51
+ * @memberof UpsertAuthEmailTemplateRequest
52
+ */
53
+ designJson?: { [key: string]: any; } | null;
54
+ /**
55
+ *
56
+ * @type {string}
57
+ * @memberof UpsertAuthEmailTemplateRequest
58
+ */
59
+ editorType?: UpsertAuthEmailTemplateRequestEditorTypeEnum | null;
60
+ /**
61
+ *
62
+ * @type {string}
63
+ * @memberof UpsertAuthEmailTemplateRequest
64
+ */
65
+ fromName?: string | null;
66
+ /**
67
+ *
68
+ * @type {string}
69
+ * @memberof UpsertAuthEmailTemplateRequest
70
+ */
71
+ replyTo?: string | null;
72
+ /**
73
+ *
74
+ * @type {boolean}
75
+ * @memberof UpsertAuthEmailTemplateRequest
76
+ */
77
+ isEnabled?: boolean;
78
+ }
79
+
80
+
81
+ /**
82
+ * @export
83
+ */
84
+ export const UpsertAuthEmailTemplateRequestEditorTypeEnum = {
85
+ CODE: 'code',
86
+ MJML: 'mjml',
87
+ DESIGN: 'design'
88
+ } as const;
89
+ export type UpsertAuthEmailTemplateRequestEditorTypeEnum = typeof UpsertAuthEmailTemplateRequestEditorTypeEnum[keyof typeof UpsertAuthEmailTemplateRequestEditorTypeEnum];
90
+
91
+
92
+ /**
93
+ * Check if a given object implements the UpsertAuthEmailTemplateRequest interface.
94
+ */
95
+ export function instanceOfUpsertAuthEmailTemplateRequest(value: object): value is UpsertAuthEmailTemplateRequest {
96
+ return true;
97
+ }
98
+
99
+ export function UpsertAuthEmailTemplateRequestFromJSON(json: any): UpsertAuthEmailTemplateRequest {
100
+ return UpsertAuthEmailTemplateRequestFromJSONTyped(json, false);
101
+ }
102
+
103
+ export function UpsertAuthEmailTemplateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpsertAuthEmailTemplateRequest {
104
+ if (json == null) {
105
+ return json;
106
+ }
107
+ return {
108
+
109
+ 'subject': json['subject'] == null ? undefined : json['subject'],
110
+ 'html': json['html'] == null ? undefined : json['html'],
111
+ 'text': json['text'] == null ? undefined : json['text'],
112
+ 'mjmlSource': json['mjml_source'] == null ? undefined : json['mjml_source'],
113
+ 'designJson': json['design_json'] == null ? undefined : json['design_json'],
114
+ 'editorType': json['editor_type'] == null ? undefined : json['editor_type'],
115
+ 'fromName': json['from_name'] == null ? undefined : json['from_name'],
116
+ 'replyTo': json['reply_to'] == null ? undefined : json['reply_to'],
117
+ 'isEnabled': json['is_enabled'] == null ? undefined : json['is_enabled'],
118
+ };
119
+ }
120
+
121
+ export function UpsertAuthEmailTemplateRequestToJSON(json: any): UpsertAuthEmailTemplateRequest {
122
+ return UpsertAuthEmailTemplateRequestToJSONTyped(json, false);
123
+ }
124
+
125
+ export function UpsertAuthEmailTemplateRequestToJSONTyped(value?: UpsertAuthEmailTemplateRequest | null, ignoreDiscriminator: boolean = false): any {
126
+ if (value == null) {
127
+ return value;
128
+ }
129
+
130
+ return {
131
+
132
+ 'subject': value['subject'],
133
+ 'html': value['html'],
134
+ 'text': value['text'],
135
+ 'mjml_source': value['mjmlSource'],
136
+ 'design_json': value['designJson'],
137
+ 'editor_type': value['editorType'],
138
+ 'from_name': value['fromName'],
139
+ 'reply_to': value['replyTo'],
140
+ 'is_enabled': value['isEnabled'],
141
+ };
142
+ }
143
+