diff --git a/CHANGES.md b/CHANGES.md index 03294d4838..3133da3604 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,18 @@ twilio-node changelog ===================== +[2018-03-22] Version 3.14.0 +---------------------------- +**Lookups** +- Disable support for `fraud` lookups *(breaking change)* + +**Preview** +- Add `BuildDuration` and `ErrorCode` to Understand ModelBuild + +**Studio** +- Add new /Context endpoint for step and engagement resources. + + [2018-03-12] Version 3.13.1 ---------------------------- **Api** diff --git a/lib/rest/chat/v1/service.js b/lib/rest/chat/v1/service.js index 4f318a9750..ff32c0d3fb 100644 --- a/lib/rest/chat/v1/service.js +++ b/lib/rest/chat/v1/service.js @@ -524,123 +524,124 @@ ServiceInstance.prototype.remove = function remove(callback) { * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout * @param {number} [opts.consumptionReportInterval] - * The consumption_report_interval - * @param {boolean} [opts.notifications.newMessage.enabled] - + * @param {boolean} [opts."notifications.newMessage.enabled"] - * The notifications.new_message.enabled - * @param {string} [opts.notifications.newMessage.template] - + * @param {string} [opts."notifications.newMessage.template"] - * The notifications.new_message.template - * @param {boolean} [opts.notifications.addedToChannel.enabled] - + * @param {boolean} [opts."notifications.addedToChannel.enabled"] - * The notifications.added_to_channel.enabled - * @param {string} [opts.notifications.addedToChannel.template] - + * @param {string} [opts."notifications.addedToChannel.template"] - * The notifications.added_to_channel.template - * @param {boolean} [opts.notifications.removedFromChannel.enabled] - + * @param {boolean} [opts."notifications.removedFromChannel.enabled"] - * The notifications.removed_from_channel.enabled - * @param {string} [opts.notifications.removedFromChannel.template] - + * @param {string} [opts."notifications.removedFromChannel.template"] - * The notifications.removed_from_channel.template - * @param {boolean} [opts.notifications.invitedToChannel.enabled] - + * @param {boolean} [opts."notifications.invitedToChannel.enabled"] - * The notifications.invited_to_channel.enabled - * @param {string} [opts.notifications.invitedToChannel.template] - + * @param {string} [opts."notifications.invitedToChannel.template"] - * The notifications.invited_to_channel.template * @param {string} [opts.preWebhookUrl] - The pre_webhook_url * @param {string} [opts.postWebhookUrl] - The post_webhook_url * @param {string} [opts.webhookMethod] - The webhook_method * @param {string|list} [opts.webhookFilters] - The webhook_filters - * @param {string} [opts.webhooks.onMessageSend.url] - + * @param {string} [opts."webhooks.onMessageSend.url"] - * The webhooks.on_message_send.url - * @param {string} [opts.webhooks.onMessageSend.method] - + * @param {string} [opts."webhooks.onMessageSend.method"] - * The webhooks.on_message_send.method - * @param {string} [opts.webhooks.onMessageSend.format] - + * @param {string} [opts."webhooks.onMessageSend.format"] - * The webhooks.on_message_send.format - * @param {string} [opts.webhooks.onMessageUpdate.url] - + * @param {string} [opts."webhooks.onMessageUpdate.url"] - * The webhooks.on_message_update.url - * @param {string} [opts.webhooks.onMessageUpdate.method] - + * @param {string} [opts."webhooks.onMessageUpdate.method"] - * The webhooks.on_message_update.method - * @param {string} [opts.webhooks.onMessageUpdate.format] - + * @param {string} [opts."webhooks.onMessageUpdate.format"] - * The webhooks.on_message_update.format - * @param {string} [opts.webhooks.onMessageRemove.url] - + * @param {string} [opts."webhooks.onMessageRemove.url"] - * The webhooks.on_message_remove.url - * @param {string} [opts.webhooks.onMessageRemove.method] - + * @param {string} [opts."webhooks.onMessageRemove.method"] - * The webhooks.on_message_remove.method - * @param {string} [opts.webhooks.onMessageRemove.format] - + * @param {string} [opts."webhooks.onMessageRemove.format"] - * The webhooks.on_message_remove.format - * @param {string} [opts.webhooks.onChannelAdd.url] - + * @param {string} [opts."webhooks.onChannelAdd.url"] - * The webhooks.on_channel_add.url - * @param {string} [opts.webhooks.onChannelAdd.method] - + * @param {string} [opts."webhooks.onChannelAdd.method"] - * The webhooks.on_channel_add.method - * @param {string} [opts.webhooks.onChannelAdd.format] - + * @param {string} [opts."webhooks.onChannelAdd.format"] - * The webhooks.on_channel_add.format - * @param {string} [opts.webhooks.onChannelDestroy.url] - + * @param {string} [opts."webhooks.onChannelDestroy.url"] - * The webhooks.on_channel_destroy.url - * @param {string} [opts.webhooks.onChannelDestroy.method] - + * @param {string} [opts."webhooks.onChannelDestroy.method"] - * The webhooks.on_channel_destroy.method - * @param {string} [opts.webhooks.onChannelDestroy.format] - + * @param {string} [opts."webhooks.onChannelDestroy.format"] - * The webhooks.on_channel_destroy.format - * @param {string} [opts.webhooks.onChannelUpdate.url] - + * @param {string} [opts."webhooks.onChannelUpdate.url"] - * The webhooks.on_channel_update.url - * @param {string} [opts.webhooks.onChannelUpdate.method] - + * @param {string} [opts."webhooks.onChannelUpdate.method"] - * The webhooks.on_channel_update.method - * @param {string} [opts.webhooks.onChannelUpdate.format] - + * @param {string} [opts."webhooks.onChannelUpdate.format"] - * The webhooks.on_channel_update.format - * @param {string} [opts.webhooks.onMemberAdd.url] - The webhooks.on_member_add.url - * @param {string} [opts.webhooks.onMemberAdd.method] - + * @param {string} [opts."webhooks.onMemberAdd.url"] - + * The webhooks.on_member_add.url + * @param {string} [opts."webhooks.onMemberAdd.method"] - * The webhooks.on_member_add.method - * @param {string} [opts.webhooks.onMemberAdd.format] - + * @param {string} [opts."webhooks.onMemberAdd.format"] - * The webhooks.on_member_add.format - * @param {string} [opts.webhooks.onMemberRemove.url] - + * @param {string} [opts."webhooks.onMemberRemove.url"] - * The webhooks.on_member_remove.url - * @param {string} [opts.webhooks.onMemberRemove.method] - + * @param {string} [opts."webhooks.onMemberRemove.method"] - * The webhooks.on_member_remove.method - * @param {string} [opts.webhooks.onMemberRemove.format] - + * @param {string} [opts."webhooks.onMemberRemove.format"] - * The webhooks.on_member_remove.format - * @param {string} [opts.webhooks.onMessageSent.url] - + * @param {string} [opts."webhooks.onMessageSent.url"] - * The webhooks.on_message_sent.url - * @param {string} [opts.webhooks.onMessageSent.method] - + * @param {string} [opts."webhooks.onMessageSent.method"] - * The webhooks.on_message_sent.method - * @param {string} [opts.webhooks.onMessageSent.format] - + * @param {string} [opts."webhooks.onMessageSent.format"] - * The webhooks.on_message_sent.format - * @param {string} [opts.webhooks.onMessageUpdated.url] - + * @param {string} [opts."webhooks.onMessageUpdated.url"] - * The webhooks.on_message_updated.url - * @param {string} [opts.webhooks.onMessageUpdated.method] - + * @param {string} [opts."webhooks.onMessageUpdated.method"] - * The webhooks.on_message_updated.method - * @param {string} [opts.webhooks.onMessageUpdated.format] - + * @param {string} [opts."webhooks.onMessageUpdated.format"] - * The webhooks.on_message_updated.format - * @param {string} [opts.webhooks.onMessageRemoved.url] - + * @param {string} [opts."webhooks.onMessageRemoved.url"] - * The webhooks.on_message_removed.url - * @param {string} [opts.webhooks.onMessageRemoved.method] - + * @param {string} [opts."webhooks.onMessageRemoved.method"] - * The webhooks.on_message_removed.method - * @param {string} [opts.webhooks.onMessageRemoved.format] - + * @param {string} [opts."webhooks.onMessageRemoved.format"] - * The webhooks.on_message_removed.format - * @param {string} [opts.webhooks.onChannelAdded.url] - + * @param {string} [opts."webhooks.onChannelAdded.url"] - * The webhooks.on_channel_added.url - * @param {string} [opts.webhooks.onChannelAdded.method] - + * @param {string} [opts."webhooks.onChannelAdded.method"] - * The webhooks.on_channel_added.method - * @param {string} [opts.webhooks.onChannelAdded.format] - + * @param {string} [opts."webhooks.onChannelAdded.format"] - * The webhooks.on_channel_added.format - * @param {string} [opts.webhooks.onChannelDestroyed.url] - + * @param {string} [opts."webhooks.onChannelDestroyed.url"] - * The webhooks.on_channel_destroyed.url - * @param {string} [opts.webhooks.onChannelDestroyed.method] - + * @param {string} [opts."webhooks.onChannelDestroyed.method"] - * The webhooks.on_channel_destroyed.method - * @param {string} [opts.webhooks.onChannelDestroyed.format] - + * @param {string} [opts."webhooks.onChannelDestroyed.format"] - * The webhooks.on_channel_destroyed.format - * @param {string} [opts.webhooks.onChannelUpdated.url] - + * @param {string} [opts."webhooks.onChannelUpdated.url"] - * The webhooks.on_channel_updated.url - * @param {string} [opts.webhooks.onChannelUpdated.method] - + * @param {string} [opts."webhooks.onChannelUpdated.method"] - * The webhooks.on_channel_updated.method - * @param {string} [opts.webhooks.onChannelUpdated.format] - + * @param {string} [opts."webhooks.onChannelUpdated.format"] - * The webhooks.on_channel_updated.format - * @param {string} [opts.webhooks.onMemberAdded.url] - + * @param {string} [opts."webhooks.onMemberAdded.url"] - * The webhooks.on_member_added.url - * @param {string} [opts.webhooks.onMemberAdded.method] - + * @param {string} [opts."webhooks.onMemberAdded.method"] - * The webhooks.on_member_added.method - * @param {string} [opts.webhooks.onMemberAdded.format] - + * @param {string} [opts."webhooks.onMemberAdded.format"] - * The webhooks.on_member_added.format - * @param {string} [opts.webhooks.onMemberRemoved.url] - + * @param {string} [opts."webhooks.onMemberRemoved.url"] - * The webhooks.on_member_removed.url - * @param {string} [opts.webhooks.onMemberRemoved.method] - + * @param {string} [opts."webhooks.onMemberRemoved.method"] - * The webhooks.on_member_removed.method - * @param {string} [opts.webhooks.onMemberRemoved.format] - + * @param {string} [opts."webhooks.onMemberRemoved.format"] - * The webhooks.on_member_removed.format - * @param {number} [opts.limits.channelMembers] - The limits.channel_members - * @param {number} [opts.limits.userChannels] - The limits.user_channels + * @param {number} [opts."limits.channelMembers"] - The limits.channel_members + * @param {number} [opts."limits.userChannels"] - The limits.user_channels * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ServiceInstance @@ -830,123 +831,124 @@ ServiceContext.prototype.remove = function remove(callback) { * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout * @param {number} [opts.consumptionReportInterval] - * The consumption_report_interval - * @param {boolean} [opts.notifications.newMessage.enabled] - + * @param {boolean} [opts."notifications.newMessage.enabled"] - * The notifications.new_message.enabled - * @param {string} [opts.notifications.newMessage.template] - + * @param {string} [opts."notifications.newMessage.template"] - * The notifications.new_message.template - * @param {boolean} [opts.notifications.addedToChannel.enabled] - + * @param {boolean} [opts."notifications.addedToChannel.enabled"] - * The notifications.added_to_channel.enabled - * @param {string} [opts.notifications.addedToChannel.template] - + * @param {string} [opts."notifications.addedToChannel.template"] - * The notifications.added_to_channel.template - * @param {boolean} [opts.notifications.removedFromChannel.enabled] - + * @param {boolean} [opts."notifications.removedFromChannel.enabled"] - * The notifications.removed_from_channel.enabled - * @param {string} [opts.notifications.removedFromChannel.template] - + * @param {string} [opts."notifications.removedFromChannel.template"] - * The notifications.removed_from_channel.template - * @param {boolean} [opts.notifications.invitedToChannel.enabled] - + * @param {boolean} [opts."notifications.invitedToChannel.enabled"] - * The notifications.invited_to_channel.enabled - * @param {string} [opts.notifications.invitedToChannel.template] - + * @param {string} [opts."notifications.invitedToChannel.template"] - * The notifications.invited_to_channel.template * @param {string} [opts.preWebhookUrl] - The pre_webhook_url * @param {string} [opts.postWebhookUrl] - The post_webhook_url * @param {string} [opts.webhookMethod] - The webhook_method * @param {string|list} [opts.webhookFilters] - The webhook_filters - * @param {string} [opts.webhooks.onMessageSend.url] - + * @param {string} [opts."webhooks.onMessageSend.url"] - * The webhooks.on_message_send.url - * @param {string} [opts.webhooks.onMessageSend.method] - + * @param {string} [opts."webhooks.onMessageSend.method"] - * The webhooks.on_message_send.method - * @param {string} [opts.webhooks.onMessageSend.format] - + * @param {string} [opts."webhooks.onMessageSend.format"] - * The webhooks.on_message_send.format - * @param {string} [opts.webhooks.onMessageUpdate.url] - + * @param {string} [opts."webhooks.onMessageUpdate.url"] - * The webhooks.on_message_update.url - * @param {string} [opts.webhooks.onMessageUpdate.method] - + * @param {string} [opts."webhooks.onMessageUpdate.method"] - * The webhooks.on_message_update.method - * @param {string} [opts.webhooks.onMessageUpdate.format] - + * @param {string} [opts."webhooks.onMessageUpdate.format"] - * The webhooks.on_message_update.format - * @param {string} [opts.webhooks.onMessageRemove.url] - + * @param {string} [opts."webhooks.onMessageRemove.url"] - * The webhooks.on_message_remove.url - * @param {string} [opts.webhooks.onMessageRemove.method] - + * @param {string} [opts."webhooks.onMessageRemove.method"] - * The webhooks.on_message_remove.method - * @param {string} [opts.webhooks.onMessageRemove.format] - + * @param {string} [opts."webhooks.onMessageRemove.format"] - * The webhooks.on_message_remove.format - * @param {string} [opts.webhooks.onChannelAdd.url] - + * @param {string} [opts."webhooks.onChannelAdd.url"] - * The webhooks.on_channel_add.url - * @param {string} [opts.webhooks.onChannelAdd.method] - + * @param {string} [opts."webhooks.onChannelAdd.method"] - * The webhooks.on_channel_add.method - * @param {string} [opts.webhooks.onChannelAdd.format] - + * @param {string} [opts."webhooks.onChannelAdd.format"] - * The webhooks.on_channel_add.format - * @param {string} [opts.webhooks.onChannelDestroy.url] - + * @param {string} [opts."webhooks.onChannelDestroy.url"] - * The webhooks.on_channel_destroy.url - * @param {string} [opts.webhooks.onChannelDestroy.method] - + * @param {string} [opts."webhooks.onChannelDestroy.method"] - * The webhooks.on_channel_destroy.method - * @param {string} [opts.webhooks.onChannelDestroy.format] - + * @param {string} [opts."webhooks.onChannelDestroy.format"] - * The webhooks.on_channel_destroy.format - * @param {string} [opts.webhooks.onChannelUpdate.url] - + * @param {string} [opts."webhooks.onChannelUpdate.url"] - * The webhooks.on_channel_update.url - * @param {string} [opts.webhooks.onChannelUpdate.method] - + * @param {string} [opts."webhooks.onChannelUpdate.method"] - * The webhooks.on_channel_update.method - * @param {string} [opts.webhooks.onChannelUpdate.format] - + * @param {string} [opts."webhooks.onChannelUpdate.format"] - * The webhooks.on_channel_update.format - * @param {string} [opts.webhooks.onMemberAdd.url] - The webhooks.on_member_add.url - * @param {string} [opts.webhooks.onMemberAdd.method] - + * @param {string} [opts."webhooks.onMemberAdd.url"] - + * The webhooks.on_member_add.url + * @param {string} [opts."webhooks.onMemberAdd.method"] - * The webhooks.on_member_add.method - * @param {string} [opts.webhooks.onMemberAdd.format] - + * @param {string} [opts."webhooks.onMemberAdd.format"] - * The webhooks.on_member_add.format - * @param {string} [opts.webhooks.onMemberRemove.url] - + * @param {string} [opts."webhooks.onMemberRemove.url"] - * The webhooks.on_member_remove.url - * @param {string} [opts.webhooks.onMemberRemove.method] - + * @param {string} [opts."webhooks.onMemberRemove.method"] - * The webhooks.on_member_remove.method - * @param {string} [opts.webhooks.onMemberRemove.format] - + * @param {string} [opts."webhooks.onMemberRemove.format"] - * The webhooks.on_member_remove.format - * @param {string} [opts.webhooks.onMessageSent.url] - + * @param {string} [opts."webhooks.onMessageSent.url"] - * The webhooks.on_message_sent.url - * @param {string} [opts.webhooks.onMessageSent.method] - + * @param {string} [opts."webhooks.onMessageSent.method"] - * The webhooks.on_message_sent.method - * @param {string} [opts.webhooks.onMessageSent.format] - + * @param {string} [opts."webhooks.onMessageSent.format"] - * The webhooks.on_message_sent.format - * @param {string} [opts.webhooks.onMessageUpdated.url] - + * @param {string} [opts."webhooks.onMessageUpdated.url"] - * The webhooks.on_message_updated.url - * @param {string} [opts.webhooks.onMessageUpdated.method] - + * @param {string} [opts."webhooks.onMessageUpdated.method"] - * The webhooks.on_message_updated.method - * @param {string} [opts.webhooks.onMessageUpdated.format] - + * @param {string} [opts."webhooks.onMessageUpdated.format"] - * The webhooks.on_message_updated.format - * @param {string} [opts.webhooks.onMessageRemoved.url] - + * @param {string} [opts."webhooks.onMessageRemoved.url"] - * The webhooks.on_message_removed.url - * @param {string} [opts.webhooks.onMessageRemoved.method] - + * @param {string} [opts."webhooks.onMessageRemoved.method"] - * The webhooks.on_message_removed.method - * @param {string} [opts.webhooks.onMessageRemoved.format] - + * @param {string} [opts."webhooks.onMessageRemoved.format"] - * The webhooks.on_message_removed.format - * @param {string} [opts.webhooks.onChannelAdded.url] - + * @param {string} [opts."webhooks.onChannelAdded.url"] - * The webhooks.on_channel_added.url - * @param {string} [opts.webhooks.onChannelAdded.method] - + * @param {string} [opts."webhooks.onChannelAdded.method"] - * The webhooks.on_channel_added.method - * @param {string} [opts.webhooks.onChannelAdded.format] - + * @param {string} [opts."webhooks.onChannelAdded.format"] - * The webhooks.on_channel_added.format - * @param {string} [opts.webhooks.onChannelDestroyed.url] - + * @param {string} [opts."webhooks.onChannelDestroyed.url"] - * The webhooks.on_channel_destroyed.url - * @param {string} [opts.webhooks.onChannelDestroyed.method] - + * @param {string} [opts."webhooks.onChannelDestroyed.method"] - * The webhooks.on_channel_destroyed.method - * @param {string} [opts.webhooks.onChannelDestroyed.format] - + * @param {string} [opts."webhooks.onChannelDestroyed.format"] - * The webhooks.on_channel_destroyed.format - * @param {string} [opts.webhooks.onChannelUpdated.url] - + * @param {string} [opts."webhooks.onChannelUpdated.url"] - * The webhooks.on_channel_updated.url - * @param {string} [opts.webhooks.onChannelUpdated.method] - + * @param {string} [opts."webhooks.onChannelUpdated.method"] - * The webhooks.on_channel_updated.method - * @param {string} [opts.webhooks.onChannelUpdated.format] - + * @param {string} [opts."webhooks.onChannelUpdated.format"] - * The webhooks.on_channel_updated.format - * @param {string} [opts.webhooks.onMemberAdded.url] - + * @param {string} [opts."webhooks.onMemberAdded.url"] - * The webhooks.on_member_added.url - * @param {string} [opts.webhooks.onMemberAdded.method] - + * @param {string} [opts."webhooks.onMemberAdded.method"] - * The webhooks.on_member_added.method - * @param {string} [opts.webhooks.onMemberAdded.format] - + * @param {string} [opts."webhooks.onMemberAdded.format"] - * The webhooks.on_member_added.format - * @param {string} [opts.webhooks.onMemberRemoved.url] - + * @param {string} [opts."webhooks.onMemberRemoved.url"] - * The webhooks.on_member_removed.url - * @param {string} [opts.webhooks.onMemberRemoved.method] - + * @param {string} [opts."webhooks.onMemberRemoved.method"] - * The webhooks.on_member_removed.method - * @param {string} [opts.webhooks.onMemberRemoved.format] - + * @param {string} [opts."webhooks.onMemberRemoved.format"] - * The webhooks.on_member_removed.format - * @param {number} [opts.limits.channelMembers] - The limits.channel_members - * @param {number} [opts.limits.userChannels] - The limits.user_channels + * @param {number} [opts."limits.channelMembers"] - The limits.channel_members + * @param {number} [opts."limits.userChannels"] - The limits.user_channels * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ServiceInstance @@ -969,68 +971,68 @@ ServiceContext.prototype.update = function update(opts, callback) { 'ReachabilityEnabled': serialize.bool(_.get(opts, 'reachabilityEnabled')), 'TypingIndicatorTimeout': _.get(opts, 'typingIndicatorTimeout'), 'ConsumptionReportInterval': _.get(opts, 'consumptionReportInterval'), - 'Notifications.NewMessage.Enabled': serialize.bool(_.get(opts, 'notifications.newMessage.enabled')), - 'Notifications.NewMessage.Template': _.get(opts, 'notifications.newMessage.template'), - 'Notifications.AddedToChannel.Enabled': serialize.bool(_.get(opts, 'notifications.addedToChannel.enabled')), - 'Notifications.AddedToChannel.Template': _.get(opts, 'notifications.addedToChannel.template'), - 'Notifications.RemovedFromChannel.Enabled': serialize.bool(_.get(opts, 'notifications.removedFromChannel.enabled')), - 'Notifications.RemovedFromChannel.Template': _.get(opts, 'notifications.removedFromChannel.template'), - 'Notifications.InvitedToChannel.Enabled': serialize.bool(_.get(opts, 'notifications.invitedToChannel.enabled')), - 'Notifications.InvitedToChannel.Template': _.get(opts, 'notifications.invitedToChannel.template'), + 'Notifications.NewMessage.Enabled': serialize.bool(_.get(opts, '"notifications.newMessage.enabled"')), + 'Notifications.NewMessage.Template': _.get(opts, '"notifications.newMessage.template"'), + 'Notifications.AddedToChannel.Enabled': serialize.bool(_.get(opts, '"notifications.addedToChannel.enabled"')), + 'Notifications.AddedToChannel.Template': _.get(opts, '"notifications.addedToChannel.template"'), + 'Notifications.RemovedFromChannel.Enabled': serialize.bool(_.get(opts, '"notifications.removedFromChannel.enabled"')), + 'Notifications.RemovedFromChannel.Template': _.get(opts, '"notifications.removedFromChannel.template"'), + 'Notifications.InvitedToChannel.Enabled': serialize.bool(_.get(opts, '"notifications.invitedToChannel.enabled"')), + 'Notifications.InvitedToChannel.Template': _.get(opts, '"notifications.invitedToChannel.template"'), 'PreWebhookUrl': _.get(opts, 'preWebhookUrl'), 'PostWebhookUrl': _.get(opts, 'postWebhookUrl'), 'WebhookMethod': _.get(opts, 'webhookMethod'), 'WebhookFilters': serialize.map(_.get(opts, 'webhookFilters'), function(e) { return e; }), - 'Webhooks.OnMessageSend.Url': _.get(opts, 'webhooks.onMessageSend.url'), - 'Webhooks.OnMessageSend.Method': _.get(opts, 'webhooks.onMessageSend.method'), - 'Webhooks.OnMessageSend.Format': _.get(opts, 'webhooks.onMessageSend.format'), - 'Webhooks.OnMessageUpdate.Url': _.get(opts, 'webhooks.onMessageUpdate.url'), - 'Webhooks.OnMessageUpdate.Method': _.get(opts, 'webhooks.onMessageUpdate.method'), - 'Webhooks.OnMessageUpdate.Format': _.get(opts, 'webhooks.onMessageUpdate.format'), - 'Webhooks.OnMessageRemove.Url': _.get(opts, 'webhooks.onMessageRemove.url'), - 'Webhooks.OnMessageRemove.Method': _.get(opts, 'webhooks.onMessageRemove.method'), - 'Webhooks.OnMessageRemove.Format': _.get(opts, 'webhooks.onMessageRemove.format'), - 'Webhooks.OnChannelAdd.Url': _.get(opts, 'webhooks.onChannelAdd.url'), - 'Webhooks.OnChannelAdd.Method': _.get(opts, 'webhooks.onChannelAdd.method'), - 'Webhooks.OnChannelAdd.Format': _.get(opts, 'webhooks.onChannelAdd.format'), - 'Webhooks.OnChannelDestroy.Url': _.get(opts, 'webhooks.onChannelDestroy.url'), - 'Webhooks.OnChannelDestroy.Method': _.get(opts, 'webhooks.onChannelDestroy.method'), - 'Webhooks.OnChannelDestroy.Format': _.get(opts, 'webhooks.onChannelDestroy.format'), - 'Webhooks.OnChannelUpdate.Url': _.get(opts, 'webhooks.onChannelUpdate.url'), - 'Webhooks.OnChannelUpdate.Method': _.get(opts, 'webhooks.onChannelUpdate.method'), - 'Webhooks.OnChannelUpdate.Format': _.get(opts, 'webhooks.onChannelUpdate.format'), - 'Webhooks.OnMemberAdd.Url': _.get(opts, 'webhooks.onMemberAdd.url'), - 'Webhooks.OnMemberAdd.Method': _.get(opts, 'webhooks.onMemberAdd.method'), - 'Webhooks.OnMemberAdd.Format': _.get(opts, 'webhooks.onMemberAdd.format'), - 'Webhooks.OnMemberRemove.Url': _.get(opts, 'webhooks.onMemberRemove.url'), - 'Webhooks.OnMemberRemove.Method': _.get(opts, 'webhooks.onMemberRemove.method'), - 'Webhooks.OnMemberRemove.Format': _.get(opts, 'webhooks.onMemberRemove.format'), - 'Webhooks.OnMessageSent.Url': _.get(opts, 'webhooks.onMessageSent.url'), - 'Webhooks.OnMessageSent.Method': _.get(opts, 'webhooks.onMessageSent.method'), - 'Webhooks.OnMessageSent.Format': _.get(opts, 'webhooks.onMessageSent.format'), - 'Webhooks.OnMessageUpdated.Url': _.get(opts, 'webhooks.onMessageUpdated.url'), - 'Webhooks.OnMessageUpdated.Method': _.get(opts, 'webhooks.onMessageUpdated.method'), - 'Webhooks.OnMessageUpdated.Format': _.get(opts, 'webhooks.onMessageUpdated.format'), - 'Webhooks.OnMessageRemoved.Url': _.get(opts, 'webhooks.onMessageRemoved.url'), - 'Webhooks.OnMessageRemoved.Method': _.get(opts, 'webhooks.onMessageRemoved.method'), - 'Webhooks.OnMessageRemoved.Format': _.get(opts, 'webhooks.onMessageRemoved.format'), - 'Webhooks.OnChannelAdded.Url': _.get(opts, 'webhooks.onChannelAdded.url'), - 'Webhooks.OnChannelAdded.Method': _.get(opts, 'webhooks.onChannelAdded.method'), - 'Webhooks.OnChannelAdded.Format': _.get(opts, 'webhooks.onChannelAdded.format'), - 'Webhooks.OnChannelDestroyed.Url': _.get(opts, 'webhooks.onChannelDestroyed.url'), - 'Webhooks.OnChannelDestroyed.Method': _.get(opts, 'webhooks.onChannelDestroyed.method'), - 'Webhooks.OnChannelDestroyed.Format': _.get(opts, 'webhooks.onChannelDestroyed.format'), - 'Webhooks.OnChannelUpdated.Url': _.get(opts, 'webhooks.onChannelUpdated.url'), - 'Webhooks.OnChannelUpdated.Method': _.get(opts, 'webhooks.onChannelUpdated.method'), - 'Webhooks.OnChannelUpdated.Format': _.get(opts, 'webhooks.onChannelUpdated.format'), - 'Webhooks.OnMemberAdded.Url': _.get(opts, 'webhooks.onMemberAdded.url'), - 'Webhooks.OnMemberAdded.Method': _.get(opts, 'webhooks.onMemberAdded.method'), - 'Webhooks.OnMemberAdded.Format': _.get(opts, 'webhooks.onMemberAdded.format'), - 'Webhooks.OnMemberRemoved.Url': _.get(opts, 'webhooks.onMemberRemoved.url'), - 'Webhooks.OnMemberRemoved.Method': _.get(opts, 'webhooks.onMemberRemoved.method'), - 'Webhooks.OnMemberRemoved.Format': _.get(opts, 'webhooks.onMemberRemoved.format'), - 'Limits.ChannelMembers': _.get(opts, 'limits.channelMembers'), - 'Limits.UserChannels': _.get(opts, 'limits.userChannels') + 'Webhooks.OnMessageSend.Url': _.get(opts, '"webhooks.onMessageSend.url"'), + 'Webhooks.OnMessageSend.Method': _.get(opts, '"webhooks.onMessageSend.method"'), + 'Webhooks.OnMessageSend.Format': _.get(opts, '"webhooks.onMessageSend.format"'), + 'Webhooks.OnMessageUpdate.Url': _.get(opts, '"webhooks.onMessageUpdate.url"'), + 'Webhooks.OnMessageUpdate.Method': _.get(opts, '"webhooks.onMessageUpdate.method"'), + 'Webhooks.OnMessageUpdate.Format': _.get(opts, '"webhooks.onMessageUpdate.format"'), + 'Webhooks.OnMessageRemove.Url': _.get(opts, '"webhooks.onMessageRemove.url"'), + 'Webhooks.OnMessageRemove.Method': _.get(opts, '"webhooks.onMessageRemove.method"'), + 'Webhooks.OnMessageRemove.Format': _.get(opts, '"webhooks.onMessageRemove.format"'), + 'Webhooks.OnChannelAdd.Url': _.get(opts, '"webhooks.onChannelAdd.url"'), + 'Webhooks.OnChannelAdd.Method': _.get(opts, '"webhooks.onChannelAdd.method"'), + 'Webhooks.OnChannelAdd.Format': _.get(opts, '"webhooks.onChannelAdd.format"'), + 'Webhooks.OnChannelDestroy.Url': _.get(opts, '"webhooks.onChannelDestroy.url"'), + 'Webhooks.OnChannelDestroy.Method': _.get(opts, '"webhooks.onChannelDestroy.method"'), + 'Webhooks.OnChannelDestroy.Format': _.get(opts, '"webhooks.onChannelDestroy.format"'), + 'Webhooks.OnChannelUpdate.Url': _.get(opts, '"webhooks.onChannelUpdate.url"'), + 'Webhooks.OnChannelUpdate.Method': _.get(opts, '"webhooks.onChannelUpdate.method"'), + 'Webhooks.OnChannelUpdate.Format': _.get(opts, '"webhooks.onChannelUpdate.format"'), + 'Webhooks.OnMemberAdd.Url': _.get(opts, '"webhooks.onMemberAdd.url"'), + 'Webhooks.OnMemberAdd.Method': _.get(opts, '"webhooks.onMemberAdd.method"'), + 'Webhooks.OnMemberAdd.Format': _.get(opts, '"webhooks.onMemberAdd.format"'), + 'Webhooks.OnMemberRemove.Url': _.get(opts, '"webhooks.onMemberRemove.url"'), + 'Webhooks.OnMemberRemove.Method': _.get(opts, '"webhooks.onMemberRemove.method"'), + 'Webhooks.OnMemberRemove.Format': _.get(opts, '"webhooks.onMemberRemove.format"'), + 'Webhooks.OnMessageSent.Url': _.get(opts, '"webhooks.onMessageSent.url"'), + 'Webhooks.OnMessageSent.Method': _.get(opts, '"webhooks.onMessageSent.method"'), + 'Webhooks.OnMessageSent.Format': _.get(opts, '"webhooks.onMessageSent.format"'), + 'Webhooks.OnMessageUpdated.Url': _.get(opts, '"webhooks.onMessageUpdated.url"'), + 'Webhooks.OnMessageUpdated.Method': _.get(opts, '"webhooks.onMessageUpdated.method"'), + 'Webhooks.OnMessageUpdated.Format': _.get(opts, '"webhooks.onMessageUpdated.format"'), + 'Webhooks.OnMessageRemoved.Url': _.get(opts, '"webhooks.onMessageRemoved.url"'), + 'Webhooks.OnMessageRemoved.Method': _.get(opts, '"webhooks.onMessageRemoved.method"'), + 'Webhooks.OnMessageRemoved.Format': _.get(opts, '"webhooks.onMessageRemoved.format"'), + 'Webhooks.OnChannelAdded.Url': _.get(opts, '"webhooks.onChannelAdded.url"'), + 'Webhooks.OnChannelAdded.Method': _.get(opts, '"webhooks.onChannelAdded.method"'), + 'Webhooks.OnChannelAdded.Format': _.get(opts, '"webhooks.onChannelAdded.format"'), + 'Webhooks.OnChannelDestroyed.Url': _.get(opts, '"webhooks.onChannelDestroyed.url"'), + 'Webhooks.OnChannelDestroyed.Method': _.get(opts, '"webhooks.onChannelDestroyed.method"'), + 'Webhooks.OnChannelDestroyed.Format': _.get(opts, '"webhooks.onChannelDestroyed.format"'), + 'Webhooks.OnChannelUpdated.Url': _.get(opts, '"webhooks.onChannelUpdated.url"'), + 'Webhooks.OnChannelUpdated.Method': _.get(opts, '"webhooks.onChannelUpdated.method"'), + 'Webhooks.OnChannelUpdated.Format': _.get(opts, '"webhooks.onChannelUpdated.format"'), + 'Webhooks.OnMemberAdded.Url': _.get(opts, '"webhooks.onMemberAdded.url"'), + 'Webhooks.OnMemberAdded.Method': _.get(opts, '"webhooks.onMemberAdded.method"'), + 'Webhooks.OnMemberAdded.Format': _.get(opts, '"webhooks.onMemberAdded.format"'), + 'Webhooks.OnMemberRemoved.Url': _.get(opts, '"webhooks.onMemberRemoved.url"'), + 'Webhooks.OnMemberRemoved.Method': _.get(opts, '"webhooks.onMemberRemoved.method"'), + 'Webhooks.OnMemberRemoved.Format': _.get(opts, '"webhooks.onMemberRemoved.format"'), + 'Limits.ChannelMembers': _.get(opts, '"limits.channelMembers"'), + 'Limits.UserChannels': _.get(opts, '"limits.userChannels"') }); var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); diff --git a/lib/rest/chat/v2/service.js b/lib/rest/chat/v2/service.js index 1c61001863..5cb4997c00 100644 --- a/lib/rest/chat/v2/service.js +++ b/lib/rest/chat/v2/service.js @@ -529,43 +529,44 @@ ServiceInstance.prototype.remove = function remove(callback) { * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout * @param {number} [opts.consumptionReportInterval] - * The consumption_report_interval - * @param {boolean} [opts.notifications.newMessage.enabled] - + * @param {boolean} [opts."notifications.newMessage.enabled"] - * The notifications.new_message.enabled - * @param {string} [opts.notifications.newMessage.template] - + * @param {string} [opts."notifications.newMessage.template"] - * The notifications.new_message.template - * @param {string} [opts.notifications.newMessage.sound] - + * @param {string} [opts."notifications.newMessage.sound"] - * The notifications.new_message.sound - * @param {boolean} [opts.notifications.newMessage.badgeCountEnabled] - + * @param {boolean} [opts."notifications.newMessage.badgeCountEnabled"] - * The notifications.new_message.badge_count_enabled - * @param {boolean} [opts.notifications.addedToChannel.enabled] - + * @param {boolean} [opts."notifications.addedToChannel.enabled"] - * The notifications.added_to_channel.enabled - * @param {string} [opts.notifications.addedToChannel.template] - + * @param {string} [opts."notifications.addedToChannel.template"] - * The notifications.added_to_channel.template - * @param {string} [opts.notifications.addedToChannel.sound] - + * @param {string} [opts."notifications.addedToChannel.sound"] - * The notifications.added_to_channel.sound - * @param {boolean} [opts.notifications.removedFromChannel.enabled] - + * @param {boolean} [opts."notifications.removedFromChannel.enabled"] - * The notifications.removed_from_channel.enabled - * @param {string} [opts.notifications.removedFromChannel.template] - + * @param {string} [opts."notifications.removedFromChannel.template"] - * The notifications.removed_from_channel.template - * @param {string} [opts.notifications.removedFromChannel.sound] - + * @param {string} [opts."notifications.removedFromChannel.sound"] - * The notifications.removed_from_channel.sound - * @param {boolean} [opts.notifications.invitedToChannel.enabled] - + * @param {boolean} [opts."notifications.invitedToChannel.enabled"] - * The notifications.invited_to_channel.enabled - * @param {string} [opts.notifications.invitedToChannel.template] - + * @param {string} [opts."notifications.invitedToChannel.template"] - * The notifications.invited_to_channel.template - * @param {string} [opts.notifications.invitedToChannel.sound] - + * @param {string} [opts."notifications.invitedToChannel.sound"] - * The notifications.invited_to_channel.sound * @param {string} [opts.preWebhookUrl] - The pre_webhook_url * @param {string} [opts.postWebhookUrl] - The post_webhook_url * @param {string} [opts.webhookMethod] - The webhook_method * @param {string|list} [opts.webhookFilters] - The webhook_filters - * @param {number} [opts.limits.channelMembers] - The limits.channel_members - * @param {number} [opts.limits.userChannels] - The limits.user_channels - * @param {string} [opts.media.compatibilityMessage] - + * @param {number} [opts."limits.channelMembers"] - The limits.channel_members + * @param {number} [opts."limits.userChannels"] - The limits.user_channels + * @param {string} [opts."media.compatibilityMessage"] - * The media.compatibility_message * @param {number} [opts.preWebhookRetryCount] - The pre_webhook_retry_count * @param {number} [opts.postWebhookRetryCount] - The post_webhook_retry_count - * @param {boolean} [opts.notifications.logEnabled] - The notifications.log_enabled + * @param {boolean} [opts."notifications.logEnabled"] - + * The notifications.log_enabled * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ServiceInstance @@ -773,43 +774,44 @@ ServiceContext.prototype.remove = function remove(callback) { * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout * @param {number} [opts.consumptionReportInterval] - * The consumption_report_interval - * @param {boolean} [opts.notifications.newMessage.enabled] - + * @param {boolean} [opts."notifications.newMessage.enabled"] - * The notifications.new_message.enabled - * @param {string} [opts.notifications.newMessage.template] - + * @param {string} [opts."notifications.newMessage.template"] - * The notifications.new_message.template - * @param {string} [opts.notifications.newMessage.sound] - + * @param {string} [opts."notifications.newMessage.sound"] - * The notifications.new_message.sound - * @param {boolean} [opts.notifications.newMessage.badgeCountEnabled] - + * @param {boolean} [opts."notifications.newMessage.badgeCountEnabled"] - * The notifications.new_message.badge_count_enabled - * @param {boolean} [opts.notifications.addedToChannel.enabled] - + * @param {boolean} [opts."notifications.addedToChannel.enabled"] - * The notifications.added_to_channel.enabled - * @param {string} [opts.notifications.addedToChannel.template] - + * @param {string} [opts."notifications.addedToChannel.template"] - * The notifications.added_to_channel.template - * @param {string} [opts.notifications.addedToChannel.sound] - + * @param {string} [opts."notifications.addedToChannel.sound"] - * The notifications.added_to_channel.sound - * @param {boolean} [opts.notifications.removedFromChannel.enabled] - + * @param {boolean} [opts."notifications.removedFromChannel.enabled"] - * The notifications.removed_from_channel.enabled - * @param {string} [opts.notifications.removedFromChannel.template] - + * @param {string} [opts."notifications.removedFromChannel.template"] - * The notifications.removed_from_channel.template - * @param {string} [opts.notifications.removedFromChannel.sound] - + * @param {string} [opts."notifications.removedFromChannel.sound"] - * The notifications.removed_from_channel.sound - * @param {boolean} [opts.notifications.invitedToChannel.enabled] - + * @param {boolean} [opts."notifications.invitedToChannel.enabled"] - * The notifications.invited_to_channel.enabled - * @param {string} [opts.notifications.invitedToChannel.template] - + * @param {string} [opts."notifications.invitedToChannel.template"] - * The notifications.invited_to_channel.template - * @param {string} [opts.notifications.invitedToChannel.sound] - + * @param {string} [opts."notifications.invitedToChannel.sound"] - * The notifications.invited_to_channel.sound * @param {string} [opts.preWebhookUrl] - The pre_webhook_url * @param {string} [opts.postWebhookUrl] - The post_webhook_url * @param {string} [opts.webhookMethod] - The webhook_method * @param {string|list} [opts.webhookFilters] - The webhook_filters - * @param {number} [opts.limits.channelMembers] - The limits.channel_members - * @param {number} [opts.limits.userChannels] - The limits.user_channels - * @param {string} [opts.media.compatibilityMessage] - + * @param {number} [opts."limits.channelMembers"] - The limits.channel_members + * @param {number} [opts."limits.userChannels"] - The limits.user_channels + * @param {string} [opts."media.compatibilityMessage"] - * The media.compatibility_message * @param {number} [opts.preWebhookRetryCount] - The pre_webhook_retry_count * @param {number} [opts.postWebhookRetryCount] - The post_webhook_retry_count - * @param {boolean} [opts.notifications.logEnabled] - The notifications.log_enabled + * @param {boolean} [opts."notifications.logEnabled"] - + * The notifications.log_enabled * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ServiceInstance @@ -832,29 +834,29 @@ ServiceContext.prototype.update = function update(opts, callback) { 'ReachabilityEnabled': serialize.bool(_.get(opts, 'reachabilityEnabled')), 'TypingIndicatorTimeout': _.get(opts, 'typingIndicatorTimeout'), 'ConsumptionReportInterval': _.get(opts, 'consumptionReportInterval'), - 'Notifications.NewMessage.Enabled': serialize.bool(_.get(opts, 'notifications.newMessage.enabled')), - 'Notifications.NewMessage.Template': _.get(opts, 'notifications.newMessage.template'), - 'Notifications.NewMessage.Sound': _.get(opts, 'notifications.newMessage.sound'), - 'Notifications.NewMessage.BadgeCountEnabled': serialize.bool(_.get(opts, 'notifications.newMessage.badgeCountEnabled')), - 'Notifications.AddedToChannel.Enabled': serialize.bool(_.get(opts, 'notifications.addedToChannel.enabled')), - 'Notifications.AddedToChannel.Template': _.get(opts, 'notifications.addedToChannel.template'), - 'Notifications.AddedToChannel.Sound': _.get(opts, 'notifications.addedToChannel.sound'), - 'Notifications.RemovedFromChannel.Enabled': serialize.bool(_.get(opts, 'notifications.removedFromChannel.enabled')), - 'Notifications.RemovedFromChannel.Template': _.get(opts, 'notifications.removedFromChannel.template'), - 'Notifications.RemovedFromChannel.Sound': _.get(opts, 'notifications.removedFromChannel.sound'), - 'Notifications.InvitedToChannel.Enabled': serialize.bool(_.get(opts, 'notifications.invitedToChannel.enabled')), - 'Notifications.InvitedToChannel.Template': _.get(opts, 'notifications.invitedToChannel.template'), - 'Notifications.InvitedToChannel.Sound': _.get(opts, 'notifications.invitedToChannel.sound'), + 'Notifications.NewMessage.Enabled': serialize.bool(_.get(opts, '"notifications.newMessage.enabled"')), + 'Notifications.NewMessage.Template': _.get(opts, '"notifications.newMessage.template"'), + 'Notifications.NewMessage.Sound': _.get(opts, '"notifications.newMessage.sound"'), + 'Notifications.NewMessage.BadgeCountEnabled': serialize.bool(_.get(opts, '"notifications.newMessage.badgeCountEnabled"')), + 'Notifications.AddedToChannel.Enabled': serialize.bool(_.get(opts, '"notifications.addedToChannel.enabled"')), + 'Notifications.AddedToChannel.Template': _.get(opts, '"notifications.addedToChannel.template"'), + 'Notifications.AddedToChannel.Sound': _.get(opts, '"notifications.addedToChannel.sound"'), + 'Notifications.RemovedFromChannel.Enabled': serialize.bool(_.get(opts, '"notifications.removedFromChannel.enabled"')), + 'Notifications.RemovedFromChannel.Template': _.get(opts, '"notifications.removedFromChannel.template"'), + 'Notifications.RemovedFromChannel.Sound': _.get(opts, '"notifications.removedFromChannel.sound"'), + 'Notifications.InvitedToChannel.Enabled': serialize.bool(_.get(opts, '"notifications.invitedToChannel.enabled"')), + 'Notifications.InvitedToChannel.Template': _.get(opts, '"notifications.invitedToChannel.template"'), + 'Notifications.InvitedToChannel.Sound': _.get(opts, '"notifications.invitedToChannel.sound"'), 'PreWebhookUrl': _.get(opts, 'preWebhookUrl'), 'PostWebhookUrl': _.get(opts, 'postWebhookUrl'), 'WebhookMethod': _.get(opts, 'webhookMethod'), 'WebhookFilters': serialize.map(_.get(opts, 'webhookFilters'), function(e) { return e; }), - 'Limits.ChannelMembers': _.get(opts, 'limits.channelMembers'), - 'Limits.UserChannels': _.get(opts, 'limits.userChannels'), - 'Media.CompatibilityMessage': _.get(opts, 'media.compatibilityMessage'), + 'Limits.ChannelMembers': _.get(opts, '"limits.channelMembers"'), + 'Limits.UserChannels': _.get(opts, '"limits.userChannels"'), + 'Media.CompatibilityMessage': _.get(opts, '"media.compatibilityMessage"'), 'PreWebhookRetryCount': _.get(opts, 'preWebhookRetryCount'), 'PostWebhookRetryCount': _.get(opts, 'postWebhookRetryCount'), - 'Notifications.LogEnabled': serialize.bool(_.get(opts, 'notifications.logEnabled')) + 'Notifications.LogEnabled': serialize.bool(_.get(opts, '"notifications.logEnabled"')) }); var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); diff --git a/lib/rest/ipMessaging/v1/service.js b/lib/rest/ipMessaging/v1/service.js index 657c148b97..cb105f427f 100644 --- a/lib/rest/ipMessaging/v1/service.js +++ b/lib/rest/ipMessaging/v1/service.js @@ -524,123 +524,124 @@ ServiceInstance.prototype.remove = function remove(callback) { * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout * @param {number} [opts.consumptionReportInterval] - * The consumption_report_interval - * @param {boolean} [opts.notifications.newMessage.enabled] - + * @param {boolean} [opts."notifications.newMessage.enabled"] - * The notifications.new_message.enabled - * @param {string} [opts.notifications.newMessage.template] - + * @param {string} [opts."notifications.newMessage.template"] - * The notifications.new_message.template - * @param {boolean} [opts.notifications.addedToChannel.enabled] - + * @param {boolean} [opts."notifications.addedToChannel.enabled"] - * The notifications.added_to_channel.enabled - * @param {string} [opts.notifications.addedToChannel.template] - + * @param {string} [opts."notifications.addedToChannel.template"] - * The notifications.added_to_channel.template - * @param {boolean} [opts.notifications.removedFromChannel.enabled] - + * @param {boolean} [opts."notifications.removedFromChannel.enabled"] - * The notifications.removed_from_channel.enabled - * @param {string} [opts.notifications.removedFromChannel.template] - + * @param {string} [opts."notifications.removedFromChannel.template"] - * The notifications.removed_from_channel.template - * @param {boolean} [opts.notifications.invitedToChannel.enabled] - + * @param {boolean} [opts."notifications.invitedToChannel.enabled"] - * The notifications.invited_to_channel.enabled - * @param {string} [opts.notifications.invitedToChannel.template] - + * @param {string} [opts."notifications.invitedToChannel.template"] - * The notifications.invited_to_channel.template * @param {string} [opts.preWebhookUrl] - The pre_webhook_url * @param {string} [opts.postWebhookUrl] - The post_webhook_url * @param {string} [opts.webhookMethod] - The webhook_method * @param {string|list} [opts.webhookFilters] - The webhook_filters - * @param {string} [opts.webhooks.onMessageSend.url] - + * @param {string} [opts."webhooks.onMessageSend.url"] - * The webhooks.on_message_send.url - * @param {string} [opts.webhooks.onMessageSend.method] - + * @param {string} [opts."webhooks.onMessageSend.method"] - * The webhooks.on_message_send.method - * @param {string} [opts.webhooks.onMessageSend.format] - + * @param {string} [opts."webhooks.onMessageSend.format"] - * The webhooks.on_message_send.format - * @param {string} [opts.webhooks.onMessageUpdate.url] - + * @param {string} [opts."webhooks.onMessageUpdate.url"] - * The webhooks.on_message_update.url - * @param {string} [opts.webhooks.onMessageUpdate.method] - + * @param {string} [opts."webhooks.onMessageUpdate.method"] - * The webhooks.on_message_update.method - * @param {string} [opts.webhooks.onMessageUpdate.format] - + * @param {string} [opts."webhooks.onMessageUpdate.format"] - * The webhooks.on_message_update.format - * @param {string} [opts.webhooks.onMessageRemove.url] - + * @param {string} [opts."webhooks.onMessageRemove.url"] - * The webhooks.on_message_remove.url - * @param {string} [opts.webhooks.onMessageRemove.method] - + * @param {string} [opts."webhooks.onMessageRemove.method"] - * The webhooks.on_message_remove.method - * @param {string} [opts.webhooks.onMessageRemove.format] - + * @param {string} [opts."webhooks.onMessageRemove.format"] - * The webhooks.on_message_remove.format - * @param {string} [opts.webhooks.onChannelAdd.url] - + * @param {string} [opts."webhooks.onChannelAdd.url"] - * The webhooks.on_channel_add.url - * @param {string} [opts.webhooks.onChannelAdd.method] - + * @param {string} [opts."webhooks.onChannelAdd.method"] - * The webhooks.on_channel_add.method - * @param {string} [opts.webhooks.onChannelAdd.format] - + * @param {string} [opts."webhooks.onChannelAdd.format"] - * The webhooks.on_channel_add.format - * @param {string} [opts.webhooks.onChannelDestroy.url] - + * @param {string} [opts."webhooks.onChannelDestroy.url"] - * The webhooks.on_channel_destroy.url - * @param {string} [opts.webhooks.onChannelDestroy.method] - + * @param {string} [opts."webhooks.onChannelDestroy.method"] - * The webhooks.on_channel_destroy.method - * @param {string} [opts.webhooks.onChannelDestroy.format] - + * @param {string} [opts."webhooks.onChannelDestroy.format"] - * The webhooks.on_channel_destroy.format - * @param {string} [opts.webhooks.onChannelUpdate.url] - + * @param {string} [opts."webhooks.onChannelUpdate.url"] - * The webhooks.on_channel_update.url - * @param {string} [opts.webhooks.onChannelUpdate.method] - + * @param {string} [opts."webhooks.onChannelUpdate.method"] - * The webhooks.on_channel_update.method - * @param {string} [opts.webhooks.onChannelUpdate.format] - + * @param {string} [opts."webhooks.onChannelUpdate.format"] - * The webhooks.on_channel_update.format - * @param {string} [opts.webhooks.onMemberAdd.url] - The webhooks.on_member_add.url - * @param {string} [opts.webhooks.onMemberAdd.method] - + * @param {string} [opts."webhooks.onMemberAdd.url"] - + * The webhooks.on_member_add.url + * @param {string} [opts."webhooks.onMemberAdd.method"] - * The webhooks.on_member_add.method - * @param {string} [opts.webhooks.onMemberAdd.format] - + * @param {string} [opts."webhooks.onMemberAdd.format"] - * The webhooks.on_member_add.format - * @param {string} [opts.webhooks.onMemberRemove.url] - + * @param {string} [opts."webhooks.onMemberRemove.url"] - * The webhooks.on_member_remove.url - * @param {string} [opts.webhooks.onMemberRemove.method] - + * @param {string} [opts."webhooks.onMemberRemove.method"] - * The webhooks.on_member_remove.method - * @param {string} [opts.webhooks.onMemberRemove.format] - + * @param {string} [opts."webhooks.onMemberRemove.format"] - * The webhooks.on_member_remove.format - * @param {string} [opts.webhooks.onMessageSent.url] - + * @param {string} [opts."webhooks.onMessageSent.url"] - * The webhooks.on_message_sent.url - * @param {string} [opts.webhooks.onMessageSent.method] - + * @param {string} [opts."webhooks.onMessageSent.method"] - * The webhooks.on_message_sent.method - * @param {string} [opts.webhooks.onMessageSent.format] - + * @param {string} [opts."webhooks.onMessageSent.format"] - * The webhooks.on_message_sent.format - * @param {string} [opts.webhooks.onMessageUpdated.url] - + * @param {string} [opts."webhooks.onMessageUpdated.url"] - * The webhooks.on_message_updated.url - * @param {string} [opts.webhooks.onMessageUpdated.method] - + * @param {string} [opts."webhooks.onMessageUpdated.method"] - * The webhooks.on_message_updated.method - * @param {string} [opts.webhooks.onMessageUpdated.format] - + * @param {string} [opts."webhooks.onMessageUpdated.format"] - * The webhooks.on_message_updated.format - * @param {string} [opts.webhooks.onMessageRemoved.url] - + * @param {string} [opts."webhooks.onMessageRemoved.url"] - * The webhooks.on_message_removed.url - * @param {string} [opts.webhooks.onMessageRemoved.method] - + * @param {string} [opts."webhooks.onMessageRemoved.method"] - * The webhooks.on_message_removed.method - * @param {string} [opts.webhooks.onMessageRemoved.format] - + * @param {string} [opts."webhooks.onMessageRemoved.format"] - * The webhooks.on_message_removed.format - * @param {string} [opts.webhooks.onChannelAdded.url] - + * @param {string} [opts."webhooks.onChannelAdded.url"] - * The webhooks.on_channel_added.url - * @param {string} [opts.webhooks.onChannelAdded.method] - + * @param {string} [opts."webhooks.onChannelAdded.method"] - * The webhooks.on_channel_added.method - * @param {string} [opts.webhooks.onChannelAdded.format] - + * @param {string} [opts."webhooks.onChannelAdded.format"] - * The webhooks.on_channel_added.format - * @param {string} [opts.webhooks.onChannelDestroyed.url] - + * @param {string} [opts."webhooks.onChannelDestroyed.url"] - * The webhooks.on_channel_destroyed.url - * @param {string} [opts.webhooks.onChannelDestroyed.method] - + * @param {string} [opts."webhooks.onChannelDestroyed.method"] - * The webhooks.on_channel_destroyed.method - * @param {string} [opts.webhooks.onChannelDestroyed.format] - + * @param {string} [opts."webhooks.onChannelDestroyed.format"] - * The webhooks.on_channel_destroyed.format - * @param {string} [opts.webhooks.onChannelUpdated.url] - + * @param {string} [opts."webhooks.onChannelUpdated.url"] - * The webhooks.on_channel_updated.url - * @param {string} [opts.webhooks.onChannelUpdated.method] - + * @param {string} [opts."webhooks.onChannelUpdated.method"] - * The webhooks.on_channel_updated.method - * @param {string} [opts.webhooks.onChannelUpdated.format] - + * @param {string} [opts."webhooks.onChannelUpdated.format"] - * The webhooks.on_channel_updated.format - * @param {string} [opts.webhooks.onMemberAdded.url] - + * @param {string} [opts."webhooks.onMemberAdded.url"] - * The webhooks.on_member_added.url - * @param {string} [opts.webhooks.onMemberAdded.method] - + * @param {string} [opts."webhooks.onMemberAdded.method"] - * The webhooks.on_member_added.method - * @param {string} [opts.webhooks.onMemberAdded.format] - + * @param {string} [opts."webhooks.onMemberAdded.format"] - * The webhooks.on_member_added.format - * @param {string} [opts.webhooks.onMemberRemoved.url] - + * @param {string} [opts."webhooks.onMemberRemoved.url"] - * The webhooks.on_member_removed.url - * @param {string} [opts.webhooks.onMemberRemoved.method] - + * @param {string} [opts."webhooks.onMemberRemoved.method"] - * The webhooks.on_member_removed.method - * @param {string} [opts.webhooks.onMemberRemoved.format] - + * @param {string} [opts."webhooks.onMemberRemoved.format"] - * The webhooks.on_member_removed.format - * @param {number} [opts.limits.channelMembers] - The limits.channel_members - * @param {number} [opts.limits.userChannels] - The limits.user_channels + * @param {number} [opts."limits.channelMembers"] - The limits.channel_members + * @param {number} [opts."limits.userChannels"] - The limits.user_channels * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ServiceInstance @@ -830,123 +831,124 @@ ServiceContext.prototype.remove = function remove(callback) { * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout * @param {number} [opts.consumptionReportInterval] - * The consumption_report_interval - * @param {boolean} [opts.notifications.newMessage.enabled] - + * @param {boolean} [opts."notifications.newMessage.enabled"] - * The notifications.new_message.enabled - * @param {string} [opts.notifications.newMessage.template] - + * @param {string} [opts."notifications.newMessage.template"] - * The notifications.new_message.template - * @param {boolean} [opts.notifications.addedToChannel.enabled] - + * @param {boolean} [opts."notifications.addedToChannel.enabled"] - * The notifications.added_to_channel.enabled - * @param {string} [opts.notifications.addedToChannel.template] - + * @param {string} [opts."notifications.addedToChannel.template"] - * The notifications.added_to_channel.template - * @param {boolean} [opts.notifications.removedFromChannel.enabled] - + * @param {boolean} [opts."notifications.removedFromChannel.enabled"] - * The notifications.removed_from_channel.enabled - * @param {string} [opts.notifications.removedFromChannel.template] - + * @param {string} [opts."notifications.removedFromChannel.template"] - * The notifications.removed_from_channel.template - * @param {boolean} [opts.notifications.invitedToChannel.enabled] - + * @param {boolean} [opts."notifications.invitedToChannel.enabled"] - * The notifications.invited_to_channel.enabled - * @param {string} [opts.notifications.invitedToChannel.template] - + * @param {string} [opts."notifications.invitedToChannel.template"] - * The notifications.invited_to_channel.template * @param {string} [opts.preWebhookUrl] - The pre_webhook_url * @param {string} [opts.postWebhookUrl] - The post_webhook_url * @param {string} [opts.webhookMethod] - The webhook_method * @param {string|list} [opts.webhookFilters] - The webhook_filters - * @param {string} [opts.webhooks.onMessageSend.url] - + * @param {string} [opts."webhooks.onMessageSend.url"] - * The webhooks.on_message_send.url - * @param {string} [opts.webhooks.onMessageSend.method] - + * @param {string} [opts."webhooks.onMessageSend.method"] - * The webhooks.on_message_send.method - * @param {string} [opts.webhooks.onMessageSend.format] - + * @param {string} [opts."webhooks.onMessageSend.format"] - * The webhooks.on_message_send.format - * @param {string} [opts.webhooks.onMessageUpdate.url] - + * @param {string} [opts."webhooks.onMessageUpdate.url"] - * The webhooks.on_message_update.url - * @param {string} [opts.webhooks.onMessageUpdate.method] - + * @param {string} [opts."webhooks.onMessageUpdate.method"] - * The webhooks.on_message_update.method - * @param {string} [opts.webhooks.onMessageUpdate.format] - + * @param {string} [opts."webhooks.onMessageUpdate.format"] - * The webhooks.on_message_update.format - * @param {string} [opts.webhooks.onMessageRemove.url] - + * @param {string} [opts."webhooks.onMessageRemove.url"] - * The webhooks.on_message_remove.url - * @param {string} [opts.webhooks.onMessageRemove.method] - + * @param {string} [opts."webhooks.onMessageRemove.method"] - * The webhooks.on_message_remove.method - * @param {string} [opts.webhooks.onMessageRemove.format] - + * @param {string} [opts."webhooks.onMessageRemove.format"] - * The webhooks.on_message_remove.format - * @param {string} [opts.webhooks.onChannelAdd.url] - + * @param {string} [opts."webhooks.onChannelAdd.url"] - * The webhooks.on_channel_add.url - * @param {string} [opts.webhooks.onChannelAdd.method] - + * @param {string} [opts."webhooks.onChannelAdd.method"] - * The webhooks.on_channel_add.method - * @param {string} [opts.webhooks.onChannelAdd.format] - + * @param {string} [opts."webhooks.onChannelAdd.format"] - * The webhooks.on_channel_add.format - * @param {string} [opts.webhooks.onChannelDestroy.url] - + * @param {string} [opts."webhooks.onChannelDestroy.url"] - * The webhooks.on_channel_destroy.url - * @param {string} [opts.webhooks.onChannelDestroy.method] - + * @param {string} [opts."webhooks.onChannelDestroy.method"] - * The webhooks.on_channel_destroy.method - * @param {string} [opts.webhooks.onChannelDestroy.format] - + * @param {string} [opts."webhooks.onChannelDestroy.format"] - * The webhooks.on_channel_destroy.format - * @param {string} [opts.webhooks.onChannelUpdate.url] - + * @param {string} [opts."webhooks.onChannelUpdate.url"] - * The webhooks.on_channel_update.url - * @param {string} [opts.webhooks.onChannelUpdate.method] - + * @param {string} [opts."webhooks.onChannelUpdate.method"] - * The webhooks.on_channel_update.method - * @param {string} [opts.webhooks.onChannelUpdate.format] - + * @param {string} [opts."webhooks.onChannelUpdate.format"] - * The webhooks.on_channel_update.format - * @param {string} [opts.webhooks.onMemberAdd.url] - The webhooks.on_member_add.url - * @param {string} [opts.webhooks.onMemberAdd.method] - + * @param {string} [opts."webhooks.onMemberAdd.url"] - + * The webhooks.on_member_add.url + * @param {string} [opts."webhooks.onMemberAdd.method"] - * The webhooks.on_member_add.method - * @param {string} [opts.webhooks.onMemberAdd.format] - + * @param {string} [opts."webhooks.onMemberAdd.format"] - * The webhooks.on_member_add.format - * @param {string} [opts.webhooks.onMemberRemove.url] - + * @param {string} [opts."webhooks.onMemberRemove.url"] - * The webhooks.on_member_remove.url - * @param {string} [opts.webhooks.onMemberRemove.method] - + * @param {string} [opts."webhooks.onMemberRemove.method"] - * The webhooks.on_member_remove.method - * @param {string} [opts.webhooks.onMemberRemove.format] - + * @param {string} [opts."webhooks.onMemberRemove.format"] - * The webhooks.on_member_remove.format - * @param {string} [opts.webhooks.onMessageSent.url] - + * @param {string} [opts."webhooks.onMessageSent.url"] - * The webhooks.on_message_sent.url - * @param {string} [opts.webhooks.onMessageSent.method] - + * @param {string} [opts."webhooks.onMessageSent.method"] - * The webhooks.on_message_sent.method - * @param {string} [opts.webhooks.onMessageSent.format] - + * @param {string} [opts."webhooks.onMessageSent.format"] - * The webhooks.on_message_sent.format - * @param {string} [opts.webhooks.onMessageUpdated.url] - + * @param {string} [opts."webhooks.onMessageUpdated.url"] - * The webhooks.on_message_updated.url - * @param {string} [opts.webhooks.onMessageUpdated.method] - + * @param {string} [opts."webhooks.onMessageUpdated.method"] - * The webhooks.on_message_updated.method - * @param {string} [opts.webhooks.onMessageUpdated.format] - + * @param {string} [opts."webhooks.onMessageUpdated.format"] - * The webhooks.on_message_updated.format - * @param {string} [opts.webhooks.onMessageRemoved.url] - + * @param {string} [opts."webhooks.onMessageRemoved.url"] - * The webhooks.on_message_removed.url - * @param {string} [opts.webhooks.onMessageRemoved.method] - + * @param {string} [opts."webhooks.onMessageRemoved.method"] - * The webhooks.on_message_removed.method - * @param {string} [opts.webhooks.onMessageRemoved.format] - + * @param {string} [opts."webhooks.onMessageRemoved.format"] - * The webhooks.on_message_removed.format - * @param {string} [opts.webhooks.onChannelAdded.url] - + * @param {string} [opts."webhooks.onChannelAdded.url"] - * The webhooks.on_channel_added.url - * @param {string} [opts.webhooks.onChannelAdded.method] - + * @param {string} [opts."webhooks.onChannelAdded.method"] - * The webhooks.on_channel_added.method - * @param {string} [opts.webhooks.onChannelAdded.format] - + * @param {string} [opts."webhooks.onChannelAdded.format"] - * The webhooks.on_channel_added.format - * @param {string} [opts.webhooks.onChannelDestroyed.url] - + * @param {string} [opts."webhooks.onChannelDestroyed.url"] - * The webhooks.on_channel_destroyed.url - * @param {string} [opts.webhooks.onChannelDestroyed.method] - + * @param {string} [opts."webhooks.onChannelDestroyed.method"] - * The webhooks.on_channel_destroyed.method - * @param {string} [opts.webhooks.onChannelDestroyed.format] - + * @param {string} [opts."webhooks.onChannelDestroyed.format"] - * The webhooks.on_channel_destroyed.format - * @param {string} [opts.webhooks.onChannelUpdated.url] - + * @param {string} [opts."webhooks.onChannelUpdated.url"] - * The webhooks.on_channel_updated.url - * @param {string} [opts.webhooks.onChannelUpdated.method] - + * @param {string} [opts."webhooks.onChannelUpdated.method"] - * The webhooks.on_channel_updated.method - * @param {string} [opts.webhooks.onChannelUpdated.format] - + * @param {string} [opts."webhooks.onChannelUpdated.format"] - * The webhooks.on_channel_updated.format - * @param {string} [opts.webhooks.onMemberAdded.url] - + * @param {string} [opts."webhooks.onMemberAdded.url"] - * The webhooks.on_member_added.url - * @param {string} [opts.webhooks.onMemberAdded.method] - + * @param {string} [opts."webhooks.onMemberAdded.method"] - * The webhooks.on_member_added.method - * @param {string} [opts.webhooks.onMemberAdded.format] - + * @param {string} [opts."webhooks.onMemberAdded.format"] - * The webhooks.on_member_added.format - * @param {string} [opts.webhooks.onMemberRemoved.url] - + * @param {string} [opts."webhooks.onMemberRemoved.url"] - * The webhooks.on_member_removed.url - * @param {string} [opts.webhooks.onMemberRemoved.method] - + * @param {string} [opts."webhooks.onMemberRemoved.method"] - * The webhooks.on_member_removed.method - * @param {string} [opts.webhooks.onMemberRemoved.format] - + * @param {string} [opts."webhooks.onMemberRemoved.format"] - * The webhooks.on_member_removed.format - * @param {number} [opts.limits.channelMembers] - The limits.channel_members - * @param {number} [opts.limits.userChannels] - The limits.user_channels + * @param {number} [opts."limits.channelMembers"] - The limits.channel_members + * @param {number} [opts."limits.userChannels"] - The limits.user_channels * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ServiceInstance @@ -969,68 +971,68 @@ ServiceContext.prototype.update = function update(opts, callback) { 'ReachabilityEnabled': serialize.bool(_.get(opts, 'reachabilityEnabled')), 'TypingIndicatorTimeout': _.get(opts, 'typingIndicatorTimeout'), 'ConsumptionReportInterval': _.get(opts, 'consumptionReportInterval'), - 'Notifications.NewMessage.Enabled': serialize.bool(_.get(opts, 'notifications.newMessage.enabled')), - 'Notifications.NewMessage.Template': _.get(opts, 'notifications.newMessage.template'), - 'Notifications.AddedToChannel.Enabled': serialize.bool(_.get(opts, 'notifications.addedToChannel.enabled')), - 'Notifications.AddedToChannel.Template': _.get(opts, 'notifications.addedToChannel.template'), - 'Notifications.RemovedFromChannel.Enabled': serialize.bool(_.get(opts, 'notifications.removedFromChannel.enabled')), - 'Notifications.RemovedFromChannel.Template': _.get(opts, 'notifications.removedFromChannel.template'), - 'Notifications.InvitedToChannel.Enabled': serialize.bool(_.get(opts, 'notifications.invitedToChannel.enabled')), - 'Notifications.InvitedToChannel.Template': _.get(opts, 'notifications.invitedToChannel.template'), + 'Notifications.NewMessage.Enabled': serialize.bool(_.get(opts, '"notifications.newMessage.enabled"')), + 'Notifications.NewMessage.Template': _.get(opts, '"notifications.newMessage.template"'), + 'Notifications.AddedToChannel.Enabled': serialize.bool(_.get(opts, '"notifications.addedToChannel.enabled"')), + 'Notifications.AddedToChannel.Template': _.get(opts, '"notifications.addedToChannel.template"'), + 'Notifications.RemovedFromChannel.Enabled': serialize.bool(_.get(opts, '"notifications.removedFromChannel.enabled"')), + 'Notifications.RemovedFromChannel.Template': _.get(opts, '"notifications.removedFromChannel.template"'), + 'Notifications.InvitedToChannel.Enabled': serialize.bool(_.get(opts, '"notifications.invitedToChannel.enabled"')), + 'Notifications.InvitedToChannel.Template': _.get(opts, '"notifications.invitedToChannel.template"'), 'PreWebhookUrl': _.get(opts, 'preWebhookUrl'), 'PostWebhookUrl': _.get(opts, 'postWebhookUrl'), 'WebhookMethod': _.get(opts, 'webhookMethod'), 'WebhookFilters': serialize.map(_.get(opts, 'webhookFilters'), function(e) { return e; }), - 'Webhooks.OnMessageSend.Url': _.get(opts, 'webhooks.onMessageSend.url'), - 'Webhooks.OnMessageSend.Method': _.get(opts, 'webhooks.onMessageSend.method'), - 'Webhooks.OnMessageSend.Format': _.get(opts, 'webhooks.onMessageSend.format'), - 'Webhooks.OnMessageUpdate.Url': _.get(opts, 'webhooks.onMessageUpdate.url'), - 'Webhooks.OnMessageUpdate.Method': _.get(opts, 'webhooks.onMessageUpdate.method'), - 'Webhooks.OnMessageUpdate.Format': _.get(opts, 'webhooks.onMessageUpdate.format'), - 'Webhooks.OnMessageRemove.Url': _.get(opts, 'webhooks.onMessageRemove.url'), - 'Webhooks.OnMessageRemove.Method': _.get(opts, 'webhooks.onMessageRemove.method'), - 'Webhooks.OnMessageRemove.Format': _.get(opts, 'webhooks.onMessageRemove.format'), - 'Webhooks.OnChannelAdd.Url': _.get(opts, 'webhooks.onChannelAdd.url'), - 'Webhooks.OnChannelAdd.Method': _.get(opts, 'webhooks.onChannelAdd.method'), - 'Webhooks.OnChannelAdd.Format': _.get(opts, 'webhooks.onChannelAdd.format'), - 'Webhooks.OnChannelDestroy.Url': _.get(opts, 'webhooks.onChannelDestroy.url'), - 'Webhooks.OnChannelDestroy.Method': _.get(opts, 'webhooks.onChannelDestroy.method'), - 'Webhooks.OnChannelDestroy.Format': _.get(opts, 'webhooks.onChannelDestroy.format'), - 'Webhooks.OnChannelUpdate.Url': _.get(opts, 'webhooks.onChannelUpdate.url'), - 'Webhooks.OnChannelUpdate.Method': _.get(opts, 'webhooks.onChannelUpdate.method'), - 'Webhooks.OnChannelUpdate.Format': _.get(opts, 'webhooks.onChannelUpdate.format'), - 'Webhooks.OnMemberAdd.Url': _.get(opts, 'webhooks.onMemberAdd.url'), - 'Webhooks.OnMemberAdd.Method': _.get(opts, 'webhooks.onMemberAdd.method'), - 'Webhooks.OnMemberAdd.Format': _.get(opts, 'webhooks.onMemberAdd.format'), - 'Webhooks.OnMemberRemove.Url': _.get(opts, 'webhooks.onMemberRemove.url'), - 'Webhooks.OnMemberRemove.Method': _.get(opts, 'webhooks.onMemberRemove.method'), - 'Webhooks.OnMemberRemove.Format': _.get(opts, 'webhooks.onMemberRemove.format'), - 'Webhooks.OnMessageSent.Url': _.get(opts, 'webhooks.onMessageSent.url'), - 'Webhooks.OnMessageSent.Method': _.get(opts, 'webhooks.onMessageSent.method'), - 'Webhooks.OnMessageSent.Format': _.get(opts, 'webhooks.onMessageSent.format'), - 'Webhooks.OnMessageUpdated.Url': _.get(opts, 'webhooks.onMessageUpdated.url'), - 'Webhooks.OnMessageUpdated.Method': _.get(opts, 'webhooks.onMessageUpdated.method'), - 'Webhooks.OnMessageUpdated.Format': _.get(opts, 'webhooks.onMessageUpdated.format'), - 'Webhooks.OnMessageRemoved.Url': _.get(opts, 'webhooks.onMessageRemoved.url'), - 'Webhooks.OnMessageRemoved.Method': _.get(opts, 'webhooks.onMessageRemoved.method'), - 'Webhooks.OnMessageRemoved.Format': _.get(opts, 'webhooks.onMessageRemoved.format'), - 'Webhooks.OnChannelAdded.Url': _.get(opts, 'webhooks.onChannelAdded.url'), - 'Webhooks.OnChannelAdded.Method': _.get(opts, 'webhooks.onChannelAdded.method'), - 'Webhooks.OnChannelAdded.Format': _.get(opts, 'webhooks.onChannelAdded.format'), - 'Webhooks.OnChannelDestroyed.Url': _.get(opts, 'webhooks.onChannelDestroyed.url'), - 'Webhooks.OnChannelDestroyed.Method': _.get(opts, 'webhooks.onChannelDestroyed.method'), - 'Webhooks.OnChannelDestroyed.Format': _.get(opts, 'webhooks.onChannelDestroyed.format'), - 'Webhooks.OnChannelUpdated.Url': _.get(opts, 'webhooks.onChannelUpdated.url'), - 'Webhooks.OnChannelUpdated.Method': _.get(opts, 'webhooks.onChannelUpdated.method'), - 'Webhooks.OnChannelUpdated.Format': _.get(opts, 'webhooks.onChannelUpdated.format'), - 'Webhooks.OnMemberAdded.Url': _.get(opts, 'webhooks.onMemberAdded.url'), - 'Webhooks.OnMemberAdded.Method': _.get(opts, 'webhooks.onMemberAdded.method'), - 'Webhooks.OnMemberAdded.Format': _.get(opts, 'webhooks.onMemberAdded.format'), - 'Webhooks.OnMemberRemoved.Url': _.get(opts, 'webhooks.onMemberRemoved.url'), - 'Webhooks.OnMemberRemoved.Method': _.get(opts, 'webhooks.onMemberRemoved.method'), - 'Webhooks.OnMemberRemoved.Format': _.get(opts, 'webhooks.onMemberRemoved.format'), - 'Limits.ChannelMembers': _.get(opts, 'limits.channelMembers'), - 'Limits.UserChannels': _.get(opts, 'limits.userChannels') + 'Webhooks.OnMessageSend.Url': _.get(opts, '"webhooks.onMessageSend.url"'), + 'Webhooks.OnMessageSend.Method': _.get(opts, '"webhooks.onMessageSend.method"'), + 'Webhooks.OnMessageSend.Format': _.get(opts, '"webhooks.onMessageSend.format"'), + 'Webhooks.OnMessageUpdate.Url': _.get(opts, '"webhooks.onMessageUpdate.url"'), + 'Webhooks.OnMessageUpdate.Method': _.get(opts, '"webhooks.onMessageUpdate.method"'), + 'Webhooks.OnMessageUpdate.Format': _.get(opts, '"webhooks.onMessageUpdate.format"'), + 'Webhooks.OnMessageRemove.Url': _.get(opts, '"webhooks.onMessageRemove.url"'), + 'Webhooks.OnMessageRemove.Method': _.get(opts, '"webhooks.onMessageRemove.method"'), + 'Webhooks.OnMessageRemove.Format': _.get(opts, '"webhooks.onMessageRemove.format"'), + 'Webhooks.OnChannelAdd.Url': _.get(opts, '"webhooks.onChannelAdd.url"'), + 'Webhooks.OnChannelAdd.Method': _.get(opts, '"webhooks.onChannelAdd.method"'), + 'Webhooks.OnChannelAdd.Format': _.get(opts, '"webhooks.onChannelAdd.format"'), + 'Webhooks.OnChannelDestroy.Url': _.get(opts, '"webhooks.onChannelDestroy.url"'), + 'Webhooks.OnChannelDestroy.Method': _.get(opts, '"webhooks.onChannelDestroy.method"'), + 'Webhooks.OnChannelDestroy.Format': _.get(opts, '"webhooks.onChannelDestroy.format"'), + 'Webhooks.OnChannelUpdate.Url': _.get(opts, '"webhooks.onChannelUpdate.url"'), + 'Webhooks.OnChannelUpdate.Method': _.get(opts, '"webhooks.onChannelUpdate.method"'), + 'Webhooks.OnChannelUpdate.Format': _.get(opts, '"webhooks.onChannelUpdate.format"'), + 'Webhooks.OnMemberAdd.Url': _.get(opts, '"webhooks.onMemberAdd.url"'), + 'Webhooks.OnMemberAdd.Method': _.get(opts, '"webhooks.onMemberAdd.method"'), + 'Webhooks.OnMemberAdd.Format': _.get(opts, '"webhooks.onMemberAdd.format"'), + 'Webhooks.OnMemberRemove.Url': _.get(opts, '"webhooks.onMemberRemove.url"'), + 'Webhooks.OnMemberRemove.Method': _.get(opts, '"webhooks.onMemberRemove.method"'), + 'Webhooks.OnMemberRemove.Format': _.get(opts, '"webhooks.onMemberRemove.format"'), + 'Webhooks.OnMessageSent.Url': _.get(opts, '"webhooks.onMessageSent.url"'), + 'Webhooks.OnMessageSent.Method': _.get(opts, '"webhooks.onMessageSent.method"'), + 'Webhooks.OnMessageSent.Format': _.get(opts, '"webhooks.onMessageSent.format"'), + 'Webhooks.OnMessageUpdated.Url': _.get(opts, '"webhooks.onMessageUpdated.url"'), + 'Webhooks.OnMessageUpdated.Method': _.get(opts, '"webhooks.onMessageUpdated.method"'), + 'Webhooks.OnMessageUpdated.Format': _.get(opts, '"webhooks.onMessageUpdated.format"'), + 'Webhooks.OnMessageRemoved.Url': _.get(opts, '"webhooks.onMessageRemoved.url"'), + 'Webhooks.OnMessageRemoved.Method': _.get(opts, '"webhooks.onMessageRemoved.method"'), + 'Webhooks.OnMessageRemoved.Format': _.get(opts, '"webhooks.onMessageRemoved.format"'), + 'Webhooks.OnChannelAdded.Url': _.get(opts, '"webhooks.onChannelAdded.url"'), + 'Webhooks.OnChannelAdded.Method': _.get(opts, '"webhooks.onChannelAdded.method"'), + 'Webhooks.OnChannelAdded.Format': _.get(opts, '"webhooks.onChannelAdded.format"'), + 'Webhooks.OnChannelDestroyed.Url': _.get(opts, '"webhooks.onChannelDestroyed.url"'), + 'Webhooks.OnChannelDestroyed.Method': _.get(opts, '"webhooks.onChannelDestroyed.method"'), + 'Webhooks.OnChannelDestroyed.Format': _.get(opts, '"webhooks.onChannelDestroyed.format"'), + 'Webhooks.OnChannelUpdated.Url': _.get(opts, '"webhooks.onChannelUpdated.url"'), + 'Webhooks.OnChannelUpdated.Method': _.get(opts, '"webhooks.onChannelUpdated.method"'), + 'Webhooks.OnChannelUpdated.Format': _.get(opts, '"webhooks.onChannelUpdated.format"'), + 'Webhooks.OnMemberAdded.Url': _.get(opts, '"webhooks.onMemberAdded.url"'), + 'Webhooks.OnMemberAdded.Method': _.get(opts, '"webhooks.onMemberAdded.method"'), + 'Webhooks.OnMemberAdded.Format': _.get(opts, '"webhooks.onMemberAdded.format"'), + 'Webhooks.OnMemberRemoved.Url': _.get(opts, '"webhooks.onMemberRemoved.url"'), + 'Webhooks.OnMemberRemoved.Method': _.get(opts, '"webhooks.onMemberRemoved.method"'), + 'Webhooks.OnMemberRemoved.Format': _.get(opts, '"webhooks.onMemberRemoved.format"'), + 'Limits.ChannelMembers': _.get(opts, '"limits.channelMembers"'), + 'Limits.UserChannels': _.get(opts, '"limits.userChannels"') }); var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); diff --git a/lib/rest/ipMessaging/v2/service.js b/lib/rest/ipMessaging/v2/service.js index 0f7509fb03..e292167b0d 100644 --- a/lib/rest/ipMessaging/v2/service.js +++ b/lib/rest/ipMessaging/v2/service.js @@ -529,43 +529,44 @@ ServiceInstance.prototype.remove = function remove(callback) { * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout * @param {number} [opts.consumptionReportInterval] - * The consumption_report_interval - * @param {boolean} [opts.notifications.newMessage.enabled] - + * @param {boolean} [opts."notifications.newMessage.enabled"] - * The notifications.new_message.enabled - * @param {string} [opts.notifications.newMessage.template] - + * @param {string} [opts."notifications.newMessage.template"] - * The notifications.new_message.template - * @param {string} [opts.notifications.newMessage.sound] - + * @param {string} [opts."notifications.newMessage.sound"] - * The notifications.new_message.sound - * @param {boolean} [opts.notifications.newMessage.badgeCountEnabled] - + * @param {boolean} [opts."notifications.newMessage.badgeCountEnabled"] - * The notifications.new_message.badge_count_enabled - * @param {boolean} [opts.notifications.addedToChannel.enabled] - + * @param {boolean} [opts."notifications.addedToChannel.enabled"] - * The notifications.added_to_channel.enabled - * @param {string} [opts.notifications.addedToChannel.template] - + * @param {string} [opts."notifications.addedToChannel.template"] - * The notifications.added_to_channel.template - * @param {string} [opts.notifications.addedToChannel.sound] - + * @param {string} [opts."notifications.addedToChannel.sound"] - * The notifications.added_to_channel.sound - * @param {boolean} [opts.notifications.removedFromChannel.enabled] - + * @param {boolean} [opts."notifications.removedFromChannel.enabled"] - * The notifications.removed_from_channel.enabled - * @param {string} [opts.notifications.removedFromChannel.template] - + * @param {string} [opts."notifications.removedFromChannel.template"] - * The notifications.removed_from_channel.template - * @param {string} [opts.notifications.removedFromChannel.sound] - + * @param {string} [opts."notifications.removedFromChannel.sound"] - * The notifications.removed_from_channel.sound - * @param {boolean} [opts.notifications.invitedToChannel.enabled] - + * @param {boolean} [opts."notifications.invitedToChannel.enabled"] - * The notifications.invited_to_channel.enabled - * @param {string} [opts.notifications.invitedToChannel.template] - + * @param {string} [opts."notifications.invitedToChannel.template"] - * The notifications.invited_to_channel.template - * @param {string} [opts.notifications.invitedToChannel.sound] - + * @param {string} [opts."notifications.invitedToChannel.sound"] - * The notifications.invited_to_channel.sound * @param {string} [opts.preWebhookUrl] - The pre_webhook_url * @param {string} [opts.postWebhookUrl] - The post_webhook_url * @param {string} [opts.webhookMethod] - The webhook_method * @param {string|list} [opts.webhookFilters] - The webhook_filters - * @param {number} [opts.limits.channelMembers] - The limits.channel_members - * @param {number} [opts.limits.userChannels] - The limits.user_channels - * @param {string} [opts.media.compatibilityMessage] - + * @param {number} [opts."limits.channelMembers"] - The limits.channel_members + * @param {number} [opts."limits.userChannels"] - The limits.user_channels + * @param {string} [opts."media.compatibilityMessage"] - * The media.compatibility_message * @param {number} [opts.preWebhookRetryCount] - The pre_webhook_retry_count * @param {number} [opts.postWebhookRetryCount] - The post_webhook_retry_count - * @param {boolean} [opts.notifications.logEnabled] - The notifications.log_enabled + * @param {boolean} [opts."notifications.logEnabled"] - + * The notifications.log_enabled * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ServiceInstance @@ -773,43 +774,44 @@ ServiceContext.prototype.remove = function remove(callback) { * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout * @param {number} [opts.consumptionReportInterval] - * The consumption_report_interval - * @param {boolean} [opts.notifications.newMessage.enabled] - + * @param {boolean} [opts."notifications.newMessage.enabled"] - * The notifications.new_message.enabled - * @param {string} [opts.notifications.newMessage.template] - + * @param {string} [opts."notifications.newMessage.template"] - * The notifications.new_message.template - * @param {string} [opts.notifications.newMessage.sound] - + * @param {string} [opts."notifications.newMessage.sound"] - * The notifications.new_message.sound - * @param {boolean} [opts.notifications.newMessage.badgeCountEnabled] - + * @param {boolean} [opts."notifications.newMessage.badgeCountEnabled"] - * The notifications.new_message.badge_count_enabled - * @param {boolean} [opts.notifications.addedToChannel.enabled] - + * @param {boolean} [opts."notifications.addedToChannel.enabled"] - * The notifications.added_to_channel.enabled - * @param {string} [opts.notifications.addedToChannel.template] - + * @param {string} [opts."notifications.addedToChannel.template"] - * The notifications.added_to_channel.template - * @param {string} [opts.notifications.addedToChannel.sound] - + * @param {string} [opts."notifications.addedToChannel.sound"] - * The notifications.added_to_channel.sound - * @param {boolean} [opts.notifications.removedFromChannel.enabled] - + * @param {boolean} [opts."notifications.removedFromChannel.enabled"] - * The notifications.removed_from_channel.enabled - * @param {string} [opts.notifications.removedFromChannel.template] - + * @param {string} [opts."notifications.removedFromChannel.template"] - * The notifications.removed_from_channel.template - * @param {string} [opts.notifications.removedFromChannel.sound] - + * @param {string} [opts."notifications.removedFromChannel.sound"] - * The notifications.removed_from_channel.sound - * @param {boolean} [opts.notifications.invitedToChannel.enabled] - + * @param {boolean} [opts."notifications.invitedToChannel.enabled"] - * The notifications.invited_to_channel.enabled - * @param {string} [opts.notifications.invitedToChannel.template] - + * @param {string} [opts."notifications.invitedToChannel.template"] - * The notifications.invited_to_channel.template - * @param {string} [opts.notifications.invitedToChannel.sound] - + * @param {string} [opts."notifications.invitedToChannel.sound"] - * The notifications.invited_to_channel.sound * @param {string} [opts.preWebhookUrl] - The pre_webhook_url * @param {string} [opts.postWebhookUrl] - The post_webhook_url * @param {string} [opts.webhookMethod] - The webhook_method * @param {string|list} [opts.webhookFilters] - The webhook_filters - * @param {number} [opts.limits.channelMembers] - The limits.channel_members - * @param {number} [opts.limits.userChannels] - The limits.user_channels - * @param {string} [opts.media.compatibilityMessage] - + * @param {number} [opts."limits.channelMembers"] - The limits.channel_members + * @param {number} [opts."limits.userChannels"] - The limits.user_channels + * @param {string} [opts."media.compatibilityMessage"] - * The media.compatibility_message * @param {number} [opts.preWebhookRetryCount] - The pre_webhook_retry_count * @param {number} [opts.postWebhookRetryCount] - The post_webhook_retry_count - * @param {boolean} [opts.notifications.logEnabled] - The notifications.log_enabled + * @param {boolean} [opts."notifications.logEnabled"] - + * The notifications.log_enabled * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ServiceInstance @@ -832,29 +834,29 @@ ServiceContext.prototype.update = function update(opts, callback) { 'ReachabilityEnabled': serialize.bool(_.get(opts, 'reachabilityEnabled')), 'TypingIndicatorTimeout': _.get(opts, 'typingIndicatorTimeout'), 'ConsumptionReportInterval': _.get(opts, 'consumptionReportInterval'), - 'Notifications.NewMessage.Enabled': serialize.bool(_.get(opts, 'notifications.newMessage.enabled')), - 'Notifications.NewMessage.Template': _.get(opts, 'notifications.newMessage.template'), - 'Notifications.NewMessage.Sound': _.get(opts, 'notifications.newMessage.sound'), - 'Notifications.NewMessage.BadgeCountEnabled': serialize.bool(_.get(opts, 'notifications.newMessage.badgeCountEnabled')), - 'Notifications.AddedToChannel.Enabled': serialize.bool(_.get(opts, 'notifications.addedToChannel.enabled')), - 'Notifications.AddedToChannel.Template': _.get(opts, 'notifications.addedToChannel.template'), - 'Notifications.AddedToChannel.Sound': _.get(opts, 'notifications.addedToChannel.sound'), - 'Notifications.RemovedFromChannel.Enabled': serialize.bool(_.get(opts, 'notifications.removedFromChannel.enabled')), - 'Notifications.RemovedFromChannel.Template': _.get(opts, 'notifications.removedFromChannel.template'), - 'Notifications.RemovedFromChannel.Sound': _.get(opts, 'notifications.removedFromChannel.sound'), - 'Notifications.InvitedToChannel.Enabled': serialize.bool(_.get(opts, 'notifications.invitedToChannel.enabled')), - 'Notifications.InvitedToChannel.Template': _.get(opts, 'notifications.invitedToChannel.template'), - 'Notifications.InvitedToChannel.Sound': _.get(opts, 'notifications.invitedToChannel.sound'), + 'Notifications.NewMessage.Enabled': serialize.bool(_.get(opts, '"notifications.newMessage.enabled"')), + 'Notifications.NewMessage.Template': _.get(opts, '"notifications.newMessage.template"'), + 'Notifications.NewMessage.Sound': _.get(opts, '"notifications.newMessage.sound"'), + 'Notifications.NewMessage.BadgeCountEnabled': serialize.bool(_.get(opts, '"notifications.newMessage.badgeCountEnabled"')), + 'Notifications.AddedToChannel.Enabled': serialize.bool(_.get(opts, '"notifications.addedToChannel.enabled"')), + 'Notifications.AddedToChannel.Template': _.get(opts, '"notifications.addedToChannel.template"'), + 'Notifications.AddedToChannel.Sound': _.get(opts, '"notifications.addedToChannel.sound"'), + 'Notifications.RemovedFromChannel.Enabled': serialize.bool(_.get(opts, '"notifications.removedFromChannel.enabled"')), + 'Notifications.RemovedFromChannel.Template': _.get(opts, '"notifications.removedFromChannel.template"'), + 'Notifications.RemovedFromChannel.Sound': _.get(opts, '"notifications.removedFromChannel.sound"'), + 'Notifications.InvitedToChannel.Enabled': serialize.bool(_.get(opts, '"notifications.invitedToChannel.enabled"')), + 'Notifications.InvitedToChannel.Template': _.get(opts, '"notifications.invitedToChannel.template"'), + 'Notifications.InvitedToChannel.Sound': _.get(opts, '"notifications.invitedToChannel.sound"'), 'PreWebhookUrl': _.get(opts, 'preWebhookUrl'), 'PostWebhookUrl': _.get(opts, 'postWebhookUrl'), 'WebhookMethod': _.get(opts, 'webhookMethod'), 'WebhookFilters': serialize.map(_.get(opts, 'webhookFilters'), function(e) { return e; }), - 'Limits.ChannelMembers': _.get(opts, 'limits.channelMembers'), - 'Limits.UserChannels': _.get(opts, 'limits.userChannels'), - 'Media.CompatibilityMessage': _.get(opts, 'media.compatibilityMessage'), + 'Limits.ChannelMembers': _.get(opts, '"limits.channelMembers"'), + 'Limits.UserChannels': _.get(opts, '"limits.userChannels"'), + 'Media.CompatibilityMessage': _.get(opts, '"media.compatibilityMessage"'), 'PreWebhookRetryCount': _.get(opts, 'preWebhookRetryCount'), 'PostWebhookRetryCount': _.get(opts, 'postWebhookRetryCount'), - 'Notifications.LogEnabled': serialize.bool(_.get(opts, 'notifications.logEnabled')) + 'Notifications.LogEnabled': serialize.bool(_.get(opts, '"notifications.logEnabled"')) }); var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); diff --git a/lib/rest/lookups/v1/phoneNumber.js b/lib/rest/lookups/v1/phoneNumber.js index a10da0ad2e..61d0ed75e8 100644 --- a/lib/rest/lookups/v1/phoneNumber.js +++ b/lib/rest/lookups/v1/phoneNumber.js @@ -119,7 +119,6 @@ PhoneNumberPage.prototype.getInstance = function getInstance(payload) { * @property {string} phoneNumber - The phone_number * @property {string} nationalFormat - The national_format * @property {string} carrier - The carrier - * @property {string} fraud - The fraud * @property {string} addOns - The add_ons * @property {string} url - The url * @@ -138,7 +137,6 @@ PhoneNumberInstance = function PhoneNumberInstance(version, payload, this.phoneNumber = payload.phone_number; // jshint ignore:line this.nationalFormat = payload.national_format; // jshint ignore:line this.carrier = payload.carrier; // jshint ignore:line - this.fraud = payload.fraud; // jshint ignore:line this.addOns = payload.add_ons; // jshint ignore:line this.url = payload.url; // jshint ignore:line diff --git a/lib/rest/preview/understand/service/modelBuild.js b/lib/rest/preview/understand/service/modelBuild.js index 4d0e460bad..68af03c0cf 100644 --- a/lib/rest/preview/understand/service/modelBuild.js +++ b/lib/rest/preview/understand/service/modelBuild.js @@ -417,6 +417,8 @@ ModelBuildPage.prototype.getInstance = function getInstance(payload) { * @property {model_build.status} status - The status * @property {string} uniqueName - The unique_name * @property {string} url - The url + * @property {number} buildDuration - The build_duration + * @property {number} errorCode - The error_code * * @param {Twilio.Preview.Understand} version - Version of the resource * @param {object} payload - The instance payload @@ -437,6 +439,8 @@ ModelBuildInstance = function ModelBuildInstance(version, payload, serviceSid, this.status = payload.status; // jshint ignore:line this.uniqueName = payload.unique_name; // jshint ignore:line this.url = payload.url; // jshint ignore:line + this.buildDuration = deserialize.integer(payload.build_duration); // jshint ignore:line + this.errorCode = deserialize.integer(payload.error_code); // jshint ignore:line // Context this._context = undefined; diff --git a/lib/rest/studio/v1/flow/engagement.js b/lib/rest/studio/v1/flow/engagement.js index 3f1f94d09c..bb8d5cad0f 100644 --- a/lib/rest/studio/v1/flow/engagement.js +++ b/lib/rest/studio/v1/flow/engagement.js @@ -11,6 +11,8 @@ var Q = require('q'); /* jshint ignore:line */ var _ = require('lodash'); /* jshint ignore:line */ +var EngagementContextList = require( + './engagement/engagementContext').EngagementContextList; var Page = require('../../../../base/Page'); /* jshint ignore:line */ var StepList = require('./engagement/step').StepList; var deserialize = require( @@ -421,8 +423,8 @@ EngagementPage.prototype.getInstance = function getInstance(payload) { * @property {string} flowSid - The flow_sid * @property {string} contactSid - The contact_sid * @property {string} contactChannelAddress - The contact_channel_address - * @property {engagement.status} status - The status * @property {string} context - The context + * @property {engagement.status} status - The status * @property {Date} dateCreated - The date_created * @property {Date} dateUpdated - The date_updated * @property {string} url - The url @@ -444,8 +446,8 @@ EngagementInstance = function EngagementInstance(version, payload, flowSid, sid) this.flowSid = payload.flow_sid; // jshint ignore:line this.contactSid = payload.contact_sid; // jshint ignore:line this.contactChannelAddress = payload.contact_channel_address; // jshint ignore:line - this.status = payload.status; // jshint ignore:line this.context = payload.context; // jshint ignore:line + this.status = payload.status; // jshint ignore:line this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line this.url = payload.url; // jshint ignore:line @@ -499,6 +501,21 @@ EngagementInstance.prototype.steps = function steps() { return this._proxy.steps; }; +/* jshint ignore:start */ +/** + * Access the engagementContext + * + * @function engagementContext + * @memberof Twilio.Studio.V1.FlowContext.EngagementInstance + * @instance + * + * @returns {Twilio.Studio.V1.FlowContext.EngagementContext.EngagementContextList} + */ +/* jshint ignore:end */ +EngagementInstance.prototype.engagementContext = function engagementContext() { + return this._proxy.engagementContext; +}; + /* jshint ignore:start */ /** * Produce a plain JSON object version of the EngagementInstance for serialization. @@ -530,6 +547,8 @@ EngagementInstance.prototype.toJSON = function toJSON() { * * @property {Twilio.Studio.V1.FlowContext.EngagementContext.StepList} steps - * steps resource + * @property {Twilio.Studio.V1.FlowContext.EngagementContext.EngagementContextList} engagementContext - + * engagementContext resource * * @param {Twilio.Studio.V1} version - Version of the resource * @param {sid} flowSid - The flow_sid @@ -547,6 +566,7 @@ EngagementContext = function EngagementContext(version, flowSid, sid) { // Dependents this._steps = undefined; + this._engagementContext = undefined; }; /* jshint ignore:start */ @@ -596,6 +616,20 @@ Object.defineProperty(EngagementContext.prototype, } }); +Object.defineProperty(EngagementContext.prototype, + 'engagementContext', { + get: function() { + if (!this._engagementContext) { + this._engagementContext = new EngagementContextList( + this._version, + this._solution.flowSid, + this._solution.sid + ); + } + return this._engagementContext; + } +}); + module.exports = { EngagementList: EngagementList, EngagementPage: EngagementPage, diff --git a/lib/rest/studio/v1/flow/engagement/engagementContext.js b/lib/rest/studio/v1/flow/engagement/engagementContext.js new file mode 100644 index 0000000000..65037a5c94 --- /dev/null +++ b/lib/rest/studio/v1/flow/engagement/engagementContext.js @@ -0,0 +1,277 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var Q = require('q'); /* jshint ignore:line */ +var _ = require('lodash'); /* jshint ignore:line */ +var Page = require('../../../../../base/Page'); /* jshint ignore:line */ +var values = require('../../../../../base/values'); /* jshint ignore:line */ + +var EngagementContextList; +var EngagementContextPage; +var EngagementContextInstance; +var EngagementContextContext; + +/* jshint ignore:start */ +/** + * @constructor Twilio.Studio.V1.FlowContext.EngagementContext.EngagementContextList + * @description Initialize the EngagementContextList + * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * + * @param {Twilio.Studio.V1} version - Version of the resource + * @param {string} flowSid - The flow_sid + * @param {string} engagementSid - The engagement_sid + */ +/* jshint ignore:end */ +EngagementContextList = function EngagementContextList(version, flowSid, + engagementSid) { + /* jshint ignore:start */ + /** + * @function engagementContext + * @memberof Twilio.Studio.V1.FlowContext.EngagementContext + * @instance + * + * @param {string} sid - sid of instance + * + * @returns {Twilio.Studio.V1.FlowContext.EngagementContext.EngagementContextContext} + */ + /* jshint ignore:end */ + function EngagementContextListInstance(sid) { + return EngagementContextListInstance.get(sid); + } + + EngagementContextListInstance._version = version; + // Path Solution + EngagementContextListInstance._solution = {flowSid: flowSid, engagementSid: engagementSid}; + /* jshint ignore:start */ + /** + * Constructs a engagement_context + * + * @function get + * @memberof Twilio.Studio.V1.FlowContext.EngagementContext.EngagementContextList + * @instance + * + * @returns {Twilio.Studio.V1.FlowContext.EngagementContext.EngagementContextContext} + */ + /* jshint ignore:end */ + EngagementContextListInstance.get = function get() { + return new EngagementContextContext( + this._version, + this._solution.flowSid, + this._solution.engagementSid + ); + }; + + return EngagementContextListInstance; +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Studio.V1.FlowContext.EngagementContext.EngagementContextPage + * @augments Page + * @description Initialize the EngagementContextPage + * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * + * @param {Twilio.Studio.V1} version - Version of the resource + * @param {object} response - Response from the API + * @param {object} solution - Path solution + * + * @returns EngagementContextPage + */ +/* jshint ignore:end */ +EngagementContextPage = function EngagementContextPage(version, response, + solution) { + // Path Solution + this._solution = solution; + + Page.prototype.constructor.call(this, version, response, this._solution); +}; + +_.extend(EngagementContextPage.prototype, Page.prototype); +EngagementContextPage.prototype.constructor = EngagementContextPage; + +/* jshint ignore:start */ +/** + * Build an instance of EngagementContextInstance + * + * @function getInstance + * @memberof Twilio.Studio.V1.FlowContext.EngagementContext.EngagementContextPage + * @instance + * + * @param {object} payload - Payload response from the API + * + * @returns EngagementContextInstance + */ +/* jshint ignore:end */ +EngagementContextPage.prototype.getInstance = function getInstance(payload) { + return new EngagementContextInstance( + this._version, + payload, + this._solution.flowSid, + this._solution.engagementSid + ); +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Studio.V1.FlowContext.EngagementContext.EngagementContextInstance + * @description Initialize the EngagementContextContext + * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * + * @property {string} accountSid - The account_sid + * @property {string} context - The context + * @property {string} engagementSid - The engagement_sid + * @property {string} flowSid - The flow_sid + * @property {string} url - The url + * + * @param {Twilio.Studio.V1} version - Version of the resource + * @param {object} payload - The instance payload + * @param {sid} flowSid - The flow_sid + * @param {sid} engagementSid - The engagement_sid + */ +/* jshint ignore:end */ +EngagementContextInstance = function EngagementContextInstance(version, payload, + flowSid, engagementSid) { + this._version = version; + + // Marshaled Properties + this.accountSid = payload.account_sid; // jshint ignore:line + this.context = payload.context; // jshint ignore:line + this.engagementSid = payload.engagement_sid; // jshint ignore:line + this.flowSid = payload.flow_sid; // jshint ignore:line + this.url = payload.url; // jshint ignore:line + + // Context + this._context = undefined; + this._solution = {flowSid: flowSid, engagementSid: engagementSid, }; +}; + +Object.defineProperty(EngagementContextInstance.prototype, + '_proxy', { + get: function() { + if (!this._context) { + this._context = new EngagementContextContext( + this._version, + this._solution.flowSid, + this._solution.engagementSid + ); + } + + return this._context; + } +}); + +/* jshint ignore:start */ +/** + * fetch a EngagementContextInstance + * + * @function fetch + * @memberof Twilio.Studio.V1.FlowContext.EngagementContext.EngagementContextInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed EngagementContextInstance + */ +/* jshint ignore:end */ +EngagementContextInstance.prototype.fetch = function fetch(callback) { + return this._proxy.fetch(callback); +}; + +/* jshint ignore:start */ +/** + * Produce a plain JSON object version of the EngagementContextInstance for serialization. + * Removes any circular references in the object. + * + * @function toJSON + * @memberof Twilio.Studio.V1.FlowContext.EngagementContext.EngagementContextInstance + * @instance + * + * @returns Object + */ +/* jshint ignore:end */ +EngagementContextInstance.prototype.toJSON = function toJSON() { + let clone = {}; + _.forOwn(this, function(value, key) { + if (!_.startsWith(key, '_') && ! _.isFunction(value)) { + clone[key] = value; + } + }); + return clone; +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Studio.V1.FlowContext.EngagementContext.EngagementContextContext + * @description Initialize the EngagementContextContext + * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * + * @param {Twilio.Studio.V1} version - Version of the resource + * @param {sid} flowSid - The flow_sid + * @param {sid} engagementSid - The engagement_sid + */ +/* jshint ignore:end */ +EngagementContextContext = function EngagementContextContext(version, flowSid, + engagementSid) { + this._version = version; + + // Path Solution + this._solution = {flowSid: flowSid, engagementSid: engagementSid, }; + this._uri = _.template( + '/Flows/<%= flowSid %>/Engagements/<%= engagementSid %>/Context' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a EngagementContextInstance + * + * @function fetch + * @memberof Twilio.Studio.V1.FlowContext.EngagementContext.EngagementContextContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed EngagementContextInstance + */ +/* jshint ignore:end */ +EngagementContextContext.prototype.fetch = function fetch(callback) { + var deferred = Q.defer(); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); + + promise = promise.then(function(payload) { + deferred.resolve(new EngagementContextInstance( + this._version, + payload, + this._solution.flowSid, + this._solution.engagementSid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +module.exports = { + EngagementContextList: EngagementContextList, + EngagementContextPage: EngagementContextPage, + EngagementContextInstance: EngagementContextInstance, + EngagementContextContext: EngagementContextContext +}; diff --git a/lib/rest/studio/v1/flow/engagement/step.js b/lib/rest/studio/v1/flow/engagement/step.js index c9913c1578..541b1ef236 100644 --- a/lib/rest/studio/v1/flow/engagement/step.js +++ b/lib/rest/studio/v1/flow/engagement/step.js @@ -12,6 +12,7 @@ var Q = require('q'); /* jshint ignore:line */ var _ = require('lodash'); /* jshint ignore:line */ var Page = require('../../../../../base/Page'); /* jshint ignore:line */ +var StepContextList = require('./step/stepContext').StepContextList; var deserialize = require( '../../../../../base/deserialize'); /* jshint ignore:line */ var values = require('../../../../../base/values'); /* jshint ignore:line */ @@ -375,6 +376,7 @@ StepPage.prototype.getInstance = function getInstance(payload) { * @property {Date} dateCreated - The date_created * @property {Date} dateUpdated - The date_updated * @property {string} url - The url + * @property {string} links - The links * * @param {Twilio.Studio.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -399,6 +401,7 @@ StepInstance = function StepInstance(version, payload, flowSid, engagementSid, this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line this.url = payload.url; // jshint ignore:line + this.links = payload.links; // jshint ignore:line // Context this._context = undefined; @@ -438,6 +441,21 @@ StepInstance.prototype.fetch = function fetch(callback) { return this._proxy.fetch(callback); }; +/* jshint ignore:start */ +/** + * Access the stepContext + * + * @function stepContext + * @memberof Twilio.Studio.V1.FlowContext.EngagementContext.StepInstance + * @instance + * + * @returns {Twilio.Studio.V1.FlowContext.EngagementContext.StepContext.StepContextList} + */ +/* jshint ignore:end */ +StepInstance.prototype.stepContext = function stepContext() { + return this._proxy.stepContext; +}; + /* jshint ignore:start */ /** * Produce a plain JSON object version of the StepInstance for serialization. @@ -467,6 +485,9 @@ StepInstance.prototype.toJSON = function toJSON() { * @description Initialize the StepContext * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * + * @property {Twilio.Studio.V1.FlowContext.EngagementContext.StepContext.StepContextList} stepContext - + * stepContext resource + * * @param {Twilio.Studio.V1} version - Version of the resource * @param {sid} flowSid - The flow_sid * @param {sid} engagementSid - The engagement_sid @@ -481,6 +502,9 @@ StepContext = function StepContext(version, flowSid, engagementSid, sid) { this._uri = _.template( '/Flows/<%= flowSid %>/Engagements/<%= engagementSid %>/Steps/<%= sid %>' // jshint ignore:line )(this._solution); + + // Dependents + this._stepContext = undefined; }; /* jshint ignore:start */ @@ -521,6 +545,21 @@ StepContext.prototype.fetch = function fetch(callback) { return deferred.promise; }; +Object.defineProperty(StepContext.prototype, + 'stepContext', { + get: function() { + if (!this._stepContext) { + this._stepContext = new StepContextList( + this._version, + this._solution.flowSid, + this._solution.engagementSid, + this._solution.sid + ); + } + return this._stepContext; + } +}); + module.exports = { StepList: StepList, StepPage: StepPage, diff --git a/lib/rest/studio/v1/flow/engagement/step/stepContext.js b/lib/rest/studio/v1/flow/engagement/step/stepContext.js new file mode 100644 index 0000000000..31876ea93e --- /dev/null +++ b/lib/rest/studio/v1/flow/engagement/step/stepContext.js @@ -0,0 +1,289 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var Q = require('q'); /* jshint ignore:line */ +var _ = require('lodash'); /* jshint ignore:line */ +var Page = require('../../../../../../base/Page'); /* jshint ignore:line */ +var values = require('../../../../../../base/values'); /* jshint ignore:line */ + +var StepContextList; +var StepContextPage; +var StepContextInstance; +var StepContextContext; + +/* jshint ignore:start */ +/** + * @constructor Twilio.Studio.V1.FlowContext.EngagementContext.StepContext.StepContextList + * @description Initialize the StepContextList + * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * + * @param {Twilio.Studio.V1} version - Version of the resource + * @param {string} flowSid - The flow_sid + * @param {string} engagementSid - The engagement_sid + * @param {string} stepSid - The step_sid + */ +/* jshint ignore:end */ +StepContextList = function StepContextList(version, flowSid, engagementSid, + stepSid) { + /* jshint ignore:start */ + /** + * @function stepContext + * @memberof Twilio.Studio.V1.FlowContext.EngagementContext.StepContext + * @instance + * + * @param {string} sid - sid of instance + * + * @returns {Twilio.Studio.V1.FlowContext.EngagementContext.StepContext.StepContextContext} + */ + /* jshint ignore:end */ + function StepContextListInstance(sid) { + return StepContextListInstance.get(sid); + } + + StepContextListInstance._version = version; + // Path Solution + StepContextListInstance._solution = { + flowSid: flowSid, + engagementSid: engagementSid, + stepSid: stepSid + }; + /* jshint ignore:start */ + /** + * Constructs a step_context + * + * @function get + * @memberof Twilio.Studio.V1.FlowContext.EngagementContext.StepContext.StepContextList + * @instance + * + * @returns {Twilio.Studio.V1.FlowContext.EngagementContext.StepContext.StepContextContext} + */ + /* jshint ignore:end */ + StepContextListInstance.get = function get() { + return new StepContextContext( + this._version, + this._solution.flowSid, + this._solution.engagementSid, + this._solution.stepSid + ); + }; + + return StepContextListInstance; +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Studio.V1.FlowContext.EngagementContext.StepContext.StepContextPage + * @augments Page + * @description Initialize the StepContextPage + * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * + * @param {Twilio.Studio.V1} version - Version of the resource + * @param {object} response - Response from the API + * @param {object} solution - Path solution + * + * @returns StepContextPage + */ +/* jshint ignore:end */ +StepContextPage = function StepContextPage(version, response, solution) { + // Path Solution + this._solution = solution; + + Page.prototype.constructor.call(this, version, response, this._solution); +}; + +_.extend(StepContextPage.prototype, Page.prototype); +StepContextPage.prototype.constructor = StepContextPage; + +/* jshint ignore:start */ +/** + * Build an instance of StepContextInstance + * + * @function getInstance + * @memberof Twilio.Studio.V1.FlowContext.EngagementContext.StepContext.StepContextPage + * @instance + * + * @param {object} payload - Payload response from the API + * + * @returns StepContextInstance + */ +/* jshint ignore:end */ +StepContextPage.prototype.getInstance = function getInstance(payload) { + return new StepContextInstance( + this._version, + payload, + this._solution.flowSid, + this._solution.engagementSid, + this._solution.stepSid + ); +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Studio.V1.FlowContext.EngagementContext.StepContext.StepContextInstance + * @description Initialize the StepContextContext + * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * + * @property {string} accountSid - The account_sid + * @property {string} context - The context + * @property {string} engagementSid - The engagement_sid + * @property {string} flowSid - The flow_sid + * @property {string} stepSid - The step_sid + * @property {string} url - The url + * + * @param {Twilio.Studio.V1} version - Version of the resource + * @param {object} payload - The instance payload + * @param {sid} flowSid - The flow_sid + * @param {sid} engagementSid - The engagement_sid + * @param {sid} stepSid - The step_sid + */ +/* jshint ignore:end */ +StepContextInstance = function StepContextInstance(version, payload, flowSid, + engagementSid, stepSid) { + this._version = version; + + // Marshaled Properties + this.accountSid = payload.account_sid; // jshint ignore:line + this.context = payload.context; // jshint ignore:line + this.engagementSid = payload.engagement_sid; // jshint ignore:line + this.flowSid = payload.flow_sid; // jshint ignore:line + this.stepSid = payload.step_sid; // jshint ignore:line + this.url = payload.url; // jshint ignore:line + + // Context + this._context = undefined; + this._solution = {flowSid: flowSid, engagementSid: engagementSid, stepSid: stepSid, }; +}; + +Object.defineProperty(StepContextInstance.prototype, + '_proxy', { + get: function() { + if (!this._context) { + this._context = new StepContextContext( + this._version, + this._solution.flowSid, + this._solution.engagementSid, + this._solution.stepSid + ); + } + + return this._context; + } +}); + +/* jshint ignore:start */ +/** + * fetch a StepContextInstance + * + * @function fetch + * @memberof Twilio.Studio.V1.FlowContext.EngagementContext.StepContext.StepContextInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed StepContextInstance + */ +/* jshint ignore:end */ +StepContextInstance.prototype.fetch = function fetch(callback) { + return this._proxy.fetch(callback); +}; + +/* jshint ignore:start */ +/** + * Produce a plain JSON object version of the StepContextInstance for serialization. + * Removes any circular references in the object. + * + * @function toJSON + * @memberof Twilio.Studio.V1.FlowContext.EngagementContext.StepContext.StepContextInstance + * @instance + * + * @returns Object + */ +/* jshint ignore:end */ +StepContextInstance.prototype.toJSON = function toJSON() { + let clone = {}; + _.forOwn(this, function(value, key) { + if (!_.startsWith(key, '_') && ! _.isFunction(value)) { + clone[key] = value; + } + }); + return clone; +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Studio.V1.FlowContext.EngagementContext.StepContext.StepContextContext + * @description Initialize the StepContextContext + * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * + * @param {Twilio.Studio.V1} version - Version of the resource + * @param {sid} flowSid - The flow_sid + * @param {sid} engagementSid - The engagement_sid + * @param {sid} stepSid - The step_sid + */ +/* jshint ignore:end */ +StepContextContext = function StepContextContext(version, flowSid, + engagementSid, stepSid) { + this._version = version; + + // Path Solution + this._solution = {flowSid: flowSid, engagementSid: engagementSid, stepSid: stepSid, }; + this._uri = _.template( + '/Flows/<%= flowSid %>/Engagements/<%= engagementSid %>/Steps/<%= stepSid %>/Context' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a StepContextInstance + * + * @function fetch + * @memberof Twilio.Studio.V1.FlowContext.EngagementContext.StepContext.StepContextContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed StepContextInstance + */ +/* jshint ignore:end */ +StepContextContext.prototype.fetch = function fetch(callback) { + var deferred = Q.defer(); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); + + promise = promise.then(function(payload) { + deferred.resolve(new StepContextInstance( + this._version, + payload, + this._solution.flowSid, + this._solution.engagementSid, + this._solution.stepSid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +module.exports = { + StepContextList: StepContextList, + StepContextPage: StepContextPage, + StepContextInstance: StepContextInstance, + StepContextContext: StepContextContext +}; diff --git a/spec/integration/rest/lookups/v1/phoneNumber.spec.js b/spec/integration/rest/lookups/v1/phoneNumber.spec.js index 972ae8ce44..81616cee07 100644 --- a/spec/integration/rest/lookups/v1/phoneNumber.spec.js +++ b/spec/integration/rest/lookups/v1/phoneNumber.spec.js @@ -66,16 +66,6 @@ describe('PhoneNumber', function() { 'name': 'verizon', 'type': 'mobile' }, - 'fraud': { - 'error_code': null, - 'advanced_line_type': 'voip', - 'is_prepaid': false, - 'mobile_country_code': '310', - 'mobile_network_code': '456', - 'carrier_name': 'verizon', - 'caller_name': 'Delicious Cheese Cake', - 'caller_type': 'CONSUMER' - }, 'country_code': 'US', 'national_format': '(510) 867-5309', 'phone_number': '+15108675309', diff --git a/spec/integration/rest/preview/understand/service/modelBuild.spec.js b/spec/integration/rest/preview/understand/service/modelBuild.spec.js index a68c58439e..5145d2c77a 100644 --- a/spec/integration/rest/preview/understand/service/modelBuild.spec.js +++ b/spec/integration/rest/preview/understand/service/modelBuild.spec.js @@ -65,7 +65,9 @@ describe('ModelBuild', function() { 'service_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'sid': 'UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'unique_name': 'unique_name' + 'unique_name': 'unique_name', + 'build_duration': null, + 'error_code': null }); holodeck.mock(new Response(200, body)); @@ -148,11 +150,13 @@ describe('ModelBuild', function() { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'status': 'enqueued', + 'status': 'failed', 'service_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'sid': 'UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'unique_name': 'unique_name' + 'unique_name': 'unique_name', + 'build_duration': null, + 'error_code': 23001 } ] }); @@ -202,7 +206,9 @@ describe('ModelBuild', function() { 'service_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'sid': 'UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'unique_name': 'unique_name' + 'unique_name': 'unique_name', + 'build_duration': null, + 'error_code': null }); holodeck.mock(new Response(201, body)); @@ -249,11 +255,13 @@ describe('ModelBuild', function() { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'status': 'enqueued', + 'status': 'completed', 'service_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'sid': 'UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'unique_name': 'unique_name' + 'unique_name': 'unique_name', + 'build_duration': 100, + 'error_code': null }); holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v1/flow/engagement.spec.js b/spec/integration/rest/studio/v1/flow/engagement.spec.js index d910ee8759..a49403d2ed 100644 --- a/spec/integration/rest/studio/v1/flow/engagement.spec.js +++ b/spec/integration/rest/studio/v1/flow/engagement.spec.js @@ -119,7 +119,8 @@ describe('Engagement', function() { 'date_updated': null, 'url': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'links': { - 'steps': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps' + 'steps': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps', + 'engagement_context': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' } }); @@ -168,18 +169,15 @@ describe('Engagement', function() { 'sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'context': { - 'flow': { - 'first_name': 'Foo' - } - }, + 'context': {}, 'contact_sid': 'FCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'contact_channel_address': '+18001234567', 'status': 'active', 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', 'links': { - 'steps': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps' + 'steps': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps', + 'engagement_context': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' } }); diff --git a/spec/integration/rest/studio/v1/flow/engagement/engagementContext.spec.js b/spec/integration/rest/studio/v1/flow/engagement/engagementContext.spec.js new file mode 100644 index 0000000000..1db8d5888a --- /dev/null +++ b/spec/integration/rest/studio/v1/flow/engagement/engagementContext.spec.js @@ -0,0 +1,86 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var _ = require('lodash'); /* jshint ignore:line */ +var Holodeck = require('../../../../../holodeck'); /* jshint ignore:line */ +var Request = require( + '../../../../../../../lib/http/request'); /* jshint ignore:line */ +var Response = require( + '../../../../../../../lib/http/response'); /* jshint ignore:line */ +var RestException = require( + '../../../../../../../lib/base/RestException'); /* jshint ignore:line */ +var Twilio = require('../../../../../../../lib'); /* jshint ignore:line */ + + +var client; +var holodeck; + +describe('EngagementContext', function() { + beforeEach(function() { + holodeck = new Holodeck(); + client = new Twilio('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'AUTHTOKEN', { + httpClient: holodeck + }); + }); + it('should generate valid fetch request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.studio.v1.flows('FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .engagements('FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .engagementContext().fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + flowSid: 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + engagementSid: 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }; + var url = _.template('https://studio.twilio.com/v1/Flows/<%= flowSid %>/Engagements/<%= engagementSid %>/Context')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid fetch response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'context': { + 'foo': 'bar' + }, + 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'engagement_sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'url': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.studio.v1.flows('FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .engagements('FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .engagementContext().fetch(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); +}); + diff --git a/spec/integration/rest/studio/v1/flow/engagement/step.spec.js b/spec/integration/rest/studio/v1/flow/engagement/step.spec.js index 4709408ab6..d9cdc1b32a 100644 --- a/spec/integration/rest/studio/v1/flow/engagement/step.spec.js +++ b/spec/integration/rest/studio/v1/flow/engagement/step.spec.js @@ -125,7 +125,10 @@ describe('Step', function() { 'transitioned_to': 'Ended', 'date_created': '2017-11-06T12:00:00Z', 'date_updated': null, - 'url': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + 'url': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'links': { + 'step_context': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' + } }); holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v1/flow/engagement/step/stepContext.spec.js b/spec/integration/rest/studio/v1/flow/engagement/step/stepContext.spec.js new file mode 100644 index 0000000000..db20a1c886 --- /dev/null +++ b/spec/integration/rest/studio/v1/flow/engagement/step/stepContext.spec.js @@ -0,0 +1,90 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var _ = require('lodash'); /* jshint ignore:line */ +var Holodeck = require('../../../../../../holodeck'); /* jshint ignore:line */ +var Request = require( + '../../../../../../../../lib/http/request'); /* jshint ignore:line */ +var Response = require( + '../../../../../../../../lib/http/response'); /* jshint ignore:line */ +var RestException = require( + '../../../../../../../../lib/base/RestException'); /* jshint ignore:line */ +var Twilio = require('../../../../../../../../lib'); /* jshint ignore:line */ + + +var client; +var holodeck; + +describe('StepContext', function() { + beforeEach(function() { + holodeck = new Holodeck(); + client = new Twilio('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'AUTHTOKEN', { + httpClient: holodeck + }); + }); + it('should generate valid fetch request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.studio.v1.flows('FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .engagements('FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .steps('FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .stepContext().fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + flowSid: 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + engagementSid: 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + stepSid: 'FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }; + var url = _.template('https://studio.twilio.com/v1/Flows/<%= flowSid %>/Engagements/<%= engagementSid %>/Steps/<%= stepSid %>/Context')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid fetch response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'context': { + 'foo': 'bar' + }, + 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'engagement_sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'step_sid': 'FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'url': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.studio.v1.flows('FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .engagements('FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .steps('FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .stepContext().fetch(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); +}); +