twilio-ruby 5.40.1 → 5.42.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +111 -0
- data/{LICENSE.md → LICENSE} +0 -0
- data/PULL_REQUEST_TEMPLATE.md +3 -3
- data/README.md +2 -2
- data/lib/twilio-ruby/framework/version.rb +4 -8
- data/lib/twilio-ruby/jwt/access_token.rb +7 -2
- data/lib/twilio-ruby/rest/accounts.rb +12 -0
- data/lib/twilio-ruby/rest/accounts/v1.rb +14 -0
- data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +186 -0
- data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +200 -0
- data/lib/twilio-ruby/rest/api.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +32 -23
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +32 -23
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +32 -23
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +32 -23
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +32 -23
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +32 -23
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +32 -23
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +21 -20
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +20 -14
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +8 -8
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +29 -22
- data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +10 -10
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +28 -21
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +6 -4
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +19 -18
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +3 -3
- data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +12 -12
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb +3 -3
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb +3 -3
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb +3 -3
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +15 -11
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb +3 -3
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +33 -26
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb +3 -3
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb +6 -6
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb +9 -9
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +31 -24
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb +8 -8
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +6 -6
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb +3 -3
- data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +5 -22
- data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +25 -40
- data/lib/twilio-ruby/rest/chat/v1/service.rb +36 -36
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +3 -3
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +19 -19
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +28 -28
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +7 -7
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +5 -5
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +8 -8
- data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v2/service.rb +36 -36
- data/lib/twilio-ruby/rest/chat/v2/service/binding.rb +18 -18
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +15 -15
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +19 -19
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +54 -54
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +25 -25
- data/lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb +15 -15
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +5 -5
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +8 -8
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb +18 -18
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +20 -20
- data/lib/twilio-ruby/rest/client.rb +1 -1
- data/lib/twilio-ruby/rest/conversations.rb +39 -3
- data/lib/twilio-ruby/rest/conversations/v1.rb +68 -5
- data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +260 -0
- data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +254 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +34 -23
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +15 -20
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +35 -28
- data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +42 -44
- data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +14 -19
- data/lib/twilio-ruby/rest/conversations/v1/credential.rb +419 -0
- data/lib/twilio-ruby/rest/conversations/v1/role.rb +366 -0
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +434 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +380 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +263 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +307 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +588 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +541 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +386 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +511 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +449 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +387 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +430 -0
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +409 -0
- data/lib/twilio-ruby/rest/events.rb +17 -0
- data/lib/twilio-ruby/rest/events/v1.rb +31 -0
- data/lib/twilio-ruby/rest/events/v1/event_type.rb +291 -0
- data/lib/twilio-ruby/rest/events/v1/schema.rb +226 -0
- data/lib/twilio-ruby/rest/events/v1/schema/schema_version.rb +290 -0
- data/lib/twilio-ruby/rest/events/v1/subscription.rb +28 -8
- data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +3 -109
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +28 -27
- data/lib/twilio-ruby/rest/insights.rb +8 -0
- data/lib/twilio-ruby/rest/insights/v1.rb +15 -0
- data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v1/room.rb +487 -0
- data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +385 -0
- data/lib/twilio-ruby/rest/ip_messaging.rb +8 -10
- data/lib/twilio-ruby/rest/ip_messaging/v1.rb +6 -8
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +29 -68
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +198 -313
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +32 -59
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +23 -55
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +28 -71
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +31 -59
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +19 -39
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +29 -51
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +12 -18
- data/lib/twilio-ruby/rest/ip_messaging/v2.rb +6 -6
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +29 -66
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +116 -205
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +23 -50
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +41 -91
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +23 -50
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +42 -118
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +46 -100
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +36 -89
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +19 -41
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +29 -53
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +23 -53
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +27 -56
- data/lib/twilio-ruby/rest/lookups.rb +1 -1
- data/lib/twilio-ruby/rest/lookups/v1.rb +1 -1
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +10 -10
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +39 -36
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +3 -3
- data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +3 -3
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +3 -3
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +15 -15
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +12 -6
- data/lib/twilio-ruby/rest/notify/v1/service.rb +24 -24
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +10 -10
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +23 -15
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +2 -2
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +18 -4
- data/lib/twilio-ruby/rest/preview.rb +8 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +5 -22
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +21 -39
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +15 -10
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +9 -6
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +1 -1
- data/lib/twilio-ruby/rest/preview/trusted_comms.rb +15 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/branded_call.rb +4 -4
- data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb +225 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb +165 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +0 -26
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb +1 -4
- data/lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb +4 -4
- data/lib/twilio-ruby/rest/preview/trusted_comms/phone_call.rb +52 -52
- data/lib/twilio-ruby/rest/preview/understand/assistant/task/field.rb +2 -2
- data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +2 -2
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +4 -4
- data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +2 -2
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +4 -4
- data/lib/twilio-ruby/rest/pricing/v1/voice.rb +2 -2
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +4 -4
- data/lib/twilio-ruby/rest/pricing/v2/voice.rb +3 -3
- data/lib/twilio-ruby/rest/pricing/v2/voice/country.rb +4 -4
- data/lib/twilio-ruby/rest/pricing/v2/voice/number.rb +4 -4
- data/lib/twilio-ruby/rest/proxy/v1/service.rb +15 -15
- data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +13 -11
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +33 -30
- data/lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb +6 -6
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +18 -17
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +9 -9
- data/lib/twilio-ruby/rest/proxy/v1/service/short_code.rb +8 -8
- data/lib/twilio-ruby/rest/serverless/v1/service.rb +13 -13
- data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +6 -6
- data/lib/twilio-ruby/rest/serverless/v1/service/asset/asset_version.rb +5 -5
- data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +33 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb +219 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +6 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +8 -8
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb +14 -14
- data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +4 -4
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +7 -7
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +1 -1
- data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +6 -6
- data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +6 -6
- data/lib/twilio-ruby/rest/supersim/v1/command.rb +7 -7
- data/lib/twilio-ruby/rest/supersim/v1/network.rb +6 -6
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +22 -12
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +6 -6
- data/lib/twilio-ruby/rest/sync/v1/service.rb +3 -3
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +6 -6
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +6 -6
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +6 -6
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +6 -6
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +6 -6
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +6 -6
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +12 -12
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +6 -6
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +6 -6
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb +4 -4
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +4 -4
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +2 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +16 -12
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +8 -8
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +9 -9
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +4 -7
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +16 -12
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +4 -4
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +4 -4
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +12 -12
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +4 -4
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +4 -4
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +6 -6
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +46 -53
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +2 -2
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +3 -2
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +3 -2
- data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +201 -0
- data/lib/twilio-ruby/rest/verify/v2/form.rb +4 -4
- data/lib/twilio-ruby/rest/verify/v2/service.rb +51 -30
- data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +3 -3
- data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +20 -34
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +32 -59
- data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +59 -61
- data/lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb +12 -12
- data/lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb +3 -3
- data/lib/twilio-ruby/rest/verify/v2/service/rate_limit/bucket.rb +3 -3
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +14 -12
- data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +5 -5
- data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +4 -4
- data/lib/twilio-ruby/rest/video/v1/composition.rb +13 -9
- data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +33 -24
- data/lib/twilio-ruby/rest/video/v1/recording.rb +6 -6
- data/lib/twilio-ruby/rest/video/v1/room.rb +27 -9
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +6 -6
- data/lib/twilio-ruby/rest/video/v1/room/room_participant.rb +9 -9
- data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +2 -2
- data/lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb +150 -0
- data/lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb +9 -9
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +3 -6
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +22 -22
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.rb +4 -4
- data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +2 -2
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +7 -7
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +8 -7
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +22 -22
- data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +4 -4
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +10 -10
- data/lib/twilio-ruby/rest/wireless/v1/usage_record.rb +6 -6
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/version_spec.rb +53 -0
- data/spec/holodeck/holodeck.rb +3 -3
- data/spec/integration/accounts/v1/auth_token_promotion_spec.rb +44 -0
- data/spec/integration/accounts/v1/secondary_auth_token_spec.rb +69 -0
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +30 -0
- data/spec/integration/bulkexports/v1/export/export_custom_job_spec.rb +4 -2
- data/spec/integration/conversations/v1/{webhook_spec.rb → configuration/webhook_spec.rb} +12 -8
- data/spec/integration/conversations/v1/configuration_spec.rb +87 -0
- data/spec/integration/conversations/v1/conversation/message/delivery_receipt_spec.rb +4 -0
- data/spec/integration/conversations/v1/conversation/participant_spec.rb +6 -6
- data/spec/integration/conversations/v1/conversation_spec.rb +5 -0
- data/spec/integration/conversations/v1/credential_spec.rb +219 -0
- data/spec/integration/conversations/v1/role_spec.rb +249 -0
- data/spec/integration/conversations/v1/service/binding_spec.rb +166 -0
- data/spec/integration/conversations/v1/service/configuration/notification_spec.rb +115 -0
- data/spec/integration/conversations/v1/service/configuration_spec.rb +87 -0
- data/spec/integration/conversations/v1/service/conversation/message/delivery_receipt_spec.rb +144 -0
- data/spec/integration/conversations/v1/service/conversation/message_spec.rb +429 -0
- data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +407 -0
- data/spec/integration/conversations/v1/service/conversation/webhook_spec.rb +299 -0
- data/spec/integration/conversations/v1/service/conversation_spec.rb +289 -0
- data/spec/integration/conversations/v1/service/role_spec.rb +260 -0
- data/spec/integration/conversations/v1/service/user_spec.rb +236 -0
- data/spec/integration/conversations/v1/service_spec.rb +174 -0
- data/spec/integration/conversations/v1/user_spec.rb +226 -0
- data/spec/integration/events/v1/event_type_spec.rb +133 -0
- data/spec/integration/events/v1/schema/schema_version_spec.rb +126 -0
- data/spec/integration/events/v1/schema_spec.rb +46 -0
- data/spec/integration/events/v1/sink/sink_test_spec.rb +1 -1
- data/spec/integration/events/v1/subscription/subscribed_event_spec.rb +0 -121
- data/spec/integration/events/v1/subscription_spec.rb +38 -0
- data/spec/integration/insights/v1/call/summary_spec.rb +1 -0
- data/spec/integration/insights/v1/room/participant_spec.rb +149 -0
- data/spec/integration/insights/v1/room_spec.rb +164 -0
- data/spec/integration/ip_messaging/v1/credential_spec.rb +13 -13
- data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +11 -11
- data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +14 -14
- data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +14 -14
- data/spec/integration/ip_messaging/v1/service/channel_spec.rb +25 -25
- data/spec/integration/ip_messaging/v1/service/role_spec.rb +13 -13
- data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +7 -7
- data/spec/integration/ip_messaging/v1/service/user_spec.rb +17 -17
- data/spec/integration/ip_messaging/v1/service_spec.rb +9 -9
- data/spec/integration/ip_messaging/v2/credential_spec.rb +13 -13
- data/spec/integration/ip_messaging/v2/service/binding_spec.rb +11 -11
- data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +11 -11
- data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +13 -13
- data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +17 -17
- data/spec/integration/ip_messaging/v2/service/channel/webhook_spec.rb +15 -15
- data/spec/integration/ip_messaging/v2/service/channel_spec.rb +29 -29
- data/spec/integration/ip_messaging/v2/service/role_spec.rb +13 -13
- data/spec/integration/ip_messaging/v2/service/user/user_binding_spec.rb +9 -9
- data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +20 -20
- data/spec/integration/ip_messaging/v2/service/user_spec.rb +21 -21
- data/spec/integration/ip_messaging/v2/service_spec.rb +29 -29
- data/spec/integration/numbers/v2/regulatory_compliance/supporting_document_spec.rb +27 -0
- data/spec/integration/preview/bulk_exports/export/export_custom_job_spec.rb +4 -2
- data/spec/integration/preview/trusted_comms/{business/brand/branded_channel → branded_channel}/channel_spec.rb +4 -8
- data/spec/integration/preview/trusted_comms/{business/brand/branded_channel_spec.rb → branded_channel_spec.rb} +5 -9
- data/spec/integration/preview/trusted_comms/business_spec.rb +0 -1
- data/spec/integration/serverless/v1/service/build/build_status_spec.rb +48 -0
- data/spec/integration/serverless/v1/service/build_spec.rb +8 -2
- data/spec/integration/supersim/v1/sim_spec.rb +23 -0
- data/spec/integration/trunking/v1/trunk/recording_spec.rb +79 -0
- data/spec/integration/verify/v2/service/entity/challenge_spec.rb +56 -20
- data/spec/integration/verify/v2/service/entity/factor_spec.rb +11 -26
- data/spec/integration/verify/v2/service/entity_spec.rb +4 -12
- data/spec/integration/verify/v2/service_spec.rb +8 -4
- data/spec/integration/video/v1/room/room_recording_rule_spec.rb +89 -0
- data/spec/integration/video/v1/room_spec.rb +12 -7
- data/spec/jwt/access_token_spec.rb +9 -1
- data/twilio-ruby.gemspec +1 -1
- metadata +88 -16
- data/lib/twilio-ruby/rest/conversations/v1/webhook.rb +0 -262
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand.rb +0 -233
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel.rb +0 -260
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/brand/branded_channel/channel.rb +0 -189
- data/spec/integration/preview/trusted_comms/business/brand_spec.rb +0 -48
@@ -0,0 +1,407 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
require 'spec_helper.rb'
|
10
|
+
|
11
|
+
describe 'Participant' do
|
12
|
+
it "can create" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
17
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
18
|
+
.participants.create(x_twilio_webhook_enabled: 'true')
|
19
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
20
|
+
|
21
|
+
headers = {'X-Twilio-Webhook-Enabled' => 'true', }
|
22
|
+
expect(
|
23
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
24
|
+
method: 'post',
|
25
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants',
|
26
|
+
headers: headers,
|
27
|
+
))).to eq(true)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "receives create_sms responses" do
|
31
|
+
@holodeck.mock(Twilio::Response.new(
|
32
|
+
201,
|
33
|
+
%q[
|
34
|
+
{
|
35
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
+
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
39
|
+
"identity": "null",
|
40
|
+
"attributes": "{ \\"role\\": \\"driver\\" }",
|
41
|
+
"messaging_binding": {
|
42
|
+
"type": "sms",
|
43
|
+
"address": "+15558675310",
|
44
|
+
"proxy_address": "+15017122661"
|
45
|
+
},
|
46
|
+
"role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
47
|
+
"date_created": "2015-12-16T22:18:37Z",
|
48
|
+
"date_updated": "2015-12-16T22:18:38Z",
|
49
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
50
|
+
}
|
51
|
+
]
|
52
|
+
))
|
53
|
+
|
54
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
55
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
56
|
+
.participants.create()
|
57
|
+
|
58
|
+
expect(actual).to_not eq(nil)
|
59
|
+
end
|
60
|
+
|
61
|
+
it "receives create_chat responses" do
|
62
|
+
@holodeck.mock(Twilio::Response.new(
|
63
|
+
201,
|
64
|
+
%q[
|
65
|
+
{
|
66
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
67
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
68
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
69
|
+
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
70
|
+
"identity": "IDENTITY",
|
71
|
+
"attributes": "{ \\"role\\": \\"driver\\" }",
|
72
|
+
"messaging_binding": null,
|
73
|
+
"role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
74
|
+
"date_created": "2015-12-16T22:18:37Z",
|
75
|
+
"date_updated": "2015-12-16T22:18:38Z",
|
76
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
77
|
+
}
|
78
|
+
]
|
79
|
+
))
|
80
|
+
|
81
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
82
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
83
|
+
.participants.create()
|
84
|
+
|
85
|
+
expect(actual).to_not eq(nil)
|
86
|
+
end
|
87
|
+
|
88
|
+
it "receives create_gmms responses" do
|
89
|
+
@holodeck.mock(Twilio::Response.new(
|
90
|
+
201,
|
91
|
+
%q[
|
92
|
+
{
|
93
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
94
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
95
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
96
|
+
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
97
|
+
"identity": "IDENTITY",
|
98
|
+
"attributes": "{ \\"role\\": \\"driver\\" }",
|
99
|
+
"messaging_binding": {
|
100
|
+
"type": "sms",
|
101
|
+
"projected_address": "+15017122661"
|
102
|
+
},
|
103
|
+
"role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
104
|
+
"date_created": "2015-12-16T22:18:37Z",
|
105
|
+
"date_updated": "2015-12-16T22:18:38Z",
|
106
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
107
|
+
}
|
108
|
+
]
|
109
|
+
))
|
110
|
+
|
111
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
112
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
113
|
+
.participants.create()
|
114
|
+
|
115
|
+
expect(actual).to_not eq(nil)
|
116
|
+
end
|
117
|
+
|
118
|
+
it "receives create_gmms_chat_no_attributes responses" do
|
119
|
+
@holodeck.mock(Twilio::Response.new(
|
120
|
+
201,
|
121
|
+
%q[
|
122
|
+
{
|
123
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
124
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
125
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
126
|
+
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
127
|
+
"identity": "IDENTITY",
|
128
|
+
"attributes": "{}",
|
129
|
+
"messaging_binding": {
|
130
|
+
"type": "sms",
|
131
|
+
"projected_address": "+15017122661"
|
132
|
+
},
|
133
|
+
"role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
134
|
+
"date_created": "2020-07-01T22:18:37Z",
|
135
|
+
"date_updated": "2020-07-01T22:18:37Z",
|
136
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
137
|
+
}
|
138
|
+
]
|
139
|
+
))
|
140
|
+
|
141
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
142
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
143
|
+
.participants.create()
|
144
|
+
|
145
|
+
expect(actual).to_not eq(nil)
|
146
|
+
end
|
147
|
+
|
148
|
+
it "receives create_gmms_sms_no_attributes responses" do
|
149
|
+
@holodeck.mock(Twilio::Response.new(
|
150
|
+
201,
|
151
|
+
%q[
|
152
|
+
{
|
153
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
154
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
155
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
156
|
+
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
157
|
+
"identity": null,
|
158
|
+
"attributes": "{}",
|
159
|
+
"messaging_binding": {
|
160
|
+
"type": "sms",
|
161
|
+
"address": "+15017122661"
|
162
|
+
},
|
163
|
+
"role_sid": null,
|
164
|
+
"date_created": "2020-07-01T22:18:37Z",
|
165
|
+
"date_updated": "2020-07-01T22:18:37Z",
|
166
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
167
|
+
}
|
168
|
+
]
|
169
|
+
))
|
170
|
+
|
171
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
172
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
173
|
+
.participants.create()
|
174
|
+
|
175
|
+
expect(actual).to_not eq(nil)
|
176
|
+
end
|
177
|
+
|
178
|
+
it "can update" do
|
179
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
180
|
+
|
181
|
+
expect {
|
182
|
+
@client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
183
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
184
|
+
.participants('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(x_twilio_webhook_enabled: 'true')
|
185
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
186
|
+
|
187
|
+
headers = {'X-Twilio-Webhook-Enabled' => 'true', }
|
188
|
+
expect(
|
189
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
190
|
+
method: 'post',
|
191
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
192
|
+
headers: headers,
|
193
|
+
))).to eq(true)
|
194
|
+
end
|
195
|
+
|
196
|
+
it "receives update responses" do
|
197
|
+
@holodeck.mock(Twilio::Response.new(
|
198
|
+
200,
|
199
|
+
%q[
|
200
|
+
{
|
201
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
202
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
203
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
204
|
+
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
205
|
+
"identity": null,
|
206
|
+
"attributes": "{ \\"role\\": \\"driver\\" }",
|
207
|
+
"messaging_binding": {
|
208
|
+
"type": "sms",
|
209
|
+
"address": "+15558675310",
|
210
|
+
"proxy_address": "+15017122661"
|
211
|
+
},
|
212
|
+
"role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
213
|
+
"date_created": "2015-12-16T22:18:37Z",
|
214
|
+
"date_updated": "2015-12-16T22:18:38Z",
|
215
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
216
|
+
}
|
217
|
+
]
|
218
|
+
))
|
219
|
+
|
220
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
221
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
222
|
+
.participants('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
223
|
+
|
224
|
+
expect(actual).to_not eq(nil)
|
225
|
+
end
|
226
|
+
|
227
|
+
it "receives update_gmms responses" do
|
228
|
+
@holodeck.mock(Twilio::Response.new(
|
229
|
+
200,
|
230
|
+
%q[
|
231
|
+
{
|
232
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
233
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
234
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
235
|
+
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
236
|
+
"identity": "id",
|
237
|
+
"attributes": "{ \\"role\\": \\"driver\\" }",
|
238
|
+
"messaging_binding": {
|
239
|
+
"type": "sms",
|
240
|
+
"projected_address": "+15017122661"
|
241
|
+
},
|
242
|
+
"role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
243
|
+
"date_created": "2015-12-16T22:18:37Z",
|
244
|
+
"date_updated": "2015-12-16T22:18:38Z",
|
245
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
246
|
+
}
|
247
|
+
]
|
248
|
+
))
|
249
|
+
|
250
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
251
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
252
|
+
.participants('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
253
|
+
|
254
|
+
expect(actual).to_not eq(nil)
|
255
|
+
end
|
256
|
+
|
257
|
+
it "can delete" do
|
258
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
259
|
+
|
260
|
+
expect {
|
261
|
+
@client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
262
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
263
|
+
.participants('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete(x_twilio_webhook_enabled: 'true')
|
264
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
265
|
+
|
266
|
+
headers = {'X-Twilio-Webhook-Enabled' => 'true', }
|
267
|
+
expect(
|
268
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
269
|
+
method: 'delete',
|
270
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
271
|
+
headers: headers,
|
272
|
+
))).to eq(true)
|
273
|
+
end
|
274
|
+
|
275
|
+
it "receives delete responses" do
|
276
|
+
@holodeck.mock(Twilio::Response.new(
|
277
|
+
204,
|
278
|
+
nil,
|
279
|
+
))
|
280
|
+
|
281
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
282
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
283
|
+
.participants('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
284
|
+
|
285
|
+
expect(actual).to eq(true)
|
286
|
+
end
|
287
|
+
|
288
|
+
it "can fetch" do
|
289
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
290
|
+
|
291
|
+
expect {
|
292
|
+
@client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
293
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
294
|
+
.participants('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
295
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
296
|
+
|
297
|
+
expect(
|
298
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
299
|
+
method: 'get',
|
300
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
301
|
+
))).to eq(true)
|
302
|
+
end
|
303
|
+
|
304
|
+
it "receives fetch responses" do
|
305
|
+
@holodeck.mock(Twilio::Response.new(
|
306
|
+
200,
|
307
|
+
%q[
|
308
|
+
{
|
309
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
310
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
311
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
312
|
+
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
313
|
+
"identity": null,
|
314
|
+
"attributes": "{ \\"role\\": \\"driver\\" }",
|
315
|
+
"messaging_binding": {
|
316
|
+
"type": "sms",
|
317
|
+
"address": "+15558675310",
|
318
|
+
"proxy_address": "+15017122661"
|
319
|
+
},
|
320
|
+
"role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
321
|
+
"date_created": "2016-03-24T21:05:50Z",
|
322
|
+
"date_updated": "2016-03-24T21:05:50Z",
|
323
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
324
|
+
}
|
325
|
+
]
|
326
|
+
))
|
327
|
+
|
328
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
329
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
330
|
+
.participants('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
331
|
+
|
332
|
+
expect(actual).to_not eq(nil)
|
333
|
+
end
|
334
|
+
|
335
|
+
it "can read" do
|
336
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
337
|
+
|
338
|
+
expect {
|
339
|
+
@client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
340
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
341
|
+
.participants.list()
|
342
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
343
|
+
|
344
|
+
expect(
|
345
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
346
|
+
method: 'get',
|
347
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants',
|
348
|
+
))).to eq(true)
|
349
|
+
end
|
350
|
+
|
351
|
+
it "receives read responses" do
|
352
|
+
@holodeck.mock(Twilio::Response.new(
|
353
|
+
200,
|
354
|
+
%q[
|
355
|
+
{
|
356
|
+
"meta": {
|
357
|
+
"page": 0,
|
358
|
+
"page_size": 50,
|
359
|
+
"first_page_url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",
|
360
|
+
"previous_page_url": null,
|
361
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",
|
362
|
+
"next_page_url": null,
|
363
|
+
"key": "participants"
|
364
|
+
},
|
365
|
+
"participants": [
|
366
|
+
{
|
367
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
368
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
369
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
370
|
+
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
371
|
+
"identity": null,
|
372
|
+
"attributes": "{ \\"role\\": \\"driver\\" }",
|
373
|
+
"messaging_binding": {
|
374
|
+
"type": "sms",
|
375
|
+
"address": "+15558675310",
|
376
|
+
"proxy_address": "+15017122661"
|
377
|
+
},
|
378
|
+
"role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
379
|
+
"date_created": "2016-03-24T21:05:50Z",
|
380
|
+
"date_updated": "2016-03-24T21:05:50Z",
|
381
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
382
|
+
},
|
383
|
+
{
|
384
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
385
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
386
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
387
|
+
"sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
388
|
+
"identity": "IDENTITY",
|
389
|
+
"attributes": "{ \\"role\\": \\"driver\\" }",
|
390
|
+
"messaging_binding": null,
|
391
|
+
"role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
392
|
+
"date_created": "2016-03-24T21:05:50Z",
|
393
|
+
"date_updated": "2016-03-24T21:05:50Z",
|
394
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
395
|
+
}
|
396
|
+
]
|
397
|
+
}
|
398
|
+
]
|
399
|
+
))
|
400
|
+
|
401
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
402
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
403
|
+
.participants.list()
|
404
|
+
|
405
|
+
expect(actual).to_not eq(nil)
|
406
|
+
end
|
407
|
+
end
|
@@ -0,0 +1,299 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
require 'spec_helper.rb'
|
10
|
+
|
11
|
+
describe 'Webhook' do
|
12
|
+
it "can create" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
17
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
18
|
+
.webhooks.create(target: 'webhook')
|
19
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
20
|
+
|
21
|
+
values = {'Target' => 'webhook', }
|
22
|
+
expect(
|
23
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
24
|
+
method: 'post',
|
25
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks',
|
26
|
+
data: values,
|
27
|
+
))).to eq(true)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "receives create responses" do
|
31
|
+
@holodeck.mock(Twilio::Response.new(
|
32
|
+
201,
|
33
|
+
%q[
|
34
|
+
{
|
35
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
+
"sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
39
|
+
"target": "webhook",
|
40
|
+
"configuration": {
|
41
|
+
"url": "https://example.com",
|
42
|
+
"method": "get",
|
43
|
+
"filters": [
|
44
|
+
"onMessageSent",
|
45
|
+
"onConversationDestroyed"
|
46
|
+
]
|
47
|
+
},
|
48
|
+
"date_created": "2016-03-24T21:05:50Z",
|
49
|
+
"date_updated": "2016-03-24T21:05:50Z",
|
50
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
51
|
+
}
|
52
|
+
]
|
53
|
+
))
|
54
|
+
|
55
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
56
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
57
|
+
.webhooks.create(target: 'webhook')
|
58
|
+
|
59
|
+
expect(actual).to_not eq(nil)
|
60
|
+
end
|
61
|
+
|
62
|
+
it "can update" do
|
63
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
64
|
+
|
65
|
+
expect {
|
66
|
+
@client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
67
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
68
|
+
.webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
69
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
70
|
+
|
71
|
+
expect(
|
72
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
73
|
+
method: 'post',
|
74
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks/WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
75
|
+
))).to eq(true)
|
76
|
+
end
|
77
|
+
|
78
|
+
it "receives update responses" do
|
79
|
+
@holodeck.mock(Twilio::Response.new(
|
80
|
+
200,
|
81
|
+
%q[
|
82
|
+
{
|
83
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
84
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
85
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
86
|
+
"sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
87
|
+
"target": "trigger",
|
88
|
+
"configuration": {
|
89
|
+
"url": "https://example.com",
|
90
|
+
"method": "post",
|
91
|
+
"filters": [
|
92
|
+
"keyword1",
|
93
|
+
"keyword2"
|
94
|
+
]
|
95
|
+
},
|
96
|
+
"date_created": "2016-03-24T21:05:50Z",
|
97
|
+
"date_updated": "2016-03-24T21:05:51Z",
|
98
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
99
|
+
}
|
100
|
+
]
|
101
|
+
))
|
102
|
+
|
103
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
104
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
105
|
+
.webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
106
|
+
|
107
|
+
expect(actual).to_not eq(nil)
|
108
|
+
end
|
109
|
+
|
110
|
+
it "can delete" do
|
111
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
112
|
+
|
113
|
+
expect {
|
114
|
+
@client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
115
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
116
|
+
.webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
117
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
118
|
+
|
119
|
+
expect(
|
120
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
121
|
+
method: 'delete',
|
122
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks/WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
123
|
+
))).to eq(true)
|
124
|
+
end
|
125
|
+
|
126
|
+
it "receives delete responses" do
|
127
|
+
@holodeck.mock(Twilio::Response.new(
|
128
|
+
204,
|
129
|
+
nil,
|
130
|
+
))
|
131
|
+
|
132
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
133
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
134
|
+
.webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
|
135
|
+
|
136
|
+
expect(actual).to eq(true)
|
137
|
+
end
|
138
|
+
|
139
|
+
it "can fetch" do
|
140
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
141
|
+
|
142
|
+
expect {
|
143
|
+
@client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
144
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
145
|
+
.webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
146
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
147
|
+
|
148
|
+
expect(
|
149
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
150
|
+
method: 'get',
|
151
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks/WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
152
|
+
))).to eq(true)
|
153
|
+
end
|
154
|
+
|
155
|
+
it "receives fetch responses" do
|
156
|
+
@holodeck.mock(Twilio::Response.new(
|
157
|
+
200,
|
158
|
+
%q[
|
159
|
+
{
|
160
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
161
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
162
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
163
|
+
"sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
164
|
+
"target": "studio",
|
165
|
+
"configuration": {
|
166
|
+
"flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
167
|
+
},
|
168
|
+
"date_created": "2016-03-24T21:05:50Z",
|
169
|
+
"date_updated": "2016-03-24T21:05:50Z",
|
170
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
171
|
+
}
|
172
|
+
]
|
173
|
+
))
|
174
|
+
|
175
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
176
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
177
|
+
.webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
|
178
|
+
|
179
|
+
expect(actual).to_not eq(nil)
|
180
|
+
end
|
181
|
+
|
182
|
+
it "can read" do
|
183
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
184
|
+
|
185
|
+
expect {
|
186
|
+
@client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
187
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
188
|
+
.webhooks.list()
|
189
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
190
|
+
|
191
|
+
expect(
|
192
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
193
|
+
method: 'get',
|
194
|
+
url: 'https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks',
|
195
|
+
))).to eq(true)
|
196
|
+
end
|
197
|
+
|
198
|
+
it "receives read_full responses" do
|
199
|
+
@holodeck.mock(Twilio::Response.new(
|
200
|
+
200,
|
201
|
+
%q[
|
202
|
+
{
|
203
|
+
"meta": {
|
204
|
+
"page": 0,
|
205
|
+
"page_size": 5,
|
206
|
+
"first_page_url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0",
|
207
|
+
"previous_page_url": null,
|
208
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0",
|
209
|
+
"next_page_url": null,
|
210
|
+
"key": "webhooks"
|
211
|
+
},
|
212
|
+
"webhooks": [
|
213
|
+
{
|
214
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
215
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
216
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
217
|
+
"sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
218
|
+
"target": "webhook",
|
219
|
+
"configuration": {
|
220
|
+
"url": "https://example.com",
|
221
|
+
"method": "get",
|
222
|
+
"filters": [
|
223
|
+
"onMessageSent",
|
224
|
+
"onConversationDestroyed"
|
225
|
+
]
|
226
|
+
},
|
227
|
+
"date_created": "2016-03-24T21:05:50Z",
|
228
|
+
"date_updated": "2016-03-24T21:05:50Z",
|
229
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
230
|
+
},
|
231
|
+
{
|
232
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
233
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
234
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
235
|
+
"sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
236
|
+
"target": "trigger",
|
237
|
+
"configuration": {
|
238
|
+
"url": "https://example.com",
|
239
|
+
"method": "post",
|
240
|
+
"filters": [
|
241
|
+
"keyword1",
|
242
|
+
"keyword2"
|
243
|
+
]
|
244
|
+
},
|
245
|
+
"date_created": "2016-03-24T21:05:50Z",
|
246
|
+
"date_updated": "2016-03-24T21:05:50Z",
|
247
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
248
|
+
},
|
249
|
+
{
|
250
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
251
|
+
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
252
|
+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
253
|
+
"sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
254
|
+
"target": "studio",
|
255
|
+
"configuration": {
|
256
|
+
"flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
257
|
+
},
|
258
|
+
"date_created": "2016-03-24T21:05:50Z",
|
259
|
+
"date_updated": "2016-03-24T21:05:50Z",
|
260
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
261
|
+
}
|
262
|
+
]
|
263
|
+
}
|
264
|
+
]
|
265
|
+
))
|
266
|
+
|
267
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
268
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
269
|
+
.webhooks.list()
|
270
|
+
|
271
|
+
expect(actual).to_not eq(nil)
|
272
|
+
end
|
273
|
+
|
274
|
+
it "receives read_empty responses" do
|
275
|
+
@holodeck.mock(Twilio::Response.new(
|
276
|
+
200,
|
277
|
+
%q[
|
278
|
+
{
|
279
|
+
"meta": {
|
280
|
+
"page": 0,
|
281
|
+
"page_size": 5,
|
282
|
+
"first_page_url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0",
|
283
|
+
"url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0",
|
284
|
+
"previous_page_url": null,
|
285
|
+
"next_page_url": null,
|
286
|
+
"key": "webhooks"
|
287
|
+
},
|
288
|
+
"webhooks": []
|
289
|
+
}
|
290
|
+
]
|
291
|
+
))
|
292
|
+
|
293
|
+
actual = @client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
294
|
+
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
295
|
+
.webhooks.list()
|
296
|
+
|
297
|
+
expect(actual).to_not eq(nil)
|
298
|
+
end
|
299
|
+
end
|