Skip to content

Commit

Permalink
fix: add opts check for remove calls (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
eshanholtz authored Nov 14, 2019
1 parent c5ad2d7 commit 025d712
Show file tree
Hide file tree
Showing 19 changed files with 114 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/rest/authy/v1/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,12 @@ ServiceContext = function ServiceContext(version, sid) {
*/
/* jshint ignore:end */
ServiceContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'Twilio-Authy-Sandbox-Mode': _.get(opts, 'twilioAuthySandboxMode')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/authy/v1/service/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,12 @@ EntityContext = function EntityContext(version, serviceSid, identity) {
*/
/* jshint ignore:end */
EntityContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'Twilio-Authy-Sandbox-Mode': _.get(opts, 'twilioAuthySandboxMode')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/authy/v1/service/entity/factor.js
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,12 @@ FactorContext = function FactorContext(version, serviceSid, identity, sid) {
*/
/* jshint ignore:end */
FactorContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'Twilio-Authy-Sandbox-Mode': _.get(opts, 'twilioAuthySandboxMode')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/authy/v1/service/entity/factor/challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,12 @@ ChallengeContext = function ChallengeContext(version, serviceSid, identity,
*/
/* jshint ignore:end */
ChallengeContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'Twilio-Authy-Sandbox-Mode': _.get(opts, 'twilioAuthySandboxMode')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/chat/v2/service/channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,12 @@ ChannelContext.prototype.fetch = function fetch(callback) {
*/
/* jshint ignore:end */
ChannelContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'X-Twilio-Webhook-Enabled': _.get(opts, 'xTwilioWebhookEnabled')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/chat/v2/service/channel/member.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,12 @@ MemberContext.prototype.fetch = function fetch(callback) {
*/
/* jshint ignore:end */
MemberContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'X-Twilio-Webhook-Enabled': _.get(opts, 'xTwilioWebhookEnabled')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/chat/v2/service/channel/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,12 @@ MessageContext.prototype.fetch = function fetch(callback) {
*/
/* jshint ignore:end */
MessageContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'X-Twilio-Webhook-Enabled': _.get(opts, 'xTwilioWebhookEnabled')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/conversations/v1/conversation.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,12 @@ ConversationContext.prototype.update = function update(opts, callback) {
*/
/* jshint ignore:end */
ConversationContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'X-Twilio-Webhook-Enabled': _.get(opts, 'xTwilioWebhookEnabled')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/conversations/v1/conversation/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,12 @@ MessageContext.prototype.update = function update(opts, callback) {
*/
/* jshint ignore:end */
MessageContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'X-Twilio-Webhook-Enabled': _.get(opts, 'xTwilioWebhookEnabled')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/conversations/v1/conversation/participant.js
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,12 @@ ParticipantContext.prototype.update = function update(opts, callback) {
*/
/* jshint ignore:end */
ParticipantContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'X-Twilio-Webhook-Enabled': _.get(opts, 'xTwilioWebhookEnabled')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/ipMessaging/v2/service/channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,12 @@ ChannelContext.prototype.fetch = function fetch(callback) {
*/
/* jshint ignore:end */
ChannelContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'X-Twilio-Webhook-Enabled': _.get(opts, 'xTwilioWebhookEnabled')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/ipMessaging/v2/service/channel/member.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,12 @@ MemberContext.prototype.fetch = function fetch(callback) {
*/
/* jshint ignore:end */
MemberContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'X-Twilio-Webhook-Enabled': _.get(opts, 'xTwilioWebhookEnabled')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/ipMessaging/v2/service/channel/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,12 @@ MessageContext.prototype.fetch = function fetch(callback) {
*/
/* jshint ignore:end */
MessageContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'X-Twilio-Webhook-Enabled': _.get(opts, 'xTwilioWebhookEnabled')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/preview/sync/service/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,12 @@ DocumentContext.prototype.fetch = function fetch(callback) {
*/
/* jshint ignore:end */
DocumentContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'If-Match': _.get(opts, 'ifMatch')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/preview/sync/service/syncList/syncListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,12 @@ SyncListItemContext.prototype.fetch = function fetch(callback) {
*/
/* jshint ignore:end */
SyncListItemContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'If-Match': _.get(opts, 'ifMatch')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/preview/sync/service/syncMap/syncMapItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,12 @@ SyncMapItemContext.prototype.fetch = function fetch(callback) {
*/
/* jshint ignore:end */
SyncMapItemContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'If-Match': _.get(opts, 'ifMatch')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/sync/v1/service/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,12 @@ DocumentContext.prototype.fetch = function fetch(callback) {
*/
/* jshint ignore:end */
DocumentContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'If-Match': _.get(opts, 'ifMatch')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/sync/v1/service/syncList/syncListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,12 @@ SyncListItemContext.prototype.fetch = function fetch(callback) {
*/
/* jshint ignore:end */
SyncListItemContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'If-Match': _.get(opts, 'ifMatch')});

Expand Down
6 changes: 6 additions & 0 deletions lib/rest/sync/v1/service/syncMap/syncMapItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,12 @@ SyncMapItemContext.prototype.fetch = function fetch(callback) {
*/
/* jshint ignore:end */
SyncMapItemContext.prototype.remove = function remove(opts, callback) {
if (_.isFunction(opts)) {
callback = opts;
opts = {};
}
opts = opts || {};

var deferred = Q.defer();
var headers = values.of({'If-Match': _.get(opts, 'ifMatch')});

Expand Down

0 comments on commit 025d712

Please sign in to comment.