twilio-ruby 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +30 -2
- data/CONTRIBUTING.md +159 -0
- data/ISSUE_TEMPLATE.md +26 -0
- data/LICENSE.md +1 -1
- data/README.md +6 -7
- data/VERSIONS.md +21 -49
- data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +11 -18
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +358 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +439 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +48 -11
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +22 -12
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +11 -18
- data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/credential.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/credential.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service.rb +11 -11
- data/lib/twilio-ruby/rest/client.rb +42 -0
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +334 -0
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +549 -0
- data/lib/twilio-ruby/rest/fax/v1.rb +41 -0
- data/lib/twilio-ruby/rest/fax.rb +44 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +11 -11
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +360 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +367 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +367 -0
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +645 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +41 -0
- data/lib/twilio-ruby/rest/messaging.rb +44 -0
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +11 -11
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +11 -11
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +411 -0
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +438 -0
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +294 -0
- data/lib/twilio-ruby/rest/notify/v1/service/segment.rb +230 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +262 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +442 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user.rb +453 -0
- data/lib/twilio-ruby/rest/notify/v1/service.rb +647 -0
- data/lib/twilio-ruby/rest/notify/v1.rb +56 -0
- data/lib/twilio-ruby/rest/notify.rb +52 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +216 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +211 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +251 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports.rb +56 -0
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +570 -0
- data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +42 -0
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +309 -0
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +341 -0
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +349 -0
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +448 -0
- data/lib/twilio-ruby/rest/preview/marketplace.rb +58 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +367 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +437 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +460 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +514 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +544 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +367 -0
- data/lib/twilio-ruby/rest/preview/proxy/service.rb +508 -0
- data/lib/twilio-ruby/rest/preview/proxy.rb +41 -0
- data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +403 -0
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +453 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +438 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +403 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +446 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +440 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +403 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +446 -0
- data/lib/twilio-ruby/rest/preview/sync/service.rb +512 -0
- data/lib/twilio-ruby/rest/preview/sync.rb +41 -0
- data/lib/twilio-ruby/rest/preview/wireless/command.rb +390 -0
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +443 -0
- data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +244 -0
- data/lib/twilio-ruby/rest/preview/wireless/sim.rb +552 -0
- data/lib/twilio-ruby/rest/preview/wireless.rb +71 -0
- data/lib/twilio-ruby/rest/preview.rb +145 -0
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +11 -11
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +11 -11
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +11 -11
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +403 -0
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +453 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +438 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +403 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +446 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +440 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +403 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +446 -0
- data/lib/twilio-ruby/rest/sync/v1/service.rb +512 -0
- data/lib/twilio-ruby/rest/sync/v1.rb +41 -0
- data/lib/twilio-ruby/rest/sync.rb +44 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +143 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +143 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +11 -11
- data/lib/twilio-ruby/rest/video/v1/recording.rb +11 -11
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +11 -11
- data/lib/twilio-ruby/rest/video/v1/room.rb +11 -11
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +375 -0
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +460 -0
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +241 -0
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +556 -0
- data/lib/twilio-ruby/rest/wireless/v1.rb +71 -0
- data/lib/twilio-ruby/rest/wireless.rb +60 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/call/recording_spec.rb +0 -2
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +135 -0
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +223 -0
- data/spec/integration/api/v2010/account/recording_spec.rb +0 -2
- data/spec/integration/fax/v1/fax/fax_media_spec.rb +126 -0
- data/spec/integration/fax/v1/fax_spec.rb +272 -0
- data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +170 -0
- data/spec/integration/messaging/v1/service/phone_number_spec.rb +201 -0
- data/spec/integration/messaging/v1/service/short_code_spec.rb +173 -0
- data/spec/integration/messaging/v1/service_spec.rb +263 -0
- data/spec/integration/notify/v1/credential_spec.rb +223 -0
- data/spec/integration/notify/v1/service/binding_spec.rb +227 -0
- data/spec/integration/notify/v1/service/notification_spec.rb +97 -0
- data/spec/integration/notify/v1/service/segment_spec.rb +84 -0
- data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +118 -0
- data/spec/integration/notify/v1/service/user/user_binding_spec.rb +269 -0
- data/spec/integration/notify/v1/service/user_spec.rb +213 -0
- data/spec/integration/notify/v1/service_spec.rb +280 -0
- data/spec/integration/preview/bulk_exports/export/day_spec.rb +56 -0
- data/spec/integration/preview/bulk_exports/export_configuration_spec.rb +79 -0
- data/spec/integration/preview/bulk_exports/export_spec.rb +43 -0
- data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +280 -0
- data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +121 -0
- data/spec/integration/preview/marketplace/available_add_on_spec.rb +142 -0
- data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +164 -0
- data/spec/integration/preview/marketplace/installed_add_on_spec.rb +252 -0
- data/spec/integration/preview/proxy/service/phone_number_spec.rb +173 -0
- data/spec/integration/preview/proxy/service/session/interaction_spec.rb +104 -0
- data/spec/integration/preview/proxy/service/session/participant/message_interaction_spec.rb +164 -0
- data/spec/integration/preview/proxy/service/session/participant_spec.rb +226 -0
- data/spec/integration/preview/proxy/service/session_spec.rb +216 -0
- data/spec/integration/preview/proxy/service/short_code_spec.rb +173 -0
- data/spec/integration/preview/proxy/service_spec.rb +200 -0
- data/spec/integration/preview/sync/service/document/document_permission_spec.rb +206 -0
- data/spec/integration/preview/sync/service/document_spec.rb +254 -0
- data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +256 -0
- data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +206 -0
- data/spec/integration/preview/sync/service/sync_list_spec.rb +207 -0
- data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +257 -0
- data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +206 -0
- data/spec/integration/preview/sync/service/sync_map_spec.rb +207 -0
- data/spec/integration/preview/sync/service_spec.rb +244 -0
- data/spec/integration/preview/wireless/command_spec.rb +169 -0
- data/spec/integration/preview/wireless/rate_plan_spec.rb +260 -0
- data/spec/integration/preview/wireless/sim/usage_spec.rb +49 -0
- data/spec/integration/preview/wireless/sim_spec.rb +208 -0
- data/spec/integration/sync/v1/service/document/document_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/document_spec.rb +254 -0
- data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +256 -0
- data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/sync_list_spec.rb +207 -0
- data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +257 -0
- data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/sync_map_spec.rb +207 -0
- data/spec/integration/sync/v1/service_spec.rb +244 -0
- data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +5 -5
- data/spec/integration/wireless/v1/command_spec.rb +166 -0
- data/spec/integration/wireless/v1/rate_plan_spec.rb +268 -0
- data/spec/integration/wireless/v1/sim/usage_record_spec.rb +65 -0
- data/spec/integration/wireless/v1/sim_spec.rb +208 -0
- data/twilio-ruby.gemspec +1 -3
- metadata +192 -2
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# \ / _ _ _| _ _
|
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
# / /
|
|
6
|
+
|
|
7
|
+
module Twilio
|
|
8
|
+
module REST
|
|
9
|
+
class Notify < Domain
|
|
10
|
+
class V1 < Version
|
|
11
|
+
class ServiceContext < InstanceContext
|
|
12
|
+
##
|
|
13
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
14
|
+
class SegmentList < ListResource
|
|
15
|
+
##
|
|
16
|
+
# Initialize the SegmentList
|
|
17
|
+
# @param [Version] version Version that contains the resource
|
|
18
|
+
# @param [String] service_sid The service_sid
|
|
19
|
+
# @return [SegmentList] SegmentList
|
|
20
|
+
def initialize(version, service_sid: nil)
|
|
21
|
+
super(version)
|
|
22
|
+
|
|
23
|
+
# Path Solution
|
|
24
|
+
@solution = {
|
|
25
|
+
service_sid: service_sid
|
|
26
|
+
}
|
|
27
|
+
@uri = "/Services/#{@solution[:service_sid]}/Segments"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
##
|
|
31
|
+
# Lists SegmentInstance records from the API as a list.
|
|
32
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
33
|
+
# memory before returning.
|
|
34
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
35
|
+
# guarantees to never return more than limit. Default is no limit
|
|
36
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
37
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
38
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
39
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
40
|
+
# @return [Array] Array of up to limit results
|
|
41
|
+
def list(limit: nil, page_size: nil)
|
|
42
|
+
self.stream(
|
|
43
|
+
limit: limit,
|
|
44
|
+
page_size: page_size
|
|
45
|
+
).entries
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
##
|
|
49
|
+
# Streams SegmentInstance records from the API as an Enumerable.
|
|
50
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
51
|
+
# is reached.
|
|
52
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
53
|
+
# guarantees to never return more than limit. Default is no limit.
|
|
54
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
55
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
56
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
57
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
58
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
59
|
+
def stream(limit: nil, page_size: nil)
|
|
60
|
+
limits = @version.read_limits(limit, page_size)
|
|
61
|
+
|
|
62
|
+
page = self.page(
|
|
63
|
+
page_size: limits[:page_size],
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
##
|
|
70
|
+
# When passed a block, yields SegmentInstance records from the API.
|
|
71
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
72
|
+
# is reached.
|
|
73
|
+
def each
|
|
74
|
+
limits = @version.read_limits
|
|
75
|
+
|
|
76
|
+
page = self.page(
|
|
77
|
+
page_size: limits[:page_size],
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
@version.stream(page,
|
|
81
|
+
limit: limits[:limit],
|
|
82
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
##
|
|
86
|
+
# Retrieve a single page of SegmentInstance records from the API.
|
|
87
|
+
# Request is executed immediately.
|
|
88
|
+
# @param [String] page_token PageToken provided by the API
|
|
89
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
90
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
91
|
+
# @return [Page] Page of SegmentInstance
|
|
92
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
|
93
|
+
params = Twilio::Values.of({
|
|
94
|
+
'PageToken' => page_token,
|
|
95
|
+
'Page' => page_number,
|
|
96
|
+
'PageSize' => page_size,
|
|
97
|
+
})
|
|
98
|
+
response = @version.page(
|
|
99
|
+
'GET',
|
|
100
|
+
@uri,
|
|
101
|
+
params
|
|
102
|
+
)
|
|
103
|
+
SegmentPage.new(@version, response, @solution)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
##
|
|
107
|
+
# Retrieve a single page of SegmentInstance records from the API.
|
|
108
|
+
# Request is executed immediately.
|
|
109
|
+
# @param [String] target_url API-generated URL for the requested results page
|
|
110
|
+
# @return [Page] Page of SegmentInstance
|
|
111
|
+
def get_page(target_url)
|
|
112
|
+
response = @version.domain.request(
|
|
113
|
+
'GET',
|
|
114
|
+
target_url
|
|
115
|
+
)
|
|
116
|
+
SegmentPage.new(@version, response, @solution)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
##
|
|
120
|
+
# Provide a user friendly representation
|
|
121
|
+
def to_s
|
|
122
|
+
'#<Twilio.Notify.V1.SegmentList>'
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
##
|
|
127
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
128
|
+
class SegmentPage < Page
|
|
129
|
+
##
|
|
130
|
+
# Initialize the SegmentPage
|
|
131
|
+
# @param [Version] version Version that contains the resource
|
|
132
|
+
# @param [Response] response Response from the API
|
|
133
|
+
# @param [Hash] solution Path solution for the resource
|
|
134
|
+
# @return [SegmentPage] SegmentPage
|
|
135
|
+
def initialize(version, response, solution)
|
|
136
|
+
super(version, response)
|
|
137
|
+
|
|
138
|
+
# Path Solution
|
|
139
|
+
@solution = solution
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
##
|
|
143
|
+
# Build an instance of SegmentInstance
|
|
144
|
+
# @param [Hash] payload Payload response from the API
|
|
145
|
+
# @return [SegmentInstance] SegmentInstance
|
|
146
|
+
def get_instance(payload)
|
|
147
|
+
SegmentInstance.new(
|
|
148
|
+
@version,
|
|
149
|
+
payload,
|
|
150
|
+
service_sid: @solution[:service_sid],
|
|
151
|
+
)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
##
|
|
155
|
+
# Provide a user friendly representation
|
|
156
|
+
def to_s
|
|
157
|
+
'<Twilio.Notify.V1.SegmentPage>'
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
##
|
|
162
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
163
|
+
class SegmentInstance < InstanceResource
|
|
164
|
+
##
|
|
165
|
+
# Initialize the SegmentInstance
|
|
166
|
+
# @param [Version] version Version that contains the resource
|
|
167
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
168
|
+
# @param [String] service_sid The service_sid
|
|
169
|
+
# @return [SegmentInstance] SegmentInstance
|
|
170
|
+
def initialize(version, payload, service_sid: nil)
|
|
171
|
+
super(version)
|
|
172
|
+
|
|
173
|
+
# Marshaled Properties
|
|
174
|
+
@properties = {
|
|
175
|
+
'sid' => payload['sid'],
|
|
176
|
+
'account_sid' => payload['account_sid'],
|
|
177
|
+
'service_sid' => payload['service_sid'],
|
|
178
|
+
'unique_name' => payload['unique_name'],
|
|
179
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
|
180
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
181
|
+
}
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
##
|
|
185
|
+
# @return [String] The sid
|
|
186
|
+
def sid
|
|
187
|
+
@properties['sid']
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
##
|
|
191
|
+
# @return [String] The account_sid
|
|
192
|
+
def account_sid
|
|
193
|
+
@properties['account_sid']
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
##
|
|
197
|
+
# @return [String] The service_sid
|
|
198
|
+
def service_sid
|
|
199
|
+
@properties['service_sid']
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
##
|
|
203
|
+
# @return [String] The unique_name
|
|
204
|
+
def unique_name
|
|
205
|
+
@properties['unique_name']
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
##
|
|
209
|
+
# @return [Time] The date_created
|
|
210
|
+
def date_created
|
|
211
|
+
@properties['date_created']
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
##
|
|
215
|
+
# @return [Time] The date_updated
|
|
216
|
+
def date_updated
|
|
217
|
+
@properties['date_updated']
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
##
|
|
221
|
+
# Provide a user friendly representation
|
|
222
|
+
def to_s
|
|
223
|
+
"<Twilio.Notify.V1.SegmentInstance>"
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
end
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# \ / _ _ _| _ _
|
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
# / /
|
|
6
|
+
|
|
7
|
+
module Twilio
|
|
8
|
+
module REST
|
|
9
|
+
class Notify < Domain
|
|
10
|
+
class V1 < Version
|
|
11
|
+
class ServiceContext < InstanceContext
|
|
12
|
+
class UserContext < InstanceContext
|
|
13
|
+
##
|
|
14
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
15
|
+
class SegmentMembershipList < ListResource
|
|
16
|
+
##
|
|
17
|
+
# Initialize the SegmentMembershipList
|
|
18
|
+
# @param [Version] version Version that contains the resource
|
|
19
|
+
# @param [String] service_sid The service_sid
|
|
20
|
+
# @param [String] identity The identity
|
|
21
|
+
# @return [SegmentMembershipList] SegmentMembershipList
|
|
22
|
+
def initialize(version, service_sid: nil, identity: nil)
|
|
23
|
+
super(version)
|
|
24
|
+
|
|
25
|
+
# Path Solution
|
|
26
|
+
@solution = {
|
|
27
|
+
service_sid: service_sid,
|
|
28
|
+
identity: identity
|
|
29
|
+
}
|
|
30
|
+
@uri = "/Services/#{@solution[:service_sid]}/Users/#{@solution[:identity]}/SegmentMemberships"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
##
|
|
34
|
+
# Retrieve a single page of SegmentMembershipInstance records from the API.
|
|
35
|
+
# Request is executed immediately.
|
|
36
|
+
# @param [String] segment The segment
|
|
37
|
+
# @return [SegmentMembershipInstance] Newly created SegmentMembershipInstance
|
|
38
|
+
def create(segment: nil)
|
|
39
|
+
data = Twilio::Values.of({
|
|
40
|
+
'Segment' => segment,
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
payload = @version.create(
|
|
44
|
+
'POST',
|
|
45
|
+
@uri,
|
|
46
|
+
data: data
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
SegmentMembershipInstance.new(
|
|
50
|
+
@version,
|
|
51
|
+
payload,
|
|
52
|
+
service_sid: @solution[:service_sid],
|
|
53
|
+
identity: @solution[:identity],
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
##
|
|
58
|
+
# Provide a user friendly representation
|
|
59
|
+
def to_s
|
|
60
|
+
'#<Twilio.Notify.V1.SegmentMembershipList>'
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
##
|
|
65
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
66
|
+
class SegmentMembershipPage < Page
|
|
67
|
+
##
|
|
68
|
+
# Initialize the SegmentMembershipPage
|
|
69
|
+
# @param [Version] version Version that contains the resource
|
|
70
|
+
# @param [Response] response Response from the API
|
|
71
|
+
# @param [Hash] solution Path solution for the resource
|
|
72
|
+
# @return [SegmentMembershipPage] SegmentMembershipPage
|
|
73
|
+
def initialize(version, response, solution)
|
|
74
|
+
super(version, response)
|
|
75
|
+
|
|
76
|
+
# Path Solution
|
|
77
|
+
@solution = solution
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
##
|
|
81
|
+
# Build an instance of SegmentMembershipInstance
|
|
82
|
+
# @param [Hash] payload Payload response from the API
|
|
83
|
+
# @return [SegmentMembershipInstance] SegmentMembershipInstance
|
|
84
|
+
def get_instance(payload)
|
|
85
|
+
SegmentMembershipInstance.new(
|
|
86
|
+
@version,
|
|
87
|
+
payload,
|
|
88
|
+
service_sid: @solution[:service_sid],
|
|
89
|
+
identity: @solution[:identity],
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
##
|
|
94
|
+
# Provide a user friendly representation
|
|
95
|
+
def to_s
|
|
96
|
+
'<Twilio.Notify.V1.SegmentMembershipPage>'
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
##
|
|
101
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
102
|
+
class SegmentMembershipContext < InstanceContext
|
|
103
|
+
##
|
|
104
|
+
# Initialize the SegmentMembershipContext
|
|
105
|
+
# @param [Version] version Version that contains the resource
|
|
106
|
+
# @param [String] service_sid The service_sid
|
|
107
|
+
# @param [String] identity The identity
|
|
108
|
+
# @param [String] segment The segment
|
|
109
|
+
# @return [SegmentMembershipContext] SegmentMembershipContext
|
|
110
|
+
def initialize(version, service_sid, identity, segment)
|
|
111
|
+
super(version)
|
|
112
|
+
|
|
113
|
+
# Path Solution
|
|
114
|
+
@solution = {
|
|
115
|
+
service_sid: service_sid,
|
|
116
|
+
identity: identity,
|
|
117
|
+
segment: segment,
|
|
118
|
+
}
|
|
119
|
+
@uri = "/Services/#{@solution[:service_sid]}/Users/#{@solution[:identity]}/SegmentMemberships/#{@solution[:segment]}"
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
##
|
|
123
|
+
# Deletes the SegmentMembershipInstance
|
|
124
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
|
125
|
+
def delete
|
|
126
|
+
@version.delete('delete', @uri)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
##
|
|
130
|
+
# Fetch a SegmentMembershipInstance
|
|
131
|
+
# @return [SegmentMembershipInstance] Fetched SegmentMembershipInstance
|
|
132
|
+
def fetch
|
|
133
|
+
params = Twilio::Values.of({})
|
|
134
|
+
|
|
135
|
+
payload = @version.fetch(
|
|
136
|
+
'GET',
|
|
137
|
+
@uri,
|
|
138
|
+
params,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
SegmentMembershipInstance.new(
|
|
142
|
+
@version,
|
|
143
|
+
payload,
|
|
144
|
+
service_sid: @solution[:service_sid],
|
|
145
|
+
identity: @solution[:identity],
|
|
146
|
+
segment: @solution[:segment],
|
|
147
|
+
)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
##
|
|
151
|
+
# Provide a user friendly representation
|
|
152
|
+
def to_s
|
|
153
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
|
154
|
+
"#<Twilio.Notify.V1.SegmentMembershipContext #{context}>"
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
##
|
|
159
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
160
|
+
class SegmentMembershipInstance < InstanceResource
|
|
161
|
+
##
|
|
162
|
+
# Initialize the SegmentMembershipInstance
|
|
163
|
+
# @param [Version] version Version that contains the resource
|
|
164
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
165
|
+
# @param [String] service_sid The service_sid
|
|
166
|
+
# @param [String] identity The identity
|
|
167
|
+
# @param [String] segment The segment
|
|
168
|
+
# @return [SegmentMembershipInstance] SegmentMembershipInstance
|
|
169
|
+
def initialize(version, payload, service_sid: nil, identity: nil, segment: nil)
|
|
170
|
+
super(version)
|
|
171
|
+
|
|
172
|
+
# Marshaled Properties
|
|
173
|
+
@properties = {
|
|
174
|
+
'account_sid' => payload['account_sid'],
|
|
175
|
+
'service_sid' => payload['service_sid'],
|
|
176
|
+
'identity' => payload['identity'],
|
|
177
|
+
'segment' => payload['segment'],
|
|
178
|
+
'url' => payload['url'],
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
# Context
|
|
182
|
+
@instance_context = nil
|
|
183
|
+
@params = {
|
|
184
|
+
'service_sid' => service_sid,
|
|
185
|
+
'identity' => identity,
|
|
186
|
+
'segment' => segment || @properties['segment'],
|
|
187
|
+
}
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
##
|
|
191
|
+
# Generate an instance context for the instance, the context is capable of
|
|
192
|
+
# performing various actions. All instance actions are proxied to the context
|
|
193
|
+
# @return [SegmentMembershipContext] SegmentMembershipContext for this SegmentMembershipInstance
|
|
194
|
+
def context
|
|
195
|
+
unless @instance_context
|
|
196
|
+
@instance_context = SegmentMembershipContext.new(
|
|
197
|
+
@version,
|
|
198
|
+
@params['service_sid'],
|
|
199
|
+
@params['identity'],
|
|
200
|
+
@params['segment'],
|
|
201
|
+
)
|
|
202
|
+
end
|
|
203
|
+
@instance_context
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
##
|
|
207
|
+
# @return [String] The account_sid
|
|
208
|
+
def account_sid
|
|
209
|
+
@properties['account_sid']
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
##
|
|
213
|
+
# @return [String] The service_sid
|
|
214
|
+
def service_sid
|
|
215
|
+
@properties['service_sid']
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
##
|
|
219
|
+
# @return [String] The identity
|
|
220
|
+
def identity
|
|
221
|
+
@properties['identity']
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
##
|
|
225
|
+
# @return [String] The segment
|
|
226
|
+
def segment
|
|
227
|
+
@properties['segment']
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
##
|
|
231
|
+
# @return [String] The url
|
|
232
|
+
def url
|
|
233
|
+
@properties['url']
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
##
|
|
237
|
+
# Deletes the SegmentMembershipInstance
|
|
238
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
|
239
|
+
def delete
|
|
240
|
+
context.delete
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
##
|
|
244
|
+
# Fetch a SegmentMembershipInstance
|
|
245
|
+
# @return [SegmentMembershipInstance] Fetched SegmentMembershipInstance
|
|
246
|
+
def fetch
|
|
247
|
+
context.fetch
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
##
|
|
251
|
+
# Provide a user friendly representation
|
|
252
|
+
def to_s
|
|
253
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
254
|
+
"<Twilio.Notify.V1.SegmentMembershipInstance #{values}>"
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
end
|
|
262
|
+
end
|