twilio-ruby 5.0.0.rc21 → 5.0.0.rc22
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/Makefile +3 -0
- data/lib/twilio-ruby.rb +7 -3
- data/lib/twilio-ruby/framework/domain.rb +5 -1
- data/lib/twilio-ruby/framework/page.rb +4 -4
- data/lib/twilio-ruby/framework/serialize.rb +3 -2
- data/lib/twilio-ruby/framework/values.rb +7 -0
- data/lib/twilio-ruby/framework/version.rb +4 -6
- data/lib/twilio-ruby/jwt/access_token.rb +160 -134
- data/lib/twilio-ruby/jwt/client_capability.rb +98 -0
- data/lib/twilio-ruby/jwt/jwt.rb +56 -0
- data/lib/twilio-ruby/jwt/task_router.rb +108 -139
- data/lib/twilio-ruby/rest/accounts.rb +1 -1
- data/lib/twilio-ruby/rest/accounts/v1/credential.rb +1 -1
- data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +30 -17
- data/lib/twilio-ruby/rest/api.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account.rb +31 -18
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +32 -19
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +18 -5
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +32 -19
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +33 -20
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +13 -13
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +8 -8
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +23 -10
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +23 -10
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +27 -14
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +32 -19
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +25 -12
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +32 -19
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +24 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +24 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +24 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +24 -11
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +26 -13
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +30 -17
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +23 -10
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +23 -10
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +28 -15
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +30 -17
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +23 -10
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +23 -10
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +21 -8
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +21 -8
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +21 -8
- data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +27 -14
- data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +26 -13
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +27 -14
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +29 -16
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +30 -17
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +24 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +24 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +27 -14
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +29 -16
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +21 -8
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +20 -7
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +32 -19
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +5 -5
- data/lib/twilio-ruby/rest/chat.rb +4 -4
- data/lib/twilio-ruby/rest/chat/v1/credential.rb +30 -17
- data/lib/twilio-ruby/rest/chat/v1/service.rb +29 -16
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +32 -19
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +27 -14
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +32 -19
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +32 -19
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +27 -14
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +30 -17
- data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +18 -5
- data/lib/twilio-ruby/rest/chat/v2/credential.rb +30 -17
- data/lib/twilio-ruby/rest/chat/v2/service.rb +29 -16
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +32 -19
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +27 -14
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +32 -19
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +32 -19
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +27 -14
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +30 -17
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +18 -5
- data/lib/twilio-ruby/rest/fax.rb +2 -2
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +32 -19
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +21 -8
- data/lib/twilio-ruby/rest/ip_messaging.rb +4 -4
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +30 -17
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +29 -16
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +32 -19
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +27 -14
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +32 -19
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +32 -19
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +27 -14
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +30 -17
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +18 -5
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +30 -17
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +29 -16
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +32 -19
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +27 -14
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +32 -19
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +32 -19
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +27 -14
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +30 -17
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +18 -5
- data/lib/twilio-ruby/rest/lookups.rb +2 -2
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +6 -6
- data/lib/twilio-ruby/rest/messaging.rb +2 -2
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +30 -17
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +24 -11
- data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +24 -11
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +24 -11
- data/lib/twilio-ruby/rest/monitor.rb +4 -4
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +23 -10
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +22 -9
- data/lib/twilio-ruby/rest/notify.rb +4 -4
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +30 -17
- data/lib/twilio-ruby/rest/notify/v1/service.rb +32 -19
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +27 -14
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +5 -5
- data/lib/twilio-ruby/rest/notify/v1/service/segment.rb +18 -5
- data/lib/twilio-ruby/rest/notify/v1/service/user.rb +27 -14
- data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +7 -7
- data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +27 -14
- data/lib/twilio-ruby/rest/preview.rb +18 -18
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +3 -3
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +18 -5
- data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +8 -8
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +32 -19
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +20 -7
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +20 -7
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +30 -17
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +23 -10
- data/lib/twilio-ruby/rest/preview/proxy/service.rb +30 -17
- data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +24 -11
- data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +32 -19
- data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +22 -9
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +32 -19
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +24 -11
- data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +24 -11
- data/lib/twilio-ruby/rest/preview/sync/service.rb +30 -17
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +28 -15
- data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +24 -11
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +25 -12
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +29 -16
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +24 -11
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +25 -12
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +29 -16
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +24 -11
- data/lib/twilio-ruby/rest/preview/wireless/command.rb +26 -13
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +30 -17
- data/lib/twilio-ruby/rest/preview/wireless/sim.rb +28 -15
- data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +6 -6
- data/lib/twilio-ruby/rest/pricing.rb +3 -3
- data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +1 -1
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +20 -7
- data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +1 -1
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +20 -7
- data/lib/twilio-ruby/rest/pricing/v1/voice.rb +1 -1
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +20 -7
- data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +3 -3
- data/lib/twilio-ruby/rest/sync.rb +2 -2
- data/lib/twilio-ruby/rest/sync/v1/service.rb +30 -17
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +28 -15
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +24 -11
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +25 -12
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +29 -16
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +24 -11
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +25 -12
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +29 -16
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +24 -11
- data/lib/twilio-ruby/rest/taskrouter.rb +2 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +33 -20
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +32 -19
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +22 -9
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +32 -19
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +27 -14
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +20 -7
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +33 -20
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +20 -7
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +33 -20
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +27 -14
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +25 -12
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +33 -20
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +6 -6
- data/lib/twilio-ruby/rest/trunking.rb +2 -2
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +30 -17
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +24 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +24 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +29 -16
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +24 -11
- data/lib/twilio-ruby/rest/video.rb +4 -4
- data/lib/twilio-ruby/rest/video/v1/recording.rb +23 -10
- data/lib/twilio-ruby/rest/video/v1/room.rb +29 -16
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +20 -7
- data/lib/twilio-ruby/rest/wireless.rb +6 -6
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +26 -13
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +30 -17
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +27 -14
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +20 -7
- data/lib/twilio-ruby/twiml/messaging_response.rb +147 -0
- data/lib/twilio-ruby/twiml/twiml.rb +77 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +925 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/holodeck/hologram.rb +0 -1
- data/spec/jwt/access_token_spec.rb +126 -182
- data/spec/jwt/client_capability_spec.rb +104 -0
- data/spec/jwt/task_router_spec.rb +164 -97
- data/spec/twiml/messaging_response_spec.rb +62 -0
- data/spec/twiml/voice_response_spec.rb +452 -0
- data/twilio-ruby.gemspec +4 -2
- metadata +36 -23
- data/lib/twilio-ruby/compatibility/v2010/account/call/feedback.rb +0 -15
- data/lib/twilio-ruby/compatibility/v2010/account/queue/member.rb +0 -23
- data/lib/twilio-ruby/jwt/capability.rb +0 -64
- data/lib/twilio-ruby/twiml/response.rb +0 -16
- data/spec/jwt/capability_spec.rb +0 -186
- data/spec/jwt/task_router_taskqueue_spec.rb +0 -111
- data/spec/jwt/task_router_worker_spec.rb +0 -146
- data/spec/jwt/task_router_workspace_spec.rb +0 -110
- data/spec/twiml/twiml_response_spec.rb +0 -47
@@ -38,8 +38,8 @@ module Twilio
|
|
38
38
|
# default_fcm_notification_protocol_version
|
39
39
|
# @param [Boolean] log_enabled The log_enabled
|
40
40
|
# @return [ServiceInstance] Newly created ServiceInstance
|
41
|
-
def create(friendly_name:
|
42
|
-
data = {
|
41
|
+
def create(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset)
|
42
|
+
data = Twilio::Values.of({
|
43
43
|
'FriendlyName' => friendly_name,
|
44
44
|
'ApnCredentialSid' => apn_credential_sid,
|
45
45
|
'GcmCredentialSid' => gcm_credential_sid,
|
@@ -50,7 +50,7 @@ module Twilio
|
|
50
50
|
'FcmCredentialSid' => fcm_credential_sid,
|
51
51
|
'DefaultFcmNotificationProtocolVersion' => default_fcm_notification_protocol_version,
|
52
52
|
'LogEnabled' => log_enabled,
|
53
|
-
}
|
53
|
+
})
|
54
54
|
|
55
55
|
payload = @version.create(
|
56
56
|
'POST',
|
@@ -58,7 +58,7 @@ module Twilio
|
|
58
58
|
data: data
|
59
59
|
)
|
60
60
|
|
61
|
-
|
61
|
+
ServiceInstance.new(
|
62
62
|
@version,
|
63
63
|
payload,
|
64
64
|
)
|
@@ -76,7 +76,7 @@ module Twilio
|
|
76
76
|
# but a limit is defined, stream() will attempt to read the
|
77
77
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
78
78
|
# @return [Array] Array of up to limit results
|
79
|
-
def list(friendly_name:
|
79
|
+
def list(friendly_name: :unset, limit: nil, page_size: nil)
|
80
80
|
self.stream(
|
81
81
|
friendly_name: friendly_name,
|
82
82
|
limit: limit,
|
@@ -96,7 +96,7 @@ module Twilio
|
|
96
96
|
# but a limit is defined, stream() will attempt to read the
|
97
97
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
98
98
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
99
|
-
def stream(friendly_name:
|
99
|
+
def stream(friendly_name: :unset, limit: nil, page_size: nil)
|
100
100
|
limits = @version.read_limits(limit, page_size)
|
101
101
|
|
102
102
|
page = self.page(
|
@@ -138,19 +138,32 @@ module Twilio
|
|
138
138
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
139
139
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
140
140
|
# @return [Page] Page of ServiceInstance
|
141
|
-
def page(friendly_name:
|
142
|
-
params = {
|
141
|
+
def page(friendly_name: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
142
|
+
params = Twilio::Values.of({
|
143
143
|
'FriendlyName' => friendly_name,
|
144
144
|
'PageToken' => page_token,
|
145
145
|
'Page' => page_number,
|
146
146
|
'PageSize' => page_size,
|
147
|
-
}
|
147
|
+
})
|
148
148
|
response = @version.page(
|
149
149
|
'GET',
|
150
150
|
@uri,
|
151
151
|
params
|
152
152
|
)
|
153
|
-
|
153
|
+
ServicePage.new(@version, response, @solution)
|
154
|
+
end
|
155
|
+
|
156
|
+
##
|
157
|
+
# Retrieve a single page of ServiceInstance records from the API.
|
158
|
+
# Request is executed immediately.
|
159
|
+
# @param [String] target_url API-generated URL for the requested results page
|
160
|
+
# @return [Page] Page of ServiceInstance
|
161
|
+
def get_page(target_url)
|
162
|
+
response = @version.domain.request(
|
163
|
+
'GET',
|
164
|
+
target_url
|
165
|
+
)
|
166
|
+
ServicePage.new(@version, response, @solution)
|
154
167
|
end
|
155
168
|
|
156
169
|
##
|
@@ -179,7 +192,7 @@ module Twilio
|
|
179
192
|
# @param [Hash] payload Payload response from the API
|
180
193
|
# @return [ServiceInstance] ServiceInstance
|
181
194
|
def get_instance(payload)
|
182
|
-
|
195
|
+
ServiceInstance.new(
|
183
196
|
@version,
|
184
197
|
payload,
|
185
198
|
)
|
@@ -218,14 +231,14 @@ module Twilio
|
|
218
231
|
# Deletes the ServiceInstance
|
219
232
|
# @return [Boolean] true if delete succeeds, true otherwise
|
220
233
|
def delete
|
221
|
-
|
234
|
+
@version.delete('delete', @uri)
|
222
235
|
end
|
223
236
|
|
224
237
|
##
|
225
238
|
# Fetch a ServiceInstance
|
226
239
|
# @return [ServiceInstance] Fetched ServiceInstance
|
227
240
|
def fetch
|
228
|
-
params = {}
|
241
|
+
params = Twilio::Values.of({})
|
229
242
|
|
230
243
|
payload = @version.fetch(
|
231
244
|
'GET',
|
@@ -233,7 +246,7 @@ module Twilio
|
|
233
246
|
params,
|
234
247
|
)
|
235
248
|
|
236
|
-
|
249
|
+
ServiceInstance.new(
|
237
250
|
@version,
|
238
251
|
payload,
|
239
252
|
sid: @solution[:sid],
|
@@ -256,8 +269,8 @@ module Twilio
|
|
256
269
|
# default_fcm_notification_protocol_version
|
257
270
|
# @param [Boolean] log_enabled The log_enabled
|
258
271
|
# @return [ServiceInstance] Updated ServiceInstance
|
259
|
-
def update(friendly_name:
|
260
|
-
data = {
|
272
|
+
def update(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset)
|
273
|
+
data = Twilio::Values.of({
|
261
274
|
'FriendlyName' => friendly_name,
|
262
275
|
'ApnCredentialSid' => apn_credential_sid,
|
263
276
|
'GcmCredentialSid' => gcm_credential_sid,
|
@@ -268,7 +281,7 @@ module Twilio
|
|
268
281
|
'FcmCredentialSid' => fcm_credential_sid,
|
269
282
|
'DefaultFcmNotificationProtocolVersion' => default_fcm_notification_protocol_version,
|
270
283
|
'LogEnabled' => log_enabled,
|
271
|
-
}
|
284
|
+
})
|
272
285
|
|
273
286
|
payload = @version.update(
|
274
287
|
'POST',
|
@@ -276,7 +289,7 @@ module Twilio
|
|
276
289
|
data: data,
|
277
290
|
)
|
278
291
|
|
279
|
-
|
292
|
+
ServiceInstance.new(
|
280
293
|
@version,
|
281
294
|
payload,
|
282
295
|
sid: @solution[:sid],
|
@@ -509,7 +522,7 @@ module Twilio
|
|
509
522
|
# default_fcm_notification_protocol_version
|
510
523
|
# @param [Boolean] log_enabled The log_enabled
|
511
524
|
# @return [ServiceInstance] Updated ServiceInstance
|
512
|
-
def update(friendly_name:
|
525
|
+
def update(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset)
|
513
526
|
context.update(
|
514
527
|
friendly_name: friendly_name,
|
515
528
|
apn_credential_sid: apn_credential_sid,
|
@@ -36,8 +36,8 @@ module Twilio
|
|
36
36
|
# @param [String] credential_sid The credential_sid
|
37
37
|
# @param [String] endpoint The endpoint
|
38
38
|
# @return [BindingInstance] Newly created BindingInstance
|
39
|
-
def create(identity: nil, binding_type: nil, address: nil, tag:
|
40
|
-
data = {
|
39
|
+
def create(identity: nil, binding_type: nil, address: nil, tag: :unset, notification_protocol_version: :unset, credential_sid: :unset, endpoint: :unset)
|
40
|
+
data = Twilio::Values.of({
|
41
41
|
'Identity' => identity,
|
42
42
|
'BindingType' => binding_type,
|
43
43
|
'Address' => address,
|
@@ -45,7 +45,7 @@ module Twilio
|
|
45
45
|
'NotificationProtocolVersion' => notification_protocol_version,
|
46
46
|
'CredentialSid' => credential_sid,
|
47
47
|
'Endpoint' => endpoint,
|
48
|
-
}
|
48
|
+
})
|
49
49
|
|
50
50
|
payload = @version.create(
|
51
51
|
'POST',
|
@@ -53,7 +53,7 @@ module Twilio
|
|
53
53
|
data: data
|
54
54
|
)
|
55
55
|
|
56
|
-
|
56
|
+
BindingInstance.new(
|
57
57
|
@version,
|
58
58
|
payload,
|
59
59
|
service_sid: @solution[:service_sid],
|
@@ -75,7 +75,7 @@ module Twilio
|
|
75
75
|
# but a limit is defined, stream() will attempt to read the
|
76
76
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
77
77
|
# @return [Array] Array of up to limit results
|
78
|
-
def list(start_date:
|
78
|
+
def list(start_date: :unset, end_date: :unset, identity: :unset, tag: :unset, limit: nil, page_size: nil)
|
79
79
|
self.stream(
|
80
80
|
start_date: start_date,
|
81
81
|
end_date: end_date,
|
@@ -101,7 +101,7 @@ module Twilio
|
|
101
101
|
# but a limit is defined, stream() will attempt to read the
|
102
102
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
103
103
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
104
|
-
def stream(start_date:
|
104
|
+
def stream(start_date: :unset, end_date: :unset, identity: :unset, tag: :unset, limit: nil, page_size: nil)
|
105
105
|
limits = @version.read_limits(limit, page_size)
|
106
106
|
|
107
107
|
page = self.page(
|
@@ -152,8 +152,8 @@ module Twilio
|
|
152
152
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
153
153
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
154
154
|
# @return [Page] Page of BindingInstance
|
155
|
-
def page(start_date:
|
156
|
-
params = {
|
155
|
+
def page(start_date: :unset, end_date: :unset, identity: :unset, tag: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
156
|
+
params = Twilio::Values.of({
|
157
157
|
'StartDate' => Twilio.serialize_iso8601(start_date),
|
158
158
|
'EndDate' => Twilio.serialize_iso8601(end_date),
|
159
159
|
'Identity' => identity,
|
@@ -161,13 +161,26 @@ module Twilio
|
|
161
161
|
'PageToken' => page_token,
|
162
162
|
'Page' => page_number,
|
163
163
|
'PageSize' => page_size,
|
164
|
-
}
|
164
|
+
})
|
165
165
|
response = @version.page(
|
166
166
|
'GET',
|
167
167
|
@uri,
|
168
168
|
params
|
169
169
|
)
|
170
|
-
|
170
|
+
BindingPage.new(@version, response, @solution)
|
171
|
+
end
|
172
|
+
|
173
|
+
##
|
174
|
+
# Retrieve a single page of BindingInstance records from the API.
|
175
|
+
# Request is executed immediately.
|
176
|
+
# @param [String] target_url API-generated URL for the requested results page
|
177
|
+
# @return [Page] Page of BindingInstance
|
178
|
+
def get_page(target_url)
|
179
|
+
response = @version.domain.request(
|
180
|
+
'GET',
|
181
|
+
target_url
|
182
|
+
)
|
183
|
+
BindingPage.new(@version, response, @solution)
|
171
184
|
end
|
172
185
|
|
173
186
|
##
|
@@ -197,7 +210,7 @@ module Twilio
|
|
197
210
|
# @param [Hash] payload Payload response from the API
|
198
211
|
# @return [BindingInstance] BindingInstance
|
199
212
|
def get_instance(payload)
|
200
|
-
|
213
|
+
BindingInstance.new(
|
201
214
|
@version,
|
202
215
|
payload,
|
203
216
|
service_sid: @solution[:service_sid],
|
@@ -233,7 +246,7 @@ module Twilio
|
|
233
246
|
# Fetch a BindingInstance
|
234
247
|
# @return [BindingInstance] Fetched BindingInstance
|
235
248
|
def fetch
|
236
|
-
params = {}
|
249
|
+
params = Twilio::Values.of({})
|
237
250
|
|
238
251
|
payload = @version.fetch(
|
239
252
|
'GET',
|
@@ -241,7 +254,7 @@ module Twilio
|
|
241
254
|
params,
|
242
255
|
)
|
243
256
|
|
244
|
-
|
257
|
+
BindingInstance.new(
|
245
258
|
@version,
|
246
259
|
payload,
|
247
260
|
service_sid: @solution[:service_sid],
|
@@ -253,7 +266,7 @@ module Twilio
|
|
253
266
|
# Deletes the BindingInstance
|
254
267
|
# @return [Boolean] true if delete succeeds, true otherwise
|
255
268
|
def delete
|
256
|
-
|
269
|
+
@version.delete('delete', @uri)
|
257
270
|
end
|
258
271
|
|
259
272
|
##
|
@@ -44,8 +44,8 @@ module Twilio
|
|
44
44
|
# @param [String] identity The identity
|
45
45
|
# @param [String] tag The tag
|
46
46
|
# @return [NotificationInstance] Newly created NotificationInstance
|
47
|
-
def create(body:
|
48
|
-
data = {
|
47
|
+
def create(body: :unset, priority: :unset, ttl: :unset, title: :unset, sound: :unset, action: :unset, data: :unset, apn: :unset, gcm: :unset, sms: :unset, facebook_messenger: :unset, fcm: :unset, segment: :unset, identity: :unset, tag: :unset)
|
48
|
+
data = Twilio::Values.of({
|
49
49
|
'Identity' => identity,
|
50
50
|
'Tag' => tag,
|
51
51
|
'Body' => body,
|
@@ -61,7 +61,7 @@ module Twilio
|
|
61
61
|
'FacebookMessenger' => Twilio.serialize_object(facebook_messenger),
|
62
62
|
'Fcm' => fcm,
|
63
63
|
'Segment' => segment,
|
64
|
-
}
|
64
|
+
})
|
65
65
|
|
66
66
|
payload = @version.create(
|
67
67
|
'POST',
|
@@ -69,7 +69,7 @@ module Twilio
|
|
69
69
|
data: data
|
70
70
|
)
|
71
71
|
|
72
|
-
|
72
|
+
NotificationInstance.new(
|
73
73
|
@version,
|
74
74
|
payload,
|
75
75
|
service_sid: @solution[:service_sid],
|
@@ -103,7 +103,7 @@ module Twilio
|
|
103
103
|
# @param [Hash] payload Payload response from the API
|
104
104
|
# @return [NotificationInstance] NotificationInstance
|
105
105
|
def get_instance(payload)
|
106
|
-
|
106
|
+
NotificationInstance.new(
|
107
107
|
@version,
|
108
108
|
payload,
|
109
109
|
service_sid: @solution[:service_sid],
|
@@ -93,18 +93,31 @@ module Twilio
|
|
93
93
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
94
94
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
95
95
|
# @return [Page] Page of SegmentInstance
|
96
|
-
def page(page_token:
|
97
|
-
params = {
|
96
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
97
|
+
params = Twilio::Values.of({
|
98
98
|
'PageToken' => page_token,
|
99
99
|
'Page' => page_number,
|
100
100
|
'PageSize' => page_size,
|
101
|
-
}
|
101
|
+
})
|
102
102
|
response = @version.page(
|
103
103
|
'GET',
|
104
104
|
@uri,
|
105
105
|
params
|
106
106
|
)
|
107
|
-
|
107
|
+
SegmentPage.new(@version, response, @solution)
|
108
|
+
end
|
109
|
+
|
110
|
+
##
|
111
|
+
# Retrieve a single page of SegmentInstance records from the API.
|
112
|
+
# Request is executed immediately.
|
113
|
+
# @param [String] target_url API-generated URL for the requested results page
|
114
|
+
# @return [Page] Page of SegmentInstance
|
115
|
+
def get_page(target_url)
|
116
|
+
response = @version.domain.request(
|
117
|
+
'GET',
|
118
|
+
target_url
|
119
|
+
)
|
120
|
+
SegmentPage.new(@version, response, @solution)
|
108
121
|
end
|
109
122
|
|
110
123
|
##
|
@@ -134,7 +147,7 @@ module Twilio
|
|
134
147
|
# @param [Hash] payload Payload response from the API
|
135
148
|
# @return [SegmentInstance] SegmentInstance
|
136
149
|
def get_instance(payload)
|
137
|
-
|
150
|
+
SegmentInstance.new(
|
138
151
|
@version,
|
139
152
|
payload,
|
140
153
|
service_sid: @solution[:service_sid],
|
@@ -31,11 +31,11 @@ module Twilio
|
|
31
31
|
# @param [String] identity The identity
|
32
32
|
# @param [String] segment The segment
|
33
33
|
# @return [UserInstance] Newly created UserInstance
|
34
|
-
def create(identity: nil, segment:
|
35
|
-
data = {
|
34
|
+
def create(identity: nil, segment: :unset)
|
35
|
+
data = Twilio::Values.of({
|
36
36
|
'Identity' => identity,
|
37
37
|
'Segment' => segment,
|
38
|
-
}
|
38
|
+
})
|
39
39
|
|
40
40
|
payload = @version.create(
|
41
41
|
'POST',
|
@@ -43,7 +43,7 @@ module Twilio
|
|
43
43
|
data: data
|
44
44
|
)
|
45
45
|
|
46
|
-
|
46
|
+
UserInstance.new(
|
47
47
|
@version,
|
48
48
|
payload,
|
49
49
|
service_sid: @solution[:service_sid],
|
@@ -63,7 +63,7 @@ module Twilio
|
|
63
63
|
# but a limit is defined, stream() will attempt to read the
|
64
64
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
65
65
|
# @return [Array] Array of up to limit results
|
66
|
-
def list(identity:
|
66
|
+
def list(identity: :unset, segment: :unset, limit: nil, page_size: nil)
|
67
67
|
self.stream(
|
68
68
|
identity: identity,
|
69
69
|
segment: segment,
|
@@ -85,7 +85,7 @@ module Twilio
|
|
85
85
|
# but a limit is defined, stream() will attempt to read the
|
86
86
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
87
87
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
88
|
-
def stream(identity:
|
88
|
+
def stream(identity: :unset, segment: :unset, limit: nil, page_size: nil)
|
89
89
|
limits = @version.read_limits(limit, page_size)
|
90
90
|
|
91
91
|
page = self.page(
|
@@ -130,20 +130,33 @@ module Twilio
|
|
130
130
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
131
131
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
132
132
|
# @return [Page] Page of UserInstance
|
133
|
-
def page(identity:
|
134
|
-
params = {
|
133
|
+
def page(identity: :unset, segment: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
134
|
+
params = Twilio::Values.of({
|
135
135
|
'Identity' => identity,
|
136
136
|
'Segment' => segment,
|
137
137
|
'PageToken' => page_token,
|
138
138
|
'Page' => page_number,
|
139
139
|
'PageSize' => page_size,
|
140
|
-
}
|
140
|
+
})
|
141
141
|
response = @version.page(
|
142
142
|
'GET',
|
143
143
|
@uri,
|
144
144
|
params
|
145
145
|
)
|
146
|
-
|
146
|
+
UserPage.new(@version, response, @solution)
|
147
|
+
end
|
148
|
+
|
149
|
+
##
|
150
|
+
# Retrieve a single page of UserInstance records from the API.
|
151
|
+
# Request is executed immediately.
|
152
|
+
# @param [String] target_url API-generated URL for the requested results page
|
153
|
+
# @return [Page] Page of UserInstance
|
154
|
+
def get_page(target_url)
|
155
|
+
response = @version.domain.request(
|
156
|
+
'GET',
|
157
|
+
target_url
|
158
|
+
)
|
159
|
+
UserPage.new(@version, response, @solution)
|
147
160
|
end
|
148
161
|
|
149
162
|
##
|
@@ -173,7 +186,7 @@ module Twilio
|
|
173
186
|
# @param [Hash] payload Payload response from the API
|
174
187
|
# @return [UserInstance] UserInstance
|
175
188
|
def get_instance(payload)
|
176
|
-
|
189
|
+
UserInstance.new(
|
177
190
|
@version,
|
178
191
|
payload,
|
179
192
|
service_sid: @solution[:service_sid],
|
@@ -213,14 +226,14 @@ module Twilio
|
|
213
226
|
# Deletes the UserInstance
|
214
227
|
# @return [Boolean] true if delete succeeds, true otherwise
|
215
228
|
def delete
|
216
|
-
|
229
|
+
@version.delete('delete', @uri)
|
217
230
|
end
|
218
231
|
|
219
232
|
##
|
220
233
|
# Fetch a UserInstance
|
221
234
|
# @return [UserInstance] Fetched UserInstance
|
222
235
|
def fetch
|
223
|
-
params = {}
|
236
|
+
params = Twilio::Values.of({})
|
224
237
|
|
225
238
|
payload = @version.fetch(
|
226
239
|
'GET',
|
@@ -228,7 +241,7 @@ module Twilio
|
|
228
241
|
params,
|
229
242
|
)
|
230
243
|
|
231
|
-
|
244
|
+
UserInstance.new(
|
232
245
|
@version,
|
233
246
|
payload,
|
234
247
|
service_sid: @solution[:service_sid],
|