twilio 3.75.1 → 3.76.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.
- package/lib/rest/Chat.d.ts +4 -0
- package/lib/rest/Chat.js +19 -0
- package/lib/rest/FlexApi.d.ts +2 -0
- package/lib/rest/FlexApi.js +8 -0
- package/lib/rest/Insights.d.ts +2 -0
- package/lib/rest/Insights.js +8 -0
- package/lib/rest/Supersim.d.ts +0 -2
- package/lib/rest/Supersim.js +0 -8
- package/lib/rest/api/v2010/account/call/payment.d.ts +1 -1
- package/lib/rest/api/v2010/account/call/payment.js +1 -1
- package/lib/rest/api/v2010/account/call/stream.d.ts +2 -8
- package/lib/rest/api/v2010/account/call/stream.js +8 -7
- package/lib/rest/api/v2010/account/usage/record/allTime.d.ts +1 -1
- package/lib/rest/api/v2010/account/usage/record/daily.d.ts +1 -1
- package/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts +1 -1
- package/lib/rest/api/v2010/account/usage/record/monthly.d.ts +1 -1
- package/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts +1 -1
- package/lib/rest/api/v2010/account/usage/record/today.d.ts +1 -1
- package/lib/rest/api/v2010/account/usage/record/yearly.d.ts +1 -1
- package/lib/rest/api/v2010/account/usage/record/yesterday.d.ts +1 -1
- package/lib/rest/api/v2010/account/usage/record.d.ts +1 -1
- package/lib/rest/api/v2010/account/usage/trigger.d.ts +1 -1
- package/lib/rest/chat/V3.d.ts +25 -0
- package/lib/rest/chat/V3.js +46 -0
- package/lib/rest/chat/v3/channel.d.ts +177 -0
- package/lib/rest/chat/v3/channel.js +373 -0
- package/lib/rest/flexApi/V1.d.ts +3 -0
- package/lib/rest/flexApi/V1.js +11 -0
- package/lib/rest/flexApi/v1/configuration.d.ts +2 -0
- package/lib/rest/flexApi/v1/configuration.js +3 -0
- package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.d.ts +266 -0
- package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelInvite.js +505 -0
- package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.d.ts +323 -0
- package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.js +674 -0
- package/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts +327 -0
- package/lib/rest/flexApi/v1/interaction/interactionChannel.js +718 -0
- package/lib/rest/flexApi/v1/interaction.d.ts +152 -0
- package/lib/rest/flexApi/v1/interaction.js +395 -0
- package/lib/rest/insights/V1.d.ts +3 -0
- package/lib/rest/insights/V1.js +11 -0
- package/lib/rest/insights/v1/annotation.d.ts +188 -0
- package/lib/rest/insights/v1/annotation.js +406 -0
- package/lib/rest/media/v1/mediaProcessor.js +1 -1
- package/lib/rest/media/v1/mediaRecording.d.ts +12 -0
- package/lib/rest/media/v1/mediaRecording.js +8 -0
- package/lib/rest/media/v1/playerStreamer.d.ts +4 -0
- package/lib/rest/media/v1/playerStreamer.js +5 -1
- package/lib/rest/supersim/V1.d.ts +0 -3
- package/lib/rest/supersim/V1.js +0 -11
- package/lib/rest/supersim/v1/fleet.d.ts +0 -16
- package/lib/rest/supersim/v1/fleet.js +0 -18
- package/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.d.ts +1 -1
- package/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.js +2 -2
- package/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.d.ts +1 -1
- package/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.js +2 -2
- package/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.d.ts +1 -1
- package/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.js +2 -2
- package/lib/rest/video/v1/composition.d.ts +4 -0
- package/lib/rest/video/v1/composition.js +6 -0
- package/lib/rest/video/v1/recording.d.ts +4 -0
- package/lib/rest/video/v1/recording.js +6 -0
- package/package.json +3 -3
- package/lib/rest/supersim/v1/command.d.ts +0 -342
- package/lib/rest/supersim/v1/command.js +0 -652
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by
|
|
3
|
+
* \ / _ _ _| _ _
|
|
4
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
* / /
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import Page = require('../../../base/Page');
|
|
9
|
+
import Response = require('../../../http/response');
|
|
10
|
+
import V1 = require('../V1');
|
|
11
|
+
import { SerializableClass } from '../../../interfaces';
|
|
12
|
+
|
|
13
|
+
type AnnotationAnsweredBy = 'unknown_answered_by'|'human'|'machine';
|
|
14
|
+
|
|
15
|
+
type AnnotationConnectivityIssue = 'unknown_connectivity_issue'|'no_connectivity_issue'|'invalid_number'|'caller_id'|'dropped_call'|'number_reachability';
|
|
16
|
+
|
|
17
|
+
type AnnotationQualityIssues = 'unknown_quality_issue'|'no_quality_issue'|'low_volume'|'choppy_robotic'|'echo'|'dtmf'|'latency'|'owa'|'static_noise';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Initialize the AnnotationList
|
|
21
|
+
*
|
|
22
|
+
* @param version - Version of the resource
|
|
23
|
+
*/
|
|
24
|
+
declare function AnnotationList(version: V1): AnnotationListInstance;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Options to pass to update
|
|
28
|
+
*
|
|
29
|
+
* @property answeredBy - The answered_by
|
|
30
|
+
* @property callScore - The call_score
|
|
31
|
+
* @property comment - The comment
|
|
32
|
+
* @property connectivityIssue - The connectivity_issue
|
|
33
|
+
* @property incident - The incident
|
|
34
|
+
* @property qualityIssues - The quality_issues
|
|
35
|
+
* @property spam - The spam
|
|
36
|
+
*/
|
|
37
|
+
interface AnnotationInstanceUpdateOptions {
|
|
38
|
+
answeredBy?: AnnotationAnsweredBy;
|
|
39
|
+
callScore?: number;
|
|
40
|
+
comment?: string;
|
|
41
|
+
connectivityIssue?: AnnotationConnectivityIssue;
|
|
42
|
+
incident?: string;
|
|
43
|
+
qualityIssues?: string;
|
|
44
|
+
spam?: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface AnnotationListInstance {
|
|
48
|
+
/**
|
|
49
|
+
* @param sid - sid of instance
|
|
50
|
+
*/
|
|
51
|
+
(sid: string): AnnotationContext;
|
|
52
|
+
/**
|
|
53
|
+
* Constructs a annotation
|
|
54
|
+
*
|
|
55
|
+
* @param callSid - The call_sid
|
|
56
|
+
*/
|
|
57
|
+
get(callSid: string): AnnotationContext;
|
|
58
|
+
/**
|
|
59
|
+
* Provide a user-friendly representation
|
|
60
|
+
*/
|
|
61
|
+
toJSON(): any;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface AnnotationPayload extends AnnotationResource, Page.TwilioResponsePayload {
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface AnnotationResource {
|
|
68
|
+
account_sid: string;
|
|
69
|
+
answered_by: AnnotationAnsweredBy;
|
|
70
|
+
call_score: number;
|
|
71
|
+
call_sid: string;
|
|
72
|
+
comment: string;
|
|
73
|
+
connectivity_issue: AnnotationConnectivityIssue;
|
|
74
|
+
incident: string;
|
|
75
|
+
quality_issues: string[];
|
|
76
|
+
spam: boolean;
|
|
77
|
+
url: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
interface AnnotationSolution {
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
declare class AnnotationContext {
|
|
85
|
+
/**
|
|
86
|
+
* Initialize the AnnotationContext
|
|
87
|
+
*
|
|
88
|
+
* @param version - Version of the resource
|
|
89
|
+
* @param callSid - The call_sid
|
|
90
|
+
*/
|
|
91
|
+
constructor(version: V1, callSid: string);
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* fetch a AnnotationInstance
|
|
95
|
+
*
|
|
96
|
+
* @param callback - Callback to handle processed record
|
|
97
|
+
*/
|
|
98
|
+
fetch(callback?: (error: Error | null, items: AnnotationInstance) => any): Promise<AnnotationInstance>;
|
|
99
|
+
/**
|
|
100
|
+
* Provide a user-friendly representation
|
|
101
|
+
*/
|
|
102
|
+
toJSON(): any;
|
|
103
|
+
/**
|
|
104
|
+
* update a AnnotationInstance
|
|
105
|
+
*
|
|
106
|
+
* @param callback - Callback to handle processed record
|
|
107
|
+
*/
|
|
108
|
+
update(callback?: (error: Error | null, items: AnnotationInstance) => any): Promise<AnnotationInstance>;
|
|
109
|
+
/**
|
|
110
|
+
* update a AnnotationInstance
|
|
111
|
+
*
|
|
112
|
+
* @param opts - Options for request
|
|
113
|
+
* @param callback - Callback to handle processed record
|
|
114
|
+
*/
|
|
115
|
+
update(opts?: AnnotationInstanceUpdateOptions, callback?: (error: Error | null, items: AnnotationInstance) => any): Promise<AnnotationInstance>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
declare class AnnotationInstance extends SerializableClass {
|
|
120
|
+
/**
|
|
121
|
+
* Initialize the AnnotationContext
|
|
122
|
+
*
|
|
123
|
+
* @param version - Version of the resource
|
|
124
|
+
* @param payload - The instance payload
|
|
125
|
+
* @param callSid - The call_sid
|
|
126
|
+
*/
|
|
127
|
+
constructor(version: V1, payload: AnnotationPayload, callSid: string);
|
|
128
|
+
|
|
129
|
+
private _proxy: AnnotationContext;
|
|
130
|
+
accountSid: string;
|
|
131
|
+
answeredBy: AnnotationAnsweredBy;
|
|
132
|
+
callScore: number;
|
|
133
|
+
callSid: string;
|
|
134
|
+
comment: string;
|
|
135
|
+
connectivityIssue: AnnotationConnectivityIssue;
|
|
136
|
+
/**
|
|
137
|
+
* fetch a AnnotationInstance
|
|
138
|
+
*
|
|
139
|
+
* @param callback - Callback to handle processed record
|
|
140
|
+
*/
|
|
141
|
+
fetch(callback?: (error: Error | null, items: AnnotationInstance) => any): Promise<AnnotationInstance>;
|
|
142
|
+
incident: string;
|
|
143
|
+
qualityIssues: string[];
|
|
144
|
+
spam: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Provide a user-friendly representation
|
|
147
|
+
*/
|
|
148
|
+
toJSON(): any;
|
|
149
|
+
/**
|
|
150
|
+
* update a AnnotationInstance
|
|
151
|
+
*
|
|
152
|
+
* @param callback - Callback to handle processed record
|
|
153
|
+
*/
|
|
154
|
+
update(callback?: (error: Error | null, items: AnnotationInstance) => any): Promise<AnnotationInstance>;
|
|
155
|
+
/**
|
|
156
|
+
* update a AnnotationInstance
|
|
157
|
+
*
|
|
158
|
+
* @param opts - Options for request
|
|
159
|
+
* @param callback - Callback to handle processed record
|
|
160
|
+
*/
|
|
161
|
+
update(opts?: AnnotationInstanceUpdateOptions, callback?: (error: Error | null, items: AnnotationInstance) => any): Promise<AnnotationInstance>;
|
|
162
|
+
url: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
declare class AnnotationPage extends Page<V1, AnnotationPayload, AnnotationResource, AnnotationInstance> {
|
|
167
|
+
/**
|
|
168
|
+
* Initialize the AnnotationPage
|
|
169
|
+
*
|
|
170
|
+
* @param version - Version of the resource
|
|
171
|
+
* @param response - Response from the API
|
|
172
|
+
* @param solution - Path solution
|
|
173
|
+
*/
|
|
174
|
+
constructor(version: V1, response: Response<string>, solution: AnnotationSolution);
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Build an instance of AnnotationInstance
|
|
178
|
+
*
|
|
179
|
+
* @param payload - Payload response from the API
|
|
180
|
+
*/
|
|
181
|
+
getInstance(payload: AnnotationPayload): AnnotationInstance;
|
|
182
|
+
/**
|
|
183
|
+
* Provide a user-friendly representation
|
|
184
|
+
*/
|
|
185
|
+
toJSON(): any;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { AnnotationAnsweredBy, AnnotationConnectivityIssue, AnnotationContext, AnnotationInstance, AnnotationInstanceUpdateOptions, AnnotationList, AnnotationListInstance, AnnotationPage, AnnotationPayload, AnnotationQualityIssues, AnnotationResource, AnnotationSolution }
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* jshint ignore:start */
|
|
4
|
+
/**
|
|
5
|
+
* This code was generated by
|
|
6
|
+
* \ / _ _ _| _ _
|
|
7
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
8
|
+
* / /
|
|
9
|
+
*/
|
|
10
|
+
/* jshint ignore:end */
|
|
11
|
+
|
|
12
|
+
var Q = require('q'); /* jshint ignore:line */
|
|
13
|
+
var _ = require('lodash'); /* jshint ignore:line */
|
|
14
|
+
var util = require('util'); /* jshint ignore:line */
|
|
15
|
+
var Page = require('../../../base/Page'); /* jshint ignore:line */
|
|
16
|
+
var deserialize = require(
|
|
17
|
+
'../../../base/deserialize'); /* jshint ignore:line */
|
|
18
|
+
var serialize = require('../../../base/serialize'); /* jshint ignore:line */
|
|
19
|
+
var values = require('../../../base/values'); /* jshint ignore:line */
|
|
20
|
+
|
|
21
|
+
var AnnotationList;
|
|
22
|
+
var AnnotationPage;
|
|
23
|
+
var AnnotationInstance;
|
|
24
|
+
var AnnotationContext;
|
|
25
|
+
|
|
26
|
+
/* jshint ignore:start */
|
|
27
|
+
/**
|
|
28
|
+
* Initialize the AnnotationList
|
|
29
|
+
*
|
|
30
|
+
* @constructor Twilio.Insights.V1.AnnotationList
|
|
31
|
+
*
|
|
32
|
+
* @param {Twilio.Insights.V1} version - Version of the resource
|
|
33
|
+
*/
|
|
34
|
+
/* jshint ignore:end */
|
|
35
|
+
AnnotationList = function AnnotationList(version) {
|
|
36
|
+
/* jshint ignore:start */
|
|
37
|
+
/**
|
|
38
|
+
* @function annotation
|
|
39
|
+
* @memberof Twilio.Insights.V1#
|
|
40
|
+
*
|
|
41
|
+
* @param {string} sid - sid of instance
|
|
42
|
+
*
|
|
43
|
+
* @returns {Twilio.Insights.V1.AnnotationContext}
|
|
44
|
+
*/
|
|
45
|
+
/* jshint ignore:end */
|
|
46
|
+
function AnnotationListInstance(sid) {
|
|
47
|
+
return AnnotationListInstance.get(sid);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
AnnotationListInstance._version = version;
|
|
51
|
+
// Path Solution
|
|
52
|
+
AnnotationListInstance._solution = {};
|
|
53
|
+
/* jshint ignore:start */
|
|
54
|
+
/**
|
|
55
|
+
* Constructs a annotation
|
|
56
|
+
*
|
|
57
|
+
* @function get
|
|
58
|
+
* @memberof Twilio.Insights.V1.AnnotationList#
|
|
59
|
+
*
|
|
60
|
+
* @param {string} callSid - The call_sid
|
|
61
|
+
*
|
|
62
|
+
* @returns {Twilio.Insights.V1.AnnotationContext}
|
|
63
|
+
*/
|
|
64
|
+
/* jshint ignore:end */
|
|
65
|
+
AnnotationListInstance.get = function get(callSid) {
|
|
66
|
+
return new AnnotationContext(this._version, callSid);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/* jshint ignore:start */
|
|
70
|
+
/**
|
|
71
|
+
* Provide a user-friendly representation
|
|
72
|
+
*
|
|
73
|
+
* @function toJSON
|
|
74
|
+
* @memberof Twilio.Insights.V1.AnnotationList#
|
|
75
|
+
*
|
|
76
|
+
* @returns Object
|
|
77
|
+
*/
|
|
78
|
+
/* jshint ignore:end */
|
|
79
|
+
AnnotationListInstance.toJSON = function toJSON() {
|
|
80
|
+
return this._solution;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
AnnotationListInstance[util.inspect.custom] = function inspect(depth, options) {
|
|
84
|
+
return util.inspect(this.toJSON(), options);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return AnnotationListInstance;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
/* jshint ignore:start */
|
|
92
|
+
/**
|
|
93
|
+
* Initialize the AnnotationPage
|
|
94
|
+
*
|
|
95
|
+
* @constructor Twilio.Insights.V1.AnnotationPage
|
|
96
|
+
*
|
|
97
|
+
* @param {V1} version - Version of the resource
|
|
98
|
+
* @param {Response<string>} response - Response from the API
|
|
99
|
+
* @param {AnnotationSolution} solution - Path solution
|
|
100
|
+
*
|
|
101
|
+
* @returns AnnotationPage
|
|
102
|
+
*/
|
|
103
|
+
/* jshint ignore:end */
|
|
104
|
+
AnnotationPage = function AnnotationPage(version, response, solution) {
|
|
105
|
+
// Path Solution
|
|
106
|
+
this._solution = solution;
|
|
107
|
+
|
|
108
|
+
Page.prototype.constructor.call(this, version, response, this._solution);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
_.extend(AnnotationPage.prototype, Page.prototype);
|
|
112
|
+
AnnotationPage.prototype.constructor = AnnotationPage;
|
|
113
|
+
|
|
114
|
+
/* jshint ignore:start */
|
|
115
|
+
/**
|
|
116
|
+
* Build an instance of AnnotationInstance
|
|
117
|
+
*
|
|
118
|
+
* @function getInstance
|
|
119
|
+
* @memberof Twilio.Insights.V1.AnnotationPage#
|
|
120
|
+
*
|
|
121
|
+
* @param {AnnotationPayload} payload - Payload response from the API
|
|
122
|
+
*
|
|
123
|
+
* @returns AnnotationInstance
|
|
124
|
+
*/
|
|
125
|
+
/* jshint ignore:end */
|
|
126
|
+
AnnotationPage.prototype.getInstance = function getInstance(payload) {
|
|
127
|
+
return new AnnotationInstance(this._version, payload);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/* jshint ignore:start */
|
|
131
|
+
/**
|
|
132
|
+
* Provide a user-friendly representation
|
|
133
|
+
*
|
|
134
|
+
* @function toJSON
|
|
135
|
+
* @memberof Twilio.Insights.V1.AnnotationPage#
|
|
136
|
+
*
|
|
137
|
+
* @returns Object
|
|
138
|
+
*/
|
|
139
|
+
/* jshint ignore:end */
|
|
140
|
+
AnnotationPage.prototype.toJSON = function toJSON() {
|
|
141
|
+
let clone = {};
|
|
142
|
+
_.forOwn(this, function(value, key) {
|
|
143
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
144
|
+
clone[key] = value;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
return clone;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
AnnotationPage.prototype[util.inspect.custom] = function inspect(depth, options)
|
|
151
|
+
{
|
|
152
|
+
return util.inspect(this.toJSON(), options);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
/* jshint ignore:start */
|
|
157
|
+
/**
|
|
158
|
+
* Initialize the AnnotationContext
|
|
159
|
+
*
|
|
160
|
+
* @constructor Twilio.Insights.V1.AnnotationInstance
|
|
161
|
+
*
|
|
162
|
+
* @property {string} callSid - The call_sid
|
|
163
|
+
* @property {string} accountSid - The account_sid
|
|
164
|
+
* @property {annotation.answered_by} answeredBy - The answered_by
|
|
165
|
+
* @property {annotation.connectivity_issue} connectivityIssue -
|
|
166
|
+
* The connectivity_issue
|
|
167
|
+
* @property {string} qualityIssues - The quality_issues
|
|
168
|
+
* @property {boolean} spam - The spam
|
|
169
|
+
* @property {number} callScore - The call_score
|
|
170
|
+
* @property {string} comment - The comment
|
|
171
|
+
* @property {string} incident - The incident
|
|
172
|
+
* @property {string} url - The url
|
|
173
|
+
*
|
|
174
|
+
* @param {V1} version - Version of the resource
|
|
175
|
+
* @param {AnnotationPayload} payload - The instance payload
|
|
176
|
+
* @param {sid} callSid - The call_sid
|
|
177
|
+
*/
|
|
178
|
+
/* jshint ignore:end */
|
|
179
|
+
AnnotationInstance = function AnnotationInstance(version, payload, callSid) {
|
|
180
|
+
this._version = version;
|
|
181
|
+
|
|
182
|
+
// Marshaled Properties
|
|
183
|
+
this.callSid = payload.call_sid; // jshint ignore:line
|
|
184
|
+
this.accountSid = payload.account_sid; // jshint ignore:line
|
|
185
|
+
this.answeredBy = payload.answered_by; // jshint ignore:line
|
|
186
|
+
this.connectivityIssue = payload.connectivity_issue; // jshint ignore:line
|
|
187
|
+
this.qualityIssues = payload.quality_issues; // jshint ignore:line
|
|
188
|
+
this.spam = payload.spam; // jshint ignore:line
|
|
189
|
+
this.callScore = deserialize.integer(payload.call_score); // jshint ignore:line
|
|
190
|
+
this.comment = payload.comment; // jshint ignore:line
|
|
191
|
+
this.incident = payload.incident; // jshint ignore:line
|
|
192
|
+
this.url = payload.url; // jshint ignore:line
|
|
193
|
+
|
|
194
|
+
// Context
|
|
195
|
+
this._context = undefined;
|
|
196
|
+
this._solution = {callSid: callSid || this.callSid, };
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
Object.defineProperty(AnnotationInstance.prototype,
|
|
200
|
+
'_proxy', {
|
|
201
|
+
get: function() {
|
|
202
|
+
if (!this._context) {
|
|
203
|
+
this._context = new AnnotationContext(this._version, this._solution.callSid);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return this._context;
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
/* jshint ignore:start */
|
|
211
|
+
/**
|
|
212
|
+
* update a AnnotationInstance
|
|
213
|
+
*
|
|
214
|
+
* @function update
|
|
215
|
+
* @memberof Twilio.Insights.V1.AnnotationInstance#
|
|
216
|
+
*
|
|
217
|
+
* @param {object} [opts] - Options for request
|
|
218
|
+
* @param {annotation.answered_by} [opts.answeredBy] - The answered_by
|
|
219
|
+
* @param {annotation.connectivity_issue} [opts.connectivityIssue] -
|
|
220
|
+
* The connectivity_issue
|
|
221
|
+
* @param {string} [opts.qualityIssues] - The quality_issues
|
|
222
|
+
* @param {boolean} [opts.spam] - The spam
|
|
223
|
+
* @param {number} [opts.callScore] - The call_score
|
|
224
|
+
* @param {string} [opts.comment] - The comment
|
|
225
|
+
* @param {string} [opts.incident] - The incident
|
|
226
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
227
|
+
*
|
|
228
|
+
* @returns {Promise} Resolves to processed AnnotationInstance
|
|
229
|
+
*/
|
|
230
|
+
/* jshint ignore:end */
|
|
231
|
+
AnnotationInstance.prototype.update = function update(opts, callback) {
|
|
232
|
+
return this._proxy.update(opts, callback);
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
/* jshint ignore:start */
|
|
236
|
+
/**
|
|
237
|
+
* fetch a AnnotationInstance
|
|
238
|
+
*
|
|
239
|
+
* @function fetch
|
|
240
|
+
* @memberof Twilio.Insights.V1.AnnotationInstance#
|
|
241
|
+
*
|
|
242
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
243
|
+
*
|
|
244
|
+
* @returns {Promise} Resolves to processed AnnotationInstance
|
|
245
|
+
*/
|
|
246
|
+
/* jshint ignore:end */
|
|
247
|
+
AnnotationInstance.prototype.fetch = function fetch(callback) {
|
|
248
|
+
return this._proxy.fetch(callback);
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
/* jshint ignore:start */
|
|
252
|
+
/**
|
|
253
|
+
* Provide a user-friendly representation
|
|
254
|
+
*
|
|
255
|
+
* @function toJSON
|
|
256
|
+
* @memberof Twilio.Insights.V1.AnnotationInstance#
|
|
257
|
+
*
|
|
258
|
+
* @returns Object
|
|
259
|
+
*/
|
|
260
|
+
/* jshint ignore:end */
|
|
261
|
+
AnnotationInstance.prototype.toJSON = function toJSON() {
|
|
262
|
+
let clone = {};
|
|
263
|
+
_.forOwn(this, function(value, key) {
|
|
264
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
265
|
+
clone[key] = value;
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
return clone;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
AnnotationInstance.prototype[util.inspect.custom] = function inspect(depth,
|
|
272
|
+
options) {
|
|
273
|
+
return util.inspect(this.toJSON(), options);
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
/* jshint ignore:start */
|
|
278
|
+
/**
|
|
279
|
+
* Initialize the AnnotationContext
|
|
280
|
+
*
|
|
281
|
+
* @constructor Twilio.Insights.V1.AnnotationContext
|
|
282
|
+
*
|
|
283
|
+
* @param {V1} version - Version of the resource
|
|
284
|
+
* @param {sid} callSid - The call_sid
|
|
285
|
+
*/
|
|
286
|
+
/* jshint ignore:end */
|
|
287
|
+
AnnotationContext = function AnnotationContext(version, callSid) {
|
|
288
|
+
this._version = version;
|
|
289
|
+
|
|
290
|
+
// Path Solution
|
|
291
|
+
this._solution = {callSid: callSid, };
|
|
292
|
+
this._uri = `/Voice/${callSid}/Annotation`;
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
/* jshint ignore:start */
|
|
296
|
+
/**
|
|
297
|
+
* update a AnnotationInstance
|
|
298
|
+
*
|
|
299
|
+
* @function update
|
|
300
|
+
* @memberof Twilio.Insights.V1.AnnotationContext#
|
|
301
|
+
*
|
|
302
|
+
* @param {object} [opts] - Options for request
|
|
303
|
+
* @param {annotation.answered_by} [opts.answeredBy] - The answered_by
|
|
304
|
+
* @param {annotation.connectivity_issue} [opts.connectivityIssue] -
|
|
305
|
+
* The connectivity_issue
|
|
306
|
+
* @param {string} [opts.qualityIssues] - The quality_issues
|
|
307
|
+
* @param {boolean} [opts.spam] - The spam
|
|
308
|
+
* @param {number} [opts.callScore] - The call_score
|
|
309
|
+
* @param {string} [opts.comment] - The comment
|
|
310
|
+
* @param {string} [opts.incident] - The incident
|
|
311
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
312
|
+
*
|
|
313
|
+
* @returns {Promise} Resolves to processed AnnotationInstance
|
|
314
|
+
*/
|
|
315
|
+
/* jshint ignore:end */
|
|
316
|
+
AnnotationContext.prototype.update = function update(opts, callback) {
|
|
317
|
+
if (_.isFunction(opts)) {
|
|
318
|
+
callback = opts;
|
|
319
|
+
opts = {};
|
|
320
|
+
}
|
|
321
|
+
opts = opts || {};
|
|
322
|
+
|
|
323
|
+
var deferred = Q.defer();
|
|
324
|
+
var data = values.of({
|
|
325
|
+
'AnsweredBy': _.get(opts, 'answeredBy'),
|
|
326
|
+
'ConnectivityIssue': _.get(opts, 'connectivityIssue'),
|
|
327
|
+
'QualityIssues': _.get(opts, 'qualityIssues'),
|
|
328
|
+
'Spam': serialize.bool(_.get(opts, 'spam')),
|
|
329
|
+
'CallScore': _.get(opts, 'callScore'),
|
|
330
|
+
'Comment': _.get(opts, 'comment'),
|
|
331
|
+
'Incident': _.get(opts, 'incident')
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
var promise = this._version.update({uri: this._uri, method: 'POST', data: data});
|
|
335
|
+
|
|
336
|
+
promise = promise.then(function(payload) {
|
|
337
|
+
deferred.resolve(new AnnotationInstance(this._version, payload, this._solution.callSid));
|
|
338
|
+
}.bind(this));
|
|
339
|
+
|
|
340
|
+
promise.catch(function(error) {
|
|
341
|
+
deferred.reject(error);
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
if (_.isFunction(callback)) {
|
|
345
|
+
deferred.promise.nodeify(callback);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return deferred.promise;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
/* jshint ignore:start */
|
|
352
|
+
/**
|
|
353
|
+
* fetch a AnnotationInstance
|
|
354
|
+
*
|
|
355
|
+
* @function fetch
|
|
356
|
+
* @memberof Twilio.Insights.V1.AnnotationContext#
|
|
357
|
+
*
|
|
358
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
359
|
+
*
|
|
360
|
+
* @returns {Promise} Resolves to processed AnnotationInstance
|
|
361
|
+
*/
|
|
362
|
+
/* jshint ignore:end */
|
|
363
|
+
AnnotationContext.prototype.fetch = function fetch(callback) {
|
|
364
|
+
var deferred = Q.defer();
|
|
365
|
+
var promise = this._version.fetch({uri: this._uri, method: 'GET'});
|
|
366
|
+
|
|
367
|
+
promise = promise.then(function(payload) {
|
|
368
|
+
deferred.resolve(new AnnotationInstance(this._version, payload, this._solution.callSid));
|
|
369
|
+
}.bind(this));
|
|
370
|
+
|
|
371
|
+
promise.catch(function(error) {
|
|
372
|
+
deferred.reject(error);
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
if (_.isFunction(callback)) {
|
|
376
|
+
deferred.promise.nodeify(callback);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return deferred.promise;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
/* jshint ignore:start */
|
|
383
|
+
/**
|
|
384
|
+
* Provide a user-friendly representation
|
|
385
|
+
*
|
|
386
|
+
* @function toJSON
|
|
387
|
+
* @memberof Twilio.Insights.V1.AnnotationContext#
|
|
388
|
+
*
|
|
389
|
+
* @returns Object
|
|
390
|
+
*/
|
|
391
|
+
/* jshint ignore:end */
|
|
392
|
+
AnnotationContext.prototype.toJSON = function toJSON() {
|
|
393
|
+
return this._solution;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
AnnotationContext.prototype[util.inspect.custom] = function inspect(depth,
|
|
397
|
+
options) {
|
|
398
|
+
return util.inspect(this.toJSON(), options);
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
module.exports = {
|
|
402
|
+
AnnotationList: AnnotationList,
|
|
403
|
+
AnnotationPage: AnnotationPage,
|
|
404
|
+
AnnotationInstance: AnnotationInstance,
|
|
405
|
+
AnnotationContext: AnnotationContext
|
|
406
|
+
};
|
|
@@ -487,7 +487,7 @@ MediaProcessorPage.prototype[util.inspect.custom] = function inspect(depth,
|
|
|
487
487
|
* The URL to which Twilio will send MediaProcessor event updates
|
|
488
488
|
* @property {string} statusCallbackMethod -
|
|
489
489
|
* The HTTP method Twilio should use to call the `status_callback` URL
|
|
490
|
-
* @property {number} maxDuration - Maximum MediaProcessor duration in
|
|
490
|
+
* @property {number} maxDuration - Maximum MediaProcessor duration in seconds
|
|
491
491
|
*
|
|
492
492
|
* @param {V1} version - Version of the resource
|
|
493
493
|
* @param {MediaProcessorPayload} payload - The instance payload
|
|
@@ -158,6 +158,8 @@ interface MediaRecordingListInstance {
|
|
|
158
158
|
* If no pageSize is defined but a limit is defined,
|
|
159
159
|
* each() will attempt to read the limit with the most efficient
|
|
160
160
|
* page size, i.e. min(limit, 1000)
|
|
161
|
+
* @property processorSid - MediaProcessor to filter by
|
|
162
|
+
* @property sourceSid - Source SID to filter by
|
|
161
163
|
* @property status - Status to filter by
|
|
162
164
|
*/
|
|
163
165
|
interface MediaRecordingListInstanceEachOptions {
|
|
@@ -166,6 +168,8 @@ interface MediaRecordingListInstanceEachOptions {
|
|
|
166
168
|
limit?: number;
|
|
167
169
|
order?: MediaRecordingOrder;
|
|
168
170
|
pageSize?: number;
|
|
171
|
+
processorSid?: string;
|
|
172
|
+
sourceSid?: string;
|
|
169
173
|
status?: MediaRecordingStatus;
|
|
170
174
|
}
|
|
171
175
|
|
|
@@ -183,12 +187,16 @@ interface MediaRecordingListInstanceEachOptions {
|
|
|
183
187
|
* If no page_size is defined but a limit is defined,
|
|
184
188
|
* list() will attempt to read the limit with the most
|
|
185
189
|
* efficient page size, i.e. min(limit, 1000)
|
|
190
|
+
* @property processorSid - MediaProcessor to filter by
|
|
191
|
+
* @property sourceSid - Source SID to filter by
|
|
186
192
|
* @property status - Status to filter by
|
|
187
193
|
*/
|
|
188
194
|
interface MediaRecordingListInstanceOptions {
|
|
189
195
|
limit?: number;
|
|
190
196
|
order?: MediaRecordingOrder;
|
|
191
197
|
pageSize?: number;
|
|
198
|
+
processorSid?: string;
|
|
199
|
+
sourceSid?: string;
|
|
192
200
|
status?: MediaRecordingStatus;
|
|
193
201
|
}
|
|
194
202
|
|
|
@@ -199,6 +207,8 @@ interface MediaRecordingListInstanceOptions {
|
|
|
199
207
|
* @property pageNumber - Page Number, this value is simply for client state
|
|
200
208
|
* @property pageSize - Number of records to return, defaults to 50
|
|
201
209
|
* @property pageToken - PageToken provided by the API
|
|
210
|
+
* @property processorSid - MediaProcessor to filter by
|
|
211
|
+
* @property sourceSid - Source SID to filter by
|
|
202
212
|
* @property status - Status to filter by
|
|
203
213
|
*/
|
|
204
214
|
interface MediaRecordingListInstancePageOptions {
|
|
@@ -206,6 +216,8 @@ interface MediaRecordingListInstancePageOptions {
|
|
|
206
216
|
pageNumber?: number;
|
|
207
217
|
pageSize?: number;
|
|
208
218
|
pageToken?: string;
|
|
219
|
+
processorSid?: string;
|
|
220
|
+
sourceSid?: string;
|
|
209
221
|
status?: MediaRecordingStatus;
|
|
210
222
|
}
|
|
211
223
|
|
|
@@ -73,6 +73,8 @@ MediaRecordingList = function MediaRecordingList(version) {
|
|
|
73
73
|
* @param {object} [opts] - Options for request
|
|
74
74
|
* @param {media_recording.order} [opts.order] - The sort order of the list
|
|
75
75
|
* @param {media_recording.status} [opts.status] - Status to filter by
|
|
76
|
+
* @param {string} [opts.processorSid] - MediaProcessor to filter by
|
|
77
|
+
* @param {string} [opts.sourceSid] - Source SID to filter by
|
|
76
78
|
* @param {number} [opts.limit] -
|
|
77
79
|
* Upper limit for the number of records to return.
|
|
78
80
|
* each() guarantees never to return more than limit.
|
|
@@ -164,6 +166,8 @@ MediaRecordingList = function MediaRecordingList(version) {
|
|
|
164
166
|
* @param {object} [opts] - Options for request
|
|
165
167
|
* @param {media_recording.order} [opts.order] - The sort order of the list
|
|
166
168
|
* @param {media_recording.status} [opts.status] - Status to filter by
|
|
169
|
+
* @param {string} [opts.processorSid] - MediaProcessor to filter by
|
|
170
|
+
* @param {string} [opts.sourceSid] - Source SID to filter by
|
|
167
171
|
* @param {number} [opts.limit] -
|
|
168
172
|
* Upper limit for the number of records to return.
|
|
169
173
|
* list() guarantees never to return more than limit.
|
|
@@ -226,6 +230,8 @@ MediaRecordingList = function MediaRecordingList(version) {
|
|
|
226
230
|
* @param {object} [opts] - Options for request
|
|
227
231
|
* @param {media_recording.order} [opts.order] - The sort order of the list
|
|
228
232
|
* @param {media_recording.status} [opts.status] - Status to filter by
|
|
233
|
+
* @param {string} [opts.processorSid] - MediaProcessor to filter by
|
|
234
|
+
* @param {string} [opts.sourceSid] - Source SID to filter by
|
|
229
235
|
* @param {string} [opts.pageToken] - PageToken provided by the API
|
|
230
236
|
* @param {number} [opts.pageNumber] -
|
|
231
237
|
* Page Number, this value is simply for client state
|
|
@@ -246,6 +252,8 @@ MediaRecordingList = function MediaRecordingList(version) {
|
|
|
246
252
|
var data = values.of({
|
|
247
253
|
'Order': _.get(opts, 'order'),
|
|
248
254
|
'Status': _.get(opts, 'status'),
|
|
255
|
+
'ProcessorSid': _.get(opts, 'processorSid'),
|
|
256
|
+
'SourceSid': _.get(opts, 'sourceSid'),
|
|
249
257
|
'PageToken': opts.pageToken,
|
|
250
258
|
'Page': opts.pageNumber,
|
|
251
259
|
'PageSize': opts.pageSize
|