twilio-ruby 5.0.0.rc26 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +21 -0
- data/.rubocop_todo.yml +187 -0
- data/.travis.yml +13 -0
- data/CHANGES.md +4 -0
- data/Gemfile +2 -2
- data/Makefile +8 -1
- data/Rakefile +3 -7
- data/examples/examples.rb +12 -10
- data/examples/{print-call-log.rb → print_call_log.rb} +4 -4
- data/lib/rack/twilio_webhook_authentication.rb +2 -3
- data/lib/twilio-ruby/framework/domain.rb +2 -6
- data/lib/twilio-ruby/framework/error.rb +0 -1
- data/lib/twilio-ruby/framework/helper.rb +1 -1
- data/lib/twilio-ruby/framework/page.rb +23 -25
- data/lib/twilio-ruby/framework/resource.rb +2 -2
- data/lib/twilio-ruby/framework/serialize.rb +5 -12
- data/lib/twilio-ruby/framework/twilio_response.rb +1 -1
- data/lib/twilio-ruby/framework/values.rb +2 -2
- data/lib/twilio-ruby/framework/version.rb +19 -37
- data/lib/twilio-ruby/http/http_client.rb +5 -6
- data/lib/twilio-ruby/jwt/access_token.rb +27 -41
- data/lib/twilio-ruby/jwt/client_capability.rb +11 -16
- data/lib/twilio-ruby/jwt/jwt.rb +7 -13
- data/lib/twilio-ruby/jwt/task_router.rb +40 -38
- data/lib/twilio-ruby/rest/accounts.rb +2 -0
- data/lib/twilio-ruby/rest/accounts/v1.rb +2 -0
- data/lib/twilio-ruby/rest/accounts/v1/credential.rb +2 -2
- data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +12 -7
- data/lib/twilio-ruby/rest/api.rb +96 -0
- data/lib/twilio-ruby/rest/api/v2010.rb +5 -0
- data/lib/twilio-ruby/rest/api/v2010/account.rb +66 -56
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +30 -13
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +22 -8
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +40 -11
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +20 -9
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +16 -15
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +26 -28
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +26 -28
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +26 -28
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +64 -34
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +12 -4
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +28 -3
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +37 -16
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +25 -15
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +28 -27
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +28 -19
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +22 -9
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +62 -58
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +52 -12
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +52 -12
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +52 -12
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +8 -9
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +47 -20
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +12 -2
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +17 -17
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +10 -2
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +10 -2
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +37 -16
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +14 -13
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +20 -10
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +10 -10
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +37 -21
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +22 -13
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +22 -13
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +26 -9
- data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +24 -13
- data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +8 -9
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +8 -10
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +16 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +14 -9
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +36 -13
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +14 -10
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +14 -10
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +16 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +16 -9
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +14 -2
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +26 -9
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +4 -6
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +44 -33
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +32 -15
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +10 -1
- data/lib/twilio-ruby/rest/chat.rb +8 -0
- data/lib/twilio-ruby/rest/chat/v1.rb +8 -0
- data/lib/twilio-ruby/rest/chat/v1/credential.rb +16 -7
- data/lib/twilio-ruby/rest/chat/v1/service.rb +48 -13
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +34 -15
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +20 -10
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +22 -10
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +26 -10
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +18 -8
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +30 -10
- data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +16 -8
- data/lib/twilio-ruby/rest/chat/v2.rb +8 -0
- data/lib/twilio-ruby/rest/chat/v2/credential.rb +16 -7
- data/lib/twilio-ruby/rest/chat/v2/service.rb +46 -13
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +34 -15
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +20 -10
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +22 -10
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +26 -10
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +18 -8
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +30 -10
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +16 -8
- data/lib/twilio-ruby/rest/client.rb +94 -45
- data/lib/twilio-ruby/rest/ip_messaging.rb +8 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1.rb +8 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +16 -7
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +48 -13
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +34 -15
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +20 -10
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +22 -10
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +26 -10
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +18 -8
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +30 -10
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +16 -8
- data/lib/twilio-ruby/rest/ip_messaging/v2.rb +8 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +16 -7
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +46 -13
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +34 -15
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +20 -10
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +22 -10
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +26 -10
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +18 -8
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +30 -10
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +16 -8
- data/lib/twilio-ruby/rest/lookups.rb +4 -0
- data/lib/twilio-ruby/rest/lookups/v1.rb +9 -5
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +14 -1
- data/lib/twilio-ruby/rest/monitor.rb +8 -0
- data/lib/twilio-ruby/rest/monitor/v1.rb +8 -0
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +34 -10
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +28 -13
- data/lib/twilio-ruby/rest/pricing.rb +6 -0
- data/lib/twilio-ruby/rest/pricing/v1.rb +6 -0
- data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +8 -2
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +12 -7
- data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +8 -2
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +10 -7
- data/lib/twilio-ruby/rest/pricing/v1/voice.rb +10 -4
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +12 -7
- data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +14 -1
- data/lib/twilio-ruby/rest/taskrouter.rb +4 -0
- data/lib/twilio-ruby/rest/taskrouter/v1.rb +4 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +46 -24
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +16 -10
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +30 -17
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +42 -19
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +22 -10
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +16 -8
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +34 -15
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +12 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +10 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +34 -23
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +22 -10
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +28 -9
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +10 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +10 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +28 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +12 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +10 -2
- data/lib/twilio-ruby/rest/trunking.rb +4 -0
- data/lib/twilio-ruby/rest/trunking/v1.rb +4 -0
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +36 -15
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +14 -8
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +14 -8
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +22 -8
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +52 -8
- data/lib/twilio-ruby/rest/video.rb +8 -0
- data/lib/twilio-ruby/rest/video/v1.rb +8 -0
- data/lib/twilio-ruby/rest/video/v1/recording.rb +26 -12
- data/lib/twilio-ruby/rest/video/v1/room.rb +34 -13
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +28 -12
- data/lib/twilio-ruby/security/request_validator.rb +1 -2
- data/lib/twilio-ruby/twiml/messaging_response.rb +7 -19
- data/lib/twilio-ruby/twiml/twiml.rb +8 -14
- data/lib/twilio-ruby/twiml/voice_response.rb +157 -169
- data/lib/twilio-ruby/util.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/serialize_spec.rb +17 -30
- data/spec/holodeck/holodeck.rb +6 -6
- data/spec/jwt/access_token_spec.rb +0 -6
- data/spec/jwt/client_capability_spec.rb +3 -3
- data/spec/jwt/task_router_spec.rb +16 -21
- data/spec/rack/twilio_webhook_authentication_spec.rb +12 -16
- data/spec/spec_helper.rb +2 -2
- data/spec/support/fakeweb.rb +1 -1
- data/spec/twiml/voice_response_spec.rb +33 -20
- data/twilio-ruby.gemspec +7 -3
- metadata +21 -193
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +0 -420
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +0 -345
- data/lib/twilio-ruby/rest/fax.rb +0 -40
- data/lib/twilio-ruby/rest/fax/v1.rb +0 -37
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -520
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +0 -321
- data/lib/twilio-ruby/rest/messaging.rb +0 -40
- data/lib/twilio-ruby/rest/messaging/v1.rb +0 -37
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +0 -604
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +0 -344
- data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +0 -349
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +0 -349
- data/lib/twilio-ruby/rest/notify.rb +0 -44
- data/lib/twilio-ruby/rest/notify/v1.rb +0 -48
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +0 -394
- data/lib/twilio-ruby/rest/notify/v1/service.rb +0 -611
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +0 -414
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +0 -249
- data/lib/twilio-ruby/rest/notify/v1/service/segment.rb +0 -219
- data/lib/twilio-ruby/rest/notify/v1/service/user.rb +0 -437
- data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +0 -247
- data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +0 -418
- data/lib/twilio-ruby/rest/preview.rb +0 -107
- data/lib/twilio-ruby/rest/preview/bulk_exports.rb +0 -48
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +0 -198
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +0 -209
- data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +0 -232
- data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +0 -37
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +0 -539
- data/lib/twilio-ruby/rest/preview/marketplace.rb +0 -48
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +0 -326
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +0 -297
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +0 -427
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +0 -335
- data/lib/twilio-ruby/rest/preview/proxy.rb +0 -37
- data/lib/twilio-ruby/rest/preview/proxy/service.rb +0 -489
- data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +0 -349
- data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +0 -525
- data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +0 -406
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +0 -495
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +0 -422
- data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +0 -349
- data/lib/twilio-ruby/rest/preview/sync.rb +0 -37
- data/lib/twilio-ruby/rest/preview/sync/service.rb +0 -491
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +0 -431
- data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +0 -390
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +0 -426
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +0 -422
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +0 -390
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +0 -426
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +0 -424
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +0 -390
- data/lib/twilio-ruby/rest/preview/wireless.rb +0 -59
- data/lib/twilio-ruby/rest/preview/wireless/command.rb +0 -371
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +0 -414
- data/lib/twilio-ruby/rest/preview/wireless/sim.rb +0 -512
- data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +0 -220
- data/lib/twilio-ruby/rest/sync.rb +0 -40
- data/lib/twilio-ruby/rest/sync/v1.rb +0 -37
- data/lib/twilio-ruby/rest/sync/v1/service.rb +0 -491
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +0 -431
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +0 -390
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +0 -426
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +0 -422
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +0 -390
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +0 -426
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +0 -424
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +0 -390
- data/lib/twilio-ruby/rest/wireless.rb +0 -48
- data/lib/twilio-ruby/rest/wireless/v1.rb +0 -59
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +0 -357
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +0 -427
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +0 -516
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +0 -235
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +0 -135
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +0 -223
- data/spec/integration/fax/v1/fax/fax_media_spec.rb +0 -126
- data/spec/integration/fax/v1/fax_spec.rb +0 -272
- data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +0 -170
- data/spec/integration/messaging/v1/service/phone_number_spec.rb +0 -201
- data/spec/integration/messaging/v1/service/short_code_spec.rb +0 -173
- data/spec/integration/messaging/v1/service_spec.rb +0 -263
- data/spec/integration/notify/v1/credential_spec.rb +0 -223
- data/spec/integration/notify/v1/service/binding_spec.rb +0 -227
- data/spec/integration/notify/v1/service/notification_spec.rb +0 -97
- data/spec/integration/notify/v1/service/segment_spec.rb +0 -84
- data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +0 -118
- data/spec/integration/notify/v1/service/user/user_binding_spec.rb +0 -269
- data/spec/integration/notify/v1/service/user_spec.rb +0 -213
- data/spec/integration/notify/v1/service_spec.rb +0 -280
- data/spec/integration/preview/bulk_exports/export/day_spec.rb +0 -56
- data/spec/integration/preview/bulk_exports/export_configuration_spec.rb +0 -79
- data/spec/integration/preview/bulk_exports/export_spec.rb +0 -43
- data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +0 -276
- data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +0 -121
- data/spec/integration/preview/marketplace/available_add_on_spec.rb +0 -142
- data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +0 -164
- data/spec/integration/preview/marketplace/installed_add_on_spec.rb +0 -252
- data/spec/integration/preview/proxy/service/phone_number_spec.rb +0 -173
- data/spec/integration/preview/proxy/service/session/interaction_spec.rb +0 -104
- data/spec/integration/preview/proxy/service/session/participant/message_interaction_spec.rb +0 -164
- data/spec/integration/preview/proxy/service/session/participant_spec.rb +0 -226
- data/spec/integration/preview/proxy/service/session_spec.rb +0 -216
- data/spec/integration/preview/proxy/service/short_code_spec.rb +0 -173
- data/spec/integration/preview/proxy/service_spec.rb +0 -200
- data/spec/integration/preview/sync/service/document/document_permission_spec.rb +0 -206
- data/spec/integration/preview/sync/service/document_spec.rb +0 -254
- data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +0 -256
- data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +0 -206
- data/spec/integration/preview/sync/service/sync_list_spec.rb +0 -207
- data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +0 -257
- data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +0 -206
- data/spec/integration/preview/sync/service/sync_map_spec.rb +0 -207
- data/spec/integration/preview/sync/service_spec.rb +0 -244
- data/spec/integration/preview/wireless/command_spec.rb +0 -169
- data/spec/integration/preview/wireless/rate_plan_spec.rb +0 -260
- data/spec/integration/preview/wireless/sim/usage_spec.rb +0 -49
- data/spec/integration/preview/wireless/sim_spec.rb +0 -208
- data/spec/integration/sync/v1/service/document/document_permission_spec.rb +0 -206
- data/spec/integration/sync/v1/service/document_spec.rb +0 -254
- data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +0 -256
- data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +0 -206
- data/spec/integration/sync/v1/service/sync_list_spec.rb +0 -207
- data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +0 -257
- data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +0 -206
- data/spec/integration/sync/v1/service/sync_map_spec.rb +0 -207
- data/spec/integration/sync/v1/service_spec.rb +0 -244
- data/spec/integration/wireless/v1/command_spec.rb +0 -166
- data/spec/integration/wireless/v1/rate_plan_spec.rb +0 -268
- data/spec/integration/wireless/v1/sim/usage_record_spec.rb +0 -65
- data/spec/integration/wireless/v1/sim_spec.rb +0 -208
|
@@ -1,611 +0,0 @@
|
|
|
1
|
-
##
|
|
2
|
-
# This code was generated by
|
|
3
|
-
# \ / _ _ _| _ _
|
|
4
|
-
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
-
# / /
|
|
6
|
-
|
|
7
|
-
module Twilio
|
|
8
|
-
module REST
|
|
9
|
-
class Notify < Domain
|
|
10
|
-
class V1 < Version
|
|
11
|
-
class ServiceList < ListResource
|
|
12
|
-
##
|
|
13
|
-
# Initialize the ServiceList
|
|
14
|
-
# @param [Version] version Version that contains the resource
|
|
15
|
-
# @return [ServiceList] ServiceList
|
|
16
|
-
def initialize(version)
|
|
17
|
-
super(version)
|
|
18
|
-
|
|
19
|
-
# Path Solution
|
|
20
|
-
@solution = {}
|
|
21
|
-
@uri = "/Services"
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
##
|
|
25
|
-
# Retrieve a single page of ServiceInstance records from the API.
|
|
26
|
-
# Request is executed immediately.
|
|
27
|
-
# @param [String] friendly_name The friendly_name
|
|
28
|
-
# @param [String] apn_credential_sid The apn_credential_sid
|
|
29
|
-
# @param [String] gcm_credential_sid The gcm_credential_sid
|
|
30
|
-
# @param [String] messaging_service_sid The messaging_service_sid
|
|
31
|
-
# @param [String] facebook_messenger_page_id The facebook_messenger_page_id
|
|
32
|
-
# @param [String] default_apn_notification_protocol_version The
|
|
33
|
-
# default_apn_notification_protocol_version
|
|
34
|
-
# @param [String] default_gcm_notification_protocol_version The
|
|
35
|
-
# default_gcm_notification_protocol_version
|
|
36
|
-
# @param [String] fcm_credential_sid The fcm_credential_sid
|
|
37
|
-
# @param [String] default_fcm_notification_protocol_version The
|
|
38
|
-
# default_fcm_notification_protocol_version
|
|
39
|
-
# @param [Boolean] log_enabled The log_enabled
|
|
40
|
-
# @param [String] alexa_skill_id The alexa_skill_id
|
|
41
|
-
# @param [String] default_alexa_notification_protocol_version The
|
|
42
|
-
# default_alexa_notification_protocol_version
|
|
43
|
-
# @return [ServiceInstance] Newly created ServiceInstance
|
|
44
|
-
def create(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset)
|
|
45
|
-
data = Twilio::Values.of({
|
|
46
|
-
'FriendlyName' => friendly_name,
|
|
47
|
-
'ApnCredentialSid' => apn_credential_sid,
|
|
48
|
-
'GcmCredentialSid' => gcm_credential_sid,
|
|
49
|
-
'MessagingServiceSid' => messaging_service_sid,
|
|
50
|
-
'FacebookMessengerPageId' => facebook_messenger_page_id,
|
|
51
|
-
'DefaultApnNotificationProtocolVersion' => default_apn_notification_protocol_version,
|
|
52
|
-
'DefaultGcmNotificationProtocolVersion' => default_gcm_notification_protocol_version,
|
|
53
|
-
'FcmCredentialSid' => fcm_credential_sid,
|
|
54
|
-
'DefaultFcmNotificationProtocolVersion' => default_fcm_notification_protocol_version,
|
|
55
|
-
'LogEnabled' => log_enabled,
|
|
56
|
-
'AlexaSkillId' => alexa_skill_id,
|
|
57
|
-
'DefaultAlexaNotificationProtocolVersion' => default_alexa_notification_protocol_version,
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
payload = @version.create(
|
|
61
|
-
'POST',
|
|
62
|
-
@uri,
|
|
63
|
-
data: data
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
ServiceInstance.new(
|
|
67
|
-
@version,
|
|
68
|
-
payload,
|
|
69
|
-
)
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
##
|
|
73
|
-
# Lists ServiceInstance records from the API as a list.
|
|
74
|
-
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
75
|
-
# memory before returning.
|
|
76
|
-
# @param [String] friendly_name The friendly_name
|
|
77
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
78
|
-
# guarantees to never return more than limit. Default is no limit
|
|
79
|
-
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
|
80
|
-
# the default value of 50 records. If no page_size is defined
|
|
81
|
-
# but a limit is defined, stream() will attempt to read the
|
|
82
|
-
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
83
|
-
# @return [Array] Array of up to limit results
|
|
84
|
-
def list(friendly_name: :unset, limit: nil, page_size: nil)
|
|
85
|
-
self.stream(
|
|
86
|
-
friendly_name: friendly_name,
|
|
87
|
-
limit: limit,
|
|
88
|
-
page_size: page_size
|
|
89
|
-
).entries
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
##
|
|
93
|
-
# Streams ServiceInstance records from the API as an Enumerable.
|
|
94
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
|
95
|
-
# is reached.
|
|
96
|
-
# @param [String] friendly_name The friendly_name
|
|
97
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
98
|
-
# guarantees to never return more than limit. Default is no limit
|
|
99
|
-
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
|
100
|
-
# the default value of 50 records. If no page_size is defined
|
|
101
|
-
# but a limit is defined, stream() will attempt to read the
|
|
102
|
-
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
103
|
-
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
104
|
-
def stream(friendly_name: :unset, limit: nil, page_size: nil)
|
|
105
|
-
limits = @version.read_limits(limit, page_size)
|
|
106
|
-
|
|
107
|
-
page = self.page(
|
|
108
|
-
friendly_name: friendly_name,
|
|
109
|
-
page_size: limits[:page_size],
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
##
|
|
116
|
-
# When passed a block, yields ServiceInstance records from the API.
|
|
117
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
|
118
|
-
# is reached.
|
|
119
|
-
# @param [String] friendly_name The friendly_name
|
|
120
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
121
|
-
# guarantees to never return more than limit. Default is no limit
|
|
122
|
-
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
|
123
|
-
# the default value of 50 records. If no page_size is defined
|
|
124
|
-
# but a limit is defined, stream() will attempt to read the
|
|
125
|
-
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
126
|
-
def each
|
|
127
|
-
limits = @version.read_limits
|
|
128
|
-
|
|
129
|
-
page = self.page(
|
|
130
|
-
page_size: limits[:page_size],
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
@version.stream(page,
|
|
134
|
-
limit: limits[:limit],
|
|
135
|
-
page_limit: limits[:page_limit]).each {|x| yield x}
|
|
136
|
-
end
|
|
137
|
-
|
|
138
|
-
##
|
|
139
|
-
# Retrieve a single page of ServiceInstance records from the API.
|
|
140
|
-
# Request is executed immediately.
|
|
141
|
-
# @param [String] friendly_name The friendly_name
|
|
142
|
-
# @param [String] page_token PageToken provided by the API
|
|
143
|
-
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
144
|
-
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
145
|
-
# @return [Page] Page of ServiceInstance
|
|
146
|
-
def page(friendly_name: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
|
147
|
-
params = Twilio::Values.of({
|
|
148
|
-
'FriendlyName' => friendly_name,
|
|
149
|
-
'PageToken' => page_token,
|
|
150
|
-
'Page' => page_number,
|
|
151
|
-
'PageSize' => page_size,
|
|
152
|
-
})
|
|
153
|
-
response = @version.page(
|
|
154
|
-
'GET',
|
|
155
|
-
@uri,
|
|
156
|
-
params
|
|
157
|
-
)
|
|
158
|
-
ServicePage.new(@version, response, @solution)
|
|
159
|
-
end
|
|
160
|
-
|
|
161
|
-
##
|
|
162
|
-
# Retrieve a single page of ServiceInstance records from the API.
|
|
163
|
-
# Request is executed immediately.
|
|
164
|
-
# @param [String] target_url API-generated URL for the requested results page
|
|
165
|
-
# @return [Page] Page of ServiceInstance
|
|
166
|
-
def get_page(target_url)
|
|
167
|
-
response = @version.domain.request(
|
|
168
|
-
'GET',
|
|
169
|
-
target_url
|
|
170
|
-
)
|
|
171
|
-
ServicePage.new(@version, response, @solution)
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
##
|
|
175
|
-
# Provide a user friendly representation
|
|
176
|
-
def to_s
|
|
177
|
-
'#<Twilio.Notify.V1.ServiceList>'
|
|
178
|
-
end
|
|
179
|
-
end
|
|
180
|
-
|
|
181
|
-
class ServicePage < Page
|
|
182
|
-
##
|
|
183
|
-
# Initialize the ServicePage
|
|
184
|
-
# @param [Version] version Version that contains the resource
|
|
185
|
-
# @param [Response] response Response from the API
|
|
186
|
-
# @param [Hash] solution Path solution for the resource
|
|
187
|
-
# @return [ServicePage] ServicePage
|
|
188
|
-
def initialize(version, response, solution)
|
|
189
|
-
super(version, response)
|
|
190
|
-
|
|
191
|
-
# Path Solution
|
|
192
|
-
@solution = solution
|
|
193
|
-
end
|
|
194
|
-
|
|
195
|
-
##
|
|
196
|
-
# Build an instance of ServiceInstance
|
|
197
|
-
# @param [Hash] payload Payload response from the API
|
|
198
|
-
# @return [ServiceInstance] ServiceInstance
|
|
199
|
-
def get_instance(payload)
|
|
200
|
-
ServiceInstance.new(
|
|
201
|
-
@version,
|
|
202
|
-
payload,
|
|
203
|
-
)
|
|
204
|
-
end
|
|
205
|
-
|
|
206
|
-
##
|
|
207
|
-
# Provide a user friendly representation
|
|
208
|
-
def to_s
|
|
209
|
-
'<Twilio.Notify.V1.ServicePage>'
|
|
210
|
-
end
|
|
211
|
-
end
|
|
212
|
-
|
|
213
|
-
class ServiceContext < InstanceContext
|
|
214
|
-
##
|
|
215
|
-
# Initialize the ServiceContext
|
|
216
|
-
# @param [Version] version Version that contains the resource
|
|
217
|
-
# @param [String] sid The sid
|
|
218
|
-
# @return [ServiceContext] ServiceContext
|
|
219
|
-
def initialize(version, sid)
|
|
220
|
-
super(version)
|
|
221
|
-
|
|
222
|
-
# Path Solution
|
|
223
|
-
@solution = {
|
|
224
|
-
sid: sid,
|
|
225
|
-
}
|
|
226
|
-
@uri = "/Services/#{@solution[:sid]}"
|
|
227
|
-
|
|
228
|
-
# Dependents
|
|
229
|
-
@bindings = nil
|
|
230
|
-
@notifications = nil
|
|
231
|
-
@users = nil
|
|
232
|
-
@segments = nil
|
|
233
|
-
end
|
|
234
|
-
|
|
235
|
-
##
|
|
236
|
-
# Deletes the ServiceInstance
|
|
237
|
-
# @return [Boolean] true if delete succeeds, true otherwise
|
|
238
|
-
def delete
|
|
239
|
-
@version.delete('delete', @uri)
|
|
240
|
-
end
|
|
241
|
-
|
|
242
|
-
##
|
|
243
|
-
# Fetch a ServiceInstance
|
|
244
|
-
# @return [ServiceInstance] Fetched ServiceInstance
|
|
245
|
-
def fetch
|
|
246
|
-
params = Twilio::Values.of({})
|
|
247
|
-
|
|
248
|
-
payload = @version.fetch(
|
|
249
|
-
'GET',
|
|
250
|
-
@uri,
|
|
251
|
-
params,
|
|
252
|
-
)
|
|
253
|
-
|
|
254
|
-
ServiceInstance.new(
|
|
255
|
-
@version,
|
|
256
|
-
payload,
|
|
257
|
-
sid: @solution[:sid],
|
|
258
|
-
)
|
|
259
|
-
end
|
|
260
|
-
|
|
261
|
-
##
|
|
262
|
-
# Update the ServiceInstance
|
|
263
|
-
# @param [String] friendly_name The friendly_name
|
|
264
|
-
# @param [String] apn_credential_sid The apn_credential_sid
|
|
265
|
-
# @param [String] gcm_credential_sid The gcm_credential_sid
|
|
266
|
-
# @param [String] messaging_service_sid The messaging_service_sid
|
|
267
|
-
# @param [String] facebook_messenger_page_id The facebook_messenger_page_id
|
|
268
|
-
# @param [String] default_apn_notification_protocol_version The
|
|
269
|
-
# default_apn_notification_protocol_version
|
|
270
|
-
# @param [String] default_gcm_notification_protocol_version The
|
|
271
|
-
# default_gcm_notification_protocol_version
|
|
272
|
-
# @param [String] fcm_credential_sid The fcm_credential_sid
|
|
273
|
-
# @param [String] default_fcm_notification_protocol_version The
|
|
274
|
-
# default_fcm_notification_protocol_version
|
|
275
|
-
# @param [Boolean] log_enabled The log_enabled
|
|
276
|
-
# @param [String] alexa_skill_id The alexa_skill_id
|
|
277
|
-
# @param [String] default_alexa_notification_protocol_version The
|
|
278
|
-
# default_alexa_notification_protocol_version
|
|
279
|
-
# @return [ServiceInstance] Updated ServiceInstance
|
|
280
|
-
def update(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset)
|
|
281
|
-
data = Twilio::Values.of({
|
|
282
|
-
'FriendlyName' => friendly_name,
|
|
283
|
-
'ApnCredentialSid' => apn_credential_sid,
|
|
284
|
-
'GcmCredentialSid' => gcm_credential_sid,
|
|
285
|
-
'MessagingServiceSid' => messaging_service_sid,
|
|
286
|
-
'FacebookMessengerPageId' => facebook_messenger_page_id,
|
|
287
|
-
'DefaultApnNotificationProtocolVersion' => default_apn_notification_protocol_version,
|
|
288
|
-
'DefaultGcmNotificationProtocolVersion' => default_gcm_notification_protocol_version,
|
|
289
|
-
'FcmCredentialSid' => fcm_credential_sid,
|
|
290
|
-
'DefaultFcmNotificationProtocolVersion' => default_fcm_notification_protocol_version,
|
|
291
|
-
'LogEnabled' => log_enabled,
|
|
292
|
-
'AlexaSkillId' => alexa_skill_id,
|
|
293
|
-
'DefaultAlexaNotificationProtocolVersion' => default_alexa_notification_protocol_version,
|
|
294
|
-
})
|
|
295
|
-
|
|
296
|
-
payload = @version.update(
|
|
297
|
-
'POST',
|
|
298
|
-
@uri,
|
|
299
|
-
data: data,
|
|
300
|
-
)
|
|
301
|
-
|
|
302
|
-
ServiceInstance.new(
|
|
303
|
-
@version,
|
|
304
|
-
payload,
|
|
305
|
-
sid: @solution[:sid],
|
|
306
|
-
)
|
|
307
|
-
end
|
|
308
|
-
|
|
309
|
-
##
|
|
310
|
-
# Access the bindings
|
|
311
|
-
# @return [BindingList] if a(n) BindingList object was created.
|
|
312
|
-
# @return [BindingContext] if a(n) BindingContext object was created.
|
|
313
|
-
def bindings(sid=:unset)
|
|
314
|
-
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
|
315
|
-
|
|
316
|
-
if sid != :unset
|
|
317
|
-
return BindingContext.new(
|
|
318
|
-
@version,
|
|
319
|
-
@solution[:sid],
|
|
320
|
-
sid,
|
|
321
|
-
)
|
|
322
|
-
end
|
|
323
|
-
|
|
324
|
-
unless @bindings
|
|
325
|
-
@bindings = BindingList.new(
|
|
326
|
-
@version,
|
|
327
|
-
service_sid: @solution[:sid],
|
|
328
|
-
)
|
|
329
|
-
end
|
|
330
|
-
|
|
331
|
-
@bindings
|
|
332
|
-
end
|
|
333
|
-
|
|
334
|
-
##
|
|
335
|
-
# Access the notifications
|
|
336
|
-
# @return [NotificationList] if a(n) NotificationList object was created.
|
|
337
|
-
# @return [NotificationContext] if a(n) NotificationContext object was created.
|
|
338
|
-
def notifications
|
|
339
|
-
unless @notifications
|
|
340
|
-
@notifications = NotificationList.new(
|
|
341
|
-
@version,
|
|
342
|
-
service_sid: @solution[:sid],
|
|
343
|
-
)
|
|
344
|
-
end
|
|
345
|
-
|
|
346
|
-
@notifications
|
|
347
|
-
end
|
|
348
|
-
|
|
349
|
-
##
|
|
350
|
-
# Access the users
|
|
351
|
-
# @return [UserList] if a(n) UserList object was created.
|
|
352
|
-
# @return [UserContext] if a(n) UserContext object was created.
|
|
353
|
-
def users(identity=:unset)
|
|
354
|
-
raise ArgumentError, 'identity cannot be nil' if identity.nil?
|
|
355
|
-
|
|
356
|
-
if identity != :unset
|
|
357
|
-
return UserContext.new(
|
|
358
|
-
@version,
|
|
359
|
-
@solution[:sid],
|
|
360
|
-
identity,
|
|
361
|
-
)
|
|
362
|
-
end
|
|
363
|
-
|
|
364
|
-
unless @users
|
|
365
|
-
@users = UserList.new(
|
|
366
|
-
@version,
|
|
367
|
-
service_sid: @solution[:sid],
|
|
368
|
-
)
|
|
369
|
-
end
|
|
370
|
-
|
|
371
|
-
@users
|
|
372
|
-
end
|
|
373
|
-
|
|
374
|
-
##
|
|
375
|
-
# Access the segments
|
|
376
|
-
# @return [SegmentList] if a(n) SegmentList object was created.
|
|
377
|
-
# @return [SegmentContext] if a(n) SegmentContext object was created.
|
|
378
|
-
def segments
|
|
379
|
-
unless @segments
|
|
380
|
-
@segments = SegmentList.new(
|
|
381
|
-
@version,
|
|
382
|
-
service_sid: @solution[:sid],
|
|
383
|
-
)
|
|
384
|
-
end
|
|
385
|
-
|
|
386
|
-
@segments
|
|
387
|
-
end
|
|
388
|
-
|
|
389
|
-
##
|
|
390
|
-
# Provide a user friendly representation
|
|
391
|
-
def to_s
|
|
392
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
|
393
|
-
"#<Twilio.Notify.V1.ServiceContext #{context}>"
|
|
394
|
-
end
|
|
395
|
-
end
|
|
396
|
-
|
|
397
|
-
class ServiceInstance < InstanceResource
|
|
398
|
-
##
|
|
399
|
-
# Initialize the ServiceInstance
|
|
400
|
-
# @param [Version] version Version that contains the resource
|
|
401
|
-
# @param [Hash] payload payload that contains response from Twilio
|
|
402
|
-
# @param [String] sid The sid
|
|
403
|
-
# @return [ServiceInstance] ServiceInstance
|
|
404
|
-
def initialize(version, payload, sid: nil)
|
|
405
|
-
super(version)
|
|
406
|
-
|
|
407
|
-
# Marshaled Properties
|
|
408
|
-
@properties = {
|
|
409
|
-
'sid' => payload['sid'],
|
|
410
|
-
'account_sid' => payload['account_sid'],
|
|
411
|
-
'friendly_name' => payload['friendly_name'],
|
|
412
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
|
413
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
414
|
-
'apn_credential_sid' => payload['apn_credential_sid'],
|
|
415
|
-
'gcm_credential_sid' => payload['gcm_credential_sid'],
|
|
416
|
-
'fcm_credential_sid' => payload['fcm_credential_sid'],
|
|
417
|
-
'messaging_service_sid' => payload['messaging_service_sid'],
|
|
418
|
-
'facebook_messenger_page_id' => payload['facebook_messenger_page_id'],
|
|
419
|
-
'default_apn_notification_protocol_version' => payload['default_apn_notification_protocol_version'],
|
|
420
|
-
'default_gcm_notification_protocol_version' => payload['default_gcm_notification_protocol_version'],
|
|
421
|
-
'default_fcm_notification_protocol_version' => payload['default_fcm_notification_protocol_version'],
|
|
422
|
-
'log_enabled' => payload['log_enabled'],
|
|
423
|
-
'url' => payload['url'],
|
|
424
|
-
'links' => payload['links'],
|
|
425
|
-
'alexa_skill_id' => payload['alexa_skill_id'],
|
|
426
|
-
'default_alexa_notification_protocol_version' => payload['default_alexa_notification_protocol_version'],
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
# Context
|
|
430
|
-
@instance_context = nil
|
|
431
|
-
@params = {
|
|
432
|
-
'sid' => sid || @properties['sid'],
|
|
433
|
-
}
|
|
434
|
-
end
|
|
435
|
-
|
|
436
|
-
##
|
|
437
|
-
# Generate an instance context for the instance, the context is capable of
|
|
438
|
-
# performing various actions. All instance actions are proxied to the context
|
|
439
|
-
# @param [Version] version Version that contains the resource
|
|
440
|
-
# @return [ServiceContext] ServiceContext for this ServiceInstance
|
|
441
|
-
def context
|
|
442
|
-
unless @instance_context
|
|
443
|
-
@instance_context = ServiceContext.new(
|
|
444
|
-
@version,
|
|
445
|
-
@params['sid'],
|
|
446
|
-
)
|
|
447
|
-
end
|
|
448
|
-
@instance_context
|
|
449
|
-
end
|
|
450
|
-
|
|
451
|
-
def sid
|
|
452
|
-
@properties['sid']
|
|
453
|
-
end
|
|
454
|
-
|
|
455
|
-
def account_sid
|
|
456
|
-
@properties['account_sid']
|
|
457
|
-
end
|
|
458
|
-
|
|
459
|
-
def friendly_name
|
|
460
|
-
@properties['friendly_name']
|
|
461
|
-
end
|
|
462
|
-
|
|
463
|
-
def date_created
|
|
464
|
-
@properties['date_created']
|
|
465
|
-
end
|
|
466
|
-
|
|
467
|
-
def date_updated
|
|
468
|
-
@properties['date_updated']
|
|
469
|
-
end
|
|
470
|
-
|
|
471
|
-
def apn_credential_sid
|
|
472
|
-
@properties['apn_credential_sid']
|
|
473
|
-
end
|
|
474
|
-
|
|
475
|
-
def gcm_credential_sid
|
|
476
|
-
@properties['gcm_credential_sid']
|
|
477
|
-
end
|
|
478
|
-
|
|
479
|
-
def fcm_credential_sid
|
|
480
|
-
@properties['fcm_credential_sid']
|
|
481
|
-
end
|
|
482
|
-
|
|
483
|
-
def messaging_service_sid
|
|
484
|
-
@properties['messaging_service_sid']
|
|
485
|
-
end
|
|
486
|
-
|
|
487
|
-
def facebook_messenger_page_id
|
|
488
|
-
@properties['facebook_messenger_page_id']
|
|
489
|
-
end
|
|
490
|
-
|
|
491
|
-
def default_apn_notification_protocol_version
|
|
492
|
-
@properties['default_apn_notification_protocol_version']
|
|
493
|
-
end
|
|
494
|
-
|
|
495
|
-
def default_gcm_notification_protocol_version
|
|
496
|
-
@properties['default_gcm_notification_protocol_version']
|
|
497
|
-
end
|
|
498
|
-
|
|
499
|
-
def default_fcm_notification_protocol_version
|
|
500
|
-
@properties['default_fcm_notification_protocol_version']
|
|
501
|
-
end
|
|
502
|
-
|
|
503
|
-
def log_enabled
|
|
504
|
-
@properties['log_enabled']
|
|
505
|
-
end
|
|
506
|
-
|
|
507
|
-
def url
|
|
508
|
-
@properties['url']
|
|
509
|
-
end
|
|
510
|
-
|
|
511
|
-
def links
|
|
512
|
-
@properties['links']
|
|
513
|
-
end
|
|
514
|
-
|
|
515
|
-
def alexa_skill_id
|
|
516
|
-
@properties['alexa_skill_id']
|
|
517
|
-
end
|
|
518
|
-
|
|
519
|
-
def default_alexa_notification_protocol_version
|
|
520
|
-
@properties['default_alexa_notification_protocol_version']
|
|
521
|
-
end
|
|
522
|
-
|
|
523
|
-
##
|
|
524
|
-
# Deletes the ServiceInstance
|
|
525
|
-
# @return [Boolean] true if delete succeeds, true otherwise
|
|
526
|
-
def delete
|
|
527
|
-
context.delete
|
|
528
|
-
end
|
|
529
|
-
|
|
530
|
-
##
|
|
531
|
-
# Fetch a ServiceInstance
|
|
532
|
-
# @return [ServiceInstance] Fetched ServiceInstance
|
|
533
|
-
def fetch
|
|
534
|
-
context.fetch
|
|
535
|
-
end
|
|
536
|
-
|
|
537
|
-
##
|
|
538
|
-
# Update the ServiceInstance
|
|
539
|
-
# @param [String] friendly_name The friendly_name
|
|
540
|
-
# @param [String] apn_credential_sid The apn_credential_sid
|
|
541
|
-
# @param [String] gcm_credential_sid The gcm_credential_sid
|
|
542
|
-
# @param [String] messaging_service_sid The messaging_service_sid
|
|
543
|
-
# @param [String] facebook_messenger_page_id The facebook_messenger_page_id
|
|
544
|
-
# @param [String] default_apn_notification_protocol_version The
|
|
545
|
-
# default_apn_notification_protocol_version
|
|
546
|
-
# @param [String] default_gcm_notification_protocol_version The
|
|
547
|
-
# default_gcm_notification_protocol_version
|
|
548
|
-
# @param [String] fcm_credential_sid The fcm_credential_sid
|
|
549
|
-
# @param [String] default_fcm_notification_protocol_version The
|
|
550
|
-
# default_fcm_notification_protocol_version
|
|
551
|
-
# @param [Boolean] log_enabled The log_enabled
|
|
552
|
-
# @param [String] alexa_skill_id The alexa_skill_id
|
|
553
|
-
# @param [String] default_alexa_notification_protocol_version The
|
|
554
|
-
# default_alexa_notification_protocol_version
|
|
555
|
-
# @return [ServiceInstance] Updated ServiceInstance
|
|
556
|
-
def update(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset)
|
|
557
|
-
context.update(
|
|
558
|
-
friendly_name: friendly_name,
|
|
559
|
-
apn_credential_sid: apn_credential_sid,
|
|
560
|
-
gcm_credential_sid: gcm_credential_sid,
|
|
561
|
-
messaging_service_sid: messaging_service_sid,
|
|
562
|
-
facebook_messenger_page_id: facebook_messenger_page_id,
|
|
563
|
-
default_apn_notification_protocol_version: default_apn_notification_protocol_version,
|
|
564
|
-
default_gcm_notification_protocol_version: default_gcm_notification_protocol_version,
|
|
565
|
-
fcm_credential_sid: fcm_credential_sid,
|
|
566
|
-
default_fcm_notification_protocol_version: default_fcm_notification_protocol_version,
|
|
567
|
-
log_enabled: log_enabled,
|
|
568
|
-
alexa_skill_id: alexa_skill_id,
|
|
569
|
-
default_alexa_notification_protocol_version: default_alexa_notification_protocol_version,
|
|
570
|
-
)
|
|
571
|
-
end
|
|
572
|
-
|
|
573
|
-
##
|
|
574
|
-
# Access the bindings
|
|
575
|
-
# @return [bindings] bindings
|
|
576
|
-
def bindings
|
|
577
|
-
context.bindings
|
|
578
|
-
end
|
|
579
|
-
|
|
580
|
-
##
|
|
581
|
-
# Access the notifications
|
|
582
|
-
# @return [notifications] notifications
|
|
583
|
-
def notifications
|
|
584
|
-
context.notifications
|
|
585
|
-
end
|
|
586
|
-
|
|
587
|
-
##
|
|
588
|
-
# Access the users
|
|
589
|
-
# @return [users] users
|
|
590
|
-
def users
|
|
591
|
-
context.users
|
|
592
|
-
end
|
|
593
|
-
|
|
594
|
-
##
|
|
595
|
-
# Access the segments
|
|
596
|
-
# @return [segments] segments
|
|
597
|
-
def segments
|
|
598
|
-
context.segments
|
|
599
|
-
end
|
|
600
|
-
|
|
601
|
-
##
|
|
602
|
-
# Provide a user friendly representation
|
|
603
|
-
def to_s
|
|
604
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
605
|
-
"<Twilio.Notify.V1.ServiceInstance #{values}>"
|
|
606
|
-
end
|
|
607
|
-
end
|
|
608
|
-
end
|
|
609
|
-
end
|
|
610
|
-
end
|
|
611
|
-
end
|