twilio-ruby 5.0.0.alpha1 → 5.0.0.rc2
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/.travis.yml +11 -2
- data/AUTHORS.md +32 -46
- data/CHANGES.md +1 -124
- data/Gemfile +2 -2
- data/LICENSE.md +12 -12
- data/Makefile +2 -15
- data/README.md +37 -29
- data/Rakefile +0 -54
- data/examples/examples.rb +57 -46
- data/examples/{print_call_log.rb → print-call-log.rb} +7 -7
- data/lib/rack/twilio_webhook_authentication.rb +6 -5
- data/lib/twilio-ruby.rb +16 -17
- data/lib/twilio-ruby/compatibility/v2010/account/call/feedback.rb +15 -0
- data/lib/twilio-ruby/compatibility/v2010/account/queue/member.rb +23 -0
- data/lib/twilio-ruby/framework/domain.rb +2 -2
- data/lib/twilio-ruby/framework/exception.rb +14 -0
- data/lib/twilio-ruby/framework/helper.rb +1 -1
- data/lib/twilio-ruby/framework/page.rb +30 -28
- data/lib/twilio-ruby/framework/resource.rb +2 -2
- data/lib/twilio-ruby/framework/serialize.rb +7 -58
- data/lib/twilio-ruby/framework/twilio_response.rb +1 -1
- data/lib/twilio-ruby/framework/version.rb +48 -43
- data/lib/twilio-ruby/http/http_client.rb +8 -8
- data/lib/twilio-ruby/rest/api.rb +33 -141
- data/lib/twilio-ruby/rest/api/v2010.rb +31 -50
- data/lib/twilio-ruby/rest/api/v2010/account.rb +239 -389
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +122 -145
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +56 -76
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +127 -144
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +83 -85
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +97 -92
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +77 -142
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +77 -142
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +77 -142
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +184 -232
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +84 -73
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +80 -85
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +115 -126
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +99 -114
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +112 -150
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +109 -228
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +98 -101
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +164 -287
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +90 -152
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +90 -152
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +90 -152
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +138 -195
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +100 -90
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +106 -118
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +105 -96
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +117 -119
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +95 -84
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +103 -194
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +93 -100
- data/lib/twilio-ruby/rest/api/v2010/account/sandbox.rb +304 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +30 -42
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +113 -111
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +115 -104
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +133 -159
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +96 -94
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +96 -94
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +114 -111
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +113 -108
- data/lib/twilio-ruby/rest/api/v2010/account/sms.rb +140 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sms/short_code.rb +431 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sms/sms_message.rb +467 -0
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +34 -41
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +90 -98
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +24 -21
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +118 -139
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +124 -130
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +31 -35
- data/lib/twilio-ruby/rest/client.rb +88 -249
- data/lib/twilio-ruby/rest/{accounts.rb → conversations.rb} +14 -16
- data/lib/twilio-ruby/rest/conversations/v1.rb +35 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +270 -0
- data/lib/twilio-ruby/rest/{notify/v1/service/segment.rb → conversations/v1/conversation/completed.rb} +101 -101
- data/lib/twilio-ruby/rest/{preview/bulk_exports/export/day.rb → conversations/v1/conversation/in_progress.rb} +109 -95
- data/lib/twilio-ruby/rest/{messaging/v1/service/phone_number.rb → conversations/v1/conversation/participant.rb} +171 -178
- data/lib/twilio-ruby/rest/ip_messaging.rb +11 -26
- data/lib/twilio-ruby/rest/ip_messaging/v1.rb +7 -19
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +112 -113
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +131 -542
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +132 -194
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +103 -159
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +102 -183
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +112 -107
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +113 -186
- data/lib/twilio-ruby/rest/lookups.rb +8 -12
- data/lib/twilio-ruby/rest/lookups/v1.rb +7 -13
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +54 -71
- data/lib/twilio-ruby/rest/monitor.rb +11 -19
- data/lib/twilio-ruby/rest/monitor/v1.rb +7 -19
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +133 -121
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +127 -116
- data/lib/twilio-ruby/rest/pricing.rb +11 -17
- data/lib/twilio-ruby/rest/pricing/v1.rb +9 -21
- data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +23 -27
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +74 -71
- data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +23 -27
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +79 -69
- data/lib/twilio-ruby/rest/pricing/v1/voice.rb +27 -33
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +74 -71
- data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +52 -47
- data/lib/twilio-ruby/rest/taskrouter.rb +8 -12
- data/lib/twilio-ruby/rest/taskrouter/v1.rb +5 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +153 -260
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +114 -115
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +101 -105
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +139 -216
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +106 -194
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +145 -187
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +65 -57
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +57 -62
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +135 -217
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +60 -54
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +56 -52
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +123 -140
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +61 -57
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +72 -52
- data/lib/twilio-ruby/rest/trunking.rb +8 -12
- data/lib/twilio-ruby/rest/trunking/v1.rb +5 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +134 -157
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +93 -89
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +93 -89
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +111 -114
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +112 -146
- data/lib/twilio-ruby/task_router.rb +0 -0
- data/lib/twilio-ruby/task_router/capability.rb +87 -0
- data/lib/twilio-ruby/twiml/response.rb +16 -0
- data/lib/twilio-ruby/util.rb +1 -1
- data/lib/twilio-ruby/util/access_token.rb +70 -0
- data/lib/twilio-ruby/util/capability.rb +64 -0
- data/lib/twilio-ruby/util/client_config.rb +29 -0
- data/lib/twilio-ruby/{security → util}/request_validator.rb +4 -21
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/holodeck/holodeck.rb +6 -6
- data/spec/holodeck/hologram.rb +1 -0
- data/spec/integration/api/v2010/account/address/dependent_phone_number_spec.rb +8 -8
- data/spec/integration/api/v2010/account/address_spec.rb +29 -37
- data/spec/integration/api/v2010/account/application_spec.rb +29 -29
- data/spec/integration/api/v2010/account/authorized_connect_app_spec.rb +13 -13
- data/spec/integration/api/v2010/account/available_phone_number/local_spec.rb +8 -9
- data/spec/integration/api/v2010/account/available_phone_number/mobile_spec.rb +8 -9
- data/spec/integration/api/v2010/account/available_phone_number/toll_free_spec.rb +8 -9
- data/spec/integration/api/v2010/account/available_phone_number_spec.rb +13 -13
- data/spec/integration/api/v2010/account/call/feedback_spec.rb +17 -17
- data/spec/integration/api/v2010/account/call/feedback_summary_spec.rb +19 -19
- data/spec/integration/api/v2010/account/call/notification_spec.rb +18 -18
- data/spec/integration/api/v2010/account/call/recording_spec.rb +20 -32
- data/spec/integration/api/v2010/account/call_spec.rb +29 -29
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +35 -107
- data/spec/integration/api/v2010/account/conference_spec.rb +19 -58
- data/spec/integration/api/v2010/account/connect_app_spec.rb +18 -18
- data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +14 -16
- data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +14 -16
- data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +14 -16
- data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +29 -41
- data/spec/integration/api/v2010/account/message/media_spec.rb +18 -18
- data/spec/integration/api/v2010/account/message_spec.rb +35 -41
- data/spec/integration/api/v2010/account/notification_spec.rb +18 -18
- data/spec/integration/api/v2010/account/outgoing_caller_id_spec.rb +23 -23
- data/spec/integration/api/v2010/account/queue/member_spec.rb +18 -18
- data/spec/integration/api/v2010/account/queue_spec.rb +32 -35
- data/spec/integration/api/v2010/account/recording/transcription_spec.rb +18 -18
- data/spec/integration/api/v2010/account/recording_spec.rb +21 -42
- data/spec/integration/api/v2010/account/sandbox_spec.rb +99 -0
- data/spec/integration/api/v2010/account/sip/credential_list/credential_spec.rb +36 -32
- data/spec/integration/api/v2010/account/sip/credential_list_spec.rb +29 -29
- data/spec/integration/api/v2010/account/sip/domain/credential_list_mapping_spec.rb +24 -24
- data/spec/integration/api/v2010/account/sip/domain/ip_access_control_list_mapping_spec.rb +24 -24
- data/spec/integration/api/v2010/account/sip/domain_spec.rb +29 -29
- data/spec/integration/api/v2010/account/sip/ip_access_control_list/ip_address_spec.rb +36 -32
- data/spec/integration/api/v2010/account/sip/ip_access_control_list_spec.rb +29 -29
- data/spec/integration/api/v2010/account/sip_spec.rb +1 -1
- data/spec/integration/api/v2010/account/{short_code_spec.rb → sms/short_code_spec.rb} +25 -18
- data/spec/integration/api/v2010/account/sms/sms_message_spec.rb +275 -0
- data/spec/integration/{accounts/v1/credential_spec.rb → api/v2010/account/sms_spec.rb} +2 -2
- data/spec/integration/api/v2010/account/token_spec.rb +7 -7
- data/spec/integration/api/v2010/account/transcription_spec.rb +18 -18
- data/spec/integration/api/v2010/account/usage/record/all_time_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/daily_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/last_month_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/monthly_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/this_month_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/today_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/yearly_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/yesterday_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/trigger_spec.rb +32 -32
- data/spec/integration/api/v2010/account/usage_spec.rb +1 -1
- data/spec/integration/api/v2010/account/validation_request_spec.rb +4 -24
- data/spec/integration/api/v2010/account_spec.rb +28 -24
- data/spec/integration/conversations/v1/conversation/completed_spec.rb +89 -0
- data/spec/integration/conversations/v1/conversation/in_progress_spec.rb +89 -0
- data/spec/integration/conversations/v1/conversation/participant_spec.rb +174 -0
- data/spec/integration/conversations/v1/conversation_spec.rb +49 -0
- data/spec/integration/ip_messaging/v1/credential_spec.rb +24 -155
- data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +13 -217
- data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +10 -241
- data/spec/integration/ip_messaging/v1/service/channel_spec.rb +23 -205
- data/spec/integration/ip_messaging/v1/service/role_spec.rb +19 -184
- data/spec/integration/ip_messaging/v1/service/user_spec.rb +24 -194
- data/spec/integration/ip_messaging/v1/service_spec.rb +17 -229
- data/spec/integration/lookups/v1/phone_number_spec.rb +6 -17
- data/spec/integration/monitor/v1/alert_spec.rb +60 -60
- data/spec/integration/monitor/v1/event_spec.rb +13 -13
- data/spec/integration/pricing/v1/messaging/country_spec.rb +7 -103
- data/spec/integration/pricing/v1/messaging_spec.rb +1 -1
- data/spec/integration/pricing/v1/phone_number/country_spec.rb +13 -13
- data/spec/integration/pricing/v1/phone_number_spec.rb +1 -1
- data/spec/integration/pricing/v1/voice/country_spec.rb +13 -13
- data/spec/integration/pricing/v1/voice/number_spec.rb +6 -6
- data/spec/integration/pricing/v1/voice_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace/activity_spec.rb +38 -34
- data/spec/integration/taskrouter/v1/workspace/event_spec.rb +13 -13
- data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +24 -21
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_statistics_spec.rb +11 -13
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queues_statistics_spec.rb +17 -18
- data/spec/integration/taskrouter/v1/workspace/task_queue_spec.rb +41 -57
- data/spec/integration/taskrouter/v1/workspace/task_spec.rb +50 -113
- data/spec/integration/taskrouter/v1/workspace/worker/worker_statistics_spec.rb +6 -7
- data/spec/integration/taskrouter/v1/workspace/worker/workers_statistics_spec.rb +6 -7
- data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +68 -96
- data/spec/integration/taskrouter/v1/workspace/workflow/workflow_statistics_spec.rb +12 -14
- data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +43 -54
- data/spec/integration/taskrouter/v1/workspace/workspace_statistics_spec.rb +9 -11
- data/spec/integration/taskrouter/v1/workspace_spec.rb +51 -71
- data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +24 -24
- data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +66 -66
- data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +28 -28
- data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +23 -23
- data/spec/integration/trunking/v1/trunk_spec.rb +28 -28
- data/spec/rack/twilio_webhook_authentication_spec.rb +23 -19
- data/spec/spec_helper.rb +2 -2
- data/spec/support/fakeweb.rb +1 -1
- data/spec/task_router_spec.rb +114 -0
- data/spec/util/access_token_spec.rb +103 -0
- data/spec/util/capability_spec.rb +186 -0
- data/spec/util/client_config_spec.rb +21 -0
- data/spec/{security → util}/request_validator_spec.rb +5 -5
- data/twilio-ruby.gemspec +8 -12
- metadata +90 -416
- data/.rubocop.yml +0 -21
- data/.rubocop_todo.yml +0 -187
- data/VERSIONS.md +0 -64
- data/lib/twilio-ruby/framework/error.rb +0 -30
- data/lib/twilio-ruby/framework/values.rb +0 -7
- data/lib/twilio-ruby/jwt/access_token.rb +0 -232
- data/lib/twilio-ruby/jwt/client_capability.rb +0 -102
- data/lib/twilio-ruby/jwt/jwt.rb +0 -50
- data/lib/twilio-ruby/jwt/task_router.rb +0 -174
- data/lib/twilio-ruby/rest/accounts/v1.rb +0 -39
- data/lib/twilio-ruby/rest/accounts/v1/credential.rb +0 -105
- data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +0 -370
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +0 -431
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +0 -350
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +0 -336
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +0 -165
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +0 -153
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +0 -153
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +0 -397
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +0 -378
- data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +0 -430
- data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +0 -336
- data/lib/twilio-ruby/rest/chat.rb +0 -59
- data/lib/twilio-ruby/rest/chat/v1.rb +0 -56
- data/lib/twilio-ruby/rest/chat/v1/credential.rb +0 -403
- data/lib/twilio-ruby/rest/chat/v1/service.rb +0 -935
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +0 -554
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +0 -386
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +0 -431
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +0 -447
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +0 -396
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +0 -467
- data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +0 -244
- data/lib/twilio-ruby/rest/chat/v2.rb +0 -56
- data/lib/twilio-ruby/rest/chat/v2/credential.rb +0 -403
- data/lib/twilio-ruby/rest/chat/v2/service.rb +0 -688
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +0 -554
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +0 -386
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +0 -431
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +0 -447
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +0 -396
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +0 -467
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +0 -244
- data/lib/twilio-ruby/rest/fax.rb +0 -44
- data/lib/twilio-ruby/rest/fax/v1.rb +0 -41
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -541
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +0 -326
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +0 -386
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +0 -244
- data/lib/twilio-ruby/rest/ip_messaging/v2.rb +0 -56
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +0 -403
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +0 -688
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +0 -554
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +0 -386
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +0 -431
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +0 -447
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +0 -396
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +0 -467
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +0 -244
- data/lib/twilio-ruby/rest/messaging.rb +0 -44
- data/lib/twilio-ruby/rest/messaging/v1.rb +0 -41
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +0 -637
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +0 -352
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +0 -359
- data/lib/twilio-ruby/rest/notify.rb +0 -52
- data/lib/twilio-ruby/rest/notify/v1.rb +0 -56
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +0 -403
- data/lib/twilio-ruby/rest/notify/v1/service.rb +0 -639
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +0 -430
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +0 -288
- data/lib/twilio-ruby/rest/notify/v1/service/user.rb +0 -445
- data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +0 -254
- data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +0 -434
- data/lib/twilio-ruby/rest/preview.rb +0 -145
- data/lib/twilio-ruby/rest/preview/bulk_exports.rb +0 -56
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +0 -203
- data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +0 -243
- data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +0 -42
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +0 -557
- data/lib/twilio-ruby/rest/preview/marketplace.rb +0 -58
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +0 -333
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +0 -301
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +0 -440
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +0 -341
- data/lib/twilio-ruby/rest/preview/proxy.rb +0 -41
- data/lib/twilio-ruby/rest/preview/proxy/service.rb +0 -500
- data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +0 -359
- data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +0 -536
- data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +0 -429
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +0 -506
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +0 -452
- data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +0 -359
- data/lib/twilio-ruby/rest/preview/sync.rb +0 -41
- data/lib/twilio-ruby/rest/preview/sync/service.rb +0 -504
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +0 -445
- data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +0 -395
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +0 -438
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +0 -430
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +0 -395
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +0 -438
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +0 -432
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +0 -395
- data/lib/twilio-ruby/rest/preview/wireless.rb +0 -71
- data/lib/twilio-ruby/rest/preview/wireless/command.rb +0 -382
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +0 -435
- data/lib/twilio-ruby/rest/preview/wireless/sim.rb +0 -544
- data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +0 -236
- data/lib/twilio-ruby/rest/sync.rb +0 -44
- data/lib/twilio-ruby/rest/sync/v1.rb +0 -41
- data/lib/twilio-ruby/rest/sync/v1/service.rb +0 -504
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +0 -445
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +0 -395
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +0 -438
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +0 -430
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +0 -395
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +0 -438
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +0 -432
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +0 -395
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +0 -315
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +0 -461
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +0 -406
- data/lib/twilio-ruby/rest/video.rb +0 -52
- data/lib/twilio-ruby/rest/video/v1.rb +0 -56
- data/lib/twilio-ruby/rest/video/v1/recording.rb +0 -382
- data/lib/twilio-ruby/rest/video/v1/room.rb +0 -485
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +0 -381
- data/lib/twilio-ruby/rest/wireless.rb +0 -60
- data/lib/twilio-ruby/rest/wireless/v1.rb +0 -71
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +0 -367
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +0 -452
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +0 -548
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +0 -235
- data/lib/twilio-ruby/twiml/messaging_response.rb +0 -141
- data/lib/twilio-ruby/twiml/twiml.rb +0 -69
- data/lib/twilio-ruby/twiml/voice_response.rb +0 -916
- data/spec/framework/serialize_spec.rb +0 -59
- data/spec/integration/accounts/v1/credential/public_key_spec.rb +0 -226
- 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/api/v2010/account/key_spec.rb +0 -178
- data/spec/integration/api/v2010/account/message/feedback_spec.rb +0 -48
- data/spec/integration/api/v2010/account/new_key_spec.rb +0 -45
- data/spec/integration/api/v2010/account/new_signing_key_spec.rb +0 -45
- data/spec/integration/api/v2010/account/recording/add_on_result/payload_spec.rb +0 -175
- data/spec/integration/api/v2010/account/recording/add_on_result_spec.rb +0 -166
- data/spec/integration/api/v2010/account/signing_key_spec.rb +0 -178
- data/spec/integration/chat/v1/credential_spec.rb +0 -223
- data/spec/integration/chat/v1/service/channel/invite_spec.rb +0 -210
- data/spec/integration/chat/v1/service/channel/member_spec.rb +0 -284
- data/spec/integration/chat/v1/service/channel/message_spec.rb +0 -294
- data/spec/integration/chat/v1/service/channel_spec.rb +0 -275
- data/spec/integration/chat/v1/service/role_spec.rb +0 -263
- data/spec/integration/chat/v1/service/user/user_channel_spec.rb +0 -92
- data/spec/integration/chat/v1/service/user_spec.rb +0 -266
- data/spec/integration/chat/v1/service_spec.rb +0 -299
- data/spec/integration/chat/v2/credential_spec.rb +0 -223
- data/spec/integration/chat/v2/service/channel/invite_spec.rb +0 -210
- data/spec/integration/chat/v2/service/channel/member_spec.rb +0 -284
- data/spec/integration/chat/v2/service/channel/message_spec.rb +0 -294
- data/spec/integration/chat/v2/service/channel_spec.rb +0 -275
- data/spec/integration/chat/v2/service/role_spec.rb +0 -263
- data/spec/integration/chat/v2/service/user/user_channel_spec.rb +0 -92
- data/spec/integration/chat/v2/service/user_spec.rb +0 -266
- data/spec/integration/chat/v2/service_spec.rb +0 -325
- 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/ip_messaging/v1/service/channel/invite_spec.rb +0 -210
- data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +0 -92
- data/spec/integration/ip_messaging/v2/credential_spec.rb +0 -223
- data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +0 -210
- data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +0 -284
- data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +0 -294
- data/spec/integration/ip_messaging/v2/service/channel_spec.rb +0 -275
- data/spec/integration/ip_messaging/v2/service/role_spec.rb +0 -263
- data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +0 -92
- data/spec/integration/ip_messaging/v2/service/user_spec.rb +0 -266
- data/spec/integration/ip_messaging/v2/service_spec.rb +0 -325
- 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 -280
- 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/taskrouter/v1/workspace/task_channel_spec.rb +0 -127
- data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +0 -192
- data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +0 -201
- data/spec/integration/video/v1/recording_spec.rb +0 -165
- data/spec/integration/video/v1/room/recording_spec.rb +0 -146
- data/spec/integration/video/v1/room_spec.rb +0 -237
- 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
- data/spec/jwt/access_token_spec.rb +0 -130
- data/spec/jwt/client_capability_spec.rb +0 -104
- data/spec/jwt/task_router_spec.rb +0 -172
- data/spec/twiml/messaging_response_spec.rb +0 -90
- data/spec/twiml/voice_response_spec.rb +0 -474
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# This code was generated by
|
|
3
3
|
# \ / _ _ _| _ _
|
|
4
4
|
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
-
# / /
|
|
5
|
+
# / /
|
|
6
6
|
|
|
7
7
|
module Twilio
|
|
8
8
|
module REST
|
|
@@ -12,203 +12,246 @@ module Twilio
|
|
|
12
12
|
##
|
|
13
13
|
# Initialize the AlertList
|
|
14
14
|
# @param [Version] version Version that contains the resource
|
|
15
|
+
|
|
15
16
|
# @return [AlertList] AlertList
|
|
16
17
|
def initialize(version)
|
|
17
18
|
super(version)
|
|
18
|
-
|
|
19
|
+
|
|
19
20
|
# Path Solution
|
|
20
21
|
@solution = {}
|
|
21
22
|
@uri = "/Alerts"
|
|
22
23
|
end
|
|
23
|
-
|
|
24
|
+
|
|
24
25
|
##
|
|
25
26
|
# Lists AlertInstance records from the API as a list.
|
|
26
27
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
27
28
|
# memory before returning.
|
|
28
29
|
# @param [String] log_level The log_level
|
|
29
|
-
# @param [
|
|
30
|
-
# @param [
|
|
30
|
+
# @param [Time] start_date_before The start_date
|
|
31
|
+
# @param [Time] start_date The start_date
|
|
32
|
+
# @param [Time] start_date_after: The start_date
|
|
33
|
+
# @param [Time] end_date_before The end_date
|
|
34
|
+
# @param [Time] end_date The end_date
|
|
35
|
+
# @param [Time] end_date_after: The end_date
|
|
31
36
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
32
37
|
# guarantees to never return more than limit. Default is no limit
|
|
33
38
|
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
|
34
39
|
# the default value of 50 records. If no page_size is defined
|
|
35
40
|
# but a limit is defined, stream() will attempt to read the
|
|
36
41
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
42
|
+
|
|
37
43
|
# @return [Array] Array of up to limit results
|
|
38
|
-
def list(log_level: :
|
|
44
|
+
def list(log_level: nil, start_date_before: nil, start_date: nil, start_date_after: nil, end_date_before: nil, end_date: nil, end_date_after: nil, limit: nil, page_size: nil)
|
|
39
45
|
self.stream(
|
|
40
46
|
log_level: log_level,
|
|
47
|
+
start_date_before: start_date_before,
|
|
41
48
|
start_date: start_date,
|
|
49
|
+
start_date_after: start_date_after,
|
|
50
|
+
end_date_before: end_date_before,
|
|
42
51
|
end_date: end_date,
|
|
52
|
+
end_date_after: end_date_after,
|
|
43
53
|
limit: limit,
|
|
44
54
|
page_size: page_size
|
|
45
55
|
).entries
|
|
46
56
|
end
|
|
47
|
-
|
|
57
|
+
|
|
48
58
|
##
|
|
49
59
|
# Streams AlertInstance records from the API as an Enumerable.
|
|
50
60
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
51
61
|
# is reached.
|
|
52
62
|
# @param [String] log_level The log_level
|
|
53
|
-
# @param [
|
|
54
|
-
# @param [
|
|
63
|
+
# @param [Time] start_date_before The start_date
|
|
64
|
+
# @param [Time] start_date The start_date
|
|
65
|
+
# @param [Time] start_date_after: The start_date
|
|
66
|
+
# @param [Time] end_date_before The end_date
|
|
67
|
+
# @param [Time] end_date The end_date
|
|
68
|
+
# @param [Time] end_date_after: The end_date
|
|
55
69
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
56
70
|
# guarantees to never return more than limit. Default is no limit
|
|
57
71
|
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
|
58
72
|
# the default value of 50 records. If no page_size is defined
|
|
59
73
|
# but a limit is defined, stream() will attempt to read the
|
|
60
74
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
75
|
+
|
|
61
76
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
62
|
-
def stream(log_level: :
|
|
77
|
+
def stream(log_level: nil, start_date_before: nil, start_date: nil, start_date_after: nil, end_date_before: nil, end_date: nil, end_date_after: nil, limit: nil, page_size: nil)
|
|
63
78
|
limits = @version.read_limits(limit, page_size)
|
|
64
|
-
|
|
79
|
+
|
|
65
80
|
page = self.page(
|
|
66
81
|
log_level: log_level,
|
|
82
|
+
start_date_before: start_date_before,
|
|
67
83
|
start_date: start_date,
|
|
84
|
+
start_date_after: start_date_after,
|
|
85
|
+
end_date_before: end_date_before,
|
|
68
86
|
end_date: end_date,
|
|
69
|
-
|
|
87
|
+
end_date_after: end_date_after,
|
|
88
|
+
page_size: limits['page_size'],
|
|
70
89
|
)
|
|
71
|
-
|
|
72
|
-
@version.stream(page, limit: limits[
|
|
90
|
+
|
|
91
|
+
@version.stream(page, limit: limits['limit'], page_limit: limits['page_limit'])
|
|
73
92
|
end
|
|
74
|
-
|
|
93
|
+
|
|
75
94
|
##
|
|
76
95
|
# When passed a block, yields AlertInstance records from the API.
|
|
77
96
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
78
97
|
# is reached.
|
|
98
|
+
# @param [String] log_level The log_level
|
|
99
|
+
# @param [Time] start_date_before The start_date
|
|
100
|
+
# @param [Time] start_date The start_date
|
|
101
|
+
# @param [Time] start_date_after: The start_date
|
|
102
|
+
# @param [Time] end_date_before The end_date
|
|
103
|
+
# @param [Time] end_date The end_date
|
|
104
|
+
# @param [Time] end_date_after: The end_date
|
|
105
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
106
|
+
# guarantees to never return more than limit. Default is no limit
|
|
107
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
|
108
|
+
# the default value of 50 records. If no page_size is defined
|
|
109
|
+
# but a limit is defined, stream() will attempt to read the
|
|
110
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
79
111
|
def each
|
|
80
112
|
limits = @version.read_limits
|
|
81
|
-
|
|
113
|
+
|
|
82
114
|
page = self.page(
|
|
83
|
-
page_size: limits[
|
|
115
|
+
page_size: limits['page_size'],
|
|
84
116
|
)
|
|
85
|
-
|
|
117
|
+
|
|
86
118
|
@version.stream(page,
|
|
87
|
-
limit: limits[
|
|
88
|
-
page_limit: limits[
|
|
119
|
+
limit: limits['limit'],
|
|
120
|
+
page_limit: limits['page_limit']).each {|x| yield x}
|
|
89
121
|
end
|
|
90
|
-
|
|
122
|
+
|
|
91
123
|
##
|
|
92
124
|
# Retrieve a single page of AlertInstance records from the API.
|
|
93
125
|
# Request is executed immediately.
|
|
94
126
|
# @param [String] log_level The log_level
|
|
95
|
-
# @param [
|
|
96
|
-
# @param [
|
|
127
|
+
# @param [Time] start_date_before The start_date
|
|
128
|
+
# @param [Time] start_date The start_date
|
|
129
|
+
# @param [Time] start_date_after: The start_date
|
|
130
|
+
# @param [Time] end_date_before The end_date
|
|
131
|
+
# @param [Time] end_date The end_date
|
|
132
|
+
# @param [Time] end_date_after: The end_date
|
|
97
133
|
# @param [String] page_token PageToken provided by the API
|
|
98
134
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
99
135
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
136
|
+
|
|
100
137
|
# @return [Page] Page of AlertInstance
|
|
101
|
-
def page(log_level: :
|
|
102
|
-
params =
|
|
138
|
+
def page(log_level: nil, start_date_before: nil, start_date: nil, start_date_after: nil, end_date_before: nil, end_date: nil, end_date_after: nil, page_token: nil, page_number: nil, page_size: nil)
|
|
139
|
+
params = {
|
|
103
140
|
'LogLevel' => log_level,
|
|
104
|
-
'StartDate' => Twilio.
|
|
105
|
-
'
|
|
141
|
+
'StartDate<' => Twilio.serialize_iso8601(start_date_before),
|
|
142
|
+
'StartDate' => Twilio.serialize_iso8601(start_date),
|
|
143
|
+
'StartDate>' => Twilio.serialize_iso8601(start_date_after),
|
|
144
|
+
'EndDate<' => Twilio.serialize_iso8601(end_date_before),
|
|
145
|
+
'EndDate' => Twilio.serialize_iso8601(end_date),
|
|
146
|
+
'EndDate>' => Twilio.serialize_iso8601(end_date_after),
|
|
106
147
|
'PageToken' => page_token,
|
|
107
148
|
'Page' => page_number,
|
|
108
149
|
'PageSize' => page_size,
|
|
109
|
-
}
|
|
150
|
+
}
|
|
110
151
|
response = @version.page(
|
|
111
152
|
'GET',
|
|
112
153
|
@uri,
|
|
113
154
|
params
|
|
114
155
|
)
|
|
115
|
-
AlertPage.new(@version, response, @solution)
|
|
156
|
+
return AlertPage.new(@version, response, @solution)
|
|
116
157
|
end
|
|
117
|
-
|
|
158
|
+
|
|
118
159
|
##
|
|
119
|
-
#
|
|
120
|
-
#
|
|
121
|
-
|
|
122
|
-
# @return [
|
|
123
|
-
def
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
160
|
+
# Constructs a AlertContext
|
|
161
|
+
# @param [String] sid The sid
|
|
162
|
+
|
|
163
|
+
# @return [AlertContext] AlertContext
|
|
164
|
+
def get(sid)
|
|
165
|
+
AlertContext.new(
|
|
166
|
+
@version,
|
|
167
|
+
sid: sid,
|
|
127
168
|
)
|
|
128
|
-
AlertPage.new(@version, response, @solution)
|
|
129
169
|
end
|
|
130
|
-
|
|
170
|
+
|
|
131
171
|
##
|
|
132
172
|
# Provide a user friendly representation
|
|
133
173
|
def to_s
|
|
134
174
|
'#<Twilio.Monitor.V1.AlertList>'
|
|
135
175
|
end
|
|
136
176
|
end
|
|
137
|
-
|
|
177
|
+
|
|
138
178
|
class AlertPage < Page
|
|
139
179
|
##
|
|
140
180
|
# Initialize the AlertPage
|
|
141
181
|
# @param [Version] version Version that contains the resource
|
|
142
182
|
# @param [Response] response Response from the API
|
|
143
183
|
# @param [Hash] solution Path solution for the resource
|
|
184
|
+
|
|
144
185
|
# @return [AlertPage] AlertPage
|
|
145
186
|
def initialize(version, response, solution)
|
|
146
187
|
super(version, response)
|
|
147
|
-
|
|
188
|
+
|
|
148
189
|
# Path Solution
|
|
149
190
|
@solution = solution
|
|
150
191
|
end
|
|
151
|
-
|
|
192
|
+
|
|
152
193
|
##
|
|
153
194
|
# Build an instance of AlertInstance
|
|
154
195
|
# @param [Hash] payload Payload response from the API
|
|
196
|
+
|
|
155
197
|
# @return [AlertInstance] AlertInstance
|
|
156
198
|
def get_instance(payload)
|
|
157
|
-
AlertInstance.new(
|
|
199
|
+
return AlertInstance.new(
|
|
158
200
|
@version,
|
|
159
201
|
payload,
|
|
160
202
|
)
|
|
161
203
|
end
|
|
162
|
-
|
|
204
|
+
|
|
163
205
|
##
|
|
164
206
|
# Provide a user friendly representation
|
|
165
207
|
def to_s
|
|
166
208
|
'<Twilio.Monitor.V1.AlertPage>'
|
|
167
209
|
end
|
|
168
210
|
end
|
|
169
|
-
|
|
211
|
+
|
|
170
212
|
class AlertContext < InstanceContext
|
|
171
213
|
##
|
|
172
214
|
# Initialize the AlertContext
|
|
173
215
|
# @param [Version] version Version that contains the resource
|
|
174
216
|
# @param [String] sid The sid
|
|
217
|
+
|
|
175
218
|
# @return [AlertContext] AlertContext
|
|
176
219
|
def initialize(version, sid)
|
|
177
220
|
super(version)
|
|
178
|
-
|
|
221
|
+
|
|
179
222
|
# Path Solution
|
|
180
223
|
@solution = {
|
|
181
224
|
sid: sid,
|
|
182
225
|
}
|
|
183
226
|
@uri = "/Alerts/#{@solution[:sid]}"
|
|
184
227
|
end
|
|
185
|
-
|
|
228
|
+
|
|
186
229
|
##
|
|
187
230
|
# Fetch a AlertInstance
|
|
188
231
|
# @return [AlertInstance] Fetched AlertInstance
|
|
189
232
|
def fetch
|
|
190
|
-
params =
|
|
191
|
-
|
|
233
|
+
params = {}
|
|
234
|
+
|
|
192
235
|
payload = @version.fetch(
|
|
193
236
|
'GET',
|
|
194
237
|
@uri,
|
|
195
238
|
params,
|
|
196
239
|
)
|
|
197
|
-
|
|
198
|
-
AlertInstance.new(
|
|
240
|
+
|
|
241
|
+
return AlertInstance.new(
|
|
199
242
|
@version,
|
|
200
243
|
payload,
|
|
201
|
-
sid: @solution[
|
|
244
|
+
sid: @solution['sid'],
|
|
202
245
|
)
|
|
203
246
|
end
|
|
204
|
-
|
|
247
|
+
|
|
205
248
|
##
|
|
206
249
|
# Deletes the AlertInstance
|
|
207
250
|
# @return [Boolean] true if delete succeeds, true otherwise
|
|
208
251
|
def delete
|
|
209
|
-
@version.delete('delete', @uri)
|
|
252
|
+
return @version.delete('delete', @uri)
|
|
210
253
|
end
|
|
211
|
-
|
|
254
|
+
|
|
212
255
|
##
|
|
213
256
|
# Provide a user friendly representation
|
|
214
257
|
def to_s
|
|
@@ -216,25 +259,26 @@ module Twilio
|
|
|
216
259
|
"#<Twilio.Monitor.V1.AlertContext #{context}>"
|
|
217
260
|
end
|
|
218
261
|
end
|
|
219
|
-
|
|
262
|
+
|
|
220
263
|
class AlertInstance < InstanceResource
|
|
221
264
|
##
|
|
222
265
|
# Initialize the AlertInstance
|
|
223
266
|
# @param [Version] version Version that contains the resource
|
|
224
267
|
# @param [Hash] payload payload that contains response from Twilio
|
|
225
268
|
# @param [String] sid The sid
|
|
269
|
+
|
|
226
270
|
# @return [AlertInstance] AlertInstance
|
|
227
271
|
def initialize(version, payload, sid: nil)
|
|
228
272
|
super(version)
|
|
229
|
-
|
|
273
|
+
|
|
230
274
|
# Marshaled Properties
|
|
231
275
|
@properties = {
|
|
232
276
|
'account_sid' => payload['account_sid'],
|
|
233
277
|
'alert_text' => payload['alert_text'],
|
|
234
278
|
'api_version' => payload['api_version'],
|
|
235
|
-
'date_created' => Twilio.
|
|
236
|
-
'date_generated' => Twilio.
|
|
237
|
-
'date_updated' => Twilio.
|
|
279
|
+
'date_created' => Twilio.deserialize_iso8601(payload['date_created']),
|
|
280
|
+
'date_generated' => Twilio.deserialize_iso8601(payload['date_generated']),
|
|
281
|
+
'date_updated' => Twilio.deserialize_iso8601(payload['date_updated']),
|
|
238
282
|
'error_code' => payload['error_code'],
|
|
239
283
|
'log_level' => payload['log_level'],
|
|
240
284
|
'more_info' => payload['more_info'],
|
|
@@ -247,17 +291,19 @@ module Twilio
|
|
|
247
291
|
'response_body' => payload['response_body'],
|
|
248
292
|
'response_headers' => payload['response_headers'],
|
|
249
293
|
}
|
|
250
|
-
|
|
294
|
+
|
|
251
295
|
# Context
|
|
252
296
|
@instance_context = nil
|
|
253
297
|
@params = {
|
|
254
298
|
'sid' => sid || @properties['sid'],
|
|
255
299
|
}
|
|
256
300
|
end
|
|
257
|
-
|
|
301
|
+
|
|
258
302
|
##
|
|
259
303
|
# Generate an instance context for the instance, the context is capable of
|
|
260
304
|
# performing various actions. All instance actions are proxied to the context
|
|
305
|
+
# @param [Version] version Version that contains the resource
|
|
306
|
+
|
|
261
307
|
# @return [AlertContext] AlertContext for this AlertInstance
|
|
262
308
|
def context
|
|
263
309
|
unless @instance_context
|
|
@@ -268,128 +314,94 @@ module Twilio
|
|
|
268
314
|
end
|
|
269
315
|
@instance_context
|
|
270
316
|
end
|
|
271
|
-
|
|
272
|
-
##
|
|
273
|
-
# @return [String] The account_sid
|
|
317
|
+
|
|
274
318
|
def account_sid
|
|
275
319
|
@properties['account_sid']
|
|
276
320
|
end
|
|
277
|
-
|
|
278
|
-
##
|
|
279
|
-
# @return [String] The alert_text
|
|
321
|
+
|
|
280
322
|
def alert_text
|
|
281
323
|
@properties['alert_text']
|
|
282
324
|
end
|
|
283
|
-
|
|
284
|
-
##
|
|
285
|
-
# @return [String] The api_version
|
|
325
|
+
|
|
286
326
|
def api_version
|
|
287
327
|
@properties['api_version']
|
|
288
328
|
end
|
|
289
|
-
|
|
290
|
-
##
|
|
291
|
-
# @return [Time] The date_created
|
|
329
|
+
|
|
292
330
|
def date_created
|
|
293
331
|
@properties['date_created']
|
|
294
332
|
end
|
|
295
|
-
|
|
296
|
-
##
|
|
297
|
-
# @return [Time] The date_generated
|
|
333
|
+
|
|
298
334
|
def date_generated
|
|
299
335
|
@properties['date_generated']
|
|
300
336
|
end
|
|
301
|
-
|
|
302
|
-
##
|
|
303
|
-
# @return [Time] The date_updated
|
|
337
|
+
|
|
304
338
|
def date_updated
|
|
305
339
|
@properties['date_updated']
|
|
306
340
|
end
|
|
307
|
-
|
|
308
|
-
##
|
|
309
|
-
# @return [String] The error_code
|
|
341
|
+
|
|
310
342
|
def error_code
|
|
311
343
|
@properties['error_code']
|
|
312
344
|
end
|
|
313
|
-
|
|
314
|
-
##
|
|
315
|
-
# @return [String] The log_level
|
|
345
|
+
|
|
316
346
|
def log_level
|
|
317
347
|
@properties['log_level']
|
|
318
348
|
end
|
|
319
|
-
|
|
320
|
-
##
|
|
321
|
-
# @return [String] The more_info
|
|
349
|
+
|
|
322
350
|
def more_info
|
|
323
351
|
@properties['more_info']
|
|
324
352
|
end
|
|
325
|
-
|
|
326
|
-
##
|
|
327
|
-
# @return [String] The request_method
|
|
353
|
+
|
|
328
354
|
def request_method
|
|
329
355
|
@properties['request_method']
|
|
330
356
|
end
|
|
331
|
-
|
|
332
|
-
##
|
|
333
|
-
# @return [String] The request_url
|
|
357
|
+
|
|
334
358
|
def request_url
|
|
335
359
|
@properties['request_url']
|
|
336
360
|
end
|
|
337
|
-
|
|
338
|
-
##
|
|
339
|
-
# @return [String] The request_variables
|
|
361
|
+
|
|
340
362
|
def request_variables
|
|
341
363
|
@properties['request_variables']
|
|
342
364
|
end
|
|
343
|
-
|
|
344
|
-
##
|
|
345
|
-
# @return [String] The resource_sid
|
|
365
|
+
|
|
346
366
|
def resource_sid
|
|
347
367
|
@properties['resource_sid']
|
|
348
368
|
end
|
|
349
|
-
|
|
350
|
-
##
|
|
351
|
-
# @return [String] The response_body
|
|
369
|
+
|
|
352
370
|
def response_body
|
|
353
371
|
@properties['response_body']
|
|
354
372
|
end
|
|
355
|
-
|
|
356
|
-
##
|
|
357
|
-
# @return [String] The response_headers
|
|
373
|
+
|
|
358
374
|
def response_headers
|
|
359
375
|
@properties['response_headers']
|
|
360
376
|
end
|
|
361
|
-
|
|
362
|
-
##
|
|
363
|
-
# @return [String] The sid
|
|
377
|
+
|
|
364
378
|
def sid
|
|
365
379
|
@properties['sid']
|
|
366
380
|
end
|
|
367
|
-
|
|
368
|
-
##
|
|
369
|
-
# @return [String] The url
|
|
381
|
+
|
|
370
382
|
def url
|
|
371
383
|
@properties['url']
|
|
372
384
|
end
|
|
373
|
-
|
|
385
|
+
|
|
374
386
|
##
|
|
375
387
|
# Fetch a AlertInstance
|
|
376
388
|
# @return [AlertInstance] Fetched AlertInstance
|
|
377
389
|
def fetch
|
|
378
|
-
context.fetch
|
|
390
|
+
@context.fetch()
|
|
379
391
|
end
|
|
380
|
-
|
|
392
|
+
|
|
381
393
|
##
|
|
382
394
|
# Deletes the AlertInstance
|
|
383
395
|
# @return [Boolean] true if delete succeeds, true otherwise
|
|
384
396
|
def delete
|
|
385
|
-
context.delete
|
|
397
|
+
@context.delete()
|
|
386
398
|
end
|
|
387
|
-
|
|
399
|
+
|
|
388
400
|
##
|
|
389
401
|
# Provide a user friendly representation
|
|
390
402
|
def to_s
|
|
391
|
-
|
|
392
|
-
"<Twilio.Monitor.V1.AlertInstance #{
|
|
403
|
+
context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
404
|
+
"<Twilio.Monitor.V1.AlertInstance #{context}>"
|
|
393
405
|
end
|
|
394
406
|
end
|
|
395
407
|
end
|