twilio 5.13.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +2 -4
  2. package/lib/rest/InsightsBase.d.ts +3 -0
  3. package/lib/rest/InsightsBase.js +5 -0
  4. package/lib/rest/MessagingBase.d.ts +3 -0
  5. package/lib/rest/MessagingBase.js +5 -0
  6. package/lib/rest/api/v2010/account/call/transcription.d.ts +2 -0
  7. package/lib/rest/api/v2010/account/call/transcription.js +4 -0
  8. package/lib/rest/api/v2010/account/message.d.ts +2 -0
  9. package/lib/rest/api/v2010/account/message.js +4 -0
  10. package/lib/rest/flexApi/V1.d.ts +0 -5
  11. package/lib/rest/flexApi/V1.js +0 -7
  12. package/lib/rest/iam/V1.d.ts +3 -0
  13. package/lib/rest/iam/V1.js +5 -0
  14. package/lib/rest/iam/v1/rolePermission.d.ts +225 -0
  15. package/lib/rest/iam/v1/rolePermission.js +181 -0
  16. package/lib/rest/insights/V2.d.ts +21 -0
  17. package/lib/rest/insights/V2.js +46 -0
  18. package/lib/rest/insights/v2/inbound.d.ts +436 -0
  19. package/lib/rest/insights/v2/inbound.js +342 -0
  20. package/lib/rest/insights/v2/outbound.d.ts +529 -0
  21. package/lib/rest/insights/v2/outbound.js +392 -0
  22. package/lib/rest/insights/v2/report.d.ts +783 -0
  23. package/lib/rest/insights/v2/report.js +550 -0
  24. package/lib/rest/messaging/V3.d.ts +15 -0
  25. package/lib/rest/messaging/V3.js +37 -0
  26. package/lib/rest/messaging/v2/channelsSender.d.ts +4 -0
  27. package/lib/rest/messaging/v2/channelsSender.js +1 -0
  28. package/lib/rest/messaging/v3/typingIndicator.d.ts +90 -0
  29. package/lib/rest/messaging/v3/typingIndicator.js +114 -0
  30. package/lib/rest/numbers/V1.d.ts +8 -0
  31. package/lib/rest/numbers/V1.js +12 -0
  32. package/lib/rest/numbers/v1/embeddedSession.d.ts +84 -0
  33. package/lib/rest/numbers/v1/embeddedSession.js +115 -0
  34. package/lib/rest/numbers/v1/senderIdRegistration.d.ts +181 -0
  35. package/lib/rest/numbers/v1/senderIdRegistration.js +146 -0
  36. package/lib/rest/numbers/v2/application.d.ts +191 -4
  37. package/lib/rest/numbers/v2/application.js +176 -3
  38. package/lib/rest/numbers/v3/hostedNumberOrder.d.ts +1 -1
  39. package/lib/rest/numbers/v3/hostedNumberOrder.js +2 -1
  40. package/lib/rest/previewIam/versionless/organization/user.d.ts +65 -0
  41. package/lib/rest/previewIam/versionless/organization/user.js +72 -1
  42. package/lib/rest/studio/v2/flow/execution.d.ts +24 -0
  43. package/lib/rest/studio/v2/flow/execution.js +10 -0
  44. package/lib/rest/studio/v2/flow/flowRevision.d.ts +6 -0
  45. package/lib/rest/studio/v2/flow/flowRevision.js +2 -0
  46. package/lib/rest/studio/v2/flow.d.ts +6 -0
  47. package/lib/rest/studio/v2/flow.js +2 -0
  48. package/lib/rest/verify/v2/service/approveChallenge.d.ts +6 -6
  49. package/lib/rest/verify/v2/service/approveChallenge.js +2 -2
  50. package/lib/rest/verify/v2/service/newChallenge.d.ts +6 -6
  51. package/lib/rest/verify/v2/service/newChallenge.js +2 -2
  52. package/lib/rest/verify/v2/service/verification.d.ts +2 -2
  53. package/lib/rest/video/v1/room.d.ts +4 -1
  54. package/lib/twiml/VoiceResponse.d.ts +10 -0
  55. package/package.json +2 -2
  56. package/lib/rest/flexApi/v1/createFlexInstance.d.ts +0 -165
  57. package/lib/rest/flexApi/v1/createFlexInstance.js +0 -165
@@ -0,0 +1,90 @@
1
+ import { inspect, InspectOptions } from "util";
2
+ import V3 from "../V3";
3
+ import { ApiResponse } from "../../../base/ApiResponse";
4
+ /**
5
+ * Request body for sending a typing indicator. The schema varies by channel. Use the `channel` field to determine which properties are required.
6
+ */
7
+ export declare class TypingIndicatorRequest {
8
+ /**
9
+ * The messaging channel. Must be \"APPLE\".
10
+ */
11
+ "channel": string;
12
+ /**
13
+ * The SID of a recent inbound message from the recipient. Must be an SM or MM SID format.
14
+ */
15
+ "messageId": string;
16
+ /**
17
+ * The Apple Messages for Business identifier of the sender (business).
18
+ */
19
+ "from": string;
20
+ /**
21
+ * The Apple Messages for Business identifier of the recipient (customer).
22
+ */
23
+ "to": string;
24
+ /**
25
+ * The type of typing event. \"START\" indicates the agent began typing, \"END\" indicates the agent stopped typing. Defaults to \"START\".
26
+ */
27
+ "event"?: string;
28
+ constructor(payload: any);
29
+ }
30
+ /**
31
+ * Options to pass to create a TypingIndicatorInstance
32
+ */
33
+ export interface TypingIndicatorListInstanceCreateOptions {
34
+ /** */
35
+ typingIndicatorRequest: TypingIndicatorRequest;
36
+ }
37
+ export interface TypingIndicatorSolution {
38
+ }
39
+ export interface TypingIndicatorListInstance {
40
+ _version: V3;
41
+ _solution: TypingIndicatorSolution;
42
+ _uri: string;
43
+ /**
44
+ * Create a TypingIndicatorInstance
45
+ *
46
+ * @param params - Body for request
47
+ * @param headers - header params for request
48
+ * @param callback - Callback to handle processed record
49
+ *
50
+ * @returns Resolves to processed TypingIndicatorInstance
51
+ */
52
+ create(params: TypingIndicatorRequest, headers?: any, callback?: (error: Error | null, item?: TypingIndicatorInstance) => any): Promise<TypingIndicatorInstance>;
53
+ /**
54
+ * Create a TypingIndicatorInstance and return HTTP info
55
+ *
56
+ * @param params - Body for request
57
+ * @param headers - header params for request
58
+ * @param callback - Callback to handle processed record
59
+ *
60
+ * @returns Resolves to processed TypingIndicatorInstance with HTTP metadata
61
+ */
62
+ createWithHttpInfo(params: TypingIndicatorRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<TypingIndicatorInstance>) => any): Promise<ApiResponse<TypingIndicatorInstance>>;
63
+ /**
64
+ * Provide a user-friendly representation
65
+ */
66
+ toJSON(): any;
67
+ [inspect.custom](_depth: any, options: InspectOptions): any;
68
+ }
69
+ export declare function TypingIndicatorListInstance(version: V3): TypingIndicatorListInstance;
70
+ interface TypingIndicatorResource {
71
+ success: boolean;
72
+ }
73
+ export declare class TypingIndicatorInstance {
74
+ protected _version: V3;
75
+ constructor(_version: V3, payload: TypingIndicatorResource);
76
+ /**
77
+ * Indicates if the typing indicator was sent successfully.
78
+ */
79
+ success: boolean;
80
+ /**
81
+ * Provide a user-friendly representation
82
+ *
83
+ * @returns Object
84
+ */
85
+ toJSON(): {
86
+ success: boolean;
87
+ };
88
+ [inspect.custom](_depth: any, options: InspectOptions): string;
89
+ }
90
+ export {};
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio - Messaging
9
+ * This is the public Twilio REST API.
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator.
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.TypingIndicatorInstance = exports.TypingIndicatorRequest = void 0;
17
+ exports.TypingIndicatorListInstance = TypingIndicatorListInstance;
18
+ const util_1 = require("util");
19
+ const deserialize = require("../../../base/deserialize");
20
+ const serialize = require("../../../base/serialize");
21
+ /**
22
+ * Request body for sending a typing indicator. The schema varies by channel. Use the `channel` field to determine which properties are required.
23
+ */
24
+ class TypingIndicatorRequest {
25
+ constructor(payload) {
26
+ this.channel = payload["channel"];
27
+ this.messageId = payload["messageId"];
28
+ this.from = payload["from"];
29
+ this.to = payload["to"];
30
+ this.event = payload["event"];
31
+ }
32
+ }
33
+ exports.TypingIndicatorRequest = TypingIndicatorRequest;
34
+ function TypingIndicatorListInstance(version) {
35
+ const instance = {};
36
+ instance._version = version;
37
+ instance._solution = {};
38
+ instance._uri = `/Indicators/Typing.json`;
39
+ instance.create = function create(params, headers, callback) {
40
+ if (params === null || params === undefined) {
41
+ throw new Error('Required parameter "params" missing.');
42
+ }
43
+ let data = {};
44
+ data = params;
45
+ if (headers === null || headers === undefined) {
46
+ headers = {};
47
+ }
48
+ headers["Content-Type"] = "application/json";
49
+ headers["Accept"] = "application/json";
50
+ let operationVersion = version, operationPromise = operationVersion.create({
51
+ uri: instance._uri,
52
+ method: "post",
53
+ data,
54
+ headers,
55
+ });
56
+ operationPromise = operationPromise.then((payload) => new TypingIndicatorInstance(operationVersion, payload));
57
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
58
+ return operationPromise;
59
+ };
60
+ instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
61
+ if (params === null || params === undefined) {
62
+ throw new Error('Required parameter "params" missing.');
63
+ }
64
+ let data = {};
65
+ data = params;
66
+ if (headers === null || headers === undefined) {
67
+ headers = {};
68
+ }
69
+ headers["Content-Type"] = "application/json";
70
+ headers["Accept"] = "application/json";
71
+ let operationVersion = version;
72
+ // CREATE, FETCH, UPDATE operations
73
+ let operationPromise = operationVersion
74
+ .createWithResponseInfo({
75
+ uri: instance._uri,
76
+ method: "post",
77
+ data,
78
+ headers,
79
+ })
80
+ .then((response) => ({
81
+ ...response,
82
+ body: new TypingIndicatorInstance(operationVersion, response.body),
83
+ }));
84
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
85
+ return operationPromise;
86
+ };
87
+ instance.toJSON = function toJSON() {
88
+ return instance._solution;
89
+ };
90
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
91
+ return (0, util_1.inspect)(instance.toJSON(), options);
92
+ };
93
+ return instance;
94
+ }
95
+ class TypingIndicatorInstance {
96
+ constructor(_version, payload) {
97
+ this._version = _version;
98
+ this.success = payload.success;
99
+ }
100
+ /**
101
+ * Provide a user-friendly representation
102
+ *
103
+ * @returns Object
104
+ */
105
+ toJSON() {
106
+ return {
107
+ success: this.success,
108
+ };
109
+ }
110
+ [util_1.inspect.custom](_depth, options) {
111
+ return (0, util_1.inspect)(this.toJSON(), options);
112
+ }
113
+ }
114
+ exports.TypingIndicatorInstance = TypingIndicatorInstance;
@@ -2,12 +2,14 @@ import NumbersBase from "../NumbersBase";
2
2
  import Version from "../../base/Version";
3
3
  import { BulkEligibilityListInstance } from "./v1/bulkEligibility";
4
4
  import { EligibilityListInstance } from "./v1/eligibility";
5
+ import { EmbeddedSessionListInstance } from "./v1/embeddedSession";
5
6
  import { PortingAllPortInListInstance } from "./v1/portingAllPortIn";
6
7
  import { PortingPortInListInstance } from "./v1/portingPortIn";
7
8
  import { PortingPortInPhoneNumberListInstance } from "./v1/portingPortInPhoneNumber";
8
9
  import { PortingPortabilityListInstance } from "./v1/portingPortability";
9
10
  import { PortingWebhookConfigurationListInstance } from "./v1/portingWebhookConfiguration";
10
11
  import { PortingWebhookConfigurationDeleteListInstance } from "./v1/portingWebhookConfigurationDelete";
12
+ import { SenderIdRegistrationListInstance } from "./v1/senderIdRegistration";
11
13
  import { SigningRequestConfigurationListInstance } from "./v1/signingRequestConfiguration";
12
14
  import { WebhookListInstance } from "./v1/webhook";
13
15
  export default class V1 extends Version {
@@ -33,6 +35,8 @@ export default class V1 extends Version {
33
35
  protected _portingWebhookConfigurations?: PortingWebhookConfigurationListInstance;
34
36
  /** portingWebhookConfigurationsDelete - { Twilio.Numbers.V1.PortingWebhookConfigurationDeleteListInstance } resource */
35
37
  protected _portingWebhookConfigurationsDelete?: PortingWebhookConfigurationDeleteListInstance;
38
+ /** senderIdRegistrations - { Twilio.Numbers.V1.SenderIdRegistrationListInstance } resource */
39
+ protected _senderIdRegistrations?: SenderIdRegistrationListInstance;
36
40
  /** signingRequestConfigurations - { Twilio.Numbers.V1.SigningRequestConfigurationListInstance } resource */
37
41
  protected _signingRequestConfigurations?: SigningRequestConfigurationListInstance;
38
42
  /** webhook - { Twilio.Numbers.V1.WebhookListInstance } resource */
@@ -41,6 +45,8 @@ export default class V1 extends Version {
41
45
  get bulkEligibilities(): BulkEligibilityListInstance;
42
46
  /** Getter for eligibilities resource */
43
47
  get eligibilities(): EligibilityListInstance;
48
+ /** Accessor for embeddedSessions resource */
49
+ embeddedSessions(BundleSid: string): EmbeddedSessionListInstance;
44
50
  /** Getter for portingAllPortIns resource */
45
51
  get portingAllPortIns(): PortingAllPortInListInstance;
46
52
  /** Getter for portingPortIns resource */
@@ -53,6 +59,8 @@ export default class V1 extends Version {
53
59
  get portingWebhookConfigurations(): PortingWebhookConfigurationListInstance;
54
60
  /** Getter for portingWebhookConfigurationsDelete resource */
55
61
  get portingWebhookConfigurationsDelete(): PortingWebhookConfigurationDeleteListInstance;
62
+ /** Getter for senderIdRegistrations resource */
63
+ get senderIdRegistrations(): SenderIdRegistrationListInstance;
56
64
  /** Getter for signingRequestConfigurations resource */
57
65
  get signingRequestConfigurations(): SigningRequestConfigurationListInstance;
58
66
  /** Getter for webhook resource */
@@ -19,12 +19,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  const Version_1 = __importDefault(require("../../base/Version"));
20
20
  const bulkEligibility_1 = require("./v1/bulkEligibility");
21
21
  const eligibility_1 = require("./v1/eligibility");
22
+ const embeddedSession_1 = require("./v1/embeddedSession");
22
23
  const portingAllPortIn_1 = require("./v1/portingAllPortIn");
23
24
  const portingPortIn_1 = require("./v1/portingPortIn");
24
25
  const portingPortInPhoneNumber_1 = require("./v1/portingPortInPhoneNumber");
25
26
  const portingPortability_1 = require("./v1/portingPortability");
26
27
  const portingWebhookConfiguration_1 = require("./v1/portingWebhookConfiguration");
27
28
  const portingWebhookConfigurationDelete_1 = require("./v1/portingWebhookConfigurationDelete");
29
+ const senderIdRegistration_1 = require("./v1/senderIdRegistration");
28
30
  const signingRequestConfiguration_1 = require("./v1/signingRequestConfiguration");
29
31
  const webhook_1 = require("./v1/webhook");
30
32
  class V1 extends Version_1.default {
@@ -47,6 +49,10 @@ class V1 extends Version_1.default {
47
49
  this._eligibilities = this._eligibilities || (0, eligibility_1.EligibilityListInstance)(this);
48
50
  return this._eligibilities;
49
51
  }
52
+ /** Accessor for embeddedSessions resource */
53
+ embeddedSessions(BundleSid) {
54
+ return (0, embeddedSession_1.EmbeddedSessionListInstance)(this, BundleSid);
55
+ }
50
56
  /** Getter for portingAllPortIns resource */
51
57
  get portingAllPortIns() {
52
58
  this._portingAllPortIns =
@@ -86,6 +92,12 @@ class V1 extends Version_1.default {
86
92
  (0, portingWebhookConfigurationDelete_1.PortingWebhookConfigurationDeleteListInstance)(this);
87
93
  return this._portingWebhookConfigurationsDelete;
88
94
  }
95
+ /** Getter for senderIdRegistrations resource */
96
+ get senderIdRegistrations() {
97
+ this._senderIdRegistrations =
98
+ this._senderIdRegistrations || (0, senderIdRegistration_1.SenderIdRegistrationListInstance)(this);
99
+ return this._senderIdRegistrations;
100
+ }
89
101
  /** Getter for signingRequestConfigurations resource */
90
102
  get signingRequestConfigurations() {
91
103
  this._signingRequestConfigurations =
@@ -0,0 +1,84 @@
1
+ import { inspect, InspectOptions } from "util";
2
+ import V1 from "../V1";
3
+ import { ApiResponse } from "../../../base/ApiResponse";
4
+ export declare class NumbersV1CreateEmbeddedSessionRequest {
5
+ /**
6
+ * Theme ID for the Compliance Embeddable UI. Overrides the theme set during registration creation.
7
+ */
8
+ "themeSetId"?: string;
9
+ constructor(payload: any);
10
+ }
11
+ /**
12
+ * Options to pass to create a EmbeddedSessionInstance
13
+ */
14
+ export interface EmbeddedSessionListInstanceCreateOptions {
15
+ /** */
16
+ numbersV1CreateEmbeddedSessionRequest: NumbersV1CreateEmbeddedSessionRequest;
17
+ }
18
+ export interface EmbeddedSessionSolution {
19
+ bundleSid: string;
20
+ }
21
+ export interface EmbeddedSessionListInstance {
22
+ _version: V1;
23
+ _solution: EmbeddedSessionSolution;
24
+ _uri: string;
25
+ /**
26
+ * Create a EmbeddedSessionInstance
27
+ *
28
+ * @param params - Body for request
29
+ * @param headers - header params for request
30
+ * @param callback - Callback to handle processed record
31
+ *
32
+ * @returns Resolves to processed EmbeddedSessionInstance
33
+ */
34
+ create(params: NumbersV1CreateEmbeddedSessionRequest, headers?: any, callback?: (error: Error | null, item?: EmbeddedSessionInstance) => any): Promise<EmbeddedSessionInstance>;
35
+ /**
36
+ * Create a EmbeddedSessionInstance and return HTTP info
37
+ *
38
+ * @param params - Body for request
39
+ * @param headers - header params for request
40
+ * @param callback - Callback to handle processed record
41
+ *
42
+ * @returns Resolves to processed EmbeddedSessionInstance with HTTP metadata
43
+ */
44
+ createWithHttpInfo(params: NumbersV1CreateEmbeddedSessionRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<EmbeddedSessionInstance>) => any): Promise<ApiResponse<EmbeddedSessionInstance>>;
45
+ /**
46
+ * Provide a user-friendly representation
47
+ */
48
+ toJSON(): any;
49
+ [inspect.custom](_depth: any, options: InspectOptions): any;
50
+ }
51
+ export declare function EmbeddedSessionListInstance(version: V1, bundleSid: string): EmbeddedSessionListInstance;
52
+ interface EmbeddedSessionResource {
53
+ id: string;
54
+ sessionId: string;
55
+ sessionToken: string;
56
+ }
57
+ export declare class EmbeddedSessionInstance {
58
+ protected _version: V1;
59
+ constructor(_version: V1, payload: EmbeddedSessionResource, bundleSid?: string);
60
+ /**
61
+ * Registration identifier (BU-prefixed).
62
+ */
63
+ id: string;
64
+ /**
65
+ * Session ID for the compliance embeddable.
66
+ */
67
+ sessionId: string;
68
+ /**
69
+ * Ephemeral session token for the compliance embeddable.
70
+ */
71
+ sessionToken: string;
72
+ /**
73
+ * Provide a user-friendly representation
74
+ *
75
+ * @returns Object
76
+ */
77
+ toJSON(): {
78
+ id: string;
79
+ sessionId: string;
80
+ sessionToken: string;
81
+ };
82
+ [inspect.custom](_depth: any, options: InspectOptions): string;
83
+ }
84
+ export {};
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio - Numbers
9
+ * This is the public Twilio REST API.
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator.
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.EmbeddedSessionInstance = exports.NumbersV1CreateEmbeddedSessionRequest = void 0;
17
+ exports.EmbeddedSessionListInstance = EmbeddedSessionListInstance;
18
+ const util_1 = require("util");
19
+ const deserialize = require("../../../base/deserialize");
20
+ const serialize = require("../../../base/serialize");
21
+ const utility_1 = require("../../../base/utility");
22
+ class NumbersV1CreateEmbeddedSessionRequest {
23
+ constructor(payload) {
24
+ this.themeSetId = payload["themeSetId"];
25
+ }
26
+ }
27
+ exports.NumbersV1CreateEmbeddedSessionRequest = NumbersV1CreateEmbeddedSessionRequest;
28
+ function EmbeddedSessionListInstance(version, bundleSid) {
29
+ if (!(0, utility_1.isValidPathParam)(bundleSid)) {
30
+ throw new Error("Parameter 'bundleSid' is not valid.");
31
+ }
32
+ const instance = {};
33
+ instance._version = version;
34
+ instance._solution = { bundleSid };
35
+ instance._uri = `/SenderIdRegistrations/${bundleSid}/EmbeddedSessions`;
36
+ instance.create = function create(params, headers, callback) {
37
+ if (params === null || params === undefined) {
38
+ throw new Error('Required parameter "params" missing.');
39
+ }
40
+ let data = {};
41
+ data = params;
42
+ if (headers === null || headers === undefined) {
43
+ headers = {};
44
+ }
45
+ headers["Content-Type"] = "application/json";
46
+ headers["Accept"] = "application/json";
47
+ let operationVersion = version, operationPromise = operationVersion.create({
48
+ uri: instance._uri,
49
+ method: "post",
50
+ data,
51
+ headers,
52
+ });
53
+ operationPromise = operationPromise.then((payload) => new EmbeddedSessionInstance(operationVersion, payload, instance._solution.bundleSid));
54
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
55
+ return operationPromise;
56
+ };
57
+ instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
58
+ if (params === null || params === undefined) {
59
+ throw new Error('Required parameter "params" missing.');
60
+ }
61
+ let data = {};
62
+ data = params;
63
+ if (headers === null || headers === undefined) {
64
+ headers = {};
65
+ }
66
+ headers["Content-Type"] = "application/json";
67
+ headers["Accept"] = "application/json";
68
+ let operationVersion = version;
69
+ // CREATE, FETCH, UPDATE operations
70
+ let operationPromise = operationVersion
71
+ .createWithResponseInfo({
72
+ uri: instance._uri,
73
+ method: "post",
74
+ data,
75
+ headers,
76
+ })
77
+ .then((response) => ({
78
+ ...response,
79
+ body: new EmbeddedSessionInstance(operationVersion, response.body, instance._solution.bundleSid),
80
+ }));
81
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
82
+ return operationPromise;
83
+ };
84
+ instance.toJSON = function toJSON() {
85
+ return instance._solution;
86
+ };
87
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
88
+ return (0, util_1.inspect)(instance.toJSON(), options);
89
+ };
90
+ return instance;
91
+ }
92
+ class EmbeddedSessionInstance {
93
+ constructor(_version, payload, bundleSid) {
94
+ this._version = _version;
95
+ this.id = payload.id;
96
+ this.sessionId = payload.sessionId;
97
+ this.sessionToken = payload.sessionToken;
98
+ }
99
+ /**
100
+ * Provide a user-friendly representation
101
+ *
102
+ * @returns Object
103
+ */
104
+ toJSON() {
105
+ return {
106
+ id: this.id,
107
+ sessionId: this.sessionId,
108
+ sessionToken: this.sessionToken,
109
+ };
110
+ }
111
+ [util_1.inspect.custom](_depth, options) {
112
+ return (0, util_1.inspect)(this.toJSON(), options);
113
+ }
114
+ }
115
+ exports.EmbeddedSessionInstance = EmbeddedSessionInstance;
@@ -0,0 +1,181 @@
1
+ import { inspect, InspectOptions } from "util";
2
+ import V1 from "../V1";
3
+ import { ApiResponse } from "../../../base/ApiResponse";
4
+ export declare class NumbersV1CreateEmbeddedRegistrationRequest {
5
+ /**
6
+ * The regulation for this registration.
7
+ */
8
+ "regulationId": string;
9
+ /**
10
+ * The regulation version.
11
+ */
12
+ "regulationVersion": number;
13
+ /**
14
+ * Human-readable name for the registration.
15
+ */
16
+ "friendlyName": string;
17
+ /**
18
+ * Email address for registration status notifications.
19
+ */
20
+ "statusNotificationEmail"?: string;
21
+ /**
22
+ * The URL of this resource.
23
+ */
24
+ "statusCallbackUrl"?: string | null;
25
+ /**
26
+ * Additional comments about the registration.
27
+ */
28
+ "comments"?: string;
29
+ /**
30
+ * Theme ID for the Compliance Embeddable UI.
31
+ */
32
+ "themeSetId"?: string;
33
+ /**
34
+ * Registration data organized by section (alphanumericSender, business, useCase, authorizedRepresentative, officer, businessAddress).
35
+ */
36
+ "data": {
37
+ [key: string]: any;
38
+ };
39
+ constructor(payload: any);
40
+ }
41
+ export declare class NumbersV1EmbeddedSession {
42
+ /**
43
+ * Session ID for the compliance embeddable.
44
+ */
45
+ "sessionId": string;
46
+ /**
47
+ * Ephemeral session token for the compliance embeddable.
48
+ */
49
+ "sessionToken": string;
50
+ constructor(payload: any);
51
+ }
52
+ /**
53
+ * Options to pass to create a SenderIdRegistrationInstance
54
+ */
55
+ export interface SenderIdRegistrationListInstanceCreateOptions {
56
+ /** */
57
+ numbersV1CreateEmbeddedRegistrationRequest: NumbersV1CreateEmbeddedRegistrationRequest;
58
+ }
59
+ export interface SenderIdRegistrationSolution {
60
+ }
61
+ export interface SenderIdRegistrationListInstance {
62
+ _version: V1;
63
+ _solution: SenderIdRegistrationSolution;
64
+ _uri: string;
65
+ /**
66
+ * Create a SenderIdRegistrationInstance
67
+ *
68
+ * @param params - Body for request
69
+ * @param headers - header params for request
70
+ * @param callback - Callback to handle processed record
71
+ *
72
+ * @returns Resolves to processed SenderIdRegistrationInstance
73
+ */
74
+ create(params: NumbersV1CreateEmbeddedRegistrationRequest, headers?: any, callback?: (error: Error | null, item?: SenderIdRegistrationInstance) => any): Promise<SenderIdRegistrationInstance>;
75
+ /**
76
+ * Create a SenderIdRegistrationInstance and return HTTP info
77
+ *
78
+ * @param params - Body for request
79
+ * @param headers - header params for request
80
+ * @param callback - Callback to handle processed record
81
+ *
82
+ * @returns Resolves to processed SenderIdRegistrationInstance with HTTP metadata
83
+ */
84
+ createWithHttpInfo(params: NumbersV1CreateEmbeddedRegistrationRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<SenderIdRegistrationInstance>) => any): Promise<ApiResponse<SenderIdRegistrationInstance>>;
85
+ /**
86
+ * Provide a user-friendly representation
87
+ */
88
+ toJSON(): any;
89
+ [inspect.custom](_depth: any, options: InspectOptions): any;
90
+ }
91
+ export declare function SenderIdRegistrationListInstance(version: V1): SenderIdRegistrationListInstance;
92
+ interface SenderIdRegistrationResource {
93
+ id: string;
94
+ regulationId: string;
95
+ regulationVersion: number;
96
+ friendlyName: string;
97
+ status: string;
98
+ statusNotificationEmail: string;
99
+ statusCallbackUrl: string;
100
+ comments: string;
101
+ embeddedSession: NumbersV1EmbeddedSession;
102
+ data: {
103
+ [key: string]: any;
104
+ };
105
+ dateCreated: Date;
106
+ dateUpdated: Date;
107
+ }
108
+ export declare class SenderIdRegistrationInstance {
109
+ protected _version: V1;
110
+ constructor(_version: V1, payload: SenderIdRegistrationResource);
111
+ /**
112
+ * Registration identifier (BU-prefixed).
113
+ */
114
+ id: string;
115
+ /**
116
+ * The regulation ID for this registration.
117
+ */
118
+ regulationId: string;
119
+ /**
120
+ * The regulation version.
121
+ */
122
+ regulationVersion: number;
123
+ /**
124
+ * The friendly name provided in the request.
125
+ */
126
+ friendlyName: string;
127
+ /**
128
+ * Registration status. Always DRAFT on creation.
129
+ */
130
+ status: string;
131
+ /**
132
+ * Email address for status notifications.
133
+ */
134
+ statusNotificationEmail: string;
135
+ /**
136
+ * Callback URL for status webhooks.
137
+ */
138
+ statusCallbackUrl: string;
139
+ /**
140
+ * Additional comments.
141
+ */
142
+ comments: string;
143
+ embeddedSession: NumbersV1EmbeddedSession;
144
+ /**
145
+ * Registration data echoed from the request.
146
+ */
147
+ data: {
148
+ [key: string]: any;
149
+ };
150
+ /**
151
+ * Timestamp of creation.
152
+ */
153
+ dateCreated: Date;
154
+ /**
155
+ * Timestamp of last update.
156
+ */
157
+ dateUpdated: Date;
158
+ /**
159
+ * Provide a user-friendly representation
160
+ *
161
+ * @returns Object
162
+ */
163
+ toJSON(): {
164
+ id: string;
165
+ regulationId: string;
166
+ regulationVersion: number;
167
+ friendlyName: string;
168
+ status: string;
169
+ statusNotificationEmail: string;
170
+ statusCallbackUrl: string;
171
+ comments: string;
172
+ embeddedSession: NumbersV1EmbeddedSession;
173
+ data: {
174
+ [key: string]: any;
175
+ };
176
+ dateCreated: Date;
177
+ dateUpdated: Date;
178
+ };
179
+ [inspect.custom](_depth: any, options: InspectOptions): string;
180
+ }
181
+ export {};