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,438 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# \ / _ _ _| _ _
|
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
# / /
|
|
6
|
+
|
|
7
|
+
module Twilio
|
|
8
|
+
module REST
|
|
9
|
+
class Sync < Domain
|
|
10
|
+
class V1 < Version
|
|
11
|
+
class ServiceContext < InstanceContext
|
|
12
|
+
class SyncListContext < InstanceContext
|
|
13
|
+
##
|
|
14
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
15
|
+
class SyncListItemList < ListResource
|
|
16
|
+
##
|
|
17
|
+
# Initialize the SyncListItemList
|
|
18
|
+
# @param [Version] version Version that contains the resource
|
|
19
|
+
# @param [String] service_sid The service_sid
|
|
20
|
+
# @param [String] list_sid The list_sid
|
|
21
|
+
# @return [SyncListItemList] SyncListItemList
|
|
22
|
+
def initialize(version, service_sid: nil, list_sid: nil)
|
|
23
|
+
super(version)
|
|
24
|
+
|
|
25
|
+
# Path Solution
|
|
26
|
+
@solution = {
|
|
27
|
+
service_sid: service_sid,
|
|
28
|
+
list_sid: list_sid
|
|
29
|
+
}
|
|
30
|
+
@uri = "/Services/#{@solution[:service_sid]}/Lists/#{@solution[:list_sid]}/Items"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
##
|
|
34
|
+
# Retrieve a single page of SyncListItemInstance records from the API.
|
|
35
|
+
# Request is executed immediately.
|
|
36
|
+
# @param [Hash] data The data
|
|
37
|
+
# @return [SyncListItemInstance] Newly created SyncListItemInstance
|
|
38
|
+
def create(data: nil)
|
|
39
|
+
data = Twilio::Values.of({
|
|
40
|
+
'Data' => Twilio.serialize_object(data),
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
payload = @version.create(
|
|
44
|
+
'POST',
|
|
45
|
+
@uri,
|
|
46
|
+
data: data
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
SyncListItemInstance.new(
|
|
50
|
+
@version,
|
|
51
|
+
payload,
|
|
52
|
+
service_sid: @solution[:service_sid],
|
|
53
|
+
list_sid: @solution[:list_sid],
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
##
|
|
58
|
+
# Lists SyncListItemInstance records from the API as a list.
|
|
59
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
60
|
+
# memory before returning.
|
|
61
|
+
# @param [sync_list_item.QueryResultOrder] order The order
|
|
62
|
+
# @param [String] from The from
|
|
63
|
+
# @param [sync_list_item.QueryFromBoundType] bounds The bounds
|
|
64
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
65
|
+
# guarantees to never return more than limit. Default is no limit
|
|
66
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
67
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
68
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
69
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
70
|
+
# @return [Array] Array of up to limit results
|
|
71
|
+
def list(order: :unset, from: :unset, bounds: :unset, limit: nil, page_size: nil)
|
|
72
|
+
self.stream(
|
|
73
|
+
order: order,
|
|
74
|
+
from: from,
|
|
75
|
+
bounds: bounds,
|
|
76
|
+
limit: limit,
|
|
77
|
+
page_size: page_size
|
|
78
|
+
).entries
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
##
|
|
82
|
+
# Streams SyncListItemInstance records from the API as an Enumerable.
|
|
83
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
84
|
+
# is reached.
|
|
85
|
+
# @param [sync_list_item.QueryResultOrder] order The order
|
|
86
|
+
# @param [String] from The from
|
|
87
|
+
# @param [sync_list_item.QueryFromBoundType] bounds The bounds
|
|
88
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
89
|
+
# guarantees to never return more than limit. Default is no limit.
|
|
90
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
91
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
92
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
93
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
94
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
95
|
+
def stream(order: :unset, from: :unset, bounds: :unset, limit: nil, page_size: nil)
|
|
96
|
+
limits = @version.read_limits(limit, page_size)
|
|
97
|
+
|
|
98
|
+
page = self.page(
|
|
99
|
+
order: order,
|
|
100
|
+
from: from,
|
|
101
|
+
bounds: bounds,
|
|
102
|
+
page_size: limits[:page_size],
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
##
|
|
109
|
+
# When passed a block, yields SyncListItemInstance records from the API.
|
|
110
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
111
|
+
# is reached.
|
|
112
|
+
def each
|
|
113
|
+
limits = @version.read_limits
|
|
114
|
+
|
|
115
|
+
page = self.page(
|
|
116
|
+
page_size: limits[:page_size],
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
@version.stream(page,
|
|
120
|
+
limit: limits[:limit],
|
|
121
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
##
|
|
125
|
+
# Retrieve a single page of SyncListItemInstance records from the API.
|
|
126
|
+
# Request is executed immediately.
|
|
127
|
+
# @param [sync_list_item.QueryResultOrder] order The order
|
|
128
|
+
# @param [String] from The from
|
|
129
|
+
# @param [sync_list_item.QueryFromBoundType] bounds The bounds
|
|
130
|
+
# @param [String] page_token PageToken provided by the API
|
|
131
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
132
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
133
|
+
# @return [Page] Page of SyncListItemInstance
|
|
134
|
+
def page(order: :unset, from: :unset, bounds: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
|
135
|
+
params = Twilio::Values.of({
|
|
136
|
+
'Order' => order,
|
|
137
|
+
'From' => from,
|
|
138
|
+
'Bounds' => bounds,
|
|
139
|
+
'PageToken' => page_token,
|
|
140
|
+
'Page' => page_number,
|
|
141
|
+
'PageSize' => page_size,
|
|
142
|
+
})
|
|
143
|
+
response = @version.page(
|
|
144
|
+
'GET',
|
|
145
|
+
@uri,
|
|
146
|
+
params
|
|
147
|
+
)
|
|
148
|
+
SyncListItemPage.new(@version, response, @solution)
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
##
|
|
152
|
+
# Retrieve a single page of SyncListItemInstance records from the API.
|
|
153
|
+
# Request is executed immediately.
|
|
154
|
+
# @param [String] target_url API-generated URL for the requested results page
|
|
155
|
+
# @return [Page] Page of SyncListItemInstance
|
|
156
|
+
def get_page(target_url)
|
|
157
|
+
response = @version.domain.request(
|
|
158
|
+
'GET',
|
|
159
|
+
target_url
|
|
160
|
+
)
|
|
161
|
+
SyncListItemPage.new(@version, response, @solution)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
##
|
|
165
|
+
# Provide a user friendly representation
|
|
166
|
+
def to_s
|
|
167
|
+
'#<Twilio.Sync.V1.SyncListItemList>'
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
##
|
|
172
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
173
|
+
class SyncListItemPage < Page
|
|
174
|
+
##
|
|
175
|
+
# Initialize the SyncListItemPage
|
|
176
|
+
# @param [Version] version Version that contains the resource
|
|
177
|
+
# @param [Response] response Response from the API
|
|
178
|
+
# @param [Hash] solution Path solution for the resource
|
|
179
|
+
# @return [SyncListItemPage] SyncListItemPage
|
|
180
|
+
def initialize(version, response, solution)
|
|
181
|
+
super(version, response)
|
|
182
|
+
|
|
183
|
+
# Path Solution
|
|
184
|
+
@solution = solution
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
##
|
|
188
|
+
# Build an instance of SyncListItemInstance
|
|
189
|
+
# @param [Hash] payload Payload response from the API
|
|
190
|
+
# @return [SyncListItemInstance] SyncListItemInstance
|
|
191
|
+
def get_instance(payload)
|
|
192
|
+
SyncListItemInstance.new(
|
|
193
|
+
@version,
|
|
194
|
+
payload,
|
|
195
|
+
service_sid: @solution[:service_sid],
|
|
196
|
+
list_sid: @solution[:list_sid],
|
|
197
|
+
)
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
##
|
|
201
|
+
# Provide a user friendly representation
|
|
202
|
+
def to_s
|
|
203
|
+
'<Twilio.Sync.V1.SyncListItemPage>'
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
##
|
|
208
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
209
|
+
class SyncListItemContext < InstanceContext
|
|
210
|
+
##
|
|
211
|
+
# Initialize the SyncListItemContext
|
|
212
|
+
# @param [Version] version Version that contains the resource
|
|
213
|
+
# @param [String] service_sid The service_sid
|
|
214
|
+
# @param [String] list_sid The list_sid
|
|
215
|
+
# @param [String] index The index
|
|
216
|
+
# @return [SyncListItemContext] SyncListItemContext
|
|
217
|
+
def initialize(version, service_sid, list_sid, index)
|
|
218
|
+
super(version)
|
|
219
|
+
|
|
220
|
+
# Path Solution
|
|
221
|
+
@solution = {
|
|
222
|
+
service_sid: service_sid,
|
|
223
|
+
list_sid: list_sid,
|
|
224
|
+
index: index,
|
|
225
|
+
}
|
|
226
|
+
@uri = "/Services/#{@solution[:service_sid]}/Lists/#{@solution[:list_sid]}/Items/#{@solution[:index]}"
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
##
|
|
230
|
+
# Fetch a SyncListItemInstance
|
|
231
|
+
# @return [SyncListItemInstance] Fetched SyncListItemInstance
|
|
232
|
+
def fetch
|
|
233
|
+
params = Twilio::Values.of({})
|
|
234
|
+
|
|
235
|
+
payload = @version.fetch(
|
|
236
|
+
'GET',
|
|
237
|
+
@uri,
|
|
238
|
+
params,
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
SyncListItemInstance.new(
|
|
242
|
+
@version,
|
|
243
|
+
payload,
|
|
244
|
+
service_sid: @solution[:service_sid],
|
|
245
|
+
list_sid: @solution[:list_sid],
|
|
246
|
+
index: @solution[:index],
|
|
247
|
+
)
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
##
|
|
251
|
+
# Deletes the SyncListItemInstance
|
|
252
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
|
253
|
+
def delete
|
|
254
|
+
@version.delete('delete', @uri)
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
##
|
|
258
|
+
# Update the SyncListItemInstance
|
|
259
|
+
# @param [Hash] data The data
|
|
260
|
+
# @return [SyncListItemInstance] Updated SyncListItemInstance
|
|
261
|
+
def update(data: nil)
|
|
262
|
+
data = Twilio::Values.of({
|
|
263
|
+
'Data' => Twilio.serialize_object(data),
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
payload = @version.update(
|
|
267
|
+
'POST',
|
|
268
|
+
@uri,
|
|
269
|
+
data: data,
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
SyncListItemInstance.new(
|
|
273
|
+
@version,
|
|
274
|
+
payload,
|
|
275
|
+
service_sid: @solution[:service_sid],
|
|
276
|
+
list_sid: @solution[:list_sid],
|
|
277
|
+
index: @solution[:index],
|
|
278
|
+
)
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
##
|
|
282
|
+
# Provide a user friendly representation
|
|
283
|
+
def to_s
|
|
284
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
|
285
|
+
"#<Twilio.Sync.V1.SyncListItemContext #{context}>"
|
|
286
|
+
end
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
##
|
|
290
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
291
|
+
class SyncListItemInstance < InstanceResource
|
|
292
|
+
##
|
|
293
|
+
# Initialize the SyncListItemInstance
|
|
294
|
+
# @param [Version] version Version that contains the resource
|
|
295
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
296
|
+
# @param [String] service_sid The service_sid
|
|
297
|
+
# @param [String] list_sid The list_sid
|
|
298
|
+
# @param [String] index The index
|
|
299
|
+
# @return [SyncListItemInstance] SyncListItemInstance
|
|
300
|
+
def initialize(version, payload, service_sid: nil, list_sid: nil, index: nil)
|
|
301
|
+
super(version)
|
|
302
|
+
|
|
303
|
+
# Marshaled Properties
|
|
304
|
+
@properties = {
|
|
305
|
+
'index' => payload['index'].to_i,
|
|
306
|
+
'account_sid' => payload['account_sid'],
|
|
307
|
+
'service_sid' => payload['service_sid'],
|
|
308
|
+
'list_sid' => payload['list_sid'],
|
|
309
|
+
'url' => payload['url'],
|
|
310
|
+
'revision' => payload['revision'],
|
|
311
|
+
'data' => payload['data'],
|
|
312
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
|
313
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
314
|
+
'created_by' => payload['created_by'],
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
# Context
|
|
318
|
+
@instance_context = nil
|
|
319
|
+
@params = {
|
|
320
|
+
'service_sid' => service_sid,
|
|
321
|
+
'list_sid' => list_sid,
|
|
322
|
+
'index' => index || @properties['index'],
|
|
323
|
+
}
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
##
|
|
327
|
+
# Generate an instance context for the instance, the context is capable of
|
|
328
|
+
# performing various actions. All instance actions are proxied to the context
|
|
329
|
+
# @return [SyncListItemContext] SyncListItemContext for this SyncListItemInstance
|
|
330
|
+
def context
|
|
331
|
+
unless @instance_context
|
|
332
|
+
@instance_context = SyncListItemContext.new(
|
|
333
|
+
@version,
|
|
334
|
+
@params['service_sid'],
|
|
335
|
+
@params['list_sid'],
|
|
336
|
+
@params['index'],
|
|
337
|
+
)
|
|
338
|
+
end
|
|
339
|
+
@instance_context
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
##
|
|
343
|
+
# @return [String] The index
|
|
344
|
+
def index
|
|
345
|
+
@properties['index']
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
##
|
|
349
|
+
# @return [String] The account_sid
|
|
350
|
+
def account_sid
|
|
351
|
+
@properties['account_sid']
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
##
|
|
355
|
+
# @return [String] The service_sid
|
|
356
|
+
def service_sid
|
|
357
|
+
@properties['service_sid']
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
##
|
|
361
|
+
# @return [String] The list_sid
|
|
362
|
+
def list_sid
|
|
363
|
+
@properties['list_sid']
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
##
|
|
367
|
+
# @return [String] The url
|
|
368
|
+
def url
|
|
369
|
+
@properties['url']
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
##
|
|
373
|
+
# @return [String] The revision
|
|
374
|
+
def revision
|
|
375
|
+
@properties['revision']
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
##
|
|
379
|
+
# @return [Hash] The data
|
|
380
|
+
def data
|
|
381
|
+
@properties['data']
|
|
382
|
+
end
|
|
383
|
+
|
|
384
|
+
##
|
|
385
|
+
# @return [Time] The date_created
|
|
386
|
+
def date_created
|
|
387
|
+
@properties['date_created']
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
##
|
|
391
|
+
# @return [Time] The date_updated
|
|
392
|
+
def date_updated
|
|
393
|
+
@properties['date_updated']
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
##
|
|
397
|
+
# @return [String] The created_by
|
|
398
|
+
def created_by
|
|
399
|
+
@properties['created_by']
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
##
|
|
403
|
+
# Fetch a SyncListItemInstance
|
|
404
|
+
# @return [SyncListItemInstance] Fetched SyncListItemInstance
|
|
405
|
+
def fetch
|
|
406
|
+
context.fetch
|
|
407
|
+
end
|
|
408
|
+
|
|
409
|
+
##
|
|
410
|
+
# Deletes the SyncListItemInstance
|
|
411
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
|
412
|
+
def delete
|
|
413
|
+
context.delete
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
##
|
|
417
|
+
# Update the SyncListItemInstance
|
|
418
|
+
# @param [Hash] data The data
|
|
419
|
+
# @return [SyncListItemInstance] Updated SyncListItemInstance
|
|
420
|
+
def update(data: nil)
|
|
421
|
+
context.update(
|
|
422
|
+
data: data,
|
|
423
|
+
)
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
##
|
|
427
|
+
# Provide a user friendly representation
|
|
428
|
+
def to_s
|
|
429
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
430
|
+
"<Twilio.Sync.V1.SyncListItemInstance #{values}>"
|
|
431
|
+
end
|
|
432
|
+
end
|
|
433
|
+
end
|
|
434
|
+
end
|
|
435
|
+
end
|
|
436
|
+
end
|
|
437
|
+
end
|
|
438
|
+
end
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# \ / _ _ _| _ _
|
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
# / /
|
|
6
|
+
|
|
7
|
+
module Twilio
|
|
8
|
+
module REST
|
|
9
|
+
class Sync < Domain
|
|
10
|
+
class V1 < Version
|
|
11
|
+
class ServiceContext < InstanceContext
|
|
12
|
+
class SyncListContext < InstanceContext
|
|
13
|
+
##
|
|
14
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
15
|
+
class SyncListPermissionList < ListResource
|
|
16
|
+
##
|
|
17
|
+
# Initialize the SyncListPermissionList
|
|
18
|
+
# @param [Version] version Version that contains the resource
|
|
19
|
+
# @param [String] service_sid The unique SID identifier of the Sync Service
|
|
20
|
+
# Instance.
|
|
21
|
+
# @param [String] list_sid The unique SID identifier of the Sync List to which the
|
|
22
|
+
# Permission applies.
|
|
23
|
+
# @return [SyncListPermissionList] SyncListPermissionList
|
|
24
|
+
def initialize(version, service_sid: nil, list_sid: nil)
|
|
25
|
+
super(version)
|
|
26
|
+
|
|
27
|
+
# Path Solution
|
|
28
|
+
@solution = {
|
|
29
|
+
service_sid: service_sid,
|
|
30
|
+
list_sid: list_sid
|
|
31
|
+
}
|
|
32
|
+
@uri = "/Services/#{@solution[:service_sid]}/Lists/#{@solution[:list_sid]}/Permissions"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
##
|
|
36
|
+
# Lists SyncListPermissionInstance records from the API as a list.
|
|
37
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
38
|
+
# memory before returning.
|
|
39
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
40
|
+
# guarantees to never return more than limit. Default is no limit
|
|
41
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
42
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
43
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
44
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
45
|
+
# @return [Array] Array of up to limit results
|
|
46
|
+
def list(limit: nil, page_size: nil)
|
|
47
|
+
self.stream(
|
|
48
|
+
limit: limit,
|
|
49
|
+
page_size: page_size
|
|
50
|
+
).entries
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
##
|
|
54
|
+
# Streams SyncListPermissionInstance records from the API as an Enumerable.
|
|
55
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
56
|
+
# is reached.
|
|
57
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
58
|
+
# guarantees to never return more than limit. Default is no limit.
|
|
59
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
60
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
61
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
62
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
63
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
64
|
+
def stream(limit: nil, page_size: nil)
|
|
65
|
+
limits = @version.read_limits(limit, page_size)
|
|
66
|
+
|
|
67
|
+
page = self.page(
|
|
68
|
+
page_size: limits[:page_size],
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
##
|
|
75
|
+
# When passed a block, yields SyncListPermissionInstance records from the API.
|
|
76
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
77
|
+
# is reached.
|
|
78
|
+
def each
|
|
79
|
+
limits = @version.read_limits
|
|
80
|
+
|
|
81
|
+
page = self.page(
|
|
82
|
+
page_size: limits[:page_size],
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
@version.stream(page,
|
|
86
|
+
limit: limits[:limit],
|
|
87
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
##
|
|
91
|
+
# Retrieve a single page of SyncListPermissionInstance records from the API.
|
|
92
|
+
# Request is executed immediately.
|
|
93
|
+
# @param [String] page_token PageToken provided by the API
|
|
94
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
95
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
96
|
+
# @return [Page] Page of SyncListPermissionInstance
|
|
97
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
|
98
|
+
params = Twilio::Values.of({
|
|
99
|
+
'PageToken' => page_token,
|
|
100
|
+
'Page' => page_number,
|
|
101
|
+
'PageSize' => page_size,
|
|
102
|
+
})
|
|
103
|
+
response = @version.page(
|
|
104
|
+
'GET',
|
|
105
|
+
@uri,
|
|
106
|
+
params
|
|
107
|
+
)
|
|
108
|
+
SyncListPermissionPage.new(@version, response, @solution)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
##
|
|
112
|
+
# Retrieve a single page of SyncListPermissionInstance records from the API.
|
|
113
|
+
# Request is executed immediately.
|
|
114
|
+
# @param [String] target_url API-generated URL for the requested results page
|
|
115
|
+
# @return [Page] Page of SyncListPermissionInstance
|
|
116
|
+
def get_page(target_url)
|
|
117
|
+
response = @version.domain.request(
|
|
118
|
+
'GET',
|
|
119
|
+
target_url
|
|
120
|
+
)
|
|
121
|
+
SyncListPermissionPage.new(@version, response, @solution)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
##
|
|
125
|
+
# Provide a user friendly representation
|
|
126
|
+
def to_s
|
|
127
|
+
'#<Twilio.Sync.V1.SyncListPermissionList>'
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
##
|
|
132
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
133
|
+
class SyncListPermissionPage < Page
|
|
134
|
+
##
|
|
135
|
+
# Initialize the SyncListPermissionPage
|
|
136
|
+
# @param [Version] version Version that contains the resource
|
|
137
|
+
# @param [Response] response Response from the API
|
|
138
|
+
# @param [Hash] solution Path solution for the resource
|
|
139
|
+
# @return [SyncListPermissionPage] SyncListPermissionPage
|
|
140
|
+
def initialize(version, response, solution)
|
|
141
|
+
super(version, response)
|
|
142
|
+
|
|
143
|
+
# Path Solution
|
|
144
|
+
@solution = solution
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
##
|
|
148
|
+
# Build an instance of SyncListPermissionInstance
|
|
149
|
+
# @param [Hash] payload Payload response from the API
|
|
150
|
+
# @return [SyncListPermissionInstance] SyncListPermissionInstance
|
|
151
|
+
def get_instance(payload)
|
|
152
|
+
SyncListPermissionInstance.new(
|
|
153
|
+
@version,
|
|
154
|
+
payload,
|
|
155
|
+
service_sid: @solution[:service_sid],
|
|
156
|
+
list_sid: @solution[:list_sid],
|
|
157
|
+
)
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
##
|
|
161
|
+
# Provide a user friendly representation
|
|
162
|
+
def to_s
|
|
163
|
+
'<Twilio.Sync.V1.SyncListPermissionPage>'
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
##
|
|
168
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
169
|
+
class SyncListPermissionContext < InstanceContext
|
|
170
|
+
##
|
|
171
|
+
# Initialize the SyncListPermissionContext
|
|
172
|
+
# @param [Version] version Version that contains the resource
|
|
173
|
+
# @param [String] service_sid The service_sid
|
|
174
|
+
# @param [String] list_sid Identifier of the Sync List. Either a SID or a unique
|
|
175
|
+
# name.
|
|
176
|
+
# @param [String] identity Arbitrary string identifier representing a user
|
|
177
|
+
# associated with an FPA token, assigned by the developer.
|
|
178
|
+
# @return [SyncListPermissionContext] SyncListPermissionContext
|
|
179
|
+
def initialize(version, service_sid, list_sid, identity)
|
|
180
|
+
super(version)
|
|
181
|
+
|
|
182
|
+
# Path Solution
|
|
183
|
+
@solution = {
|
|
184
|
+
service_sid: service_sid,
|
|
185
|
+
list_sid: list_sid,
|
|
186
|
+
identity: identity,
|
|
187
|
+
}
|
|
188
|
+
@uri = "/Services/#{@solution[:service_sid]}/Lists/#{@solution[:list_sid]}/Permissions/#{@solution[:identity]}"
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
##
|
|
192
|
+
# Fetch a SyncListPermissionInstance
|
|
193
|
+
# @return [SyncListPermissionInstance] Fetched SyncListPermissionInstance
|
|
194
|
+
def fetch
|
|
195
|
+
params = Twilio::Values.of({})
|
|
196
|
+
|
|
197
|
+
payload = @version.fetch(
|
|
198
|
+
'GET',
|
|
199
|
+
@uri,
|
|
200
|
+
params,
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
SyncListPermissionInstance.new(
|
|
204
|
+
@version,
|
|
205
|
+
payload,
|
|
206
|
+
service_sid: @solution[:service_sid],
|
|
207
|
+
list_sid: @solution[:list_sid],
|
|
208
|
+
identity: @solution[:identity],
|
|
209
|
+
)
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
##
|
|
213
|
+
# Deletes the SyncListPermissionInstance
|
|
214
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
|
215
|
+
def delete
|
|
216
|
+
@version.delete('delete', @uri)
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
##
|
|
220
|
+
# Update the SyncListPermissionInstance
|
|
221
|
+
# @param [Boolean] read Boolean flag specifying whether the identity can read the
|
|
222
|
+
# Sync List.
|
|
223
|
+
# @param [Boolean] write Boolean flag specifying whether the identity can create,
|
|
224
|
+
# update and delete Items of the Sync List.
|
|
225
|
+
# @param [Boolean] manage Boolean flag specifying whether the identity can delete
|
|
226
|
+
# the Sync List.
|
|
227
|
+
# @return [SyncListPermissionInstance] Updated SyncListPermissionInstance
|
|
228
|
+
def update(read: nil, write: nil, manage: nil)
|
|
229
|
+
data = Twilio::Values.of({
|
|
230
|
+
'Read' => read,
|
|
231
|
+
'Write' => write,
|
|
232
|
+
'Manage' => manage,
|
|
233
|
+
})
|
|
234
|
+
|
|
235
|
+
payload = @version.update(
|
|
236
|
+
'POST',
|
|
237
|
+
@uri,
|
|
238
|
+
data: data,
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
SyncListPermissionInstance.new(
|
|
242
|
+
@version,
|
|
243
|
+
payload,
|
|
244
|
+
service_sid: @solution[:service_sid],
|
|
245
|
+
list_sid: @solution[:list_sid],
|
|
246
|
+
identity: @solution[:identity],
|
|
247
|
+
)
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
##
|
|
251
|
+
# Provide a user friendly representation
|
|
252
|
+
def to_s
|
|
253
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
|
254
|
+
"#<Twilio.Sync.V1.SyncListPermissionContext #{context}>"
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
##
|
|
259
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
260
|
+
class SyncListPermissionInstance < InstanceResource
|
|
261
|
+
##
|
|
262
|
+
# Initialize the SyncListPermissionInstance
|
|
263
|
+
# @param [Version] version Version that contains the resource
|
|
264
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
265
|
+
# @param [String] service_sid The unique SID identifier of the Sync Service
|
|
266
|
+
# Instance.
|
|
267
|
+
# @param [String] list_sid The unique SID identifier of the Sync List to which the
|
|
268
|
+
# Permission applies.
|
|
269
|
+
# @param [String] identity Arbitrary string identifier representing a user
|
|
270
|
+
# associated with an FPA token, assigned by the developer.
|
|
271
|
+
# @return [SyncListPermissionInstance] SyncListPermissionInstance
|
|
272
|
+
def initialize(version, payload, service_sid: nil, list_sid: nil, identity: nil)
|
|
273
|
+
super(version)
|
|
274
|
+
|
|
275
|
+
# Marshaled Properties
|
|
276
|
+
@properties = {
|
|
277
|
+
'account_sid' => payload['account_sid'],
|
|
278
|
+
'service_sid' => payload['service_sid'],
|
|
279
|
+
'list_sid' => payload['list_sid'],
|
|
280
|
+
'identity' => payload['identity'],
|
|
281
|
+
'read' => payload['read'],
|
|
282
|
+
'write' => payload['write'],
|
|
283
|
+
'manage' => payload['manage'],
|
|
284
|
+
'url' => payload['url'],
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
# Context
|
|
288
|
+
@instance_context = nil
|
|
289
|
+
@params = {
|
|
290
|
+
'service_sid' => service_sid,
|
|
291
|
+
'list_sid' => list_sid,
|
|
292
|
+
'identity' => identity || @properties['identity'],
|
|
293
|
+
}
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
##
|
|
297
|
+
# Generate an instance context for the instance, the context is capable of
|
|
298
|
+
# performing various actions. All instance actions are proxied to the context
|
|
299
|
+
# @return [SyncListPermissionContext] SyncListPermissionContext for this SyncListPermissionInstance
|
|
300
|
+
def context
|
|
301
|
+
unless @instance_context
|
|
302
|
+
@instance_context = SyncListPermissionContext.new(
|
|
303
|
+
@version,
|
|
304
|
+
@params['service_sid'],
|
|
305
|
+
@params['list_sid'],
|
|
306
|
+
@params['identity'],
|
|
307
|
+
)
|
|
308
|
+
end
|
|
309
|
+
@instance_context
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
##
|
|
313
|
+
# @return [String] Twilio Account SID.
|
|
314
|
+
def account_sid
|
|
315
|
+
@properties['account_sid']
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
##
|
|
319
|
+
# @return [String] Sync Service Instance SID.
|
|
320
|
+
def service_sid
|
|
321
|
+
@properties['service_sid']
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
##
|
|
325
|
+
# @return [String] Sync List SID.
|
|
326
|
+
def list_sid
|
|
327
|
+
@properties['list_sid']
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
##
|
|
331
|
+
# @return [String] Identity of the user to whom the Sync List Permission applies.
|
|
332
|
+
def identity
|
|
333
|
+
@properties['identity']
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
##
|
|
337
|
+
# @return [Boolean] Read access.
|
|
338
|
+
def read
|
|
339
|
+
@properties['read']
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
##
|
|
343
|
+
# @return [Boolean] Write access.
|
|
344
|
+
def write
|
|
345
|
+
@properties['write']
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
##
|
|
349
|
+
# @return [Boolean] Manage access.
|
|
350
|
+
def manage
|
|
351
|
+
@properties['manage']
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
##
|
|
355
|
+
# @return [String] URL of this Sync List Permission.
|
|
356
|
+
def url
|
|
357
|
+
@properties['url']
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
##
|
|
361
|
+
# Fetch a SyncListPermissionInstance
|
|
362
|
+
# @return [SyncListPermissionInstance] Fetched SyncListPermissionInstance
|
|
363
|
+
def fetch
|
|
364
|
+
context.fetch
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
##
|
|
368
|
+
# Deletes the SyncListPermissionInstance
|
|
369
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
|
370
|
+
def delete
|
|
371
|
+
context.delete
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
##
|
|
375
|
+
# Update the SyncListPermissionInstance
|
|
376
|
+
# @param [Boolean] read Boolean flag specifying whether the identity can read the
|
|
377
|
+
# Sync List.
|
|
378
|
+
# @param [Boolean] write Boolean flag specifying whether the identity can create,
|
|
379
|
+
# update and delete Items of the Sync List.
|
|
380
|
+
# @param [Boolean] manage Boolean flag specifying whether the identity can delete
|
|
381
|
+
# the Sync List.
|
|
382
|
+
# @return [SyncListPermissionInstance] Updated SyncListPermissionInstance
|
|
383
|
+
def update(read: nil, write: nil, manage: nil)
|
|
384
|
+
context.update(
|
|
385
|
+
read: read,
|
|
386
|
+
write: write,
|
|
387
|
+
manage: manage,
|
|
388
|
+
)
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
##
|
|
392
|
+
# Provide a user friendly representation
|
|
393
|
+
def to_s
|
|
394
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
395
|
+
"<Twilio.Sync.V1.SyncListPermissionInstance #{values}>"
|
|
396
|
+
end
|
|
397
|
+
end
|
|
398
|
+
end
|
|
399
|
+
end
|
|
400
|
+
end
|
|
401
|
+
end
|
|
402
|
+
end
|
|
403
|
+
end
|