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