Skip to content

Commit

Permalink
[Librarian] Regenerated @ 00cef9e991575601086193d36fd374e7ad61d4d0
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-ci committed Jul 5, 2018
1 parent 38121a7 commit 79b1ef3
Show file tree
Hide file tree
Showing 24 changed files with 2,575 additions and 250 deletions.
11 changes: 11 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
twilio-node changelog
=====================

[2018-07-05] Version 3.17.5
----------------------------
**Library**
- PR #358: Add Dockerfile and related changes to build the Docker image. Thanks to @jonatasbaldin!
- PR #361: Regenerate with structured params/properties. Thanks to @ekarson!

**Api**
- Release `Call Recording Controls` feature support in helper libraries
- Add Voice Insights sub-category keys to usage records


[2018-06-21] Version 3.17.4
----------------------------
**Library**
Expand Down
18 changes: 18 additions & 0 deletions lib/rest/Video.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ var V1 = require('./video/V1'); /* jshint ignore:line */
* @constructor Twilio.Video
*
* @property {Twilio.Video.V1} v1 - v1 version
* @property {Twilio.Video.V1.CompositionSettingsList} compositionSettings -
* compositionSettings resource
* @property {Twilio.Video.V1.RecordingList} recordings - recordings resource
* @property {Twilio.Video.V1.RecordingSettingsList} recordingSettings -
* recordingSettings resource
* @property {Twilio.Video.V1.CompositionList} compositions - compositions resource
* @property {Twilio.Video.V1.RoomList} rooms - rooms resource
*
Expand All @@ -46,13 +50,27 @@ Object.defineProperty(Video.prototype,
}
});

Object.defineProperty(Video.prototype,
'compositionSettings', {
get: function() {
return this.v1.compositionSettings;
}
});

Object.defineProperty(Video.prototype,
'recordings', {
get: function() {
return this.v1.recordings;
}
});

Object.defineProperty(Video.prototype,
'recordingSettings', {
get: function() {
return this.v1.recordingSettings;
}
});

Object.defineProperty(Video.prototype,
'compositions', {
get: function() {
Expand Down
208 changes: 175 additions & 33 deletions lib/rest/api/v2010/account/call/recording.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ var RecordingContext;
* @description Initialize the RecordingList
*
* @param {Twilio.Api.V2010} version - Version of the resource
* @param {string} accountSid - The account_sid
* @param {string} callSid - The call_sid
* @param {string} accountSid - The unique sid that identifies this account
* @param {string} callSid -
* The unique id for the call leg that corresponds to the recording.
*/
/* jshint ignore:end */
RecordingList = function RecordingList(version, accountSid, callSid) {
Expand All @@ -55,6 +56,69 @@ RecordingList = function RecordingList(version, accountSid, callSid) {
RecordingListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/Calls/<%= callSid %>/Recordings.json' // jshint ignore:line
)(RecordingListInstance._solution);
/* jshint ignore:start */
/**
* create a RecordingInstance
*
* @function create
* @memberof Twilio.Api.V2010.AccountContext.CallContext.RecordingList
* @instance
*
* @param {object} [opts] - ...
* @param {string|list} [opts.recordingStatusCallbackEvent] -
* The recording_status_callback_event
* @param {string} [opts.recordingStatusCallback] - The recording_status_callback
* @param {string} [opts.recordingStatusCallbackMethod] -
* The recording_status_callback_method
* @param {string} [opts.trim] - Whether to trim the silence in the recording
* @param {string} [opts.recordingChannels] - The recording_channels
* @param {boolean} [opts.playBeep] -
* Whether to play beeps for recording status changes
* @param {function} [callback] - Callback to handle processed record
*
* @returns {Promise} Resolves to processed RecordingInstance
*/
/* jshint ignore:end */
RecordingListInstance.create = function create(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var data = values.of({
'RecordingStatusCallbackEvent': serialize.map(_.get(opts, 'recordingStatusCallbackEvent'), function(e) { return e; }),
'RecordingStatusCallback': _.get(opts, 'recordingStatusCallback'),
'RecordingStatusCallbackMethod': _.get(opts, 'recordingStatusCallbackMethod'),
'Trim': _.get(opts, 'trim'),
'RecordingChannels': _.get(opts, 'recordingChannels'),
'PlayBeep': serialize.bool(_.get(opts, 'playBeep'))
});

var promise = this._version.create({uri: this._uri, method: 'POST', data: data});

promise = promise.then(function(payload) {
deferred.resolve(new RecordingInstance(
this._version,
payload,
this._solution.accountSid,
this._solution.callSid,
this._solution.sid
));
}.bind(this));

promise.catch(function(error) {
deferred.reject(error);
});

if (_.isFunction(callback)) {
deferred.promise.nodeify(callback);
}

return deferred.promise;
};

/* jshint ignore:start */
/**
* Streams RecordingInstance records from the API.
Expand All @@ -71,9 +135,9 @@ RecordingList = function RecordingList(version, accountSid, callSid) {
* @instance
*
* @param {object} [opts] - ...
* @param {Date} [opts.dateCreatedBefore] - The date_created
* @param {Date} [opts.dateCreated] - The date_created
* @param {Date} [opts.dateCreatedAfter] - The date_created
* @param {Date} [opts.dateCreatedBefore] - Filter by date created
* @param {Date} [opts.dateCreated] - Filter by date created
* @param {Date} [opts.dateCreatedAfter] - Filter by date created
* @param {number} [opts.limit] -
* Upper limit for the number of records to return.
* each() guarantees never to return more than limit.
Expand Down Expand Up @@ -163,9 +227,9 @@ RecordingList = function RecordingList(version, accountSid, callSid) {
* @instance
*
* @param {object} [opts] - ...
* @param {Date} [opts.dateCreatedBefore] - The date_created
* @param {Date} [opts.dateCreated] - The date_created
* @param {Date} [opts.dateCreatedAfter] - The date_created
* @param {Date} [opts.dateCreatedBefore] - Filter by date created
* @param {Date} [opts.dateCreated] - Filter by date created
* @param {Date} [opts.dateCreatedAfter] - Filter by date created
* @param {number} [opts.limit] -
* Upper limit for the number of records to return.
* list() guarantees never to return more than limit.
Expand Down Expand Up @@ -225,9 +289,9 @@ RecordingList = function RecordingList(version, accountSid, callSid) {
* @instance
*
* @param {object} [opts] - ...
* @param {Date} [opts.dateCreatedBefore] - The date_created
* @param {Date} [opts.dateCreated] - The date_created
* @param {Date} [opts.dateCreatedAfter] - The date_created
* @param {Date} [opts.dateCreatedBefore] - Filter by date created
* @param {Date} [opts.dateCreated] - Filter by date created
* @param {Date} [opts.dateCreatedAfter] - Filter by date created
* @param {string} [opts.pageToken] - PageToken provided by the API
* @param {number} [opts.pageNumber] -
* Page Number, this value is simply for client state
Expand Down Expand Up @@ -316,7 +380,7 @@ RecordingList = function RecordingList(version, accountSid, callSid) {
* @memberof Twilio.Api.V2010.AccountContext.CallContext.RecordingList
* @instance
*
* @param {string} sid - The sid
* @param {string} sid - Fetch by unique recording Sid
*
* @returns {Twilio.Api.V2010.AccountContext.CallContext.RecordingContext}
*/
Expand Down Expand Up @@ -380,28 +444,37 @@ RecordingPage.prototype.getInstance = function getInstance(payload) {
* @constructor Twilio.Api.V2010.AccountContext.CallContext.RecordingInstance
* @description Initialize the RecordingContext
*
* @property {string} accountSid - The account_sid
* @property {string} apiVersion - The api_version
* @property {string} callSid - The call_sid
* @property {string} conferenceSid - The conference_sid
* @property {Date} dateCreated - The date_created
* @property {Date} dateUpdated - The date_updated
* @property {string} duration - The duration
* @property {string} sid - The sid
* @property {number} price - The price
* @property {string} uri - The uri
* @property {string} encryptionDetails - The encryption_details
* @property {string} priceUnit - The price_unit
* @property {recording.status} status - The status
* @property {number} channels - The channels
* @property {recording.source} source - The source
* @property {number} errorCode - The error_code
* @property {string} accountSid - The unique sid that identifies this account
* @property {string} apiVersion -
* The version of the API in use during the recording.
* @property {string} callSid -
* The unique id for the call leg that corresponds to the recording.
* @property {string} conferenceSid -
* The unique id for the conference associated with the recording, if a conference recording.
* @property {Date} dateCreated - The date this resource was created
* @property {Date} dateUpdated - The date this resource was last updated
* @property {Date} startTime -
* The start time of the recording, given in RFC 2822 format.
* @property {string} duration - The length of the recording, in seconds.
* @property {string} sid - A string that uniquely identifies this recording
* @property {number} price - The one-time cost of creating this recording.
* @property {string} uri - The URI for this resource
* @property {string} encryptionDetails - Details for how to decrypt the recording.
* @property {string} priceUnit - The currency used in the Price property.
* @property {recording.status} status - The status of the recording.
* @property {number} channels -
* The number of channels in the final recording file as an integer.
* @property {recording.source} source -
* The way in which this recording was created.
* @property {number} errorCode -
* More information about the recording failure, if Status is failed.
*
* @param {Twilio.Api.V2010} version - Version of the resource
* @param {object} payload - The instance payload
* @param {sid} accountSid - The account_sid
* @param {sid} callSid - The call_sid
* @param {sid} sid - The sid
* @param {sid} accountSid - The unique sid that identifies this account
* @param {sid} callSid -
* The unique id for the call leg that corresponds to the recording.
* @param {sid} sid - Fetch by unique recording Sid
*/
/* jshint ignore:end */
RecordingInstance = function RecordingInstance(version, payload, accountSid,
Expand All @@ -415,6 +488,7 @@ RecordingInstance = function RecordingInstance(version, payload, accountSid,
this.conferenceSid = payload.conference_sid; // jshint ignore:line
this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); // jshint ignore:line
this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated); // jshint ignore:line
this.startTime = deserialize.rfc2822DateTime(payload.start_time); // jshint ignore:line
this.duration = payload.duration; // jshint ignore:line
this.sid = payload.sid; // jshint ignore:line
this.price = deserialize.decimal(payload.price); // jshint ignore:line
Expand Down Expand Up @@ -447,6 +521,25 @@ Object.defineProperty(RecordingInstance.prototype,
}
});

/* jshint ignore:start */
/**
* update a RecordingInstance
*
* @function update
* @memberof Twilio.Api.V2010.AccountContext.CallContext.RecordingInstance
* @instance
*
* @param {object} opts - ...
* @param {recording.status} opts.status - The status to change the recording to.
* @param {function} [callback] - Callback to handle processed record
*
* @returns {Promise} Resolves to processed RecordingInstance
*/
/* jshint ignore:end */
RecordingInstance.prototype.update = function update(opts, callback) {
return this._proxy.update(opts, callback);
};

/* jshint ignore:start */
/**
* fetch a RecordingInstance
Expand Down Expand Up @@ -511,8 +604,8 @@ RecordingInstance.prototype.toJSON = function toJSON() {
*
* @param {Twilio.Api.V2010} version - Version of the resource
* @param {sid} accountSid - The account_sid
* @param {sid} callSid - The call_sid
* @param {sid} sid - The sid
* @param {sid} callSid - Fetch by unique call Sid for the recording
* @param {sid} sid - Fetch by unique recording Sid
*/
/* jshint ignore:end */
RecordingContext = function RecordingContext(version, accountSid, callSid, sid)
Expand All @@ -526,6 +619,55 @@ RecordingContext = function RecordingContext(version, accountSid, callSid, sid)
)(this._solution);
};

/* jshint ignore:start */
/**
* update a RecordingInstance
*
* @function update
* @memberof Twilio.Api.V2010.AccountContext.CallContext.RecordingContext
* @instance
*
* @param {object} opts - ...
* @param {recording.status} opts.status - The status to change the recording to.
* @param {function} [callback] - Callback to handle processed record
*
* @returns {Promise} Resolves to processed RecordingInstance
*/
/* jshint ignore:end */
RecordingContext.prototype.update = function update(opts, callback) {
if (_.isUndefined(opts)) {
throw new Error('Required parameter "opts" missing.');
}
if (_.isUndefined(opts.status)) {
throw new Error('Required parameter "opts.status" missing.');
}

var deferred = Q.defer();
var data = values.of({'Status': _.get(opts, 'status')});

var promise = this._version.update({uri: this._uri, method: 'POST', data: data});

promise = promise.then(function(payload) {
deferred.resolve(new RecordingInstance(
this._version,
payload,
this._solution.accountSid,
this._solution.callSid,
this._solution.sid
));
}.bind(this));

promise.catch(function(error) {
deferred.reject(error);
});

if (_.isFunction(callback)) {
deferred.promise.nodeify(callback);
}

return deferred.promise;
};

/* jshint ignore:start */
/**
* fetch a RecordingInstance
Expand Down
Loading

0 comments on commit 79b1ef3

Please sign in to comment.