pingram 1.0.30 → 1.0.31-alpha.1468

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.
@@ -10,9 +10,16 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { EventsWebhookResponse, EventsWebhookUpsertRequest } from '../models/index';
14
- export interface UpsertEventsWebhookRequest {
15
- eventsWebhookUpsertRequest: EventsWebhookUpsertRequest;
13
+ import type { WebhookEndpoint, WebhookEndpointUpsertRequest, WebhookEndpointsResponse } from '../models/index';
14
+ export interface CreateWebhookRequest {
15
+ webhookEndpointUpsertRequest: WebhookEndpointUpsertRequest;
16
+ }
17
+ export interface DeleteWebhookRequest {
18
+ endpointId: string;
19
+ }
20
+ export interface UpdateWebhookRequest {
21
+ endpointId: string;
22
+ webhookEndpointUpsertRequest: WebhookEndpointUpsertRequest;
16
23
  }
17
24
  /**
18
25
  * WebhooksApi - interface
@@ -23,68 +30,91 @@ export interface UpsertEventsWebhookRequest {
23
30
  export interface WebhooksApiInterface {
24
31
  /**
25
32
  *
26
- * @summary Delete the events webhook configuration for the current account/environment.
33
+ * @summary Create a webhook.
34
+ * @param {WebhookEndpointUpsertRequest} webhookEndpointUpsertRequest
35
+ * @param {*} [options] Override http request option.
36
+ * @throws {RequiredError}
37
+ * @memberof WebhooksApiInterface
38
+ */
39
+ createWebhookRaw(requestParameters: CreateWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpoint>>;
40
+ /**
41
+ * Create a webhook.
42
+ */
43
+ createWebhook(webhookEndpointUpsertRequest: WebhookEndpointUpsertRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpoint>;
44
+ /**
45
+ *
46
+ * @summary Delete a webhook.
47
+ * @param {string} endpointId Webhook endpoint id
27
48
  * @param {*} [options] Override http request option.
28
49
  * @throws {RequiredError}
29
50
  * @memberof WebhooksApiInterface
30
51
  */
31
- deleteEventsWebhookRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
52
+ deleteWebhookRaw(requestParameters: DeleteWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
32
53
  /**
33
- * Delete the events webhook configuration for the current account/environment.
54
+ * Delete a webhook.
34
55
  */
35
- deleteEventsWebhook(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
56
+ deleteWebhook(endpointId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
36
57
  /**
37
58
  *
38
- * @summary Get the events webhook configuration for the current account/environment.
59
+ * @summary List webhooks for the current account.
39
60
  * @param {*} [options] Override http request option.
40
61
  * @throws {RequiredError}
41
62
  * @memberof WebhooksApiInterface
42
63
  */
43
- getEventsWebhookRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EventsWebhookResponse>>;
64
+ listWebhooksRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpointsResponse>>;
44
65
  /**
45
- * Get the events webhook configuration for the current account/environment.
66
+ * List webhooks for the current account.
46
67
  */
47
- getEventsWebhook(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EventsWebhookResponse>;
68
+ listWebhooks(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpointsResponse>;
48
69
  /**
49
70
  *
50
- * @summary Create or update the events webhook configuration for the current account/environment.
51
- * @param {EventsWebhookUpsertRequest} eventsWebhookUpsertRequest
71
+ * @summary Update a webhook. The signing secret is preserved.
72
+ * @param {string} endpointId Webhook endpoint id
73
+ * @param {WebhookEndpointUpsertRequest} webhookEndpointUpsertRequest
52
74
  * @param {*} [options] Override http request option.
53
75
  * @throws {RequiredError}
54
76
  * @memberof WebhooksApiInterface
55
77
  */
56
- upsertEventsWebhookRaw(requestParameters: UpsertEventsWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EventsWebhookResponse>>;
78
+ updateWebhookRaw(requestParameters: UpdateWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpoint>>;
57
79
  /**
58
- * Create or update the events webhook configuration for the current account/environment.
80
+ * Update a webhook. The signing secret is preserved.
59
81
  */
60
- upsertEventsWebhook(eventsWebhookUpsertRequest: EventsWebhookUpsertRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EventsWebhookResponse>;
82
+ updateWebhook(endpointId: string, webhookEndpointUpsertRequest: WebhookEndpointUpsertRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpoint>;
61
83
  }
62
84
  /**
63
85
  *
64
86
  */
65
87
  export declare class WebhooksApi extends runtime.BaseAPI implements WebhooksApiInterface {
66
88
  /**
67
- * Delete the events webhook configuration for the current account/environment.
89
+ * Create a webhook.
90
+ */
91
+ createWebhookRaw(requestParameters: CreateWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpoint>>;
92
+ /**
93
+ * Create a webhook.
94
+ */
95
+ createWebhook(webhookEndpointUpsertRequest: WebhookEndpointUpsertRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpoint>;
96
+ /**
97
+ * Delete a webhook.
68
98
  */
69
- deleteEventsWebhookRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
99
+ deleteWebhookRaw(requestParameters: DeleteWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
70
100
  /**
71
- * Delete the events webhook configuration for the current account/environment.
101
+ * Delete a webhook.
72
102
  */
73
- deleteEventsWebhook(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
103
+ deleteWebhook(endpointId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
74
104
  /**
75
- * Get the events webhook configuration for the current account/environment.
105
+ * List webhooks for the current account.
76
106
  */
77
- getEventsWebhookRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EventsWebhookResponse>>;
107
+ listWebhooksRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpointsResponse>>;
78
108
  /**
79
- * Get the events webhook configuration for the current account/environment.
109
+ * List webhooks for the current account.
80
110
  */
81
- getEventsWebhook(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EventsWebhookResponse>;
111
+ listWebhooks(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpointsResponse>;
82
112
  /**
83
- * Create or update the events webhook configuration for the current account/environment.
113
+ * Update a webhook. The signing secret is preserved.
84
114
  */
85
- upsertEventsWebhookRaw(requestParameters: UpsertEventsWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EventsWebhookResponse>>;
115
+ updateWebhookRaw(requestParameters: UpdateWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WebhookEndpoint>>;
86
116
  /**
87
- * Create or update the events webhook configuration for the current account/environment.
117
+ * Update a webhook. The signing secret is preserved.
88
118
  */
89
- upsertEventsWebhook(eventsWebhookUpsertRequest: EventsWebhookUpsertRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EventsWebhookResponse>;
119
+ updateWebhook(endpointId: string, webhookEndpointUpsertRequest: WebhookEndpointUpsertRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WebhookEndpoint>;
90
120
  }
@@ -54,11 +54,15 @@ const index_1 = require("../models/index");
54
54
  */
55
55
  class WebhooksApi extends runtime.BaseAPI {
56
56
  /**
57
- * Delete the events webhook configuration for the current account/environment.
57
+ * Create a webhook.
58
58
  */
59
- async deleteEventsWebhookRaw(initOverrides) {
59
+ async createWebhookRaw(requestParameters, initOverrides) {
60
+ if (requestParameters['webhookEndpointUpsertRequest'] == null) {
61
+ throw new runtime.RequiredError('webhookEndpointUpsertRequest', 'Required parameter "webhookEndpointUpsertRequest" was null or undefined when calling createWebhook().');
62
+ }
60
63
  const queryParameters = {};
61
64
  const headerParameters = {};
65
+ headerParameters['Content-Type'] = 'application/json';
62
66
  if (this.configuration &&
63
67
  (this.configuration.username !== undefined ||
64
68
  this.configuration.password !== undefined)) {
@@ -87,7 +91,62 @@ class WebhooksApi extends runtime.BaseAPI {
87
91
  'Basic ' +
88
92
  btoa(this.configuration.username + ':' + this.configuration.password);
89
93
  }
90
- let urlPath = `/webhooks/events`;
94
+ let urlPath = `/webhooks`;
95
+ const response = await this.request({
96
+ path: urlPath,
97
+ method: 'POST',
98
+ headers: headerParameters,
99
+ query: queryParameters,
100
+ body: (0, index_1.WebhookEndpointUpsertRequestToJSON)(requestParameters['webhookEndpointUpsertRequest'])
101
+ }, initOverrides);
102
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookEndpointFromJSON)(jsonValue));
103
+ }
104
+ /**
105
+ * Create a webhook.
106
+ */
107
+ async createWebhook(webhookEndpointUpsertRequest, initOverrides) {
108
+ const response = await this.createWebhookRaw({ webhookEndpointUpsertRequest: webhookEndpointUpsertRequest }, initOverrides);
109
+ return await response.value();
110
+ }
111
+ /**
112
+ * Delete a webhook.
113
+ */
114
+ async deleteWebhookRaw(requestParameters, initOverrides) {
115
+ if (requestParameters['endpointId'] == null) {
116
+ throw new runtime.RequiredError('endpointId', 'Required parameter "endpointId" was null or undefined when calling deleteWebhook().');
117
+ }
118
+ const queryParameters = {};
119
+ const headerParameters = {};
120
+ if (this.configuration &&
121
+ (this.configuration.username !== undefined ||
122
+ this.configuration.password !== undefined)) {
123
+ headerParameters['Authorization'] =
124
+ 'Basic ' +
125
+ btoa(this.configuration.username + ':' + this.configuration.password);
126
+ }
127
+ if (this.configuration &&
128
+ (this.configuration.username !== undefined ||
129
+ this.configuration.password !== undefined)) {
130
+ headerParameters['Authorization'] =
131
+ 'Basic ' +
132
+ btoa(this.configuration.username + ':' + this.configuration.password);
133
+ }
134
+ if (this.configuration && this.configuration.accessToken) {
135
+ const token = this.configuration.accessToken;
136
+ const tokenString = await token('apiKey', []);
137
+ if (tokenString) {
138
+ headerParameters['Authorization'] = `Bearer ${tokenString}`;
139
+ }
140
+ }
141
+ if (this.configuration &&
142
+ (this.configuration.username !== undefined ||
143
+ this.configuration.password !== undefined)) {
144
+ headerParameters['Authorization'] =
145
+ 'Basic ' +
146
+ btoa(this.configuration.username + ':' + this.configuration.password);
147
+ }
148
+ let urlPath = `/webhooks/{endpointId}`;
149
+ urlPath = urlPath.replace(`{${'endpointId'}}`, encodeURIComponent(String(requestParameters['endpointId'])));
91
150
  const response = await this.request({
92
151
  path: urlPath,
93
152
  method: 'DELETE',
@@ -97,15 +156,15 @@ class WebhooksApi extends runtime.BaseAPI {
97
156
  return new runtime.VoidApiResponse(response);
98
157
  }
99
158
  /**
100
- * Delete the events webhook configuration for the current account/environment.
159
+ * Delete a webhook.
101
160
  */
102
- async deleteEventsWebhook(initOverrides) {
103
- await this.deleteEventsWebhookRaw(initOverrides);
161
+ async deleteWebhook(endpointId, initOverrides) {
162
+ await this.deleteWebhookRaw({ endpointId: endpointId }, initOverrides);
104
163
  }
105
164
  /**
106
- * Get the events webhook configuration for the current account/environment.
165
+ * List webhooks for the current account.
107
166
  */
108
- async getEventsWebhookRaw(initOverrides) {
167
+ async listWebhooksRaw(initOverrides) {
109
168
  const queryParameters = {};
110
169
  const headerParameters = {};
111
170
  if (this.configuration &&
@@ -136,28 +195,31 @@ class WebhooksApi extends runtime.BaseAPI {
136
195
  'Basic ' +
137
196
  btoa(this.configuration.username + ':' + this.configuration.password);
138
197
  }
139
- let urlPath = `/webhooks/events`;
198
+ let urlPath = `/webhooks`;
140
199
  const response = await this.request({
141
200
  path: urlPath,
142
201
  method: 'GET',
143
202
  headers: headerParameters,
144
203
  query: queryParameters
145
204
  }, initOverrides);
146
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EventsWebhookResponseFromJSON)(jsonValue));
205
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookEndpointsResponseFromJSON)(jsonValue));
147
206
  }
148
207
  /**
149
- * Get the events webhook configuration for the current account/environment.
208
+ * List webhooks for the current account.
150
209
  */
151
- async getEventsWebhook(initOverrides) {
152
- const response = await this.getEventsWebhookRaw(initOverrides);
210
+ async listWebhooks(initOverrides) {
211
+ const response = await this.listWebhooksRaw(initOverrides);
153
212
  return await response.value();
154
213
  }
155
214
  /**
156
- * Create or update the events webhook configuration for the current account/environment.
215
+ * Update a webhook. The signing secret is preserved.
157
216
  */
158
- async upsertEventsWebhookRaw(requestParameters, initOverrides) {
159
- if (requestParameters['eventsWebhookUpsertRequest'] == null) {
160
- throw new runtime.RequiredError('eventsWebhookUpsertRequest', 'Required parameter "eventsWebhookUpsertRequest" was null or undefined when calling upsertEventsWebhook().');
217
+ async updateWebhookRaw(requestParameters, initOverrides) {
218
+ if (requestParameters['endpointId'] == null) {
219
+ throw new runtime.RequiredError('endpointId', 'Required parameter "endpointId" was null or undefined when calling updateWebhook().');
220
+ }
221
+ if (requestParameters['webhookEndpointUpsertRequest'] == null) {
222
+ throw new runtime.RequiredError('webhookEndpointUpsertRequest', 'Required parameter "webhookEndpointUpsertRequest" was null or undefined when calling updateWebhook().');
161
223
  }
162
224
  const queryParameters = {};
163
225
  const headerParameters = {};
@@ -190,21 +252,25 @@ class WebhooksApi extends runtime.BaseAPI {
190
252
  'Basic ' +
191
253
  btoa(this.configuration.username + ':' + this.configuration.password);
192
254
  }
193
- let urlPath = `/webhooks/events`;
255
+ let urlPath = `/webhooks/{endpointId}`;
256
+ urlPath = urlPath.replace(`{${'endpointId'}}`, encodeURIComponent(String(requestParameters['endpointId'])));
194
257
  const response = await this.request({
195
258
  path: urlPath,
196
259
  method: 'PUT',
197
260
  headers: headerParameters,
198
261
  query: queryParameters,
199
- body: (0, index_1.EventsWebhookUpsertRequestToJSON)(requestParameters['eventsWebhookUpsertRequest'])
262
+ body: (0, index_1.WebhookEndpointUpsertRequestToJSON)(requestParameters['webhookEndpointUpsertRequest'])
200
263
  }, initOverrides);
201
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EventsWebhookResponseFromJSON)(jsonValue));
264
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WebhookEndpointFromJSON)(jsonValue));
202
265
  }
203
266
  /**
204
- * Create or update the events webhook configuration for the current account/environment.
267
+ * Update a webhook. The signing secret is preserved.
205
268
  */
206
- async upsertEventsWebhook(eventsWebhookUpsertRequest, initOverrides) {
207
- const response = await this.upsertEventsWebhookRaw({ eventsWebhookUpsertRequest: eventsWebhookUpsertRequest }, initOverrides);
269
+ async updateWebhook(endpointId, webhookEndpointUpsertRequest, initOverrides) {
270
+ const response = await this.updateWebhookRaw({
271
+ endpointId: endpointId,
272
+ webhookEndpointUpsertRequest: webhookEndpointUpsertRequest
273
+ }, initOverrides);
208
274
  return await response.value();
209
275
  }
210
276
  }
@@ -50,5 +50,5 @@ export type { DeleteUserRequest, ListUsersRequest, RemoveUserFromSuppressionRequ
50
50
  export { UsersApi } from './UsersApi';
51
51
  export type { BindNumberOperationRequest, CallRequest, CreateAgentRequest, CreateBrowserCallRequest, DeleteAgentRequest, GetAgentRequest, GetCallRequest, ListCallsRequest, UnbindNumberRequest, UpdateAgentRequest, VoiceApiInterface } from './VoiceApi';
52
52
  export { VoiceApi } from './VoiceApi';
53
- export type { UpsertEventsWebhookRequest, WebhooksApiInterface } from './WebhooksApi';
53
+ export type { CreateWebhookRequest, DeleteWebhookRequest, UpdateWebhookRequest, WebhooksApiInterface } from './WebhooksApi';
54
54
  export { WebhooksApi } from './WebhooksApi';
@@ -10,33 +10,33 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- * Events webhook configuration returned by the API.
13
+ * Destination URL that receives signed event payloads for a set of subscribed events.
14
14
  * @export
15
- * @interface EventsWebhookResponse
15
+ * @interface WebhookEndpoint
16
16
  */
17
- export interface EventsWebhookResponse {
17
+ export interface WebhookEndpoint {
18
18
  /**
19
- * Storage key in the format accountId:envId (currently accountId:accountId for account-scoped usage).
19
+ * Unique identifier for this endpoint within the account.
20
20
  * @type {string}
21
- * @memberof EventsWebhookResponse
21
+ * @memberof WebhookEndpoint
22
22
  */
23
- webhookId: string;
23
+ id: string;
24
24
  /**
25
25
  * Destination URL that receives webhook event payloads.
26
26
  * @type {string}
27
- * @memberof EventsWebhookResponse
27
+ * @memberof WebhookEndpoint
28
28
  */
29
29
  webhook: string;
30
30
  /**
31
- * List of subscribed event types for this webhook configuration.
31
+ * List of subscribed event types for this endpoint.
32
32
  * @type {Array<string>}
33
- * @memberof EventsWebhookResponse
33
+ * @memberof WebhookEndpoint
34
34
  */
35
- events: Array<EventsWebhookResponseEventsEnum>;
35
+ events: Array<WebhookEndpointEventsEnum>;
36
36
  /**
37
37
  * HMAC secret for verifying webhook signatures. Use this with your X-Pingram-Signature verification.
38
38
  * @type {string}
39
- * @memberof EventsWebhookResponse
39
+ * @memberof WebhookEndpoint
40
40
  */
41
41
  secret: string;
42
42
  }
@@ -44,7 +44,7 @@ export interface EventsWebhookResponse {
44
44
  * @export
45
45
  * @enum {string}
46
46
  */
47
- export declare enum EventsWebhookResponseEventsEnum {
47
+ export declare enum WebhookEndpointEventsEnum {
48
48
  EMAIL_OPEN = "EMAIL_OPEN",
49
49
  EMAIL_CLICK = "EMAIL_CLICK",
50
50
  EMAIL_FAILED = "EMAIL_FAILED",
@@ -68,10 +68,10 @@ export declare enum EventsWebhookResponseEventsEnum {
68
68
  SLACK_UNSUBSCRIBE = "SLACK_UNSUBSCRIBE"
69
69
  }
70
70
  /**
71
- * Check if a given object implements the EventsWebhookResponse interface.
71
+ * Check if a given object implements the WebhookEndpoint interface.
72
72
  */
73
- export declare function instanceOfEventsWebhookResponse(value: object): value is EventsWebhookResponse;
74
- export declare function EventsWebhookResponseFromJSON(json: any): EventsWebhookResponse;
75
- export declare function EventsWebhookResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): EventsWebhookResponse;
76
- export declare function EventsWebhookResponseToJSON(json: any): EventsWebhookResponse;
77
- export declare function EventsWebhookResponseToJSONTyped(value?: EventsWebhookResponse | null, ignoreDiscriminator?: boolean): any;
73
+ export declare function instanceOfWebhookEndpoint(value: object): value is WebhookEndpoint;
74
+ export declare function WebhookEndpointFromJSON(json: any): WebhookEndpoint;
75
+ export declare function WebhookEndpointFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookEndpoint;
76
+ export declare function WebhookEndpointToJSON(json: any): WebhookEndpoint;
77
+ export declare function WebhookEndpointToJSONTyped(value?: WebhookEndpoint | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Pingram
6
+ * Internal API for notification delivery and management
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.WebhookEndpointEventsEnum = void 0;
17
+ exports.instanceOfWebhookEndpoint = instanceOfWebhookEndpoint;
18
+ exports.WebhookEndpointFromJSON = WebhookEndpointFromJSON;
19
+ exports.WebhookEndpointFromJSONTyped = WebhookEndpointFromJSONTyped;
20
+ exports.WebhookEndpointToJSON = WebhookEndpointToJSON;
21
+ exports.WebhookEndpointToJSONTyped = WebhookEndpointToJSONTyped;
22
+ /**
23
+ * @export
24
+ * @enum {string}
25
+ */
26
+ var WebhookEndpointEventsEnum;
27
+ (function (WebhookEndpointEventsEnum) {
28
+ WebhookEndpointEventsEnum["EMAIL_OPEN"] = "EMAIL_OPEN";
29
+ WebhookEndpointEventsEnum["EMAIL_CLICK"] = "EMAIL_CLICK";
30
+ WebhookEndpointEventsEnum["EMAIL_FAILED"] = "EMAIL_FAILED";
31
+ WebhookEndpointEventsEnum["EMAIL_DELIVERED"] = "EMAIL_DELIVERED";
32
+ WebhookEndpointEventsEnum["EMAIL_UNSUBSCRIBE"] = "EMAIL_UNSUBSCRIBE";
33
+ WebhookEndpointEventsEnum["EMAIL_INBOUND"] = "EMAIL_INBOUND";
34
+ WebhookEndpointEventsEnum["INAPP_WEB_FAILED"] = "INAPP_WEB_FAILED";
35
+ WebhookEndpointEventsEnum["INAPP_WEB_UNSUBSCRIBE"] = "INAPP_WEB_UNSUBSCRIBE";
36
+ WebhookEndpointEventsEnum["SMS_DELIVERED"] = "SMS_DELIVERED";
37
+ WebhookEndpointEventsEnum["SMS_FAILED"] = "SMS_FAILED";
38
+ WebhookEndpointEventsEnum["SMS_UNSUBSCRIBE"] = "SMS_UNSUBSCRIBE";
39
+ WebhookEndpointEventsEnum["SMS_SUBSCRIBE"] = "SMS_SUBSCRIBE";
40
+ WebhookEndpointEventsEnum["SMS_INBOUND"] = "SMS_INBOUND";
41
+ WebhookEndpointEventsEnum["PUSH_FAILED"] = "PUSH_FAILED";
42
+ WebhookEndpointEventsEnum["PUSH_UNSUBSCRIBE"] = "PUSH_UNSUBSCRIBE";
43
+ WebhookEndpointEventsEnum["CALL_FAILED"] = "CALL_FAILED";
44
+ WebhookEndpointEventsEnum["CALL_UNSUBSCRIBE"] = "CALL_UNSUBSCRIBE";
45
+ WebhookEndpointEventsEnum["WEB_PUSH_FAILED"] = "WEB_PUSH_FAILED";
46
+ WebhookEndpointEventsEnum["WEB_PUSH_UNSUBSCRIBE"] = "WEB_PUSH_UNSUBSCRIBE";
47
+ WebhookEndpointEventsEnum["SLACK_FAILED"] = "SLACK_FAILED";
48
+ WebhookEndpointEventsEnum["SLACK_UNSUBSCRIBE"] = "SLACK_UNSUBSCRIBE";
49
+ })(WebhookEndpointEventsEnum || (exports.WebhookEndpointEventsEnum = WebhookEndpointEventsEnum = {}));
50
+ /**
51
+ * Check if a given object implements the WebhookEndpoint interface.
52
+ */
53
+ function instanceOfWebhookEndpoint(value) {
54
+ if (!('id' in value) || value['id'] === undefined)
55
+ return false;
56
+ if (!('webhook' in value) || value['webhook'] === undefined)
57
+ return false;
58
+ if (!('events' in value) || value['events'] === undefined)
59
+ return false;
60
+ if (!('secret' in value) || value['secret'] === undefined)
61
+ return false;
62
+ return true;
63
+ }
64
+ function WebhookEndpointFromJSON(json) {
65
+ return WebhookEndpointFromJSONTyped(json, false);
66
+ }
67
+ function WebhookEndpointFromJSONTyped(json, ignoreDiscriminator) {
68
+ if (json == null) {
69
+ return json;
70
+ }
71
+ return {
72
+ id: json['id'],
73
+ webhook: json['webhook'],
74
+ events: json['events'],
75
+ secret: json['secret']
76
+ };
77
+ }
78
+ function WebhookEndpointToJSON(json) {
79
+ return WebhookEndpointToJSONTyped(json, false);
80
+ }
81
+ function WebhookEndpointToJSONTyped(value, ignoreDiscriminator = false) {
82
+ if (value == null) {
83
+ return value;
84
+ }
85
+ return {
86
+ id: value['id'],
87
+ webhook: value['webhook'],
88
+ events: value['events'],
89
+ secret: value['secret']
90
+ };
91
+ }
@@ -10,29 +10,29 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- * Request body for creating or updating the events webhook configuration.
13
+ * Request body for creating or updating an events webhook endpoint.
14
14
  * @export
15
- * @interface EventsWebhookUpsertRequest
15
+ * @interface WebhookEndpointUpsertRequest
16
16
  */
17
- export interface EventsWebhookUpsertRequest {
17
+ export interface WebhookEndpointUpsertRequest {
18
18
  /**
19
19
  * Destination URL that receives webhook event payloads. Must be a valid http(s) URL.
20
20
  * @type {string}
21
- * @memberof EventsWebhookUpsertRequest
21
+ * @memberof WebhookEndpointUpsertRequest
22
22
  */
23
23
  webhook: string;
24
24
  /**
25
25
  * List of event types that should be forwarded to the webhook URL.
26
26
  * @type {Array<string>}
27
- * @memberof EventsWebhookUpsertRequest
27
+ * @memberof WebhookEndpointUpsertRequest
28
28
  */
29
- events: Array<EventsWebhookUpsertRequestEventsEnum>;
29
+ events: Array<WebhookEndpointUpsertRequestEventsEnum>;
30
30
  }
31
31
  /**
32
32
  * @export
33
33
  * @enum {string}
34
34
  */
35
- export declare enum EventsWebhookUpsertRequestEventsEnum {
35
+ export declare enum WebhookEndpointUpsertRequestEventsEnum {
36
36
  EMAIL_OPEN = "EMAIL_OPEN",
37
37
  EMAIL_CLICK = "EMAIL_CLICK",
38
38
  EMAIL_FAILED = "EMAIL_FAILED",
@@ -56,10 +56,10 @@ export declare enum EventsWebhookUpsertRequestEventsEnum {
56
56
  SLACK_UNSUBSCRIBE = "SLACK_UNSUBSCRIBE"
57
57
  }
58
58
  /**
59
- * Check if a given object implements the EventsWebhookUpsertRequest interface.
59
+ * Check if a given object implements the WebhookEndpointUpsertRequest interface.
60
60
  */
61
- export declare function instanceOfEventsWebhookUpsertRequest(value: object): value is EventsWebhookUpsertRequest;
62
- export declare function EventsWebhookUpsertRequestFromJSON(json: any): EventsWebhookUpsertRequest;
63
- export declare function EventsWebhookUpsertRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): EventsWebhookUpsertRequest;
64
- export declare function EventsWebhookUpsertRequestToJSON(json: any): EventsWebhookUpsertRequest;
65
- export declare function EventsWebhookUpsertRequestToJSONTyped(value?: EventsWebhookUpsertRequest | null, ignoreDiscriminator?: boolean): any;
61
+ export declare function instanceOfWebhookEndpointUpsertRequest(value: object): value is WebhookEndpointUpsertRequest;
62
+ export declare function WebhookEndpointUpsertRequestFromJSON(json: any): WebhookEndpointUpsertRequest;
63
+ export declare function WebhookEndpointUpsertRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookEndpointUpsertRequest;
64
+ export declare function WebhookEndpointUpsertRequestToJSON(json: any): WebhookEndpointUpsertRequest;
65
+ export declare function WebhookEndpointUpsertRequestToJSONTyped(value?: WebhookEndpointUpsertRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Pingram
6
+ * Internal API for notification delivery and management
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.WebhookEndpointUpsertRequestEventsEnum = void 0;
17
+ exports.instanceOfWebhookEndpointUpsertRequest = instanceOfWebhookEndpointUpsertRequest;
18
+ exports.WebhookEndpointUpsertRequestFromJSON = WebhookEndpointUpsertRequestFromJSON;
19
+ exports.WebhookEndpointUpsertRequestFromJSONTyped = WebhookEndpointUpsertRequestFromJSONTyped;
20
+ exports.WebhookEndpointUpsertRequestToJSON = WebhookEndpointUpsertRequestToJSON;
21
+ exports.WebhookEndpointUpsertRequestToJSONTyped = WebhookEndpointUpsertRequestToJSONTyped;
22
+ /**
23
+ * @export
24
+ * @enum {string}
25
+ */
26
+ var WebhookEndpointUpsertRequestEventsEnum;
27
+ (function (WebhookEndpointUpsertRequestEventsEnum) {
28
+ WebhookEndpointUpsertRequestEventsEnum["EMAIL_OPEN"] = "EMAIL_OPEN";
29
+ WebhookEndpointUpsertRequestEventsEnum["EMAIL_CLICK"] = "EMAIL_CLICK";
30
+ WebhookEndpointUpsertRequestEventsEnum["EMAIL_FAILED"] = "EMAIL_FAILED";
31
+ WebhookEndpointUpsertRequestEventsEnum["EMAIL_DELIVERED"] = "EMAIL_DELIVERED";
32
+ WebhookEndpointUpsertRequestEventsEnum["EMAIL_UNSUBSCRIBE"] = "EMAIL_UNSUBSCRIBE";
33
+ WebhookEndpointUpsertRequestEventsEnum["EMAIL_INBOUND"] = "EMAIL_INBOUND";
34
+ WebhookEndpointUpsertRequestEventsEnum["INAPP_WEB_FAILED"] = "INAPP_WEB_FAILED";
35
+ WebhookEndpointUpsertRequestEventsEnum["INAPP_WEB_UNSUBSCRIBE"] = "INAPP_WEB_UNSUBSCRIBE";
36
+ WebhookEndpointUpsertRequestEventsEnum["SMS_DELIVERED"] = "SMS_DELIVERED";
37
+ WebhookEndpointUpsertRequestEventsEnum["SMS_FAILED"] = "SMS_FAILED";
38
+ WebhookEndpointUpsertRequestEventsEnum["SMS_UNSUBSCRIBE"] = "SMS_UNSUBSCRIBE";
39
+ WebhookEndpointUpsertRequestEventsEnum["SMS_SUBSCRIBE"] = "SMS_SUBSCRIBE";
40
+ WebhookEndpointUpsertRequestEventsEnum["SMS_INBOUND"] = "SMS_INBOUND";
41
+ WebhookEndpointUpsertRequestEventsEnum["PUSH_FAILED"] = "PUSH_FAILED";
42
+ WebhookEndpointUpsertRequestEventsEnum["PUSH_UNSUBSCRIBE"] = "PUSH_UNSUBSCRIBE";
43
+ WebhookEndpointUpsertRequestEventsEnum["CALL_FAILED"] = "CALL_FAILED";
44
+ WebhookEndpointUpsertRequestEventsEnum["CALL_UNSUBSCRIBE"] = "CALL_UNSUBSCRIBE";
45
+ WebhookEndpointUpsertRequestEventsEnum["WEB_PUSH_FAILED"] = "WEB_PUSH_FAILED";
46
+ WebhookEndpointUpsertRequestEventsEnum["WEB_PUSH_UNSUBSCRIBE"] = "WEB_PUSH_UNSUBSCRIBE";
47
+ WebhookEndpointUpsertRequestEventsEnum["SLACK_FAILED"] = "SLACK_FAILED";
48
+ WebhookEndpointUpsertRequestEventsEnum["SLACK_UNSUBSCRIBE"] = "SLACK_UNSUBSCRIBE";
49
+ })(WebhookEndpointUpsertRequestEventsEnum || (exports.WebhookEndpointUpsertRequestEventsEnum = WebhookEndpointUpsertRequestEventsEnum = {}));
50
+ /**
51
+ * Check if a given object implements the WebhookEndpointUpsertRequest interface.
52
+ */
53
+ function instanceOfWebhookEndpointUpsertRequest(value) {
54
+ if (!('webhook' in value) || value['webhook'] === undefined)
55
+ return false;
56
+ if (!('events' in value) || value['events'] === undefined)
57
+ return false;
58
+ return true;
59
+ }
60
+ function WebhookEndpointUpsertRequestFromJSON(json) {
61
+ return WebhookEndpointUpsertRequestFromJSONTyped(json, false);
62
+ }
63
+ function WebhookEndpointUpsertRequestFromJSONTyped(json, ignoreDiscriminator) {
64
+ if (json == null) {
65
+ return json;
66
+ }
67
+ return {
68
+ webhook: json['webhook'],
69
+ events: json['events']
70
+ };
71
+ }
72
+ function WebhookEndpointUpsertRequestToJSON(json) {
73
+ return WebhookEndpointUpsertRequestToJSONTyped(json, false);
74
+ }
75
+ function WebhookEndpointUpsertRequestToJSONTyped(value, ignoreDiscriminator = false) {
76
+ if (value == null) {
77
+ return value;
78
+ }
79
+ return {
80
+ webhook: value['webhook'],
81
+ events: value['events']
82
+ };
83
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Pingram
3
+ * Internal API for notification delivery and management
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { WebhookEndpointsResponseEndpointsInner } from './WebhookEndpointsResponseEndpointsInner';
13
+ /**
14
+ * Events webhook endpoints configured for the current account.
15
+ * @export
16
+ * @interface WebhookEndpointsResponse
17
+ */
18
+ export interface WebhookEndpointsResponse {
19
+ /**
20
+ * Configured webhook endpoints. Empty when none exist.
21
+ * @type {Array<WebhookEndpointsResponseEndpointsInner>}
22
+ * @memberof WebhookEndpointsResponse
23
+ */
24
+ endpoints: Array<WebhookEndpointsResponseEndpointsInner>;
25
+ }
26
+ /**
27
+ * Check if a given object implements the WebhookEndpointsResponse interface.
28
+ */
29
+ export declare function instanceOfWebhookEndpointsResponse(value: object): value is WebhookEndpointsResponse;
30
+ export declare function WebhookEndpointsResponseFromJSON(json: any): WebhookEndpointsResponse;
31
+ export declare function WebhookEndpointsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookEndpointsResponse;
32
+ export declare function WebhookEndpointsResponseToJSON(json: any): WebhookEndpointsResponse;
33
+ export declare function WebhookEndpointsResponseToJSONTyped(value?: WebhookEndpointsResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Pingram
6
+ * Internal API for notification delivery and management
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfWebhookEndpointsResponse = instanceOfWebhookEndpointsResponse;
17
+ exports.WebhookEndpointsResponseFromJSON = WebhookEndpointsResponseFromJSON;
18
+ exports.WebhookEndpointsResponseFromJSONTyped = WebhookEndpointsResponseFromJSONTyped;
19
+ exports.WebhookEndpointsResponseToJSON = WebhookEndpointsResponseToJSON;
20
+ exports.WebhookEndpointsResponseToJSONTyped = WebhookEndpointsResponseToJSONTyped;
21
+ const WebhookEndpointsResponseEndpointsInner_1 = require("./WebhookEndpointsResponseEndpointsInner");
22
+ /**
23
+ * Check if a given object implements the WebhookEndpointsResponse interface.
24
+ */
25
+ function instanceOfWebhookEndpointsResponse(value) {
26
+ if (!('endpoints' in value) || value['endpoints'] === undefined)
27
+ return false;
28
+ return true;
29
+ }
30
+ function WebhookEndpointsResponseFromJSON(json) {
31
+ return WebhookEndpointsResponseFromJSONTyped(json, false);
32
+ }
33
+ function WebhookEndpointsResponseFromJSONTyped(json, ignoreDiscriminator) {
34
+ if (json == null) {
35
+ return json;
36
+ }
37
+ return {
38
+ endpoints: json['endpoints'].map(WebhookEndpointsResponseEndpointsInner_1.WebhookEndpointsResponseEndpointsInnerFromJSON)
39
+ };
40
+ }
41
+ function WebhookEndpointsResponseToJSON(json) {
42
+ return WebhookEndpointsResponseToJSONTyped(json, false);
43
+ }
44
+ function WebhookEndpointsResponseToJSONTyped(value, ignoreDiscriminator = false) {
45
+ if (value == null) {
46
+ return value;
47
+ }
48
+ return {
49
+ endpoints: (value['endpoints'] ?? []).map(WebhookEndpointsResponseEndpointsInner_1.WebhookEndpointsResponseEndpointsInnerToJSON)
50
+ };
51
+ }
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Pingram
3
+ * Internal API for notification delivery and management
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Destination URL that receives signed event payloads for a set of subscribed events.
14
+ * @export
15
+ * @interface WebhookEndpointsResponseEndpointsInner
16
+ */
17
+ export interface WebhookEndpointsResponseEndpointsInner {
18
+ /**
19
+ * Unique identifier for this endpoint within the account.
20
+ * @type {string}
21
+ * @memberof WebhookEndpointsResponseEndpointsInner
22
+ */
23
+ id: string;
24
+ /**
25
+ * Destination URL that receives webhook event payloads.
26
+ * @type {string}
27
+ * @memberof WebhookEndpointsResponseEndpointsInner
28
+ */
29
+ webhook: string;
30
+ /**
31
+ * List of subscribed event types for this endpoint.
32
+ * @type {Array<string>}
33
+ * @memberof WebhookEndpointsResponseEndpointsInner
34
+ */
35
+ events: Array<WebhookEndpointsResponseEndpointsInnerEventsEnum>;
36
+ /**
37
+ * HMAC secret for verifying webhook signatures. Use this with your X-Pingram-Signature verification.
38
+ * @type {string}
39
+ * @memberof WebhookEndpointsResponseEndpointsInner
40
+ */
41
+ secret: string;
42
+ }
43
+ /**
44
+ * @export
45
+ * @enum {string}
46
+ */
47
+ export declare enum WebhookEndpointsResponseEndpointsInnerEventsEnum {
48
+ EMAIL_OPEN = "EMAIL_OPEN",
49
+ EMAIL_CLICK = "EMAIL_CLICK",
50
+ EMAIL_FAILED = "EMAIL_FAILED",
51
+ EMAIL_DELIVERED = "EMAIL_DELIVERED",
52
+ EMAIL_UNSUBSCRIBE = "EMAIL_UNSUBSCRIBE",
53
+ EMAIL_INBOUND = "EMAIL_INBOUND",
54
+ INAPP_WEB_FAILED = "INAPP_WEB_FAILED",
55
+ INAPP_WEB_UNSUBSCRIBE = "INAPP_WEB_UNSUBSCRIBE",
56
+ SMS_DELIVERED = "SMS_DELIVERED",
57
+ SMS_FAILED = "SMS_FAILED",
58
+ SMS_UNSUBSCRIBE = "SMS_UNSUBSCRIBE",
59
+ SMS_SUBSCRIBE = "SMS_SUBSCRIBE",
60
+ SMS_INBOUND = "SMS_INBOUND",
61
+ PUSH_FAILED = "PUSH_FAILED",
62
+ PUSH_UNSUBSCRIBE = "PUSH_UNSUBSCRIBE",
63
+ CALL_FAILED = "CALL_FAILED",
64
+ CALL_UNSUBSCRIBE = "CALL_UNSUBSCRIBE",
65
+ WEB_PUSH_FAILED = "WEB_PUSH_FAILED",
66
+ WEB_PUSH_UNSUBSCRIBE = "WEB_PUSH_UNSUBSCRIBE",
67
+ SLACK_FAILED = "SLACK_FAILED",
68
+ SLACK_UNSUBSCRIBE = "SLACK_UNSUBSCRIBE"
69
+ }
70
+ /**
71
+ * Check if a given object implements the WebhookEndpointsResponseEndpointsInner interface.
72
+ */
73
+ export declare function instanceOfWebhookEndpointsResponseEndpointsInner(value: object): value is WebhookEndpointsResponseEndpointsInner;
74
+ export declare function WebhookEndpointsResponseEndpointsInnerFromJSON(json: any): WebhookEndpointsResponseEndpointsInner;
75
+ export declare function WebhookEndpointsResponseEndpointsInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): WebhookEndpointsResponseEndpointsInner;
76
+ export declare function WebhookEndpointsResponseEndpointsInnerToJSON(json: any): WebhookEndpointsResponseEndpointsInner;
77
+ export declare function WebhookEndpointsResponseEndpointsInnerToJSONTyped(value?: WebhookEndpointsResponseEndpointsInner | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Pingram
6
+ * Internal API for notification delivery and management
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.WebhookEndpointsResponseEndpointsInnerEventsEnum = void 0;
17
+ exports.instanceOfWebhookEndpointsResponseEndpointsInner = instanceOfWebhookEndpointsResponseEndpointsInner;
18
+ exports.WebhookEndpointsResponseEndpointsInnerFromJSON = WebhookEndpointsResponseEndpointsInnerFromJSON;
19
+ exports.WebhookEndpointsResponseEndpointsInnerFromJSONTyped = WebhookEndpointsResponseEndpointsInnerFromJSONTyped;
20
+ exports.WebhookEndpointsResponseEndpointsInnerToJSON = WebhookEndpointsResponseEndpointsInnerToJSON;
21
+ exports.WebhookEndpointsResponseEndpointsInnerToJSONTyped = WebhookEndpointsResponseEndpointsInnerToJSONTyped;
22
+ /**
23
+ * @export
24
+ * @enum {string}
25
+ */
26
+ var WebhookEndpointsResponseEndpointsInnerEventsEnum;
27
+ (function (WebhookEndpointsResponseEndpointsInnerEventsEnum) {
28
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["EMAIL_OPEN"] = "EMAIL_OPEN";
29
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["EMAIL_CLICK"] = "EMAIL_CLICK";
30
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["EMAIL_FAILED"] = "EMAIL_FAILED";
31
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["EMAIL_DELIVERED"] = "EMAIL_DELIVERED";
32
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["EMAIL_UNSUBSCRIBE"] = "EMAIL_UNSUBSCRIBE";
33
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["EMAIL_INBOUND"] = "EMAIL_INBOUND";
34
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["INAPP_WEB_FAILED"] = "INAPP_WEB_FAILED";
35
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["INAPP_WEB_UNSUBSCRIBE"] = "INAPP_WEB_UNSUBSCRIBE";
36
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["SMS_DELIVERED"] = "SMS_DELIVERED";
37
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["SMS_FAILED"] = "SMS_FAILED";
38
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["SMS_UNSUBSCRIBE"] = "SMS_UNSUBSCRIBE";
39
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["SMS_SUBSCRIBE"] = "SMS_SUBSCRIBE";
40
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["SMS_INBOUND"] = "SMS_INBOUND";
41
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["PUSH_FAILED"] = "PUSH_FAILED";
42
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["PUSH_UNSUBSCRIBE"] = "PUSH_UNSUBSCRIBE";
43
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["CALL_FAILED"] = "CALL_FAILED";
44
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["CALL_UNSUBSCRIBE"] = "CALL_UNSUBSCRIBE";
45
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["WEB_PUSH_FAILED"] = "WEB_PUSH_FAILED";
46
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["WEB_PUSH_UNSUBSCRIBE"] = "WEB_PUSH_UNSUBSCRIBE";
47
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["SLACK_FAILED"] = "SLACK_FAILED";
48
+ WebhookEndpointsResponseEndpointsInnerEventsEnum["SLACK_UNSUBSCRIBE"] = "SLACK_UNSUBSCRIBE";
49
+ })(WebhookEndpointsResponseEndpointsInnerEventsEnum || (exports.WebhookEndpointsResponseEndpointsInnerEventsEnum = WebhookEndpointsResponseEndpointsInnerEventsEnum = {}));
50
+ /**
51
+ * Check if a given object implements the WebhookEndpointsResponseEndpointsInner interface.
52
+ */
53
+ function instanceOfWebhookEndpointsResponseEndpointsInner(value) {
54
+ if (!('id' in value) || value['id'] === undefined)
55
+ return false;
56
+ if (!('webhook' in value) || value['webhook'] === undefined)
57
+ return false;
58
+ if (!('events' in value) || value['events'] === undefined)
59
+ return false;
60
+ if (!('secret' in value) || value['secret'] === undefined)
61
+ return false;
62
+ return true;
63
+ }
64
+ function WebhookEndpointsResponseEndpointsInnerFromJSON(json) {
65
+ return WebhookEndpointsResponseEndpointsInnerFromJSONTyped(json, false);
66
+ }
67
+ function WebhookEndpointsResponseEndpointsInnerFromJSONTyped(json, ignoreDiscriminator) {
68
+ if (json == null) {
69
+ return json;
70
+ }
71
+ return {
72
+ id: json['id'],
73
+ webhook: json['webhook'],
74
+ events: json['events'],
75
+ secret: json['secret']
76
+ };
77
+ }
78
+ function WebhookEndpointsResponseEndpointsInnerToJSON(json) {
79
+ return WebhookEndpointsResponseEndpointsInnerToJSONTyped(json, false);
80
+ }
81
+ function WebhookEndpointsResponseEndpointsInnerToJSONTyped(value, ignoreDiscriminator = false) {
82
+ if (value == null) {
83
+ return value;
84
+ }
85
+ return {
86
+ id: value['id'],
87
+ webhook: value['webhook'],
88
+ events: value['events'],
89
+ secret: value['secret']
90
+ };
91
+ }
@@ -55,8 +55,6 @@ export * from './EmailComponentResponse';
55
55
  export * from './EmailComponentResponseReferencedByInner';
56
56
  export * from './Environment';
57
57
  export * from './EnvironmentPatchRequest';
58
- export * from './EventsWebhookResponse';
59
- export * from './EventsWebhookUpsertRequest';
60
58
  export * from './FirstAccountRequest';
61
59
  export * from './FirstAccountResponse';
62
60
  export * from './GetAccountMetadataResponse';
@@ -268,5 +266,9 @@ export * from './VoiceBrowserCallRequest';
268
266
  export * from './VoiceBrowserCallResponse';
269
267
  export * from './VoiceCallRequest';
270
268
  export * from './VoiceCallResponse';
269
+ export * from './WebhookEndpoint';
270
+ export * from './WebhookEndpointUpsertRequest';
271
+ export * from './WebhookEndpointsResponse';
272
+ export * from './WebhookEndpointsResponseEndpointsInner';
271
273
  export * from './WebhookEvent';
272
274
  export * from './WebhookResponse';
@@ -73,8 +73,6 @@ __exportStar(require("./EmailComponentResponse"), exports);
73
73
  __exportStar(require("./EmailComponentResponseReferencedByInner"), exports);
74
74
  __exportStar(require("./Environment"), exports);
75
75
  __exportStar(require("./EnvironmentPatchRequest"), exports);
76
- __exportStar(require("./EventsWebhookResponse"), exports);
77
- __exportStar(require("./EventsWebhookUpsertRequest"), exports);
78
76
  __exportStar(require("./FirstAccountRequest"), exports);
79
77
  __exportStar(require("./FirstAccountResponse"), exports);
80
78
  __exportStar(require("./GetAccountMetadataResponse"), exports);
@@ -286,5 +284,9 @@ __exportStar(require("./VoiceBrowserCallRequest"), exports);
286
284
  __exportStar(require("./VoiceBrowserCallResponse"), exports);
287
285
  __exportStar(require("./VoiceCallRequest"), exports);
288
286
  __exportStar(require("./VoiceCallResponse"), exports);
287
+ __exportStar(require("./WebhookEndpoint"), exports);
288
+ __exportStar(require("./WebhookEndpointUpsertRequest"), exports);
289
+ __exportStar(require("./WebhookEndpointsResponse"), exports);
290
+ __exportStar(require("./WebhookEndpointsResponseEndpointsInner"), exports);
289
291
  __exportStar(require("./WebhookEvent"), exports);
290
292
  __exportStar(require("./WebhookResponse"), exports);
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.Pingram = void 0;
9
9
  const src_1 = require("../generated/src");
10
10
  // SDK version for User-Agent header (injected at codegen time)
11
- const SDK_VERSION = '1.0.30';
11
+ const SDK_VERSION = '1.0.31';
12
12
  const USER_AGENT = `pingram-node/${SDK_VERSION}`;
13
13
  const src_2 = require("../generated/src");
14
14
  const src_3 = require("../generated/src");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pingram",
3
- "version": "1.0.30",
3
+ "version": "1.0.31-alpha.1468",
4
4
  "description": "Official Node.js SDK for Pingram - Send notifications via Email, SMS, Push, In-App, and more",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -1,91 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * Pingram
6
- * Internal API for notification delivery and management
7
- *
8
- * The version of the OpenAPI document: 1.0.0
9
- *
10
- *
11
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
- * https://openapi-generator.tech
13
- * Do not edit the class manually.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.EventsWebhookResponseEventsEnum = void 0;
17
- exports.instanceOfEventsWebhookResponse = instanceOfEventsWebhookResponse;
18
- exports.EventsWebhookResponseFromJSON = EventsWebhookResponseFromJSON;
19
- exports.EventsWebhookResponseFromJSONTyped = EventsWebhookResponseFromJSONTyped;
20
- exports.EventsWebhookResponseToJSON = EventsWebhookResponseToJSON;
21
- exports.EventsWebhookResponseToJSONTyped = EventsWebhookResponseToJSONTyped;
22
- /**
23
- * @export
24
- * @enum {string}
25
- */
26
- var EventsWebhookResponseEventsEnum;
27
- (function (EventsWebhookResponseEventsEnum) {
28
- EventsWebhookResponseEventsEnum["EMAIL_OPEN"] = "EMAIL_OPEN";
29
- EventsWebhookResponseEventsEnum["EMAIL_CLICK"] = "EMAIL_CLICK";
30
- EventsWebhookResponseEventsEnum["EMAIL_FAILED"] = "EMAIL_FAILED";
31
- EventsWebhookResponseEventsEnum["EMAIL_DELIVERED"] = "EMAIL_DELIVERED";
32
- EventsWebhookResponseEventsEnum["EMAIL_UNSUBSCRIBE"] = "EMAIL_UNSUBSCRIBE";
33
- EventsWebhookResponseEventsEnum["EMAIL_INBOUND"] = "EMAIL_INBOUND";
34
- EventsWebhookResponseEventsEnum["INAPP_WEB_FAILED"] = "INAPP_WEB_FAILED";
35
- EventsWebhookResponseEventsEnum["INAPP_WEB_UNSUBSCRIBE"] = "INAPP_WEB_UNSUBSCRIBE";
36
- EventsWebhookResponseEventsEnum["SMS_DELIVERED"] = "SMS_DELIVERED";
37
- EventsWebhookResponseEventsEnum["SMS_FAILED"] = "SMS_FAILED";
38
- EventsWebhookResponseEventsEnum["SMS_UNSUBSCRIBE"] = "SMS_UNSUBSCRIBE";
39
- EventsWebhookResponseEventsEnum["SMS_SUBSCRIBE"] = "SMS_SUBSCRIBE";
40
- EventsWebhookResponseEventsEnum["SMS_INBOUND"] = "SMS_INBOUND";
41
- EventsWebhookResponseEventsEnum["PUSH_FAILED"] = "PUSH_FAILED";
42
- EventsWebhookResponseEventsEnum["PUSH_UNSUBSCRIBE"] = "PUSH_UNSUBSCRIBE";
43
- EventsWebhookResponseEventsEnum["CALL_FAILED"] = "CALL_FAILED";
44
- EventsWebhookResponseEventsEnum["CALL_UNSUBSCRIBE"] = "CALL_UNSUBSCRIBE";
45
- EventsWebhookResponseEventsEnum["WEB_PUSH_FAILED"] = "WEB_PUSH_FAILED";
46
- EventsWebhookResponseEventsEnum["WEB_PUSH_UNSUBSCRIBE"] = "WEB_PUSH_UNSUBSCRIBE";
47
- EventsWebhookResponseEventsEnum["SLACK_FAILED"] = "SLACK_FAILED";
48
- EventsWebhookResponseEventsEnum["SLACK_UNSUBSCRIBE"] = "SLACK_UNSUBSCRIBE";
49
- })(EventsWebhookResponseEventsEnum || (exports.EventsWebhookResponseEventsEnum = EventsWebhookResponseEventsEnum = {}));
50
- /**
51
- * Check if a given object implements the EventsWebhookResponse interface.
52
- */
53
- function instanceOfEventsWebhookResponse(value) {
54
- if (!('webhookId' in value) || value['webhookId'] === undefined)
55
- return false;
56
- if (!('webhook' in value) || value['webhook'] === undefined)
57
- return false;
58
- if (!('events' in value) || value['events'] === undefined)
59
- return false;
60
- if (!('secret' in value) || value['secret'] === undefined)
61
- return false;
62
- return true;
63
- }
64
- function EventsWebhookResponseFromJSON(json) {
65
- return EventsWebhookResponseFromJSONTyped(json, false);
66
- }
67
- function EventsWebhookResponseFromJSONTyped(json, ignoreDiscriminator) {
68
- if (json == null) {
69
- return json;
70
- }
71
- return {
72
- webhookId: json['webhookId'],
73
- webhook: json['webhook'],
74
- events: json['events'],
75
- secret: json['secret']
76
- };
77
- }
78
- function EventsWebhookResponseToJSON(json) {
79
- return EventsWebhookResponseToJSONTyped(json, false);
80
- }
81
- function EventsWebhookResponseToJSONTyped(value, ignoreDiscriminator = false) {
82
- if (value == null) {
83
- return value;
84
- }
85
- return {
86
- webhookId: value['webhookId'],
87
- webhook: value['webhook'],
88
- events: value['events'],
89
- secret: value['secret']
90
- };
91
- }
@@ -1,83 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * Pingram
6
- * Internal API for notification delivery and management
7
- *
8
- * The version of the OpenAPI document: 1.0.0
9
- *
10
- *
11
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
- * https://openapi-generator.tech
13
- * Do not edit the class manually.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.EventsWebhookUpsertRequestEventsEnum = void 0;
17
- exports.instanceOfEventsWebhookUpsertRequest = instanceOfEventsWebhookUpsertRequest;
18
- exports.EventsWebhookUpsertRequestFromJSON = EventsWebhookUpsertRequestFromJSON;
19
- exports.EventsWebhookUpsertRequestFromJSONTyped = EventsWebhookUpsertRequestFromJSONTyped;
20
- exports.EventsWebhookUpsertRequestToJSON = EventsWebhookUpsertRequestToJSON;
21
- exports.EventsWebhookUpsertRequestToJSONTyped = EventsWebhookUpsertRequestToJSONTyped;
22
- /**
23
- * @export
24
- * @enum {string}
25
- */
26
- var EventsWebhookUpsertRequestEventsEnum;
27
- (function (EventsWebhookUpsertRequestEventsEnum) {
28
- EventsWebhookUpsertRequestEventsEnum["EMAIL_OPEN"] = "EMAIL_OPEN";
29
- EventsWebhookUpsertRequestEventsEnum["EMAIL_CLICK"] = "EMAIL_CLICK";
30
- EventsWebhookUpsertRequestEventsEnum["EMAIL_FAILED"] = "EMAIL_FAILED";
31
- EventsWebhookUpsertRequestEventsEnum["EMAIL_DELIVERED"] = "EMAIL_DELIVERED";
32
- EventsWebhookUpsertRequestEventsEnum["EMAIL_UNSUBSCRIBE"] = "EMAIL_UNSUBSCRIBE";
33
- EventsWebhookUpsertRequestEventsEnum["EMAIL_INBOUND"] = "EMAIL_INBOUND";
34
- EventsWebhookUpsertRequestEventsEnum["INAPP_WEB_FAILED"] = "INAPP_WEB_FAILED";
35
- EventsWebhookUpsertRequestEventsEnum["INAPP_WEB_UNSUBSCRIBE"] = "INAPP_WEB_UNSUBSCRIBE";
36
- EventsWebhookUpsertRequestEventsEnum["SMS_DELIVERED"] = "SMS_DELIVERED";
37
- EventsWebhookUpsertRequestEventsEnum["SMS_FAILED"] = "SMS_FAILED";
38
- EventsWebhookUpsertRequestEventsEnum["SMS_UNSUBSCRIBE"] = "SMS_UNSUBSCRIBE";
39
- EventsWebhookUpsertRequestEventsEnum["SMS_SUBSCRIBE"] = "SMS_SUBSCRIBE";
40
- EventsWebhookUpsertRequestEventsEnum["SMS_INBOUND"] = "SMS_INBOUND";
41
- EventsWebhookUpsertRequestEventsEnum["PUSH_FAILED"] = "PUSH_FAILED";
42
- EventsWebhookUpsertRequestEventsEnum["PUSH_UNSUBSCRIBE"] = "PUSH_UNSUBSCRIBE";
43
- EventsWebhookUpsertRequestEventsEnum["CALL_FAILED"] = "CALL_FAILED";
44
- EventsWebhookUpsertRequestEventsEnum["CALL_UNSUBSCRIBE"] = "CALL_UNSUBSCRIBE";
45
- EventsWebhookUpsertRequestEventsEnum["WEB_PUSH_FAILED"] = "WEB_PUSH_FAILED";
46
- EventsWebhookUpsertRequestEventsEnum["WEB_PUSH_UNSUBSCRIBE"] = "WEB_PUSH_UNSUBSCRIBE";
47
- EventsWebhookUpsertRequestEventsEnum["SLACK_FAILED"] = "SLACK_FAILED";
48
- EventsWebhookUpsertRequestEventsEnum["SLACK_UNSUBSCRIBE"] = "SLACK_UNSUBSCRIBE";
49
- })(EventsWebhookUpsertRequestEventsEnum || (exports.EventsWebhookUpsertRequestEventsEnum = EventsWebhookUpsertRequestEventsEnum = {}));
50
- /**
51
- * Check if a given object implements the EventsWebhookUpsertRequest interface.
52
- */
53
- function instanceOfEventsWebhookUpsertRequest(value) {
54
- if (!('webhook' in value) || value['webhook'] === undefined)
55
- return false;
56
- if (!('events' in value) || value['events'] === undefined)
57
- return false;
58
- return true;
59
- }
60
- function EventsWebhookUpsertRequestFromJSON(json) {
61
- return EventsWebhookUpsertRequestFromJSONTyped(json, false);
62
- }
63
- function EventsWebhookUpsertRequestFromJSONTyped(json, ignoreDiscriminator) {
64
- if (json == null) {
65
- return json;
66
- }
67
- return {
68
- webhook: json['webhook'],
69
- events: json['events']
70
- };
71
- }
72
- function EventsWebhookUpsertRequestToJSON(json) {
73
- return EventsWebhookUpsertRequestToJSONTyped(json, false);
74
- }
75
- function EventsWebhookUpsertRequestToJSONTyped(value, ignoreDiscriminator = false) {
76
- if (value == null) {
77
- return value;
78
- }
79
- return {
80
- webhook: value['webhook'],
81
- events: value['events']
82
- };
83
- }