Skip to content

Commit

Permalink
[Librarian] Regenerated @ 7a7839b47231760a343c1db31f805001d48237b2
Browse files Browse the repository at this point in the history
  • Loading branch information
codejudas committed Oct 27, 2017
1 parent ab30f37 commit 405ad2c
Show file tree
Hide file tree
Showing 408 changed files with 6,483 additions and 12,936 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
twilio-node changelog
=====================

[2017-10-27] Version 3.9.1
---------------------------
**Chat**
- Add Binding resource
- Add UserBinding resource


[2017-10-20] Version 3.9.0
---------------------------
**TwiML**
Expand Down
4 changes: 1 addition & 3 deletions lib/rest/accounts/v1/credential.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ CredentialList = function CredentialList(version) {
'publicKey', {
get: function publicKey() {
if (!this._publicKey) {
this._publicKey = new PublicKeyList(
this._version
);
this._publicKey = new PublicKeyList(this._version);
}

return this._publicKey;
Expand Down
90 changes: 17 additions & 73 deletions lib/rest/accounts/v1/credential/publicKey.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,10 @@ PublicKeyList = function PublicKeyList(version) {
'PageSize': opts.pageSize
});

var promise = this._version.page({
uri: this._uri,
method: 'GET',
params: data
});
var promise = this._version.page({uri: this._uri, method: 'GET', params: data});

promise = promise.then(function(payload) {
deferred.resolve(new PublicKeyPage(
this._version,
payload,
this._solution
));
deferred.resolve(new PublicKeyPage(this._version, payload, this._solution));
}.bind(this));

promise.catch(function(error) {
Expand Down Expand Up @@ -278,17 +270,10 @@ PublicKeyList = function PublicKeyList(version) {
PublicKeyListInstance.getPage = function getPage(targetUrl, callback) {
var deferred = Q.defer();

var promise = this._version._domain.twilio.request({
method: 'GET',
uri: targetUrl
});
var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl});

promise = promise.then(function(payload) {
deferred.resolve(new PublicKeyPage(
this._version,
payload,
this._solution
));
deferred.resolve(new PublicKeyPage(this._version, payload, this._solution));
}.bind(this));

promise.catch(function(error) {
Expand Down Expand Up @@ -336,18 +321,10 @@ PublicKeyList = function PublicKeyList(version) {
'AccountSid': _.get(opts, 'accountSid')
});

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

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

promise.catch(function(error) {
Expand Down Expand Up @@ -375,10 +352,7 @@ PublicKeyList = function PublicKeyList(version) {
*/
/* jshint ignore:end */
PublicKeyListInstance.get = function get(sid) {
return new PublicKeyContext(
this._version,
sid
);
return new PublicKeyContext(this._version, sid);
};

return PublicKeyListInstance;
Expand Down Expand Up @@ -422,10 +396,7 @@ PublicKeyPage.prototype.constructor = PublicKeyPage;
*/
/* jshint ignore:end */
PublicKeyPage.prototype.getInstance = function getInstance(payload) {
return new PublicKeyInstance(
this._version,
payload
);
return new PublicKeyInstance(this._version, payload);
};


Expand Down Expand Up @@ -461,19 +432,14 @@ PublicKeyInstance = function PublicKeyInstance(version, payload, sid) {

// Context
this._context = undefined;
this._solution = {
sid: sid || this.sid,
};
this._solution = {sid: sid || this.sid,};
};

Object.defineProperty(PublicKeyInstance.prototype,
'_proxy', {
get: function() {
if (!this._context) {
this._context = new PublicKeyContext(
this._version,
this._solution.sid
);
this._context = new PublicKeyContext(this._version, this._solution.sid);
}

return this._context;
Expand Down Expand Up @@ -548,9 +514,7 @@ PublicKeyContext = function PublicKeyContext(version, sid) {
this._version = version;

// Path Solution
this._solution = {
sid: sid,
};
this._solution = {sid: sid,};
this._uri = _.template(
'/Credentials/PublicKeys/<%= sid %>' // jshint ignore:line
)(this._solution);
Expand All @@ -571,17 +535,10 @@ PublicKeyContext = function PublicKeyContext(version, sid) {
/* jshint ignore:end */
PublicKeyContext.prototype.fetch = function fetch(callback) {
var deferred = Q.defer();
var promise = this._version.fetch({
uri: this._uri,
method: 'GET'
});
var promise = this._version.fetch({uri: this._uri, method: 'GET'});

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

promise.catch(function(error) {
Expand Down Expand Up @@ -619,22 +576,12 @@ PublicKeyContext.prototype.update = function update(opts, callback) {
opts = opts || {};

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

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

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

promise.catch(function(error) {
Expand Down Expand Up @@ -663,10 +610,7 @@ PublicKeyContext.prototype.update = function update(opts, callback) {
/* jshint ignore:end */
PublicKeyContext.prototype.remove = function remove(callback) {
var deferred = Q.defer();
var promise = this._version.remove({
uri: this._uri,
method: 'DELETE'
});
var promise = this._version.remove({uri: this._uri, method: 'DELETE'});

promise = promise.then(function(payload) {
deferred.resolve(payload);
Expand Down
Loading

0 comments on commit 405ad2c

Please sign in to comment.