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
|
|
@@ -15,17 +15,18 @@ module Twilio
|
|
|
15
15
|
# @param [Version] version Version that contains the resource
|
|
16
16
|
# @param [String] account_sid The unique id of the Account responsible for this
|
|
17
17
|
# Caller Id.
|
|
18
|
+
|
|
18
19
|
# @return [OutgoingCallerIdList] OutgoingCallerIdList
|
|
19
20
|
def initialize(version, account_sid: nil)
|
|
20
21
|
super(version)
|
|
21
|
-
|
|
22
|
+
|
|
22
23
|
# Path Solution
|
|
23
24
|
@solution = {
|
|
24
25
|
account_sid: account_sid
|
|
25
26
|
}
|
|
26
27
|
@uri = "/Accounts/#{@solution[:account_sid]}/OutgoingCallerIds.json"
|
|
27
28
|
end
|
|
28
|
-
|
|
29
|
+
|
|
29
30
|
##
|
|
30
31
|
# Lists OutgoingCallerIdInstance records from the API as a list.
|
|
31
32
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
@@ -40,8 +41,9 @@ module Twilio
|
|
|
40
41
|
# the default value of 50 records. If no page_size is defined
|
|
41
42
|
# but a limit is defined, stream() will attempt to read the
|
|
42
43
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
44
|
+
|
|
43
45
|
# @return [Array] Array of up to limit results
|
|
44
|
-
def list(phone_number:
|
|
46
|
+
def list(phone_number: nil, friendly_name: nil, limit: nil, page_size: nil)
|
|
45
47
|
self.stream(
|
|
46
48
|
phone_number: phone_number,
|
|
47
49
|
friendly_name: friendly_name,
|
|
@@ -49,7 +51,7 @@ module Twilio
|
|
|
49
51
|
page_size: page_size
|
|
50
52
|
).entries
|
|
51
53
|
end
|
|
52
|
-
|
|
54
|
+
|
|
53
55
|
##
|
|
54
56
|
# Streams OutgoingCallerIdInstance records from the API as an Enumerable.
|
|
55
57
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
@@ -64,35 +66,46 @@ module Twilio
|
|
|
64
66
|
# the default value of 50 records. If no page_size is defined
|
|
65
67
|
# but a limit is defined, stream() will attempt to read the
|
|
66
68
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
69
|
+
|
|
67
70
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
68
|
-
def stream(phone_number:
|
|
71
|
+
def stream(phone_number: nil, friendly_name: nil, limit: nil, page_size: nil)
|
|
69
72
|
limits = @version.read_limits(limit, page_size)
|
|
70
|
-
|
|
73
|
+
|
|
71
74
|
page = self.page(
|
|
72
75
|
phone_number: phone_number,
|
|
73
76
|
friendly_name: friendly_name,
|
|
74
|
-
page_size: limits[
|
|
77
|
+
page_size: limits['page_size'],
|
|
75
78
|
)
|
|
76
|
-
|
|
77
|
-
@version.stream(page, limit: limits[
|
|
79
|
+
|
|
80
|
+
@version.stream(page, limit: limits['limit'], page_limit: limits['page_limit'])
|
|
78
81
|
end
|
|
79
|
-
|
|
82
|
+
|
|
80
83
|
##
|
|
81
84
|
# When passed a block, yields OutgoingCallerIdInstance records from the API.
|
|
82
85
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
83
86
|
# is reached.
|
|
87
|
+
# @param [String] phone_number Only show the caller id resource that exactly
|
|
88
|
+
# matches this phone number
|
|
89
|
+
# @param [String] friendly_name Only show the caller id resource that exactly
|
|
90
|
+
# matches this name
|
|
91
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
92
|
+
# guarantees to never return more than limit. Default is no limit
|
|
93
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
|
94
|
+
# the default value of 50 records. If no page_size is defined
|
|
95
|
+
# but a limit is defined, stream() will attempt to read the
|
|
96
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
84
97
|
def each
|
|
85
98
|
limits = @version.read_limits
|
|
86
|
-
|
|
99
|
+
|
|
87
100
|
page = self.page(
|
|
88
|
-
page_size: limits[
|
|
101
|
+
page_size: limits['page_size'],
|
|
89
102
|
)
|
|
90
|
-
|
|
103
|
+
|
|
91
104
|
@version.stream(page,
|
|
92
|
-
limit: limits[
|
|
93
|
-
page_limit: limits[
|
|
105
|
+
limit: limits['limit'],
|
|
106
|
+
page_limit: limits['page_limit']).each {|x| yield x}
|
|
94
107
|
end
|
|
95
|
-
|
|
108
|
+
|
|
96
109
|
##
|
|
97
110
|
# Retrieve a single page of OutgoingCallerIdInstance records from the API.
|
|
98
111
|
# Request is executed immediately.
|
|
@@ -103,76 +116,82 @@ module Twilio
|
|
|
103
116
|
# @param [String] page_token PageToken provided by the API
|
|
104
117
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
105
118
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
119
|
+
|
|
106
120
|
# @return [Page] Page of OutgoingCallerIdInstance
|
|
107
|
-
def page(phone_number:
|
|
108
|
-
params =
|
|
121
|
+
def page(phone_number: nil, friendly_name: nil, page_token: nil, page_number: nil, page_size: nil)
|
|
122
|
+
params = {
|
|
109
123
|
'PhoneNumber' => phone_number,
|
|
110
124
|
'FriendlyName' => friendly_name,
|
|
111
125
|
'PageToken' => page_token,
|
|
112
126
|
'Page' => page_number,
|
|
113
127
|
'PageSize' => page_size,
|
|
114
|
-
}
|
|
128
|
+
}
|
|
115
129
|
response = @version.page(
|
|
116
130
|
'GET',
|
|
117
131
|
@uri,
|
|
118
132
|
params
|
|
119
133
|
)
|
|
120
|
-
OutgoingCallerIdPage.new(@version, response, @solution)
|
|
134
|
+
return OutgoingCallerIdPage.new(@version, response, @solution)
|
|
121
135
|
end
|
|
122
|
-
|
|
136
|
+
|
|
123
137
|
##
|
|
124
|
-
#
|
|
125
|
-
#
|
|
126
|
-
#
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
138
|
+
# Constructs a OutgoingCallerIdContext
|
|
139
|
+
# @param [String] sid The outgoing-caller-id Sid that uniquely identifies this
|
|
140
|
+
# resource
|
|
141
|
+
|
|
142
|
+
# @return [OutgoingCallerIdContext] OutgoingCallerIdContext
|
|
143
|
+
def get(sid)
|
|
144
|
+
OutgoingCallerIdContext.new(
|
|
145
|
+
@version,
|
|
146
|
+
account_sid: @solution[:account_sid],
|
|
147
|
+
sid: sid,
|
|
132
148
|
)
|
|
133
|
-
OutgoingCallerIdPage.new(@version, response, @solution)
|
|
134
149
|
end
|
|
135
|
-
|
|
150
|
+
|
|
136
151
|
##
|
|
137
152
|
# Provide a user friendly representation
|
|
138
153
|
def to_s
|
|
139
154
|
'#<Twilio.Api.V2010.OutgoingCallerIdList>'
|
|
140
155
|
end
|
|
141
156
|
end
|
|
142
|
-
|
|
157
|
+
|
|
143
158
|
class OutgoingCallerIdPage < Page
|
|
144
159
|
##
|
|
145
160
|
# Initialize the OutgoingCallerIdPage
|
|
146
161
|
# @param [Version] version Version that contains the resource
|
|
147
162
|
# @param [Response] response Response from the API
|
|
148
163
|
# @param [Hash] solution Path solution for the resource
|
|
164
|
+
# @param [String] account_sid The unique id of the Account responsible for this
|
|
165
|
+
# Caller Id.
|
|
166
|
+
|
|
149
167
|
# @return [OutgoingCallerIdPage] OutgoingCallerIdPage
|
|
150
168
|
def initialize(version, response, solution)
|
|
151
169
|
super(version, response)
|
|
152
|
-
|
|
170
|
+
|
|
153
171
|
# Path Solution
|
|
154
172
|
@solution = solution
|
|
155
173
|
end
|
|
156
|
-
|
|
174
|
+
|
|
157
175
|
##
|
|
158
176
|
# Build an instance of OutgoingCallerIdInstance
|
|
159
177
|
# @param [Hash] payload Payload response from the API
|
|
178
|
+
|
|
160
179
|
# @return [OutgoingCallerIdInstance] OutgoingCallerIdInstance
|
|
161
180
|
def get_instance(payload)
|
|
162
|
-
OutgoingCallerIdInstance.new(
|
|
181
|
+
return OutgoingCallerIdInstance.new(
|
|
163
182
|
@version,
|
|
164
183
|
payload,
|
|
165
|
-
account_sid: @solution[
|
|
184
|
+
account_sid: @solution['account_sid'],
|
|
166
185
|
)
|
|
167
186
|
end
|
|
168
|
-
|
|
187
|
+
|
|
169
188
|
##
|
|
170
189
|
# Provide a user friendly representation
|
|
171
190
|
def to_s
|
|
172
191
|
'<Twilio.Api.V2010.OutgoingCallerIdPage>'
|
|
173
192
|
end
|
|
174
193
|
end
|
|
175
|
-
|
|
194
|
+
|
|
176
195
|
class OutgoingCallerIdContext < InstanceContext
|
|
177
196
|
##
|
|
178
197
|
# Initialize the OutgoingCallerIdContext
|
|
@@ -180,10 +199,11 @@ module Twilio
|
|
|
180
199
|
# @param [String] account_sid The account_sid
|
|
181
200
|
# @param [String] sid The outgoing-caller-id Sid that uniquely identifies this
|
|
182
201
|
# resource
|
|
202
|
+
|
|
183
203
|
# @return [OutgoingCallerIdContext] OutgoingCallerIdContext
|
|
184
204
|
def initialize(version, account_sid, sid)
|
|
185
205
|
super(version)
|
|
186
|
-
|
|
206
|
+
|
|
187
207
|
# Path Solution
|
|
188
208
|
@solution = {
|
|
189
209
|
account_sid: account_sid,
|
|
@@ -191,57 +211,58 @@ module Twilio
|
|
|
191
211
|
}
|
|
192
212
|
@uri = "/Accounts/#{@solution[:account_sid]}/OutgoingCallerIds/#{@solution[:sid]}.json"
|
|
193
213
|
end
|
|
194
|
-
|
|
214
|
+
|
|
195
215
|
##
|
|
196
216
|
# Fetch a OutgoingCallerIdInstance
|
|
197
217
|
# @return [OutgoingCallerIdInstance] Fetched OutgoingCallerIdInstance
|
|
198
218
|
def fetch
|
|
199
|
-
params =
|
|
200
|
-
|
|
219
|
+
params = {}
|
|
220
|
+
|
|
201
221
|
payload = @version.fetch(
|
|
202
222
|
'GET',
|
|
203
223
|
@uri,
|
|
204
224
|
params,
|
|
205
225
|
)
|
|
206
|
-
|
|
207
|
-
OutgoingCallerIdInstance.new(
|
|
226
|
+
|
|
227
|
+
return OutgoingCallerIdInstance.new(
|
|
208
228
|
@version,
|
|
209
229
|
payload,
|
|
210
|
-
account_sid: @solution[
|
|
211
|
-
sid: @solution[
|
|
230
|
+
account_sid: @solution['account_sid'],
|
|
231
|
+
sid: @solution['sid'],
|
|
212
232
|
)
|
|
213
233
|
end
|
|
214
|
-
|
|
234
|
+
|
|
215
235
|
##
|
|
216
236
|
# Update the OutgoingCallerIdInstance
|
|
217
237
|
# @param [String] friendly_name A human readable description of the caller ID
|
|
238
|
+
|
|
218
239
|
# @return [OutgoingCallerIdInstance] Updated OutgoingCallerIdInstance
|
|
219
|
-
def update(friendly_name:
|
|
220
|
-
data =
|
|
240
|
+
def update(friendly_name: nil)
|
|
241
|
+
data = {
|
|
221
242
|
'FriendlyName' => friendly_name,
|
|
222
|
-
}
|
|
223
|
-
|
|
243
|
+
}
|
|
244
|
+
|
|
224
245
|
payload = @version.update(
|
|
225
246
|
'POST',
|
|
226
247
|
@uri,
|
|
227
248
|
data: data,
|
|
228
249
|
)
|
|
229
|
-
|
|
230
|
-
OutgoingCallerIdInstance.new(
|
|
250
|
+
|
|
251
|
+
return OutgoingCallerIdInstance.new(
|
|
231
252
|
@version,
|
|
232
253
|
payload,
|
|
233
|
-
account_sid: @solution[
|
|
234
|
-
sid: @solution[
|
|
254
|
+
account_sid: @solution['account_sid'],
|
|
255
|
+
sid: @solution['sid'],
|
|
235
256
|
)
|
|
236
257
|
end
|
|
237
|
-
|
|
258
|
+
|
|
238
259
|
##
|
|
239
260
|
# Deletes the OutgoingCallerIdInstance
|
|
240
261
|
# @return [Boolean] true if delete succeeds, true otherwise
|
|
241
262
|
def delete
|
|
242
|
-
@version.delete('delete', @uri)
|
|
263
|
+
return @version.delete('delete', @uri)
|
|
243
264
|
end
|
|
244
|
-
|
|
265
|
+
|
|
245
266
|
##
|
|
246
267
|
# Provide a user friendly representation
|
|
247
268
|
def to_s
|
|
@@ -249,7 +270,7 @@ module Twilio
|
|
|
249
270
|
"#<Twilio.Api.V2010.OutgoingCallerIdContext #{context}>"
|
|
250
271
|
end
|
|
251
272
|
end
|
|
252
|
-
|
|
273
|
+
|
|
253
274
|
class OutgoingCallerIdInstance < InstanceResource
|
|
254
275
|
##
|
|
255
276
|
# Initialize the OutgoingCallerIdInstance
|
|
@@ -259,10 +280,11 @@ module Twilio
|
|
|
259
280
|
# Caller Id.
|
|
260
281
|
# @param [String] sid The outgoing-caller-id Sid that uniquely identifies this
|
|
261
282
|
# resource
|
|
283
|
+
|
|
262
284
|
# @return [OutgoingCallerIdInstance] OutgoingCallerIdInstance
|
|
263
285
|
def initialize(version, payload, account_sid: nil, sid: nil)
|
|
264
286
|
super(version)
|
|
265
|
-
|
|
287
|
+
|
|
266
288
|
# Marshaled Properties
|
|
267
289
|
@properties = {
|
|
268
290
|
'sid' => payload['sid'],
|
|
@@ -273,7 +295,7 @@ module Twilio
|
|
|
273
295
|
'phone_number' => payload['phone_number'],
|
|
274
296
|
'uri' => payload['uri'],
|
|
275
297
|
}
|
|
276
|
-
|
|
298
|
+
|
|
277
299
|
# Context
|
|
278
300
|
@instance_context = nil
|
|
279
301
|
@params = {
|
|
@@ -281,10 +303,12 @@ module Twilio
|
|
|
281
303
|
'sid' => sid || @properties['sid'],
|
|
282
304
|
}
|
|
283
305
|
end
|
|
284
|
-
|
|
306
|
+
|
|
285
307
|
##
|
|
286
308
|
# Generate an instance context for the instance, the context is capable of
|
|
287
309
|
# performing various actions. All instance actions are proxied to the context
|
|
310
|
+
# @param [Version] version Version that contains the resource
|
|
311
|
+
|
|
288
312
|
# @return [OutgoingCallerIdContext] OutgoingCallerIdContext for this OutgoingCallerIdInstance
|
|
289
313
|
def context
|
|
290
314
|
unless @instance_context
|
|
@@ -296,78 +320,63 @@ module Twilio
|
|
|
296
320
|
end
|
|
297
321
|
@instance_context
|
|
298
322
|
end
|
|
299
|
-
|
|
300
|
-
##
|
|
301
|
-
# @return [String] A string that uniquely identifies this outgoing-caller-ids
|
|
323
|
+
|
|
302
324
|
def sid
|
|
303
325
|
@properties['sid']
|
|
304
326
|
end
|
|
305
|
-
|
|
306
|
-
##
|
|
307
|
-
# @return [Time] The date this resource was created
|
|
327
|
+
|
|
308
328
|
def date_created
|
|
309
329
|
@properties['date_created']
|
|
310
330
|
end
|
|
311
|
-
|
|
312
|
-
##
|
|
313
|
-
# @return [Time] The date this resource was last updated
|
|
331
|
+
|
|
314
332
|
def date_updated
|
|
315
333
|
@properties['date_updated']
|
|
316
334
|
end
|
|
317
|
-
|
|
318
|
-
##
|
|
319
|
-
# @return [String] A human readable description for this resource
|
|
335
|
+
|
|
320
336
|
def friendly_name
|
|
321
337
|
@properties['friendly_name']
|
|
322
338
|
end
|
|
323
|
-
|
|
324
|
-
##
|
|
325
|
-
# @return [String] The unique sid that identifies this account
|
|
339
|
+
|
|
326
340
|
def account_sid
|
|
327
341
|
@properties['account_sid']
|
|
328
342
|
end
|
|
329
|
-
|
|
330
|
-
##
|
|
331
|
-
# @return [String] The incoming phone number
|
|
343
|
+
|
|
332
344
|
def phone_number
|
|
333
345
|
@properties['phone_number']
|
|
334
346
|
end
|
|
335
|
-
|
|
336
|
-
##
|
|
337
|
-
# @return [String] The URI for this resource
|
|
347
|
+
|
|
338
348
|
def uri
|
|
339
349
|
@properties['uri']
|
|
340
350
|
end
|
|
341
|
-
|
|
351
|
+
|
|
342
352
|
##
|
|
343
353
|
# Fetch a OutgoingCallerIdInstance
|
|
344
354
|
# @return [OutgoingCallerIdInstance] Fetched OutgoingCallerIdInstance
|
|
345
355
|
def fetch
|
|
346
|
-
context.fetch
|
|
356
|
+
@context.fetch()
|
|
347
357
|
end
|
|
348
|
-
|
|
358
|
+
|
|
349
359
|
##
|
|
350
360
|
# Update the OutgoingCallerIdInstance
|
|
351
361
|
# @param [String] friendly_name A human readable description of the caller ID
|
|
362
|
+
|
|
352
363
|
# @return [OutgoingCallerIdInstance] Updated OutgoingCallerIdInstance
|
|
353
|
-
def update(friendly_name:
|
|
354
|
-
context.update(
|
|
355
|
-
friendly_name: friendly_name,
|
|
356
|
-
)
|
|
364
|
+
def update(friendly_name: nil)
|
|
365
|
+
@context.update()
|
|
357
366
|
end
|
|
358
|
-
|
|
367
|
+
|
|
359
368
|
##
|
|
360
369
|
# Deletes the OutgoingCallerIdInstance
|
|
361
370
|
# @return [Boolean] true if delete succeeds, true otherwise
|
|
362
371
|
def delete
|
|
363
|
-
context.delete
|
|
372
|
+
@context.delete()
|
|
364
373
|
end
|
|
365
|
-
|
|
374
|
+
|
|
366
375
|
##
|
|
367
376
|
# Provide a user friendly representation
|
|
368
377
|
def to_s
|
|
369
|
-
|
|
370
|
-
"<Twilio.Api.V2010.OutgoingCallerIdInstance #{
|
|
378
|
+
context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
379
|
+
"<Twilio.Api.V2010.OutgoingCallerIdInstance #{context}>"
|
|
371
380
|
end
|
|
372
381
|
end
|
|
373
382
|
end
|
|
@@ -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
|
|
@@ -14,17 +14,18 @@ module Twilio
|
|
|
14
14
|
# Initialize the QueueList
|
|
15
15
|
# @param [Version] version Version that contains the resource
|
|
16
16
|
# @param [String] account_sid The account_sid
|
|
17
|
+
|
|
17
18
|
# @return [QueueList] QueueList
|
|
18
19
|
def initialize(version, account_sid: nil)
|
|
19
20
|
super(version)
|
|
20
|
-
|
|
21
|
+
|
|
21
22
|
# Path Solution
|
|
22
23
|
@solution = {
|
|
23
24
|
account_sid: account_sid
|
|
24
25
|
}
|
|
25
26
|
@uri = "/Accounts/#{@solution[:account_sid]}/Queues.json"
|
|
26
27
|
end
|
|
27
|
-
|
|
28
|
+
|
|
28
29
|
##
|
|
29
30
|
# Lists QueueInstance records from the API as a list.
|
|
30
31
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
@@ -35,6 +36,7 @@ module Twilio
|
|
|
35
36
|
# the default value of 50 records. If no page_size is defined
|
|
36
37
|
# but a limit is defined, stream() will attempt to read the
|
|
37
38
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
39
|
+
|
|
38
40
|
# @return [Array] Array of up to limit results
|
|
39
41
|
def list(limit: nil, page_size: nil)
|
|
40
42
|
self.stream(
|
|
@@ -42,7 +44,7 @@ module Twilio
|
|
|
42
44
|
page_size: page_size
|
|
43
45
|
).entries
|
|
44
46
|
end
|
|
45
|
-
|
|
47
|
+
|
|
46
48
|
##
|
|
47
49
|
# Streams QueueInstance records from the API as an Enumerable.
|
|
48
50
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
@@ -53,214 +55,225 @@ module Twilio
|
|
|
53
55
|
# the default value of 50 records. If no page_size is defined
|
|
54
56
|
# but a limit is defined, stream() will attempt to read the
|
|
55
57
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
58
|
+
|
|
56
59
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
57
60
|
def stream(limit: nil, page_size: nil)
|
|
58
61
|
limits = @version.read_limits(limit, page_size)
|
|
59
|
-
|
|
62
|
+
|
|
60
63
|
page = self.page(
|
|
61
|
-
page_size: limits[
|
|
64
|
+
page_size: limits['page_size'],
|
|
62
65
|
)
|
|
63
|
-
|
|
64
|
-
@version.stream(page, limit: limits[
|
|
66
|
+
|
|
67
|
+
@version.stream(page, limit: limits['limit'], page_limit: limits['page_limit'])
|
|
65
68
|
end
|
|
66
|
-
|
|
69
|
+
|
|
67
70
|
##
|
|
68
71
|
# When passed a block, yields QueueInstance records from the API.
|
|
69
72
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
70
73
|
# is reached.
|
|
74
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
75
|
+
# guarantees to never return more than limit. Default is no limit
|
|
76
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
|
77
|
+
# the default value of 50 records. If no page_size is defined
|
|
78
|
+
# but a limit is defined, stream() will attempt to read the
|
|
79
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
71
80
|
def each
|
|
72
81
|
limits = @version.read_limits
|
|
73
|
-
|
|
82
|
+
|
|
74
83
|
page = self.page(
|
|
75
|
-
page_size: limits[
|
|
84
|
+
page_size: limits['page_size'],
|
|
76
85
|
)
|
|
77
|
-
|
|
86
|
+
|
|
78
87
|
@version.stream(page,
|
|
79
|
-
limit: limits[
|
|
80
|
-
page_limit: limits[
|
|
88
|
+
limit: limits['limit'],
|
|
89
|
+
page_limit: limits['page_limit']).each {|x| yield x}
|
|
81
90
|
end
|
|
82
|
-
|
|
91
|
+
|
|
83
92
|
##
|
|
84
93
|
# Retrieve a single page of QueueInstance records from the API.
|
|
85
94
|
# Request is executed immediately.
|
|
86
95
|
# @param [String] page_token PageToken provided by the API
|
|
87
96
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
88
97
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
98
|
+
|
|
89
99
|
# @return [Page] Page of QueueInstance
|
|
90
|
-
def page(page_token:
|
|
91
|
-
params =
|
|
100
|
+
def page(page_token: nil, page_number: nil, page_size: nil)
|
|
101
|
+
params = {
|
|
92
102
|
'PageToken' => page_token,
|
|
93
103
|
'Page' => page_number,
|
|
94
104
|
'PageSize' => page_size,
|
|
95
|
-
}
|
|
105
|
+
}
|
|
96
106
|
response = @version.page(
|
|
97
107
|
'GET',
|
|
98
108
|
@uri,
|
|
99
109
|
params
|
|
100
110
|
)
|
|
101
|
-
QueuePage.new(@version, response, @solution)
|
|
111
|
+
return QueuePage.new(@version, response, @solution)
|
|
102
112
|
end
|
|
103
|
-
|
|
104
|
-
##
|
|
105
|
-
# Retrieve a single page of QueueInstance records from the API.
|
|
106
|
-
# Request is executed immediately.
|
|
107
|
-
# @param [String] target_url API-generated URL for the requested results page
|
|
108
|
-
# @return [Page] Page of QueueInstance
|
|
109
|
-
def get_page(target_url)
|
|
110
|
-
response = @version.domain.request(
|
|
111
|
-
'GET',
|
|
112
|
-
target_url
|
|
113
|
-
)
|
|
114
|
-
QueuePage.new(@version, response, @solution)
|
|
115
|
-
end
|
|
116
|
-
|
|
113
|
+
|
|
117
114
|
##
|
|
118
115
|
# Retrieve a single page of QueueInstance records from the API.
|
|
119
116
|
# Request is executed immediately.
|
|
120
117
|
# @param [String] friendly_name A user-provided string that identifies this queue.
|
|
121
118
|
# @param [String] max_size The upper limit of calls allowed to be in the queue.
|
|
122
119
|
# The default is 100. The maximum is 1000.
|
|
120
|
+
|
|
123
121
|
# @return [QueueInstance] Newly created QueueInstance
|
|
124
|
-
def create(friendly_name: nil, max_size:
|
|
125
|
-
data =
|
|
122
|
+
def create(friendly_name: nil, max_size: nil)
|
|
123
|
+
data = {
|
|
126
124
|
'FriendlyName' => friendly_name,
|
|
127
125
|
'MaxSize' => max_size,
|
|
128
|
-
}
|
|
129
|
-
|
|
126
|
+
}
|
|
127
|
+
|
|
130
128
|
payload = @version.create(
|
|
131
129
|
'POST',
|
|
132
130
|
@uri,
|
|
133
131
|
data: data
|
|
134
132
|
)
|
|
135
|
-
|
|
136
|
-
QueueInstance.new(
|
|
133
|
+
|
|
134
|
+
return QueueInstance.new(
|
|
137
135
|
@version,
|
|
138
136
|
payload,
|
|
137
|
+
account_sid: @solution['account_sid'],
|
|
138
|
+
)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
##
|
|
142
|
+
# Constructs a QueueContext
|
|
143
|
+
# @param [String] sid The queue Sid that uniquely identifies this resource
|
|
144
|
+
|
|
145
|
+
# @return [QueueContext] QueueContext
|
|
146
|
+
def get(sid)
|
|
147
|
+
QueueContext.new(
|
|
148
|
+
@version,
|
|
139
149
|
account_sid: @solution[:account_sid],
|
|
150
|
+
sid: sid,
|
|
140
151
|
)
|
|
141
152
|
end
|
|
142
|
-
|
|
153
|
+
|
|
143
154
|
##
|
|
144
155
|
# Provide a user friendly representation
|
|
145
156
|
def to_s
|
|
146
157
|
'#<Twilio.Api.V2010.QueueList>'
|
|
147
158
|
end
|
|
148
159
|
end
|
|
149
|
-
|
|
160
|
+
|
|
150
161
|
class QueuePage < Page
|
|
151
162
|
##
|
|
152
163
|
# Initialize the QueuePage
|
|
153
164
|
# @param [Version] version Version that contains the resource
|
|
154
165
|
# @param [Response] response Response from the API
|
|
155
166
|
# @param [Hash] solution Path solution for the resource
|
|
167
|
+
# @param [String] account_sid The account_sid
|
|
168
|
+
|
|
156
169
|
# @return [QueuePage] QueuePage
|
|
157
170
|
def initialize(version, response, solution)
|
|
158
171
|
super(version, response)
|
|
159
|
-
|
|
172
|
+
|
|
160
173
|
# Path Solution
|
|
161
174
|
@solution = solution
|
|
162
175
|
end
|
|
163
|
-
|
|
176
|
+
|
|
164
177
|
##
|
|
165
178
|
# Build an instance of QueueInstance
|
|
166
179
|
# @param [Hash] payload Payload response from the API
|
|
180
|
+
|
|
167
181
|
# @return [QueueInstance] QueueInstance
|
|
168
182
|
def get_instance(payload)
|
|
169
|
-
QueueInstance.new(
|
|
183
|
+
return QueueInstance.new(
|
|
170
184
|
@version,
|
|
171
185
|
payload,
|
|
172
|
-
account_sid: @solution[
|
|
186
|
+
account_sid: @solution['account_sid'],
|
|
173
187
|
)
|
|
174
188
|
end
|
|
175
|
-
|
|
189
|
+
|
|
176
190
|
##
|
|
177
191
|
# Provide a user friendly representation
|
|
178
192
|
def to_s
|
|
179
193
|
'<Twilio.Api.V2010.QueuePage>'
|
|
180
194
|
end
|
|
181
195
|
end
|
|
182
|
-
|
|
196
|
+
|
|
183
197
|
class QueueContext < InstanceContext
|
|
184
198
|
##
|
|
185
199
|
# Initialize the QueueContext
|
|
186
200
|
# @param [Version] version Version that contains the resource
|
|
187
201
|
# @param [String] account_sid The account_sid
|
|
188
202
|
# @param [String] sid The queue Sid that uniquely identifies this resource
|
|
203
|
+
|
|
189
204
|
# @return [QueueContext] QueueContext
|
|
190
205
|
def initialize(version, account_sid, sid)
|
|
191
206
|
super(version)
|
|
192
|
-
|
|
207
|
+
|
|
193
208
|
# Path Solution
|
|
194
209
|
@solution = {
|
|
195
210
|
account_sid: account_sid,
|
|
196
211
|
sid: sid,
|
|
197
212
|
}
|
|
198
213
|
@uri = "/Accounts/#{@solution[:account_sid]}/Queues/#{@solution[:sid]}.json"
|
|
199
|
-
|
|
214
|
+
|
|
200
215
|
# Dependents
|
|
201
216
|
@members = nil
|
|
202
217
|
end
|
|
203
|
-
|
|
218
|
+
|
|
204
219
|
##
|
|
205
220
|
# Fetch a QueueInstance
|
|
206
221
|
# @return [QueueInstance] Fetched QueueInstance
|
|
207
222
|
def fetch
|
|
208
|
-
params =
|
|
209
|
-
|
|
223
|
+
params = {}
|
|
224
|
+
|
|
210
225
|
payload = @version.fetch(
|
|
211
226
|
'GET',
|
|
212
227
|
@uri,
|
|
213
228
|
params,
|
|
214
229
|
)
|
|
215
|
-
|
|
216
|
-
QueueInstance.new(
|
|
230
|
+
|
|
231
|
+
return QueueInstance.new(
|
|
217
232
|
@version,
|
|
218
233
|
payload,
|
|
219
|
-
account_sid: @solution[
|
|
220
|
-
sid: @solution[
|
|
234
|
+
account_sid: @solution['account_sid'],
|
|
235
|
+
sid: @solution['sid'],
|
|
221
236
|
)
|
|
222
237
|
end
|
|
223
|
-
|
|
238
|
+
|
|
224
239
|
##
|
|
225
240
|
# Update the QueueInstance
|
|
226
241
|
# @param [String] friendly_name A human readable description of the queue
|
|
227
242
|
# @param [String] max_size The maximum number of members that can be in the queue
|
|
228
243
|
# at a time
|
|
244
|
+
|
|
229
245
|
# @return [QueueInstance] Updated QueueInstance
|
|
230
|
-
def update(friendly_name:
|
|
231
|
-
data =
|
|
246
|
+
def update(friendly_name: nil, max_size: nil)
|
|
247
|
+
data = {
|
|
232
248
|
'FriendlyName' => friendly_name,
|
|
233
249
|
'MaxSize' => max_size,
|
|
234
|
-
}
|
|
235
|
-
|
|
250
|
+
}
|
|
251
|
+
|
|
236
252
|
payload = @version.update(
|
|
237
253
|
'POST',
|
|
238
254
|
@uri,
|
|
239
255
|
data: data,
|
|
240
256
|
)
|
|
241
|
-
|
|
242
|
-
QueueInstance.new(
|
|
257
|
+
|
|
258
|
+
return QueueInstance.new(
|
|
243
259
|
@version,
|
|
244
260
|
payload,
|
|
245
|
-
account_sid: @solution[
|
|
246
|
-
sid: @solution[
|
|
261
|
+
account_sid: @solution['account_sid'],
|
|
262
|
+
sid: @solution['sid'],
|
|
247
263
|
)
|
|
248
264
|
end
|
|
249
|
-
|
|
265
|
+
|
|
250
266
|
##
|
|
251
267
|
# Deletes the QueueInstance
|
|
252
268
|
# @return [Boolean] true if delete succeeds, true otherwise
|
|
253
269
|
def delete
|
|
254
|
-
@version.delete('delete', @uri)
|
|
270
|
+
return @version.delete('delete', @uri)
|
|
255
271
|
end
|
|
256
|
-
|
|
272
|
+
|
|
257
273
|
##
|
|
258
274
|
# Access the members
|
|
259
|
-
# @return [MemberList]
|
|
260
|
-
# @return [MemberContext] if call_sid was passed.
|
|
275
|
+
# @return [MemberList] MemberList
|
|
261
276
|
def members(call_sid=:unset)
|
|
262
|
-
raise ArgumentError, 'call_sid cannot be nil' if call_sid.nil?
|
|
263
|
-
|
|
264
277
|
if call_sid != :unset
|
|
265
278
|
return MemberContext.new(
|
|
266
279
|
@version,
|
|
@@ -269,7 +282,7 @@ module Twilio
|
|
|
269
282
|
call_sid,
|
|
270
283
|
)
|
|
271
284
|
end
|
|
272
|
-
|
|
285
|
+
|
|
273
286
|
unless @members
|
|
274
287
|
@members = MemberList.new(
|
|
275
288
|
@version,
|
|
@@ -277,10 +290,10 @@ module Twilio
|
|
|
277
290
|
queue_sid: @solution[:sid],
|
|
278
291
|
)
|
|
279
292
|
end
|
|
280
|
-
|
|
293
|
+
|
|
281
294
|
@members
|
|
282
295
|
end
|
|
283
|
-
|
|
296
|
+
|
|
284
297
|
##
|
|
285
298
|
# Provide a user friendly representation
|
|
286
299
|
def to_s
|
|
@@ -288,7 +301,7 @@ module Twilio
|
|
|
288
301
|
"#<Twilio.Api.V2010.QueueContext #{context}>"
|
|
289
302
|
end
|
|
290
303
|
end
|
|
291
|
-
|
|
304
|
+
|
|
292
305
|
class QueueInstance < InstanceResource
|
|
293
306
|
##
|
|
294
307
|
# Initialize the QueueInstance
|
|
@@ -296,10 +309,11 @@ module Twilio
|
|
|
296
309
|
# @param [Hash] payload payload that contains response from Twilio
|
|
297
310
|
# @param [String] account_sid The account_sid
|
|
298
311
|
# @param [String] sid The queue Sid that uniquely identifies this resource
|
|
312
|
+
|
|
299
313
|
# @return [QueueInstance] QueueInstance
|
|
300
314
|
def initialize(version, payload, account_sid: nil, sid: nil)
|
|
301
315
|
super(version)
|
|
302
|
-
|
|
316
|
+
|
|
303
317
|
# Marshaled Properties
|
|
304
318
|
@properties = {
|
|
305
319
|
'account_sid' => payload['account_sid'],
|
|
@@ -312,7 +326,7 @@ module Twilio
|
|
|
312
326
|
'sid' => payload['sid'],
|
|
313
327
|
'uri' => payload['uri'],
|
|
314
328
|
}
|
|
315
|
-
|
|
329
|
+
|
|
316
330
|
# Context
|
|
317
331
|
@instance_context = nil
|
|
318
332
|
@params = {
|
|
@@ -320,10 +334,12 @@ module Twilio
|
|
|
320
334
|
'sid' => sid || @properties['sid'],
|
|
321
335
|
}
|
|
322
336
|
end
|
|
323
|
-
|
|
337
|
+
|
|
324
338
|
##
|
|
325
339
|
# Generate an instance context for the instance, the context is capable of
|
|
326
340
|
# performing various actions. All instance actions are proxied to the context
|
|
341
|
+
# @param [Version] version Version that contains the resource
|
|
342
|
+
|
|
327
343
|
# @return [QueueContext] QueueContext for this QueueInstance
|
|
328
344
|
def context
|
|
329
345
|
unless @instance_context
|
|
@@ -335,100 +351,82 @@ module Twilio
|
|
|
335
351
|
end
|
|
336
352
|
@instance_context
|
|
337
353
|
end
|
|
338
|
-
|
|
339
|
-
##
|
|
340
|
-
# @return [String] The account_sid
|
|
354
|
+
|
|
341
355
|
def account_sid
|
|
342
356
|
@properties['account_sid']
|
|
343
357
|
end
|
|
344
|
-
|
|
345
|
-
##
|
|
346
|
-
# @return [String] Average wait time of members in the queue
|
|
358
|
+
|
|
347
359
|
def average_wait_time
|
|
348
360
|
@properties['average_wait_time']
|
|
349
361
|
end
|
|
350
|
-
|
|
351
|
-
##
|
|
352
|
-
# @return [String] The count of calls currently in the queue.
|
|
362
|
+
|
|
353
363
|
def current_size
|
|
354
364
|
@properties['current_size']
|
|
355
365
|
end
|
|
356
|
-
|
|
357
|
-
##
|
|
358
|
-
# @return [Time] The date_created
|
|
366
|
+
|
|
359
367
|
def date_created
|
|
360
368
|
@properties['date_created']
|
|
361
369
|
end
|
|
362
|
-
|
|
363
|
-
##
|
|
364
|
-
# @return [Time] The date_updated
|
|
370
|
+
|
|
365
371
|
def date_updated
|
|
366
372
|
@properties['date_updated']
|
|
367
373
|
end
|
|
368
|
-
|
|
369
|
-
##
|
|
370
|
-
# @return [String] A user-provided string that identifies this queue.
|
|
374
|
+
|
|
371
375
|
def friendly_name
|
|
372
376
|
@properties['friendly_name']
|
|
373
377
|
end
|
|
374
|
-
|
|
375
|
-
##
|
|
376
|
-
# @return [String] The max number of calls allowed in the queue
|
|
378
|
+
|
|
377
379
|
def max_size
|
|
378
380
|
@properties['max_size']
|
|
379
381
|
end
|
|
380
|
-
|
|
381
|
-
##
|
|
382
|
-
# @return [String] A string that uniquely identifies this queue
|
|
382
|
+
|
|
383
383
|
def sid
|
|
384
384
|
@properties['sid']
|
|
385
385
|
end
|
|
386
|
-
|
|
387
|
-
##
|
|
388
|
-
# @return [String] The uri
|
|
386
|
+
|
|
389
387
|
def uri
|
|
390
388
|
@properties['uri']
|
|
391
389
|
end
|
|
392
|
-
|
|
390
|
+
|
|
393
391
|
##
|
|
394
392
|
# Fetch a QueueInstance
|
|
395
393
|
# @return [QueueInstance] Fetched QueueInstance
|
|
396
394
|
def fetch
|
|
397
|
-
context.fetch
|
|
395
|
+
@context.fetch()
|
|
398
396
|
end
|
|
399
|
-
|
|
397
|
+
|
|
400
398
|
##
|
|
401
399
|
# Update the QueueInstance
|
|
402
400
|
# @param [String] friendly_name A human readable description of the queue
|
|
403
401
|
# @param [String] max_size The maximum number of members that can be in the queue
|
|
404
402
|
# at a time
|
|
403
|
+
|
|
405
404
|
# @return [QueueInstance] Updated QueueInstance
|
|
406
|
-
def update(friendly_name:
|
|
407
|
-
context.update(
|
|
408
|
-
friendly_name: friendly_name,
|
|
405
|
+
def update(friendly_name: nil, max_size: nil)
|
|
406
|
+
@context.update(
|
|
409
407
|
max_size: max_size,
|
|
410
408
|
)
|
|
411
409
|
end
|
|
412
|
-
|
|
410
|
+
|
|
413
411
|
##
|
|
414
412
|
# Deletes the QueueInstance
|
|
415
413
|
# @return [Boolean] true if delete succeeds, true otherwise
|
|
416
414
|
def delete
|
|
417
|
-
context.delete
|
|
415
|
+
@context.delete()
|
|
418
416
|
end
|
|
419
|
-
|
|
417
|
+
|
|
420
418
|
##
|
|
421
419
|
# Access the members
|
|
422
420
|
# @return [members] members
|
|
423
421
|
def members
|
|
424
|
-
context.members
|
|
422
|
+
@context.members
|
|
425
423
|
end
|
|
426
|
-
|
|
424
|
+
|
|
427
425
|
##
|
|
428
426
|
# Provide a user friendly representation
|
|
429
427
|
def to_s
|
|
430
|
-
|
|
431
|
-
"<Twilio.Api.V2010.QueueInstance #{
|
|
428
|
+
context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
429
|
+
"<Twilio.Api.V2010.QueueInstance #{context}>"
|
|
432
430
|
end
|
|
433
431
|
end
|
|
434
432
|
end
|