twilio 5.3.3 → 5.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rest/conversations/V1.d.ts +5 -0
- package/lib/rest/conversations/V1.js +8 -0
- package/lib/rest/conversations/v1/conversationWithParticipants.d.ts +159 -0
- package/lib/rest/conversations/v1/conversationWithParticipants.js +126 -0
- package/lib/rest/conversations/v1/service/conversationWithParticipants.d.ts +160 -0
- package/lib/rest/conversations/v1/service/conversationWithParticipants.js +130 -0
- package/lib/rest/conversations/v1/service.d.ts +8 -0
- package/lib/rest/conversations/v1/service.js +13 -0
- package/lib/rest/marketplace/v1/referralConversion.d.ts +8 -45
- package/lib/rest/marketplace/v1/referralConversion.js +17 -49
- package/lib/rest/messaging/V1.d.ts +5 -0
- package/lib/rest/messaging/V1.js +7 -0
- package/lib/rest/messaging/v1/requestManagedCert.d.ts +127 -0
- package/lib/rest/messaging/v1/requestManagedCert.js +122 -0
- package/lib/rest/numbers/V1.d.ts +5 -5
- package/lib/rest/numbers/V1.js +8 -6
- package/lib/rest/numbers/v1/{webhook.d.ts → portingWebhookConfigurationFetch.d.ts} +10 -10
- package/lib/rest/numbers/v1/{webhook.js → portingWebhookConfigurationFetch.js} +6 -6
- package/lib/rest/video/v1/room.d.ts +14 -14
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import Version from "../../base/Version";
|
|
|
3
3
|
import { AddressConfigurationListInstance } from "./v1/addressConfiguration";
|
|
4
4
|
import { ConfigurationListInstance } from "./v1/configuration";
|
|
5
5
|
import { ConversationListInstance } from "./v1/conversation";
|
|
6
|
+
import { ConversationWithParticipantsListInstance } from "./v1/conversationWithParticipants";
|
|
6
7
|
import { CredentialListInstance } from "./v1/credential";
|
|
7
8
|
import { ParticipantConversationListInstance } from "./v1/participantConversation";
|
|
8
9
|
import { RoleListInstance } from "./v1/role";
|
|
@@ -21,6 +22,8 @@ export default class V1 extends Version {
|
|
|
21
22
|
protected _configuration?: ConfigurationListInstance;
|
|
22
23
|
/** conversations - { Twilio.Conversations.V1.ConversationListInstance } resource */
|
|
23
24
|
protected _conversations?: ConversationListInstance;
|
|
25
|
+
/** conversationWithParticipants - { Twilio.Conversations.V1.ConversationWithParticipantsListInstance } resource */
|
|
26
|
+
protected _conversationWithParticipants?: ConversationWithParticipantsListInstance;
|
|
24
27
|
/** credentials - { Twilio.Conversations.V1.CredentialListInstance } resource */
|
|
25
28
|
protected _credentials?: CredentialListInstance;
|
|
26
29
|
/** participantConversations - { Twilio.Conversations.V1.ParticipantConversationListInstance } resource */
|
|
@@ -37,6 +40,8 @@ export default class V1 extends Version {
|
|
|
37
40
|
get configuration(): ConfigurationListInstance;
|
|
38
41
|
/** Getter for conversations resource */
|
|
39
42
|
get conversations(): ConversationListInstance;
|
|
43
|
+
/** Getter for conversationWithParticipants resource */
|
|
44
|
+
get conversationWithParticipants(): ConversationWithParticipantsListInstance;
|
|
40
45
|
/** Getter for credentials resource */
|
|
41
46
|
get credentials(): CredentialListInstance;
|
|
42
47
|
/** Getter for participantConversations resource */
|
|
@@ -20,6 +20,7 @@ const Version_1 = __importDefault(require("../../base/Version"));
|
|
|
20
20
|
const addressConfiguration_1 = require("./v1/addressConfiguration");
|
|
21
21
|
const configuration_1 = require("./v1/configuration");
|
|
22
22
|
const conversation_1 = require("./v1/conversation");
|
|
23
|
+
const conversationWithParticipants_1 = require("./v1/conversationWithParticipants");
|
|
23
24
|
const credential_1 = require("./v1/credential");
|
|
24
25
|
const participantConversation_1 = require("./v1/participantConversation");
|
|
25
26
|
const role_1 = require("./v1/role");
|
|
@@ -51,6 +52,13 @@ class V1 extends Version_1.default {
|
|
|
51
52
|
this._conversations = this._conversations || (0, conversation_1.ConversationListInstance)(this);
|
|
52
53
|
return this._conversations;
|
|
53
54
|
}
|
|
55
|
+
/** Getter for conversationWithParticipants resource */
|
|
56
|
+
get conversationWithParticipants() {
|
|
57
|
+
this._conversationWithParticipants =
|
|
58
|
+
this._conversationWithParticipants ||
|
|
59
|
+
(0, conversationWithParticipants_1.ConversationWithParticipantsListInstance)(this);
|
|
60
|
+
return this._conversationWithParticipants;
|
|
61
|
+
}
|
|
54
62
|
/** Getter for credentials resource */
|
|
55
63
|
get credentials() {
|
|
56
64
|
this._credentials = this._credentials || (0, credential_1.CredentialListInstance)(this);
|
|
@@ -0,0 +1,159 @@
|
|
|
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 parameters are as 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
|
+
}
|
|
39
|
+
export interface ConversationWithParticipantsListInstance {
|
|
40
|
+
_version: V1;
|
|
41
|
+
_solution: ConversationWithParticipantsSolution;
|
|
42
|
+
_uri: string;
|
|
43
|
+
/**
|
|
44
|
+
* Create a ConversationWithParticipantsInstance
|
|
45
|
+
*
|
|
46
|
+
* @param callback - Callback to handle processed record
|
|
47
|
+
*
|
|
48
|
+
* @returns Resolves to processed ConversationWithParticipantsInstance
|
|
49
|
+
*/
|
|
50
|
+
create(callback?: (error: Error | null, item?: ConversationWithParticipantsInstance) => any): Promise<ConversationWithParticipantsInstance>;
|
|
51
|
+
/**
|
|
52
|
+
* Create a ConversationWithParticipantsInstance
|
|
53
|
+
*
|
|
54
|
+
* @param params - Parameter for request
|
|
55
|
+
* @param callback - Callback to handle processed record
|
|
56
|
+
*
|
|
57
|
+
* @returns Resolves to processed ConversationWithParticipantsInstance
|
|
58
|
+
*/
|
|
59
|
+
create(params: ConversationWithParticipantsListInstanceCreateOptions, callback?: (error: Error | null, item?: ConversationWithParticipantsInstance) => any): Promise<ConversationWithParticipantsInstance>;
|
|
60
|
+
/**
|
|
61
|
+
* Provide a user-friendly representation
|
|
62
|
+
*/
|
|
63
|
+
toJSON(): any;
|
|
64
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
65
|
+
}
|
|
66
|
+
export declare function ConversationWithParticipantsListInstance(version: V1): ConversationWithParticipantsListInstance;
|
|
67
|
+
interface ConversationWithParticipantsResource {
|
|
68
|
+
account_sid: string;
|
|
69
|
+
chat_service_sid: string;
|
|
70
|
+
messaging_service_sid: string;
|
|
71
|
+
sid: string;
|
|
72
|
+
friendly_name: string;
|
|
73
|
+
unique_name: string;
|
|
74
|
+
attributes: string;
|
|
75
|
+
state: ConversationWithParticipantsState;
|
|
76
|
+
date_created: Date;
|
|
77
|
+
date_updated: Date;
|
|
78
|
+
timers: any;
|
|
79
|
+
links: Record<string, string>;
|
|
80
|
+
bindings: any;
|
|
81
|
+
url: string;
|
|
82
|
+
}
|
|
83
|
+
export declare class ConversationWithParticipantsInstance {
|
|
84
|
+
protected _version: V1;
|
|
85
|
+
constructor(_version: V1, payload: ConversationWithParticipantsResource);
|
|
86
|
+
/**
|
|
87
|
+
* The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation.
|
|
88
|
+
*/
|
|
89
|
+
accountSid: string;
|
|
90
|
+
/**
|
|
91
|
+
* The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to.
|
|
92
|
+
*/
|
|
93
|
+
chatServiceSid: string;
|
|
94
|
+
/**
|
|
95
|
+
* The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to.
|
|
96
|
+
*/
|
|
97
|
+
messagingServiceSid: string;
|
|
98
|
+
/**
|
|
99
|
+
* A 34 character string that uniquely identifies this resource.
|
|
100
|
+
*/
|
|
101
|
+
sid: string;
|
|
102
|
+
/**
|
|
103
|
+
* The human-readable name of this conversation, limited to 256 characters. Optional.
|
|
104
|
+
*/
|
|
105
|
+
friendlyName: string;
|
|
106
|
+
/**
|
|
107
|
+
* 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.
|
|
108
|
+
*/
|
|
109
|
+
uniqueName: string;
|
|
110
|
+
/**
|
|
111
|
+
* 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.
|
|
112
|
+
*/
|
|
113
|
+
attributes: string;
|
|
114
|
+
state: ConversationWithParticipantsState;
|
|
115
|
+
/**
|
|
116
|
+
* The date that this resource was created.
|
|
117
|
+
*/
|
|
118
|
+
dateCreated: Date;
|
|
119
|
+
/**
|
|
120
|
+
* The date that this resource was last updated.
|
|
121
|
+
*/
|
|
122
|
+
dateUpdated: Date;
|
|
123
|
+
/**
|
|
124
|
+
* Timer date values representing state update for this conversation.
|
|
125
|
+
*/
|
|
126
|
+
timers: any;
|
|
127
|
+
/**
|
|
128
|
+
* 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.
|
|
129
|
+
*/
|
|
130
|
+
links: Record<string, string>;
|
|
131
|
+
bindings: any;
|
|
132
|
+
/**
|
|
133
|
+
* An absolute API resource URL for this conversation.
|
|
134
|
+
*/
|
|
135
|
+
url: string;
|
|
136
|
+
/**
|
|
137
|
+
* Provide a user-friendly representation
|
|
138
|
+
*
|
|
139
|
+
* @returns Object
|
|
140
|
+
*/
|
|
141
|
+
toJSON(): {
|
|
142
|
+
accountSid: string;
|
|
143
|
+
chatServiceSid: string;
|
|
144
|
+
messagingServiceSid: string;
|
|
145
|
+
sid: string;
|
|
146
|
+
friendlyName: string;
|
|
147
|
+
uniqueName: string;
|
|
148
|
+
attributes: string;
|
|
149
|
+
state: ConversationWithParticipantsState;
|
|
150
|
+
dateCreated: Date;
|
|
151
|
+
dateUpdated: Date;
|
|
152
|
+
timers: any;
|
|
153
|
+
links: Record<string, string>;
|
|
154
|
+
bindings: any;
|
|
155
|
+
url: string;
|
|
156
|
+
};
|
|
157
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
158
|
+
}
|
|
159
|
+
export {};
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
function ConversationWithParticipantsListInstance(version) {
|
|
21
|
+
const instance = {};
|
|
22
|
+
instance._version = version;
|
|
23
|
+
instance._solution = {};
|
|
24
|
+
instance._uri = `/ConversationWithParticipants`;
|
|
25
|
+
instance.create = function create(params, callback) {
|
|
26
|
+
if (params instanceof Function) {
|
|
27
|
+
callback = params;
|
|
28
|
+
params = {};
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
params = params || {};
|
|
32
|
+
}
|
|
33
|
+
let data = {};
|
|
34
|
+
if (params["friendlyName"] !== undefined)
|
|
35
|
+
data["FriendlyName"] = params["friendlyName"];
|
|
36
|
+
if (params["uniqueName"] !== undefined)
|
|
37
|
+
data["UniqueName"] = params["uniqueName"];
|
|
38
|
+
if (params["dateCreated"] !== undefined)
|
|
39
|
+
data["DateCreated"] = serialize.iso8601DateTime(params["dateCreated"]);
|
|
40
|
+
if (params["dateUpdated"] !== undefined)
|
|
41
|
+
data["DateUpdated"] = serialize.iso8601DateTime(params["dateUpdated"]);
|
|
42
|
+
if (params["messagingServiceSid"] !== undefined)
|
|
43
|
+
data["MessagingServiceSid"] = params["messagingServiceSid"];
|
|
44
|
+
if (params["attributes"] !== undefined)
|
|
45
|
+
data["Attributes"] = params["attributes"];
|
|
46
|
+
if (params["state"] !== undefined)
|
|
47
|
+
data["State"] = params["state"];
|
|
48
|
+
if (params["timers.inactive"] !== undefined)
|
|
49
|
+
data["Timers.Inactive"] = params["timers.inactive"];
|
|
50
|
+
if (params["timers.closed"] !== undefined)
|
|
51
|
+
data["Timers.Closed"] = params["timers.closed"];
|
|
52
|
+
if (params["bindings.email.address"] !== undefined)
|
|
53
|
+
data["Bindings.Email.Address"] = params["bindings.email.address"];
|
|
54
|
+
if (params["bindings.email.name"] !== undefined)
|
|
55
|
+
data["Bindings.Email.Name"] = params["bindings.email.name"];
|
|
56
|
+
if (params["participant"] !== undefined)
|
|
57
|
+
data["Participant"] = serialize.map(params["participant"], (e) => e);
|
|
58
|
+
const headers = {};
|
|
59
|
+
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
60
|
+
if (params["xTwilioWebhookEnabled"] !== undefined)
|
|
61
|
+
headers["X-Twilio-Webhook-Enabled"] = params["xTwilioWebhookEnabled"];
|
|
62
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
63
|
+
uri: instance._uri,
|
|
64
|
+
method: "post",
|
|
65
|
+
data,
|
|
66
|
+
headers,
|
|
67
|
+
});
|
|
68
|
+
operationPromise = operationPromise.then((payload) => new ConversationWithParticipantsInstance(operationVersion, payload));
|
|
69
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
70
|
+
return operationPromise;
|
|
71
|
+
};
|
|
72
|
+
instance.toJSON = function toJSON() {
|
|
73
|
+
return instance._solution;
|
|
74
|
+
};
|
|
75
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
76
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
77
|
+
};
|
|
78
|
+
return instance;
|
|
79
|
+
}
|
|
80
|
+
exports.ConversationWithParticipantsListInstance = ConversationWithParticipantsListInstance;
|
|
81
|
+
class ConversationWithParticipantsInstance {
|
|
82
|
+
constructor(_version, payload) {
|
|
83
|
+
this._version = _version;
|
|
84
|
+
this.accountSid = payload.account_sid;
|
|
85
|
+
this.chatServiceSid = payload.chat_service_sid;
|
|
86
|
+
this.messagingServiceSid = payload.messaging_service_sid;
|
|
87
|
+
this.sid = payload.sid;
|
|
88
|
+
this.friendlyName = payload.friendly_name;
|
|
89
|
+
this.uniqueName = payload.unique_name;
|
|
90
|
+
this.attributes = payload.attributes;
|
|
91
|
+
this.state = payload.state;
|
|
92
|
+
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
93
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
94
|
+
this.timers = payload.timers;
|
|
95
|
+
this.links = payload.links;
|
|
96
|
+
this.bindings = payload.bindings;
|
|
97
|
+
this.url = payload.url;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Provide a user-friendly representation
|
|
101
|
+
*
|
|
102
|
+
* @returns Object
|
|
103
|
+
*/
|
|
104
|
+
toJSON() {
|
|
105
|
+
return {
|
|
106
|
+
accountSid: this.accountSid,
|
|
107
|
+
chatServiceSid: this.chatServiceSid,
|
|
108
|
+
messagingServiceSid: this.messagingServiceSid,
|
|
109
|
+
sid: this.sid,
|
|
110
|
+
friendlyName: this.friendlyName,
|
|
111
|
+
uniqueName: this.uniqueName,
|
|
112
|
+
attributes: this.attributes,
|
|
113
|
+
state: this.state,
|
|
114
|
+
dateCreated: this.dateCreated,
|
|
115
|
+
dateUpdated: this.dateUpdated,
|
|
116
|
+
timers: this.timers,
|
|
117
|
+
links: this.links,
|
|
118
|
+
bindings: this.bindings,
|
|
119
|
+
url: this.url,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
[util_1.inspect.custom](_depth, options) {
|
|
123
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
exports.ConversationWithParticipantsInstance = ConversationWithParticipantsInstance;
|
|
@@ -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 parameters are as 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
|
*/
|