@zyphr-dev/node-sdk 0.1.33 → 0.1.34

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyphr-dev/node-sdk",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "description": "Official Zyphr SDK for Node.js, React, and React Native",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -19,6 +19,7 @@ src/apis/DevicesApi.ts
19
19
  src/apis/DomainsApi.ts
20
20
  src/apis/EmailsApi.ts
21
21
  src/apis/ExecutionsApi.ts
22
+ src/apis/InboundEmailApi.ts
22
23
  src/apis/InboxApi.ts
23
24
  src/apis/MuseApi.ts
24
25
  src/apis/PushApi.ts
@@ -153,6 +154,14 @@ src/models/GetDomain200ResponseMeta.ts
153
154
  src/models/GetWaaSEndpoint200Response.ts
154
155
  src/models/GetWaaSUsage200Response.ts
155
156
  src/models/InAppNotification.ts
157
+ src/models/InboundAttachmentUrlResponse.ts
158
+ src/models/InboundAttachmentUrlResponseData.ts
159
+ src/models/InboundEmail.ts
160
+ src/models/InboundEmailAttachment.ts
161
+ src/models/InboundEmailFrom.ts
162
+ src/models/InboundEmailListResponse.ts
163
+ src/models/InboundEmailListResponseMeta.ts
164
+ src/models/InboundEmailResponse.ts
156
165
  src/models/InboxListMeta.ts
157
166
  src/models/InboxListResponse.ts
158
167
  src/models/InboxNotificationResponse.ts
@@ -300,6 +309,7 @@ src/models/SendWebhookTestEventRequest.ts
300
309
  src/models/SessionListResponse.ts
301
310
  src/models/SessionListResponseData.ts
302
311
  src/models/SessionListResponseDataSessionInfo.ts
312
+ src/models/SetDomainInboundRequest.ts
303
313
  src/models/SetPreferencesRequest.ts
304
314
  src/models/SetPreferencesRequestPreferencesInner.ts
305
315
  src/models/SignInAnonymouslyRequest.ts
package/src/client.ts CHANGED
@@ -31,6 +31,7 @@ import {
31
31
  DevicesApi,
32
32
  DomainsApi,
33
33
  EmailsApi,
34
+ InboundEmailApi,
34
35
  InboxApi,
35
36
  PushApi,
36
37
  SlackApi,
@@ -84,6 +85,8 @@ export class Zyphr {
84
85
  readonly topics: TopicsApi;
85
86
  readonly devices: DevicesApi;
86
87
  readonly domains: DomainsApi;
88
+ /** Inbound (received) email — read access. Requires the `email:read` scope. */
89
+ readonly inbound: InboundEmailApi;
87
90
 
88
91
  readonly waas: {
89
92
  readonly applications: WaaSApplicationsApi;
@@ -135,6 +138,7 @@ export class Zyphr {
135
138
  this.topics = new TopicsApi(config);
136
139
  this.devices = new DevicesApi(config);
137
140
  this.domains = new DomainsApi(config);
141
+ this.inbound = new InboundEmailApi(config);
138
142
 
139
143
  this.waas = {
140
144
  applications: new WaaSApplicationsApi(config),
@@ -21,6 +21,7 @@ import type {
21
21
  DeleteDomainResponse,
22
22
  DomainListResponse,
23
23
  GetDomain200Response,
24
+ SetDomainInboundRequest,
24
25
  VerificationStatusResponse,
25
26
  VerifyDomainResponse,
26
27
  } from '../models/index';
@@ -37,6 +38,8 @@ import {
37
38
  DomainListResponseToJSON,
38
39
  GetDomain200ResponseFromJSON,
39
40
  GetDomain200ResponseToJSON,
41
+ SetDomainInboundRequestFromJSON,
42
+ SetDomainInboundRequestToJSON,
40
43
  VerificationStatusResponseFromJSON,
41
44
  VerificationStatusResponseToJSON,
42
45
  VerifyDomainResponseFromJSON,
@@ -59,6 +62,11 @@ export interface DomainsApiGetDomainVerificationStatusRequest {
59
62
  id: string;
60
63
  }
61
64
 
65
+ export interface DomainsApiSetDomainInboundOperationRequest {
66
+ id: string;
67
+ setDomainInboundRequest: SetDomainInboundRequest;
68
+ }
69
+
62
70
  export interface DomainsApiVerifyDomainRequest {
63
71
  id: string;
64
72
  }
@@ -149,6 +157,23 @@ export interface DomainsApiInterface {
149
157
  */
150
158
  listDomains(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DomainListResponse>;
151
159
 
160
+ /**
161
+ * Toggle email receiving for a domain. When enabled, the domain\'s DNS records gain an MX record on the `inbound.` subdomain that the tenant must publish. Requires a plan with inbound email (Starter+).
162
+ * @summary Enable or disable inbound email for a domain
163
+ * @param {string} id
164
+ * @param {SetDomainInboundRequest} setDomainInboundRequest
165
+ * @param {*} [options] Override http request option.
166
+ * @throws {RequiredError}
167
+ * @memberof DomainsApiInterface
168
+ */
169
+ setDomainInboundRaw(requestParameters: DomainsApiSetDomainInboundOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
170
+
171
+ /**
172
+ * Toggle email receiving for a domain. When enabled, the domain\'s DNS records gain an MX record on the `inbound.` subdomain that the tenant must publish. Requires a plan with inbound email (Starter+).
173
+ * Enable or disable inbound email for a domain
174
+ */
175
+ setDomainInbound(id: string, setDomainInboundRequest: SetDomainInboundRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
176
+
152
177
  /**
153
178
  * Queue an asynchronous DNS verification check. Returns immediately with a `job_id`. Poll `GET /v1/domains/{id}/verification-status` (or the higher-level `GET /v1/domains/{id}`) for the result, or subscribe to the `domain.verified` webhook event when sc-5444 ships. Returns 409 if a verification is already in progress for this domain (within the last 2 minutes).
154
179
  * @summary Trigger domain verification
@@ -363,6 +388,54 @@ export class DomainsApi extends runtime.BaseAPI implements DomainsApiInterface {
363
388
  return await response.value();
364
389
  }
365
390
 
391
+ /**
392
+ * Toggle email receiving for a domain. When enabled, the domain\'s DNS records gain an MX record on the `inbound.` subdomain that the tenant must publish. Requires a plan with inbound email (Starter+).
393
+ * Enable or disable inbound email for a domain
394
+ */
395
+ async setDomainInboundRaw(requestParameters: DomainsApiSetDomainInboundOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
396
+ if (requestParameters['id'] == null) {
397
+ throw new runtime.RequiredError(
398
+ 'id',
399
+ 'Required parameter "id" was null or undefined when calling setDomainInbound().'
400
+ );
401
+ }
402
+
403
+ if (requestParameters['setDomainInboundRequest'] == null) {
404
+ throw new runtime.RequiredError(
405
+ 'setDomainInboundRequest',
406
+ 'Required parameter "setDomainInboundRequest" was null or undefined when calling setDomainInbound().'
407
+ );
408
+ }
409
+
410
+ const queryParameters: any = {};
411
+
412
+ const headerParameters: runtime.HTTPHeaders = {};
413
+
414
+ headerParameters['Content-Type'] = 'application/json';
415
+
416
+ if (this.configuration && this.configuration.apiKey) {
417
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
418
+ }
419
+
420
+ const response = await this.request({
421
+ path: `/domains/{id}/inbound`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
422
+ method: 'PUT',
423
+ headers: headerParameters,
424
+ query: queryParameters,
425
+ body: SetDomainInboundRequestToJSON(requestParameters['setDomainInboundRequest']),
426
+ }, initOverrides);
427
+
428
+ return new runtime.VoidApiResponse(response);
429
+ }
430
+
431
+ /**
432
+ * Toggle email receiving for a domain. When enabled, the domain\'s DNS records gain an MX record on the `inbound.` subdomain that the tenant must publish. Requires a plan with inbound email (Starter+).
433
+ * Enable or disable inbound email for a domain
434
+ */
435
+ async setDomainInbound(id: string, setDomainInboundRequest: SetDomainInboundRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
436
+ await this.setDomainInboundRaw({ id: id, setDomainInboundRequest: setDomainInboundRequest }, initOverrides);
437
+ }
438
+
366
439
  /**
367
440
  * Queue an asynchronous DNS verification check. Returns immediately with a `job_id`. Poll `GET /v1/domains/{id}/verification-status` (or the higher-level `GET /v1/domains/{id}`) for the result, or subscribe to the `domain.verified` webhook event when sc-5444 ships. Returns 409 if a verification is already in progress for this domain (within the last 2 minutes).
368
441
  * Trigger domain verification
@@ -0,0 +1,264 @@
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
+ import * as runtime from '../runtime';
17
+ import type {
18
+ InboundAttachmentUrlResponse,
19
+ InboundEmailListResponse,
20
+ InboundEmailResponse,
21
+ } from '../models/index';
22
+ import {
23
+ InboundAttachmentUrlResponseFromJSON,
24
+ InboundAttachmentUrlResponseToJSON,
25
+ InboundEmailListResponseFromJSON,
26
+ InboundEmailListResponseToJSON,
27
+ InboundEmailResponseFromJSON,
28
+ InboundEmailResponseToJSON,
29
+ } from '../models/index';
30
+
31
+ export interface InboundEmailApiGetInboundAttachmentUrlRequest {
32
+ id: string;
33
+ attachmentId: string;
34
+ }
35
+
36
+ export interface InboundEmailApiGetInboundEmailRequest {
37
+ id: string;
38
+ }
39
+
40
+ export interface InboundEmailApiListInboundEmailsRequest {
41
+ status?: ListInboundEmailsStatusEnum;
42
+ to?: string;
43
+ includeWithheld?: boolean;
44
+ limit?: number;
45
+ offset?: number;
46
+ }
47
+
48
+ /**
49
+ * InboundEmailApi - interface
50
+ *
51
+ * @export
52
+ * @interface InboundEmailApiInterface
53
+ */
54
+ export interface InboundEmailApiInterface {
55
+ /**
56
+ * Return a short-lived presigned S3 download URL for one attachment of a received email. `attachmentId` is the positional id from the email\'s `attachments` array.
57
+ * @summary Get an attachment download URL
58
+ * @param {string} id
59
+ * @param {string} attachmentId
60
+ * @param {*} [options] Override http request option.
61
+ * @throws {RequiredError}
62
+ * @memberof InboundEmailApiInterface
63
+ */
64
+ getInboundAttachmentUrlRaw(requestParameters: InboundEmailApiGetInboundAttachmentUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InboundAttachmentUrlResponse>>;
65
+
66
+ /**
67
+ * Return a short-lived presigned S3 download URL for one attachment of a received email. `attachmentId` is the positional id from the email\'s `attachments` array.
68
+ * Get an attachment download URL
69
+ */
70
+ getInboundAttachmentUrl(id: string, attachmentId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InboundAttachmentUrlResponse>;
71
+
72
+ /**
73
+ * Retrieve a single inbound email by id (scoped to the project).
74
+ * @summary Get a received email
75
+ * @param {string} id
76
+ * @param {*} [options] Override http request option.
77
+ * @throws {RequiredError}
78
+ * @memberof InboundEmailApiInterface
79
+ */
80
+ getInboundEmailRaw(requestParameters: InboundEmailApiGetInboundEmailRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InboundEmailResponse>>;
81
+
82
+ /**
83
+ * Retrieve a single inbound email by id (scoped to the project).
84
+ * Get a received email
85
+ */
86
+ getInboundEmail(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InboundEmailResponse>;
87
+
88
+ /**
89
+ * List inbound (received) emails for the project, newest first. By default only delivered mail (`received`/`processed`) is returned; pass `include_withheld=true` to also see quarantined/dropped.
90
+ * @summary List received emails
91
+ * @param {'received' | 'processed' | 'quarantined' | 'dropped' | 'failed'} [status]
92
+ * @param {string} [to] Filter by receiving address
93
+ * @param {boolean} [includeWithheld] Include quarantined/dropped mail
94
+ * @param {number} [limit]
95
+ * @param {number} [offset]
96
+ * @param {*} [options] Override http request option.
97
+ * @throws {RequiredError}
98
+ * @memberof InboundEmailApiInterface
99
+ */
100
+ listInboundEmailsRaw(requestParameters: InboundEmailApiListInboundEmailsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InboundEmailListResponse>>;
101
+
102
+ /**
103
+ * List inbound (received) emails for the project, newest first. By default only delivered mail (`received`/`processed`) is returned; pass `include_withheld=true` to also see quarantined/dropped.
104
+ * List received emails
105
+ */
106
+ listInboundEmails(status?: ListInboundEmailsStatusEnum, to?: string, includeWithheld?: boolean, limit?: number, offset?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InboundEmailListResponse>;
107
+
108
+ }
109
+
110
+ /**
111
+ *
112
+ */
113
+ export class InboundEmailApi extends runtime.BaseAPI implements InboundEmailApiInterface {
114
+
115
+ /**
116
+ * Return a short-lived presigned S3 download URL for one attachment of a received email. `attachmentId` is the positional id from the email\'s `attachments` array.
117
+ * Get an attachment download URL
118
+ */
119
+ async getInboundAttachmentUrlRaw(requestParameters: InboundEmailApiGetInboundAttachmentUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InboundAttachmentUrlResponse>> {
120
+ if (requestParameters['id'] == null) {
121
+ throw new runtime.RequiredError(
122
+ 'id',
123
+ 'Required parameter "id" was null or undefined when calling getInboundAttachmentUrl().'
124
+ );
125
+ }
126
+
127
+ if (requestParameters['attachmentId'] == null) {
128
+ throw new runtime.RequiredError(
129
+ 'attachmentId',
130
+ 'Required parameter "attachmentId" was null or undefined when calling getInboundAttachmentUrl().'
131
+ );
132
+ }
133
+
134
+ const queryParameters: any = {};
135
+
136
+ const headerParameters: runtime.HTTPHeaders = {};
137
+
138
+ if (this.configuration && this.configuration.apiKey) {
139
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
140
+ }
141
+
142
+ const response = await this.request({
143
+ path: `/inbound-emails/{id}/attachments/{attachmentId}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))).replace(`{${"attachmentId"}}`, encodeURIComponent(String(requestParameters['attachmentId']))),
144
+ method: 'GET',
145
+ headers: headerParameters,
146
+ query: queryParameters,
147
+ }, initOverrides);
148
+
149
+ return new runtime.JSONApiResponse(response, (jsonValue) => InboundAttachmentUrlResponseFromJSON(jsonValue));
150
+ }
151
+
152
+ /**
153
+ * Return a short-lived presigned S3 download URL for one attachment of a received email. `attachmentId` is the positional id from the email\'s `attachments` array.
154
+ * Get an attachment download URL
155
+ */
156
+ async getInboundAttachmentUrl(id: string, attachmentId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InboundAttachmentUrlResponse> {
157
+ const response = await this.getInboundAttachmentUrlRaw({ id: id, attachmentId: attachmentId }, initOverrides);
158
+ return await response.value();
159
+ }
160
+
161
+ /**
162
+ * Retrieve a single inbound email by id (scoped to the project).
163
+ * Get a received email
164
+ */
165
+ async getInboundEmailRaw(requestParameters: InboundEmailApiGetInboundEmailRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InboundEmailResponse>> {
166
+ if (requestParameters['id'] == null) {
167
+ throw new runtime.RequiredError(
168
+ 'id',
169
+ 'Required parameter "id" was null or undefined when calling getInboundEmail().'
170
+ );
171
+ }
172
+
173
+ const queryParameters: any = {};
174
+
175
+ const headerParameters: runtime.HTTPHeaders = {};
176
+
177
+ if (this.configuration && this.configuration.apiKey) {
178
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
179
+ }
180
+
181
+ const response = await this.request({
182
+ path: `/inbound-emails/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
183
+ method: 'GET',
184
+ headers: headerParameters,
185
+ query: queryParameters,
186
+ }, initOverrides);
187
+
188
+ return new runtime.JSONApiResponse(response, (jsonValue) => InboundEmailResponseFromJSON(jsonValue));
189
+ }
190
+
191
+ /**
192
+ * Retrieve a single inbound email by id (scoped to the project).
193
+ * Get a received email
194
+ */
195
+ async getInboundEmail(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InboundEmailResponse> {
196
+ const response = await this.getInboundEmailRaw({ id: id }, initOverrides);
197
+ return await response.value();
198
+ }
199
+
200
+ /**
201
+ * List inbound (received) emails for the project, newest first. By default only delivered mail (`received`/`processed`) is returned; pass `include_withheld=true` to also see quarantined/dropped.
202
+ * List received emails
203
+ */
204
+ async listInboundEmailsRaw(requestParameters: InboundEmailApiListInboundEmailsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InboundEmailListResponse>> {
205
+ const queryParameters: any = {};
206
+
207
+ if (requestParameters['status'] != null) {
208
+ queryParameters['status'] = requestParameters['status'];
209
+ }
210
+
211
+ if (requestParameters['to'] != null) {
212
+ queryParameters['to'] = requestParameters['to'];
213
+ }
214
+
215
+ if (requestParameters['includeWithheld'] != null) {
216
+ queryParameters['include_withheld'] = requestParameters['includeWithheld'];
217
+ }
218
+
219
+ if (requestParameters['limit'] != null) {
220
+ queryParameters['limit'] = requestParameters['limit'];
221
+ }
222
+
223
+ if (requestParameters['offset'] != null) {
224
+ queryParameters['offset'] = requestParameters['offset'];
225
+ }
226
+
227
+ const headerParameters: runtime.HTTPHeaders = {};
228
+
229
+ if (this.configuration && this.configuration.apiKey) {
230
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
231
+ }
232
+
233
+ const response = await this.request({
234
+ path: `/inbound-emails`,
235
+ method: 'GET',
236
+ headers: headerParameters,
237
+ query: queryParameters,
238
+ }, initOverrides);
239
+
240
+ return new runtime.JSONApiResponse(response, (jsonValue) => InboundEmailListResponseFromJSON(jsonValue));
241
+ }
242
+
243
+ /**
244
+ * List inbound (received) emails for the project, newest first. By default only delivered mail (`received`/`processed`) is returned; pass `include_withheld=true` to also see quarantined/dropped.
245
+ * List received emails
246
+ */
247
+ async listInboundEmails(status?: ListInboundEmailsStatusEnum, to?: string, includeWithheld?: boolean, limit?: number, offset?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InboundEmailListResponse> {
248
+ const response = await this.listInboundEmailsRaw({ status: status, to: to, includeWithheld: includeWithheld, limit: limit, offset: offset }, initOverrides);
249
+ return await response.value();
250
+ }
251
+
252
+ }
253
+
254
+ /**
255
+ * @export
256
+ */
257
+ export const ListInboundEmailsStatusEnum = {
258
+ RECEIVED: 'received',
259
+ PROCESSED: 'processed',
260
+ QUARANTINED: 'quarantined',
261
+ DROPPED: 'dropped',
262
+ FAILED: 'failed'
263
+ } as const;
264
+ export type ListInboundEmailsStatusEnum = typeof ListInboundEmailsStatusEnum[keyof typeof ListInboundEmailsStatusEnum];
@@ -17,6 +17,7 @@ export * from './DevicesApi';
17
17
  export * from './DomainsApi';
18
18
  export * from './EmailsApi';
19
19
  export * from './ExecutionsApi';
20
+ export * from './InboundEmailApi';
20
21
  export * from './InboxApi';
21
22
  export * from './MuseApi';
22
23
  export * from './PushApi';
@@ -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 { InboundAttachmentUrlResponseData } from './InboundAttachmentUrlResponseData';
17
+ import {
18
+ InboundAttachmentUrlResponseDataFromJSON,
19
+ InboundAttachmentUrlResponseDataFromJSONTyped,
20
+ InboundAttachmentUrlResponseDataToJSON,
21
+ InboundAttachmentUrlResponseDataToJSONTyped,
22
+ } from './InboundAttachmentUrlResponseData';
23
+ import type { RequestMeta } from './RequestMeta';
24
+ import {
25
+ RequestMetaFromJSON,
26
+ RequestMetaFromJSONTyped,
27
+ RequestMetaToJSON,
28
+ RequestMetaToJSONTyped,
29
+ } from './RequestMeta';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface InboundAttachmentUrlResponse
35
+ */
36
+ export interface InboundAttachmentUrlResponse {
37
+ /**
38
+ *
39
+ * @type {InboundAttachmentUrlResponseData}
40
+ * @memberof InboundAttachmentUrlResponse
41
+ */
42
+ data?: InboundAttachmentUrlResponseData;
43
+ /**
44
+ *
45
+ * @type {RequestMeta}
46
+ * @memberof InboundAttachmentUrlResponse
47
+ */
48
+ meta?: RequestMeta;
49
+ }
50
+
51
+ /**
52
+ * Check if a given object implements the InboundAttachmentUrlResponse interface.
53
+ */
54
+ export function instanceOfInboundAttachmentUrlResponse(value: object): value is InboundAttachmentUrlResponse {
55
+ return true;
56
+ }
57
+
58
+ export function InboundAttachmentUrlResponseFromJSON(json: any): InboundAttachmentUrlResponse {
59
+ return InboundAttachmentUrlResponseFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function InboundAttachmentUrlResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): InboundAttachmentUrlResponse {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'data': json['data'] == null ? undefined : InboundAttachmentUrlResponseDataFromJSON(json['data']),
69
+ 'meta': json['meta'] == null ? undefined : RequestMetaFromJSON(json['meta']),
70
+ };
71
+ }
72
+
73
+ export function InboundAttachmentUrlResponseToJSON(json: any): InboundAttachmentUrlResponse {
74
+ return InboundAttachmentUrlResponseToJSONTyped(json, false);
75
+ }
76
+
77
+ export function InboundAttachmentUrlResponseToJSONTyped(value?: InboundAttachmentUrlResponse | null, ignoreDiscriminator: boolean = false): any {
78
+ if (value == null) {
79
+ return value;
80
+ }
81
+
82
+ return {
83
+
84
+ 'data': InboundAttachmentUrlResponseDataToJSON(value['data']),
85
+ 'meta': RequestMetaToJSON(value['meta']),
86
+ };
87
+ }
88
+
@@ -0,0 +1,81 @@
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 InboundAttachmentUrlResponseData
20
+ */
21
+ export interface InboundAttachmentUrlResponseData {
22
+ /**
23
+ * Short-lived presigned S3 download URL
24
+ * @type {string}
25
+ * @memberof InboundAttachmentUrlResponseData
26
+ */
27
+ downloadUrl?: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof InboundAttachmentUrlResponseData
32
+ */
33
+ filename?: string | null;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof InboundAttachmentUrlResponseData
38
+ */
39
+ contentType?: string;
40
+ }
41
+
42
+ /**
43
+ * Check if a given object implements the InboundAttachmentUrlResponseData interface.
44
+ */
45
+ export function instanceOfInboundAttachmentUrlResponseData(value: object): value is InboundAttachmentUrlResponseData {
46
+ return true;
47
+ }
48
+
49
+ export function InboundAttachmentUrlResponseDataFromJSON(json: any): InboundAttachmentUrlResponseData {
50
+ return InboundAttachmentUrlResponseDataFromJSONTyped(json, false);
51
+ }
52
+
53
+ export function InboundAttachmentUrlResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): InboundAttachmentUrlResponseData {
54
+ if (json == null) {
55
+ return json;
56
+ }
57
+ return {
58
+
59
+ 'downloadUrl': json['download_url'] == null ? undefined : json['download_url'],
60
+ 'filename': json['filename'] == null ? undefined : json['filename'],
61
+ 'contentType': json['content_type'] == null ? undefined : json['content_type'],
62
+ };
63
+ }
64
+
65
+ export function InboundAttachmentUrlResponseDataToJSON(json: any): InboundAttachmentUrlResponseData {
66
+ return InboundAttachmentUrlResponseDataToJSONTyped(json, false);
67
+ }
68
+
69
+ export function InboundAttachmentUrlResponseDataToJSONTyped(value?: InboundAttachmentUrlResponseData | null, ignoreDiscriminator: boolean = false): any {
70
+ if (value == null) {
71
+ return value;
72
+ }
73
+
74
+ return {
75
+
76
+ 'download_url': value['downloadUrl'],
77
+ 'filename': value['filename'],
78
+ 'content_type': value['contentType'],
79
+ };
80
+ }
81
+