twilio 5.3.4 → 5.3.6

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 (33) hide show
  1. package/README.md +21 -0
  2. package/lib/base/BaseTwilio.d.ts +27 -1
  3. package/lib/base/BaseTwilio.js +18 -0
  4. package/lib/base/RequestClient.d.ts +1 -0
  5. package/lib/base/RequestClient.js +10 -10
  6. package/lib/rest/Preview.d.ts +0 -5
  7. package/lib/rest/Preview.js +0 -7
  8. package/lib/rest/api/v2010/account/usage/record/allTime.d.ts +1 -1
  9. package/lib/rest/api/v2010/account/usage/record/daily.d.ts +1 -1
  10. package/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts +1 -1
  11. package/lib/rest/api/v2010/account/usage/record/monthly.d.ts +1 -1
  12. package/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts +1 -1
  13. package/lib/rest/api/v2010/account/usage/record/today.d.ts +1 -1
  14. package/lib/rest/api/v2010/account/usage/record/yearly.d.ts +1 -1
  15. package/lib/rest/api/v2010/account/usage/record/yesterday.d.ts +1 -1
  16. package/lib/rest/api/v2010/account/usage/record.d.ts +1 -1
  17. package/lib/rest/api/v2010/account/usage/trigger.d.ts +1 -1
  18. package/lib/rest/api/v2010/account/usage.d.ts +1 -1
  19. package/lib/rest/content/v1/content.d.ts +1 -1
  20. package/lib/rest/conversations/V1.d.ts +5 -0
  21. package/lib/rest/conversations/V1.js +8 -0
  22. package/lib/rest/conversations/v1/conversationWithParticipants.d.ts +159 -0
  23. package/lib/rest/conversations/v1/conversationWithParticipants.js +126 -0
  24. package/lib/rest/conversations/v1/service/conversationWithParticipants.d.ts +160 -0
  25. package/lib/rest/conversations/v1/service/conversationWithParticipants.js +130 -0
  26. package/lib/rest/conversations/v1/service.d.ts +8 -0
  27. package/lib/rest/conversations/v1/service.js +13 -0
  28. package/lib/rest/insights/v1/conference.d.ts +1 -1
  29. package/lib/rest/insights/v1/room/participant.d.ts +2 -2
  30. package/lib/rest/insights/v1/room.d.ts +2 -2
  31. package/lib/rest/marketplace/v1/referralConversion.d.ts +8 -45
  32. package/lib/rest/marketplace/v1/referralConversion.js +17 -49
  33. package/package.json +1 -1
@@ -0,0 +1,160 @@
1
+ /// <reference types="node" />
2
+ import { inspect, InspectOptions } from "util";
3
+ import V1 from "../../V1";
4
+ export type ConversationWithParticipantsState = "inactive" | "active" | "closed";
5
+ export type ConversationWithParticipantsWebhookEnabledType = "true" | "false";
6
+ /**
7
+ * Options to pass to create a ConversationWithParticipantsInstance
8
+ */
9
+ export interface ConversationWithParticipantsListInstanceCreateOptions {
10
+ /** The X-Twilio-Webhook-Enabled HTTP request header */
11
+ xTwilioWebhookEnabled?: ConversationWithParticipantsWebhookEnabledType;
12
+ /** The human-readable name of this conversation, limited to 256 characters. Optional. */
13
+ friendlyName?: string;
14
+ /** An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\\\'s `sid` in the URL. */
15
+ uniqueName?: string;
16
+ /** The date that this resource was created. */
17
+ dateCreated?: Date;
18
+ /** The date that this resource was last updated. */
19
+ dateUpdated?: Date;
20
+ /** The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. */
21
+ messagingServiceSid?: string;
22
+ /** An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. */
23
+ attributes?: string;
24
+ /** */
25
+ state?: ConversationWithParticipantsState;
26
+ /** ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. */
27
+ "timers.inactive"?: string;
28
+ /** ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. */
29
+ "timers.closed"?: string;
30
+ /** The default email address that will be used when sending outbound emails in this conversation. */
31
+ "bindings.email.address"?: string;
32
+ /** The default name that will be used when sending outbound emails in this conversation. */
33
+ "bindings.email.name"?: string;
34
+ /** The participant to be added to the conversation in JSON format. The JSON object attributes are as parameters in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10. */
35
+ participant?: Array<string>;
36
+ }
37
+ export interface ConversationWithParticipantsSolution {
38
+ chatServiceSid: string;
39
+ }
40
+ export interface ConversationWithParticipantsListInstance {
41
+ _version: V1;
42
+ _solution: ConversationWithParticipantsSolution;
43
+ _uri: string;
44
+ /**
45
+ * Create a ConversationWithParticipantsInstance
46
+ *
47
+ * @param callback - Callback to handle processed record
48
+ *
49
+ * @returns Resolves to processed ConversationWithParticipantsInstance
50
+ */
51
+ create(callback?: (error: Error | null, item?: ConversationWithParticipantsInstance) => any): Promise<ConversationWithParticipantsInstance>;
52
+ /**
53
+ * Create a ConversationWithParticipantsInstance
54
+ *
55
+ * @param params - Parameter for request
56
+ * @param callback - Callback to handle processed record
57
+ *
58
+ * @returns Resolves to processed ConversationWithParticipantsInstance
59
+ */
60
+ create(params: ConversationWithParticipantsListInstanceCreateOptions, callback?: (error: Error | null, item?: ConversationWithParticipantsInstance) => any): Promise<ConversationWithParticipantsInstance>;
61
+ /**
62
+ * Provide a user-friendly representation
63
+ */
64
+ toJSON(): any;
65
+ [inspect.custom](_depth: any, options: InspectOptions): any;
66
+ }
67
+ export declare function ConversationWithParticipantsListInstance(version: V1, chatServiceSid: string): ConversationWithParticipantsListInstance;
68
+ interface ConversationWithParticipantsResource {
69
+ account_sid: string;
70
+ chat_service_sid: string;
71
+ messaging_service_sid: string;
72
+ sid: string;
73
+ friendly_name: string;
74
+ unique_name: string;
75
+ attributes: string;
76
+ state: ConversationWithParticipantsState;
77
+ date_created: Date;
78
+ date_updated: Date;
79
+ timers: any;
80
+ links: Record<string, string>;
81
+ bindings: any;
82
+ url: string;
83
+ }
84
+ export declare class ConversationWithParticipantsInstance {
85
+ protected _version: V1;
86
+ constructor(_version: V1, payload: ConversationWithParticipantsResource, chatServiceSid: string);
87
+ /**
88
+ * The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation.
89
+ */
90
+ accountSid: string;
91
+ /**
92
+ * The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to.
93
+ */
94
+ chatServiceSid: string;
95
+ /**
96
+ * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to.
97
+ */
98
+ messagingServiceSid: string;
99
+ /**
100
+ * A 34 character string that uniquely identifies this resource.
101
+ */
102
+ sid: string;
103
+ /**
104
+ * The human-readable name of this conversation, limited to 256 characters. Optional.
105
+ */
106
+ friendlyName: string;
107
+ /**
108
+ * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource\'s `sid` in the URL.
109
+ */
110
+ uniqueName: string;
111
+ /**
112
+ * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned.
113
+ */
114
+ attributes: string;
115
+ state: ConversationWithParticipantsState;
116
+ /**
117
+ * The date that this resource was created.
118
+ */
119
+ dateCreated: Date;
120
+ /**
121
+ * The date that this resource was last updated.
122
+ */
123
+ dateUpdated: Date;
124
+ /**
125
+ * Timer date values representing state update for this conversation.
126
+ */
127
+ timers: any;
128
+ /**
129
+ * Contains absolute URLs to access the [participants](https://www.twilio.com/docs/conversations/api/conversation-participant-resource), [messages](https://www.twilio.com/docs/conversations/api/conversation-message-resource) and [webhooks](https://www.twilio.com/docs/conversations/api/conversation-scoped-webhook-resource) of this conversation.
130
+ */
131
+ links: Record<string, string>;
132
+ bindings: any;
133
+ /**
134
+ * An absolute API resource URL for this conversation.
135
+ */
136
+ url: string;
137
+ /**
138
+ * Provide a user-friendly representation
139
+ *
140
+ * @returns Object
141
+ */
142
+ toJSON(): {
143
+ accountSid: string;
144
+ chatServiceSid: string;
145
+ messagingServiceSid: string;
146
+ sid: string;
147
+ friendlyName: string;
148
+ uniqueName: string;
149
+ attributes: string;
150
+ state: ConversationWithParticipantsState;
151
+ dateCreated: Date;
152
+ dateUpdated: Date;
153
+ timers: any;
154
+ links: Record<string, string>;
155
+ bindings: any;
156
+ url: string;
157
+ };
158
+ [inspect.custom](_depth: any, options: InspectOptions): string;
159
+ }
160
+ export {};
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio - Conversations
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.ConversationWithParticipantsInstance = exports.ConversationWithParticipantsListInstance = void 0;
17
+ const util_1 = require("util");
18
+ const deserialize = require("../../../../base/deserialize");
19
+ const serialize = require("../../../../base/serialize");
20
+ const utility_1 = require("../../../../base/utility");
21
+ function ConversationWithParticipantsListInstance(version, chatServiceSid) {
22
+ if (!(0, utility_1.isValidPathParam)(chatServiceSid)) {
23
+ throw new Error("Parameter 'chatServiceSid' is not valid.");
24
+ }
25
+ const instance = {};
26
+ instance._version = version;
27
+ instance._solution = { chatServiceSid };
28
+ instance._uri = `/Services/${chatServiceSid}/ConversationWithParticipants`;
29
+ instance.create = function create(params, callback) {
30
+ if (params instanceof Function) {
31
+ callback = params;
32
+ params = {};
33
+ }
34
+ else {
35
+ params = params || {};
36
+ }
37
+ let data = {};
38
+ if (params["friendlyName"] !== undefined)
39
+ data["FriendlyName"] = params["friendlyName"];
40
+ if (params["uniqueName"] !== undefined)
41
+ data["UniqueName"] = params["uniqueName"];
42
+ if (params["dateCreated"] !== undefined)
43
+ data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]);
44
+ if (params["dateUpdated"] !== undefined)
45
+ data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]);
46
+ if (params["messagingServiceSid"] !== undefined)
47
+ data["MessagingServiceSid"] = params["messagingServiceSid"];
48
+ if (params["attributes"] !== undefined)
49
+ data["Attributes"] = params["attributes"];
50
+ if (params["state"] !== undefined)
51
+ data["State"] = params["state"];
52
+ if (params["timers.inactive"] !== undefined)
53
+ data["Timers.Inactive"] = params["timers.inactive"];
54
+ if (params["timers.closed"] !== undefined)
55
+ data["Timers.Closed"] = params["timers.closed"];
56
+ if (params["bindings.email.address"] !== undefined)
57
+ data["Bindings.Email.Address"] = params["bindings.email.address"];
58
+ if (params["bindings.email.name"] !== undefined)
59
+ data["Bindings.Email.Name"] = params["bindings.email.name"];
60
+ if (params["participant"] !== undefined)
61
+ data["Participant"] = serialize.map(params["participant"], (e) => e);
62
+ const headers = {};
63
+ headers["Content-Type"] = "application/x-www-form-urlencoded";
64
+ if (params["xTwilioWebhookEnabled"] !== undefined)
65
+ headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"];
66
+ let operationVersion = version, operationPromise = operationVersion.create({
67
+ uri: instance._uri,
68
+ method: "post",
69
+ data,
70
+ headers,
71
+ });
72
+ operationPromise = operationPromise.then((payload) => new ConversationWithParticipantsInstance(operationVersion, payload, instance._solution.chatServiceSid));
73
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
74
+ return operationPromise;
75
+ };
76
+ instance.toJSON = function toJSON() {
77
+ return instance._solution;
78
+ };
79
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
80
+ return (0, util_1.inspect)(instance.toJSON(), options);
81
+ };
82
+ return instance;
83
+ }
84
+ exports.ConversationWithParticipantsListInstance = ConversationWithParticipantsListInstance;
85
+ class ConversationWithParticipantsInstance {
86
+ constructor(_version, payload, chatServiceSid) {
87
+ this._version = _version;
88
+ this.accountSid = payload.account_sid;
89
+ this.chatServiceSid = payload.chat_service_sid;
90
+ this.messagingServiceSid = payload.messaging_service_sid;
91
+ this.sid = payload.sid;
92
+ this.friendlyName = payload.friendly_name;
93
+ this.uniqueName = payload.unique_name;
94
+ this.attributes = payload.attributes;
95
+ this.state = payload.state;
96
+ this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
97
+ this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
98
+ this.timers = payload.timers;
99
+ this.links = payload.links;
100
+ this.bindings = payload.bindings;
101
+ this.url = payload.url;
102
+ }
103
+ /**
104
+ * Provide a user-friendly representation
105
+ *
106
+ * @returns Object
107
+ */
108
+ toJSON() {
109
+ return {
110
+ accountSid: this.accountSid,
111
+ chatServiceSid: this.chatServiceSid,
112
+ messagingServiceSid: this.messagingServiceSid,
113
+ sid: this.sid,
114
+ friendlyName: this.friendlyName,
115
+ uniqueName: this.uniqueName,
116
+ attributes: this.attributes,
117
+ state: this.state,
118
+ dateCreated: this.dateCreated,
119
+ dateUpdated: this.dateUpdated,
120
+ timers: this.timers,
121
+ links: this.links,
122
+ bindings: this.bindings,
123
+ url: this.url,
124
+ };
125
+ }
126
+ [util_1.inspect.custom](_depth, options) {
127
+ return (0, util_1.inspect)(this.toJSON(), options);
128
+ }
129
+ }
130
+ exports.ConversationWithParticipantsInstance = ConversationWithParticipantsInstance;
@@ -6,6 +6,7 @@ import V1 from "../V1";
6
6
  import { BindingListInstance } from "./service/binding";
7
7
  import { ConfigurationListInstance } from "./service/configuration";
8
8
  import { ConversationListInstance } from "./service/conversation";
9
+ import { ConversationWithParticipantsListInstance } from "./service/conversationWithParticipants";
9
10
  import { ParticipantConversationListInstance } from "./service/participantConversation";
10
11
  import { RoleListInstance } from "./service/role";
11
12
  import { UserListInstance } from "./service/user";
@@ -53,6 +54,7 @@ export interface ServiceContext {
53
54
  bindings: BindingListInstance;
54
55
  configuration: ConfigurationListInstance;
55
56
  conversations: ConversationListInstance;
57
+ conversationWithParticipants: ConversationWithParticipantsListInstance;
56
58
  participantConversations: ParticipantConversationListInstance;
57
59
  roles: RoleListInstance;
58
60
  users: UserListInstance;
@@ -88,6 +90,7 @@ export declare class ServiceContextImpl implements ServiceContext {
88
90
  protected _bindings?: BindingListInstance;
89
91
  protected _configuration?: ConfigurationListInstance;
90
92
  protected _conversations?: ConversationListInstance;
93
+ protected _conversationWithParticipants?: ConversationWithParticipantsListInstance;
91
94
  protected _participantConversations?: ParticipantConversationListInstance;
92
95
  protected _roles?: RoleListInstance;
93
96
  protected _users?: UserListInstance;
@@ -95,6 +98,7 @@ export declare class ServiceContextImpl implements ServiceContext {
95
98
  get bindings(): BindingListInstance;
96
99
  get configuration(): ConfigurationListInstance;
97
100
  get conversations(): ConversationListInstance;
101
+ get conversationWithParticipants(): ConversationWithParticipantsListInstance;
98
102
  get participantConversations(): ParticipantConversationListInstance;
99
103
  get roles(): RoleListInstance;
100
104
  get users(): UserListInstance;
@@ -182,6 +186,10 @@ export declare class ServiceInstance {
182
186
  * Access the conversations.
183
187
  */
184
188
  conversations(): ConversationListInstance;
189
+ /**
190
+ * Access the conversationWithParticipants.
191
+ */
192
+ conversationWithParticipants(): ConversationWithParticipantsListInstance;
185
193
  /**
186
194
  * Access the participantConversations.
187
195
  */
@@ -25,6 +25,7 @@ const utility_1 = require("../../../base/utility");
25
25
  const binding_1 = require("./service/binding");
26
26
  const configuration_1 = require("./service/configuration");
27
27
  const conversation_1 = require("./service/conversation");
28
+ const conversationWithParticipants_1 = require("./service/conversationWithParticipants");
28
29
  const participantConversation_1 = require("./service/participantConversation");
29
30
  const role_1 = require("./service/role");
30
31
  const user_1 = require("./service/user");
@@ -54,6 +55,12 @@ class ServiceContextImpl {
54
55
  (0, conversation_1.ConversationListInstance)(this._version, this._solution.sid);
55
56
  return this._conversations;
56
57
  }
58
+ get conversationWithParticipants() {
59
+ this._conversationWithParticipants =
60
+ this._conversationWithParticipants ||
61
+ (0, conversationWithParticipants_1.ConversationWithParticipantsListInstance)(this._version, this._solution.sid);
62
+ return this._conversationWithParticipants;
63
+ }
57
64
  get participantConversations() {
58
65
  this._participantConversations =
59
66
  this._participantConversations ||
@@ -158,6 +165,12 @@ class ServiceInstance {
158
165
  conversations() {
159
166
  return this._proxy.conversations;
160
167
  }
168
+ /**
169
+ * Access the conversationWithParticipants.
170
+ */
171
+ conversationWithParticipants() {
172
+ return this._proxy.conversationWithParticipants;
173
+ }
161
174
  /**
162
175
  * Access the participantConversations.
163
176
  */
@@ -8,7 +8,7 @@ export type ConferenceConferenceEndReason = "last_participant_left" | "conferenc
8
8
  export type ConferenceConferenceStatus = "in_progress" | "not_started" | "completed" | "summary_timeout";
9
9
  export type ConferenceProcessingState = "complete" | "in_progress" | "timeout";
10
10
  export type ConferenceRegion = "us1" | "au1" | "br1" | "ie1" | "jp1" | "sg1" | "de1";
11
- export type ConferenceTag = "invalid_requested_region" | "duplicate_identity" | "start_failure" | "region_configuration_issues" | "quality_warnings" | "participant_behavior_issues" | "high_packet_loss" | "high_jitter" | "high_latency" | "low_mos" | "detected_silence";
11
+ export type ConferenceTag = "invalid_requested_region" | "duplicate_identity" | "start_failure" | "region_configuration_issues" | "quality_warnings" | "participant_behavior_issues" | "high_packet_loss" | "high_jitter" | "high_latency" | "low_mos" | "detected_silence" | "no_concurrent_participants";
12
12
  /**
13
13
  * Options to pass to each
14
14
  */
@@ -3,10 +3,10 @@ import { inspect, InspectOptions } from "util";
3
3
  import Page, { TwilioResponsePayload } from "../../../../base/Page";
4
4
  import Response from "../../../../http/response";
5
5
  import V1 from "../../V1";
6
- export type ParticipantCodec = "VP8" | "H264" | "VP9";
6
+ export type ParticipantCodec = "VP8" | "H264" | "VP9" | "opus";
7
7
  export type ParticipantEdgeLocation = "ashburn" | "dublin" | "frankfurt" | "singapore" | "sydney" | "sao_paulo" | "roaming" | "umatilla" | "tokyo";
8
8
  export type ParticipantRoomStatus = "in_progress" | "completed";
9
- export type ParticipantTwilioRealm = "us1" | "us2" | "au1" | "br1" | "ie1" | "jp1" | "sg1" | "in1" | "de1" | "gll";
9
+ export type ParticipantTwilioRealm = "us1" | "us2" | "au1" | "br1" | "ie1" | "jp1" | "sg1" | "in1" | "de1" | "gll" | "stage_us1" | "dev_us1";
10
10
  /**
11
11
  * Options to pass to each
12
12
  */
@@ -4,14 +4,14 @@ import Page, { TwilioResponsePayload } from "../../../base/Page";
4
4
  import Response from "../../../http/response";
5
5
  import V1 from "../V1";
6
6
  import { ParticipantListInstance } from "./room/participant";
7
- export type RoomCodec = "VP8" | "H264" | "VP9";
7
+ export type RoomCodec = "VP8" | "H264" | "VP9" | "opus";
8
8
  export type RoomCreatedMethod = "sdk" | "ad_hoc" | "api";
9
9
  export type RoomEdgeLocation = "ashburn" | "dublin" | "frankfurt" | "singapore" | "sydney" | "sao_paulo" | "roaming" | "umatilla" | "tokyo";
10
10
  export type RoomEndReason = "room_ended_via_api" | "timeout";
11
11
  export type RoomProcessingState = "complete" | "in_progress";
12
12
  export type RoomRoomStatus = "in_progress" | "completed";
13
13
  export type RoomRoomType = "go" | "peer_to_peer" | "group" | "group_small";
14
- export type RoomTwilioRealm = "us1" | "us2" | "au1" | "br1" | "ie1" | "jp1" | "sg1" | "in1" | "de1" | "gll";
14
+ export type RoomTwilioRealm = "us1" | "us2" | "au1" | "br1" | "ie1" | "jp1" | "sg1" | "in1" | "de1" | "gll" | "stage_us1" | "dev_us1";
15
15
  /**
16
16
  * Options to pass to each
17
17
  */
@@ -7,11 +7,16 @@ export declare class CreateReferralConversionRequest {
7
7
  /**
8
8
  * Options to pass to create a ReferralConversionInstance
9
9
  */
10
- export interface ReferralConversionContextCreateOptions {
10
+ export interface ReferralConversionListInstanceCreateOptions {
11
11
  /** */
12
12
  createReferralConversionRequest: CreateReferralConversionRequest;
13
13
  }
14
- export interface ReferralConversionContext {
14
+ export interface ReferralConversionSolution {
15
+ }
16
+ export interface ReferralConversionListInstance {
17
+ _version: V1;
18
+ _solution: ReferralConversionSolution;
19
+ _uri: string;
15
20
  /**
16
21
  * Create a ReferralConversionInstance
17
22
  *
@@ -27,41 +32,14 @@ export interface ReferralConversionContext {
27
32
  toJSON(): any;
28
33
  [inspect.custom](_depth: any, options: InspectOptions): any;
29
34
  }
30
- export interface ReferralConversionContextSolution {
31
- }
32
- export declare class ReferralConversionContextImpl implements ReferralConversionContext {
33
- protected _version: V1;
34
- protected _solution: ReferralConversionContextSolution;
35
- protected _uri: string;
36
- constructor(_version: V1);
37
- create(params: CreateReferralConversionRequest, callback?: (error: Error | null, item?: ReferralConversionInstance) => any): Promise<ReferralConversionInstance>;
38
- /**
39
- * Provide a user-friendly representation
40
- *
41
- * @returns Object
42
- */
43
- toJSON(): ReferralConversionContextSolution;
44
- [inspect.custom](_depth: any, options: InspectOptions): string;
45
- }
35
+ export declare function ReferralConversionListInstance(version: V1): ReferralConversionListInstance;
46
36
  interface ReferralConversionResource {
47
37
  converted_account_sid: string;
48
38
  }
49
39
  export declare class ReferralConversionInstance {
50
40
  protected _version: V1;
51
- protected _solution: ReferralConversionContextSolution;
52
- protected _context?: ReferralConversionContext;
53
41
  constructor(_version: V1, payload: ReferralConversionResource);
54
42
  convertedAccountSid: string;
55
- private get _proxy();
56
- /**
57
- * Create a ReferralConversionInstance
58
- *
59
- * @param params - Body for request
60
- * @param callback - Callback to handle processed record
61
- *
62
- * @returns Resolves to processed ReferralConversionInstance
63
- */
64
- create(params: CreateReferralConversionRequest, callback?: (error: Error | null, item?: ReferralConversionInstance) => any): Promise<ReferralConversionInstance>;
65
43
  /**
66
44
  * Provide a user-friendly representation
67
45
  *
@@ -72,19 +50,4 @@ export declare class ReferralConversionInstance {
72
50
  };
73
51
  [inspect.custom](_depth: any, options: InspectOptions): string;
74
52
  }
75
- export interface ReferralConversionSolution {
76
- }
77
- export interface ReferralConversionListInstance {
78
- _version: V1;
79
- _solution: ReferralConversionSolution;
80
- _uri: string;
81
- (): ReferralConversionContext;
82
- get(): ReferralConversionContext;
83
- /**
84
- * Provide a user-friendly representation
85
- */
86
- toJSON(): any;
87
- [inspect.custom](_depth: any, options: InspectOptions): any;
88
- }
89
- export declare function ReferralConversionListInstance(version: V1): ReferralConversionListInstance;
90
53
  export {};
@@ -13,20 +13,19 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ReferralConversionListInstance = exports.ReferralConversionInstance = exports.ReferralConversionContextImpl = exports.CreateReferralConversionRequest = void 0;
16
+ exports.ReferralConversionInstance = exports.ReferralConversionListInstance = exports.CreateReferralConversionRequest = void 0;
17
17
  const util_1 = require("util");
18
18
  const deserialize = require("../../../base/deserialize");
19
19
  const serialize = require("../../../base/serialize");
20
20
  class CreateReferralConversionRequest {
21
21
  }
22
22
  exports.CreateReferralConversionRequest = CreateReferralConversionRequest;
23
- class ReferralConversionContextImpl {
24
- constructor(_version) {
25
- this._version = _version;
26
- this._solution = {};
27
- this._uri = `/ReferralConversion`;
28
- }
29
- create(params, callback) {
23
+ function ReferralConversionListInstance(version) {
24
+ const instance = {};
25
+ instance._version = version;
26
+ instance._solution = {};
27
+ instance._uri = `/ReferralConversion`;
28
+ instance.create = function create(params, callback) {
30
29
  if (params === null || params === undefined) {
31
30
  throw new Error('Required parameter "params" missing.');
32
31
  }
@@ -34,8 +33,7 @@ class ReferralConversionContextImpl {
34
33
  data = params;
35
34
  const headers = {};
36
35
  headers["Content-Type"] = "application/json";
37
- const instance = this;
38
- let operationVersion = instance._version, operationPromise = operationVersion.create({
36
+ let operationVersion = version, operationPromise = operationVersion.create({
39
37
  uri: instance._uri,
40
38
  method: "post",
41
39
  data,
@@ -44,33 +42,20 @@ class ReferralConversionContextImpl {
44
42
  operationPromise = operationPromise.then((payload) => new ReferralConversionInstance(operationVersion, payload));
45
43
  operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
46
44
  return operationPromise;
47
- }
48
- /**
49
- * Provide a user-friendly representation
50
- *
51
- * @returns Object
52
- */
53
- toJSON() {
54
- return this._solution;
55
- }
56
- [util_1.inspect.custom](_depth, options) {
57
- return (0, util_1.inspect)(this.toJSON(), options);
58
- }
45
+ };
46
+ instance.toJSON = function toJSON() {
47
+ return instance._solution;
48
+ };
49
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
50
+ return (0, util_1.inspect)(instance.toJSON(), options);
51
+ };
52
+ return instance;
59
53
  }
60
- exports.ReferralConversionContextImpl = ReferralConversionContextImpl;
54
+ exports.ReferralConversionListInstance = ReferralConversionListInstance;
61
55
  class ReferralConversionInstance {
62
56
  constructor(_version, payload) {
63
57
  this._version = _version;
64
58
  this.convertedAccountSid = payload.converted_account_sid;
65
- this._solution = {};
66
- }
67
- get _proxy() {
68
- this._context =
69
- this._context || new ReferralConversionContextImpl(this._version);
70
- return this._context;
71
- }
72
- create(params, callback) {
73
- return this._proxy.create(params, callback);
74
59
  }
75
60
  /**
76
61
  * Provide a user-friendly representation
@@ -87,20 +72,3 @@ class ReferralConversionInstance {
87
72
  }
88
73
  }
89
74
  exports.ReferralConversionInstance = ReferralConversionInstance;
90
- function ReferralConversionListInstance(version) {
91
- const instance = (() => instance.get());
92
- instance.get = function get() {
93
- return new ReferralConversionContextImpl(version);
94
- };
95
- instance._version = version;
96
- instance._solution = {};
97
- instance._uri = ``;
98
- instance.toJSON = function toJSON() {
99
- return instance._solution;
100
- };
101
- instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
102
- return (0, util_1.inspect)(instance.toJSON(), options);
103
- };
104
- return instance;
105
- }
106
- exports.ReferralConversionListInstance = ReferralConversionListInstance;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "twilio",
3
3
  "description": "A Twilio helper library",
4
- "version": "5.3.4",
4
+ "version": "5.3.6",
5
5
  "author": "API Team <api@twilio.com>",
6
6
  "contributors": [
7
7
  {