twilio-api-sdk 1.0.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 +7 -0
- data/LICENSE +28 -0
- data/README.md +213 -0
- data/bin/console +15 -0
- data/lib/twilio_ap_is/api_helper.rb +10 -0
- data/lib/twilio_ap_is/apis/accounts_v1_auth_token_promotion_api.rb +27 -0
- data/lib/twilio_ap_is/apis/accounts_v1_aws_api.rb +137 -0
- data/lib/twilio_ap_is/apis/accounts_v1_bulk_consents_api.rb +41 -0
- data/lib/twilio_ap_is/apis/accounts_v1_bulk_contacts_api.rb +36 -0
- data/lib/twilio_ap_is/apis/accounts_v1_messaging_geopermissions_api.rb +54 -0
- data/lib/twilio_ap_is/apis/accounts_v1_public_key_api.rb +136 -0
- data/lib/twilio_ap_is/apis/accounts_v1_safelist_api.rb +69 -0
- data/lib/twilio_ap_is/apis/accounts_v1_secondary_auth_token_api.rb +39 -0
- data/lib/twilio_ap_is/apis/base_api.rb +67 -0
- data/lib/twilio_ap_is/apis/chat_v3_channel_api.rb +51 -0
- data/lib/twilio_ap_is/apis/conversations_v1_address_configuration_api.rb +218 -0
- data/lib/twilio_ap_is/apis/conversations_v1_binding_api.rb +116 -0
- data/lib/twilio_ap_is/apis/conversations_v1_configuration_api.rb +133 -0
- data/lib/twilio_ap_is/apis/conversations_v1_conversation_api.rb +550 -0
- data/lib/twilio_ap_is/apis/conversations_v1_conversation_with_participants_api.rb +182 -0
- data/lib/twilio_ap_is/apis/conversations_v1_credential_api.rb +189 -0
- data/lib/twilio_ap_is/apis/conversations_v1_delivery_receipt_api.rb +183 -0
- data/lib/twilio_ap_is/apis/conversations_v1_message_api.rb +497 -0
- data/lib/twilio_ap_is/apis/conversations_v1_notification_api.rb +124 -0
- data/lib/twilio_ap_is/apis/conversations_v1_participant_api.rb +546 -0
- data/lib/twilio_ap_is/apis/conversations_v1_participant_conversation_api.rb +99 -0
- data/lib/twilio_ap_is/apis/conversations_v1_role_api.rb +325 -0
- data/lib/twilio_ap_is/apis/conversations_v1_service_api.rb +98 -0
- data/lib/twilio_ap_is/apis/conversations_v1_user_api.rb +364 -0
- data/lib/twilio_ap_is/apis/conversations_v1_user_conversation_api.rb +335 -0
- data/lib/twilio_ap_is/apis/conversations_v1_webhook_api.rb +561 -0
- data/lib/twilio_ap_is/apis/notify_v1_binding_api.rb +186 -0
- data/lib/twilio_ap_is/apis/notify_v1_credential_api.rb +183 -0
- data/lib/twilio_ap_is/apis/notify_v1_notification_api.rb +174 -0
- data/lib/twilio_ap_is/apis/notify_v1_service_api.rb +262 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_activity_api.rb +177 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_event_api.rb +125 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_task_api.rb +310 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_task_channel_api.rb +173 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_task_queue_api.rb +232 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_task_queue_bulk_real_time_statistics_api.rb +36 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_task_queue_cumulative_statistics_api.rb +63 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_task_queue_real_time_statistics_api.rb +41 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_task_queue_statistics_api.rb +63 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_task_queues_statistics_api.rb +72 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_task_reservation_api.rb +396 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_worker_api.rb +232 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_worker_channel_api.rb +126 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_worker_reservation_api.rb +385 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_worker_statistics_api.rb +57 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_workers_cumulative_statistics_api.rb +51 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_workers_real_time_statistics_api.rb +35 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_workers_statistics_api.rb +63 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_workflow_api.rb +213 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_workflow_cumulative_statistics_api.rb +68 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_workflow_real_time_statistics_api.rb +41 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_workflow_statistics_api.rb +67 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_workspace_api.rb +225 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_workspace_cumulative_statistics_api.rb +62 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_workspace_real_time_statistics_api.rb +35 -0
- data/lib/twilio_ap_is/apis/taskrouter_v1_workspace_statistics_api.rb +61 -0
- data/lib/twilio_ap_is/apis/verify_v2_service_api.rb +178 -0
- data/lib/twilio_ap_is/apis/verify_v2_verification_api.rb +143 -0
- data/lib/twilio_ap_is/apis/verify_v2_verification_check_api.rb +61 -0
- data/lib/twilio_ap_is/client.rb +417 -0
- data/lib/twilio_ap_is/configuration.rb +187 -0
- data/lib/twilio_ap_is/exceptions/api_exception.rb +21 -0
- data/lib/twilio_ap_is/exceptions/v2_services_verifications429_error_exception.rb +63 -0
- data/lib/twilio_ap_is/http/api_response.rb +19 -0
- data/lib/twilio_ap_is/http/auth/basic_auth.rb +62 -0
- data/lib/twilio_ap_is/http/http_call_back.rb +10 -0
- data/lib/twilio_ap_is/http/http_method_enum.rb +10 -0
- data/lib/twilio_ap_is/http/http_request.rb +10 -0
- data/lib/twilio_ap_is/http/http_response.rb +10 -0
- data/lib/twilio_ap_is/http/proxy_settings.rb +22 -0
- data/lib/twilio_ap_is/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/twilio_ap_is/logging/sdk_logger.rb +17 -0
- data/lib/twilio_ap_is/models/access_token.rb +188 -0
- data/lib/twilio_ap_is/models/access_token_enum_factor_types.rb +26 -0
- data/lib/twilio_ap_is/models/activity.rb +189 -0
- data/lib/twilio_ap_is/models/auth_token_promotion.rb +142 -0
- data/lib/twilio_ap_is/models/base_model.rb +110 -0
- data/lib/twilio_ap_is/models/binding.rb +269 -0
- data/lib/twilio_ap_is/models/binding_binding_type.rb +53 -0
- data/lib/twilio_ap_is/models/bucket.rb +186 -0
- data/lib/twilio_ap_is/models/bulk_consents.rb +83 -0
- data/lib/twilio_ap_is/models/bulk_contacts.rb +83 -0
- data/lib/twilio_ap_is/models/challenge.rb +317 -0
- data/lib/twilio_ap_is/models/challenge_enum_challenge_reasons.rb +41 -0
- data/lib/twilio_ap_is/models/challenge_enum_challenge_statuses.rb +45 -0
- data/lib/twilio_ap_is/models/challenge_enum_factor_types.rb +41 -0
- data/lib/twilio_ap_is/models/channel.rb +249 -0
- data/lib/twilio_ap_is/models/channel_channel_type.rb +36 -0
- data/lib/twilio_ap_is/models/channel_webhook_enabled_type.rb +36 -0
- data/lib/twilio_ap_is/models/configuration.rb +164 -0
- data/lib/twilio_ap_is/models/configuration_address.rb +199 -0
- data/lib/twilio_ap_is/models/configuration_address_auto_creation_type.rb +40 -0
- data/lib/twilio_ap_is/models/configuration_address_method.rb +36 -0
- data/lib/twilio_ap_is/models/configuration_address_type.rb +60 -0
- data/lib/twilio_ap_is/models/configuration_webhook.rb +154 -0
- data/lib/twilio_ap_is/models/configuration_webhook_method.rb +46 -0
- data/lib/twilio_ap_is/models/configuration_webhook_target.rb +37 -0
- data/lib/twilio_ap_is/models/conversation.rb +264 -0
- data/lib/twilio_ap_is/models/conversation_message.rb +268 -0
- data/lib/twilio_ap_is/models/conversation_message_order_type.rb +36 -0
- data/lib/twilio_ap_is/models/conversation_message_receipt.rb +219 -0
- data/lib/twilio_ap_is/models/conversation_message_receipt_delivery_status.rb +49 -0
- data/lib/twilio_ap_is/models/conversation_participant.rb +240 -0
- data/lib/twilio_ap_is/models/conversation_scoped_webhook.rb +178 -0
- data/lib/twilio_ap_is/models/conversation_scoped_webhook_method.rb +36 -0
- data/lib/twilio_ap_is/models/conversation_scoped_webhook_target.rb +40 -0
- data/lib/twilio_ap_is/models/conversation_state.rb +45 -0
- data/lib/twilio_ap_is/models/conversation_webhook_method.rb +36 -0
- data/lib/twilio_ap_is/models/conversation_webhook_target.rb +37 -0
- data/lib/twilio_ap_is/models/conversation_with_participants.rb +264 -0
- data/lib/twilio_ap_is/models/conversation_with_participants_state.rb +45 -0
- data/lib/twilio_ap_is/models/credential.rb +175 -0
- data/lib/twilio_ap_is/models/credential1.rb +174 -0
- data/lib/twilio_ap_is/models/credential_aws.rb +153 -0
- data/lib/twilio_ap_is/models/credential_public_key.rb +153 -0
- data/lib/twilio_ap_is/models/credential_push_type.rb +41 -0
- data/lib/twilio_ap_is/models/entity.rb +177 -0
- data/lib/twilio_ap_is/models/event.rb +270 -0
- data/lib/twilio_ap_is/models/factor.rb +235 -0
- data/lib/twilio_ap_is/models/factor_enum_factor_statuses.rb +36 -0
- data/lib/twilio_ap_is/models/factor_enum_factor_type.rb +40 -0
- data/lib/twilio_ap_is/models/factor_enum_notification_platforms.rb +40 -0
- data/lib/twilio_ap_is/models/factor_enum_totp_algorithms.rb +40 -0
- data/lib/twilio_ap_is/models/form_enum_form_types.rb +26 -0
- data/lib/twilio_ap_is/models/list_activity_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_binding_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_configuration_address_response.rb +95 -0
- data/lib/twilio_ap_is/models/list_conversation_message_receipt_response.rb +95 -0
- data/lib/twilio_ap_is/models/list_conversation_message_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_conversation_participant_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_conversation_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_conversation_scoped_webhook_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_credential_aws_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_credential_public_key_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_credential_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_event_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_participant_conversation_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_role_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_service_binding_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_service_conversation_message_receipt_response.rb +95 -0
- data/lib/twilio_ap_is/models/list_service_conversation_message_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_service_conversation_participant_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_service_conversation_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_service_conversation_scoped_webhook_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_service_participant_conversation_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_service_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_service_role_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_service_user_conversation_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_service_user_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_task_channel_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_task_queue_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_task_queues_statistics_response.rb +95 -0
- data/lib/twilio_ap_is/models/list_task_reservation_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_task_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_user_conversation_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_user_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_worker_channel_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_worker_reservation_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_worker_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_workflow_response.rb +94 -0
- data/lib/twilio_ap_is/models/list_workspace_response.rb +94 -0
- data/lib/twilio_ap_is/models/messaging_configuration.rb +170 -0
- data/lib/twilio_ap_is/models/meta.rb +140 -0
- data/lib/twilio_ap_is/models/msg_geopermissions.rb +86 -0
- data/lib/twilio_ap_is/models/new_factor.rb +277 -0
- data/lib/twilio_ap_is/models/new_factor_enum_factor_statuses.rb +36 -0
- data/lib/twilio_ap_is/models/new_factor_enum_factor_types.rb +40 -0
- data/lib/twilio_ap_is/models/new_factor_enum_notification_platforms.rb +40 -0
- data/lib/twilio_ap_is/models/new_factor_enum_totp_algorithms.rb +40 -0
- data/lib/twilio_ap_is/models/notif_priority.rb +43 -0
- data/lib/twilio_ap_is/models/notification.rb +363 -0
- data/lib/twilio_ap_is/models/notification1.rb +181 -0
- data/lib/twilio_ap_is/models/participant_conversation.rb +325 -0
- data/lib/twilio_ap_is/models/participant_conversation_state.rb +41 -0
- data/lib/twilio_ap_is/models/rate_limit.rb +189 -0
- data/lib/twilio_ap_is/models/role.rb +192 -0
- data/lib/twilio_ap_is/models/role_role_type.rb +40 -0
- data/lib/twilio_ap_is/models/safelist.rb +88 -0
- data/lib/twilio_ap_is/models/safelist1.rb +99 -0
- data/lib/twilio_ap_is/models/secondary_auth_token.rb +145 -0
- data/lib/twilio_ap_is/models/service.rb +164 -0
- data/lib/twilio_ap_is/models/service1.rb +380 -0
- data/lib/twilio_ap_is/models/service2.rb +350 -0
- data/lib/twilio_ap_is/models/service_binding.rb +226 -0
- data/lib/twilio_ap_is/models/service_binding_binding_type.rb +47 -0
- data/lib/twilio_ap_is/models/service_configuration.rb +180 -0
- data/lib/twilio_ap_is/models/service_conversation.rb +264 -0
- data/lib/twilio_ap_is/models/service_conversation_message.rb +282 -0
- data/lib/twilio_ap_is/models/service_conversation_message_order_type.rb +36 -0
- data/lib/twilio_ap_is/models/service_conversation_message_receipt.rb +233 -0
- data/lib/twilio_ap_is/models/service_conversation_message_receipt_delivery_status.rb +49 -0
- data/lib/twilio_ap_is/models/service_conversation_participant.rb +256 -0
- data/lib/twilio_ap_is/models/service_conversation_scoped_webhook.rb +191 -0
- data/lib/twilio_ap_is/models/service_conversation_scoped_webhook_method.rb +36 -0
- data/lib/twilio_ap_is/models/service_conversation_scoped_webhook_target.rb +40 -0
- data/lib/twilio_ap_is/models/service_conversation_state.rb +45 -0
- data/lib/twilio_ap_is/models/service_conversation_with_participants.rb +264 -0
- data/lib/twilio_ap_is/models/service_conversation_with_participants_state.rb +45 -0
- data/lib/twilio_ap_is/models/service_notification.rb +155 -0
- data/lib/twilio_ap_is/models/service_participant_conversation.rb +325 -0
- data/lib/twilio_ap_is/models/service_participant_conversation_state.rb +41 -0
- data/lib/twilio_ap_is/models/service_role.rb +192 -0
- data/lib/twilio_ap_is/models/service_role_role_type.rb +40 -0
- data/lib/twilio_ap_is/models/service_stats_conversations_rate_limiting_errors_source.rb +36 -0
- data/lib/twilio_ap_is/models/service_user.rb +250 -0
- data/lib/twilio_ap_is/models/service_user_conversation.rb +317 -0
- data/lib/twilio_ap_is/models/service_user_conversation_notification_level.rb +37 -0
- data/lib/twilio_ap_is/models/service_user_conversation_state.rb +41 -0
- data/lib/twilio_ap_is/models/service_webhook_configuration.rb +160 -0
- data/lib/twilio_ap_is/models/service_webhook_configuration_method.rb +37 -0
- data/lib/twilio_ap_is/models/stats_twilsock_rate_limiting_errors_source.rb +26 -0
- data/lib/twilio_ap_is/models/task_channel.rb +204 -0
- data/lib/twilio_ap_is/models/task_queue.rb +278 -0
- data/lib/twilio_ap_is/models/task_queue_bulk_real_time_statistics.rb +141 -0
- data/lib/twilio_ap_is/models/task_queue_cumulative.rb +356 -0
- data/lib/twilio_ap_is/models/task_queue_real_time_statistics.rb +250 -0
- data/lib/twilio_ap_is/models/task_queue_statistics.rb +135 -0
- data/lib/twilio_ap_is/models/task_queue_task_order.rb +40 -0
- data/lib/twilio_ap_is/models/task_queues_stats.rb +124 -0
- data/lib/twilio_ap_is/models/task_reservation.rb +210 -0
- data/lib/twilio_ap_is/models/task_reservation_call_status.rb +44 -0
- data/lib/twilio_ap_is/models/task_reservation_conference_event.rb +56 -0
- data/lib/twilio_ap_is/models/task_reservation_status.rb +61 -0
- data/lib/twilio_ap_is/models/task_reservation_supervisor_mode.rb +40 -0
- data/lib/twilio_ap_is/models/task_router_task.rb +394 -0
- data/lib/twilio_ap_is/models/task_status.rb +53 -0
- data/lib/twilio_ap_is/models/user.rb +250 -0
- data/lib/twilio_ap_is/models/user_binding_binding_type.rb +52 -0
- data/lib/twilio_ap_is/models/user_conversation.rb +317 -0
- data/lib/twilio_ap_is/models/user_conversation_notification_level.rb +37 -0
- data/lib/twilio_ap_is/models/user_conversation_state.rb +41 -0
- data/lib/twilio_ap_is/models/v2_form.rb +112 -0
- data/lib/twilio_ap_is/models/verification.rb +262 -0
- data/lib/twilio_ap_is/models/verification_attempt.rb +219 -0
- data/lib/twilio_ap_is/models/verification_attempt_enum_attempt_status.rb +40 -0
- data/lib/twilio_ap_is/models/verification_attempt_enum_call_status.rb +60 -0
- data/lib/twilio_ap_is/models/verification_attempt_enum_channels.rb +49 -0
- data/lib/twilio_ap_is/models/verification_attempt_enum_conversion_status.rb +38 -0
- data/lib/twilio_ap_is/models/verification_attempt_enum_message_status.rb +80 -0
- data/lib/twilio_ap_is/models/verification_attempts.rb +129 -0
- data/lib/twilio_ap_is/models/verification_attempts_summary_enum_channels.rb +48 -0
- data/lib/twilio_ap_is/models/verification_check.rb +231 -0
- data/lib/twilio_ap_is/models/verification_check_enum_channel.rb +50 -0
- data/lib/twilio_ap_is/models/verification_enum_channel.rb +50 -0
- data/lib/twilio_ap_is/models/verification_enum_risk_check.rb +39 -0
- data/lib/twilio_ap_is/models/verification_enum_status.rb +37 -0
- data/lib/twilio_ap_is/models/verification_template.rb +126 -0
- data/lib/twilio_ap_is/models/webhook.rb +222 -0
- data/lib/twilio_ap_is/models/webhook_enum_status.rb +37 -0
- data/lib/twilio_ap_is/models/webhook_enum_version.rb +37 -0
- data/lib/twilio_ap_is/models/worker.rb +247 -0
- data/lib/twilio_ap_is/models/worker_channel.rb +244 -0
- data/lib/twilio_ap_is/models/worker_instance_statistics.rb +122 -0
- data/lib/twilio_ap_is/models/worker_reservation.rb +210 -0
- data/lib/twilio_ap_is/models/worker_reservation_call_status.rb +44 -0
- data/lib/twilio_ap_is/models/worker_reservation_conference_event.rb +56 -0
- data/lib/twilio_ap_is/models/worker_reservation_status.rb +61 -0
- data/lib/twilio_ap_is/models/worker_statistics.rb +122 -0
- data/lib/twilio_ap_is/models/workers_cumulative_statistics.rb +221 -0
- data/lib/twilio_ap_is/models/workers_real_time_statistics.rb +124 -0
- data/lib/twilio_ap_is/models/workflow.rb +247 -0
- data/lib/twilio_ap_is/models/workflow_cumulative_statistics.rb +347 -0
- data/lib/twilio_ap_is/models/workflow_real_time_statistics.rb +173 -0
- data/lib/twilio_ap_is/models/workflow_statistics.rb +135 -0
- data/lib/twilio_ap_is/models/workspace.rb +285 -0
- data/lib/twilio_ap_is/models/workspace_cumulative_statistics.rb +334 -0
- data/lib/twilio_ap_is/models/workspace_queue_order.rb +40 -0
- data/lib/twilio_ap_is/models/workspace_real_time_statistics.rb +185 -0
- data/lib/twilio_ap_is/models/workspace_statistics.rb +122 -0
- data/lib/twilio_ap_is/utilities/date_time_helper.rb +11 -0
- data/lib/twilio_ap_is/utilities/file_wrapper.rb +28 -0
- data/lib/twilio_ap_is.rb +326 -0
- metadata +361 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# twilio_ap_is
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module TwilioApIs
|
|
7
|
+
# NotifyV1BindingApi
|
|
8
|
+
class NotifyV1BindingApi < BaseApi
|
|
9
|
+
# TODO: type endpoint description here
|
|
10
|
+
# @param [String] service_sid Required parameter: The SID of the
|
|
11
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource) to
|
|
12
|
+
# fetch the resource from.
|
|
13
|
+
# @param [String] sid Required parameter: The Twilio-provided string that
|
|
14
|
+
# uniquely identifies the Binding resource to fetch.
|
|
15
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
16
|
+
def fetch_binding(service_sid,
|
|
17
|
+
sid)
|
|
18
|
+
@api_call
|
|
19
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
20
|
+
'/v1/Services/{ServiceSid}/Bindings/{Sid}',
|
|
21
|
+
Server::DEFAULT3)
|
|
22
|
+
.template_param(new_parameter(service_sid, key: 'ServiceSid')
|
|
23
|
+
.is_required(true)
|
|
24
|
+
.should_encode(true))
|
|
25
|
+
.template_param(new_parameter(sid, key: 'Sid')
|
|
26
|
+
.is_required(true)
|
|
27
|
+
.should_encode(true))
|
|
28
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
29
|
+
.auth(Single.new('accountSid_authToken')))
|
|
30
|
+
.response(new_response_handler
|
|
31
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
32
|
+
.deserialize_into(Binding.method(:from_hash))
|
|
33
|
+
.is_api_response(true))
|
|
34
|
+
.execute
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# TODO: type endpoint description here
|
|
38
|
+
# @param [String] service_sid Required parameter: The SID of the
|
|
39
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource) to
|
|
40
|
+
# delete the resource from.
|
|
41
|
+
# @param [String] sid Required parameter: The Twilio-provided string that
|
|
42
|
+
# uniquely identifies the Binding resource to delete.
|
|
43
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
44
|
+
def delete_binding(service_sid,
|
|
45
|
+
sid)
|
|
46
|
+
@api_call
|
|
47
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
48
|
+
'/v1/Services/{ServiceSid}/Bindings/{Sid}',
|
|
49
|
+
Server::DEFAULT3)
|
|
50
|
+
.template_param(new_parameter(service_sid, key: 'ServiceSid')
|
|
51
|
+
.is_required(true)
|
|
52
|
+
.should_encode(true))
|
|
53
|
+
.template_param(new_parameter(sid, key: 'Sid')
|
|
54
|
+
.is_required(true)
|
|
55
|
+
.should_encode(true))
|
|
56
|
+
.auth(Single.new('accountSid_authToken')))
|
|
57
|
+
.response(new_response_handler
|
|
58
|
+
.is_response_void(true)
|
|
59
|
+
.is_api_response(true))
|
|
60
|
+
.execute
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# TODO: type endpoint description here
|
|
64
|
+
# @param [String] service_sid Required parameter: The SID of the
|
|
65
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource) to
|
|
66
|
+
# create the resource under.
|
|
67
|
+
# @param [String] identity Required parameter: The `identity` value that
|
|
68
|
+
# uniquely identifies the new resource's
|
|
69
|
+
# [User](https://www.twilio.com/docs/chat/rest/user-resource) within the
|
|
70
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource). Up to
|
|
71
|
+
# 20 Bindings can be created for the same Identity in a given Service.
|
|
72
|
+
# @param [BindingBindingType] binding_type Required parameter: The transport
|
|
73
|
+
# technology to use for the Binding. Can be: `apn`, `fcm`, `gcm`, `sms`, or
|
|
74
|
+
# `facebook-messenger`.
|
|
75
|
+
# @param [String] address Required parameter: The channel-specific address.
|
|
76
|
+
# For APNS, the device token. For FCM and GCM, the registration token. For
|
|
77
|
+
# SMS, a phone number in E.164 format. For Facebook Messenger, the Messenger
|
|
78
|
+
# ID of the user or a phone number in E.164 format.
|
|
79
|
+
# @param [Array[String]] tag Optional parameter: A tag that can be used to
|
|
80
|
+
# select the Bindings to notify. Repeat this parameter to specify more than
|
|
81
|
+
# one tag, up to a total of 20 tags.
|
|
82
|
+
# @param [String] notification_protocol_version Optional parameter: The
|
|
83
|
+
# protocol version to use to send the notification. This defaults to the
|
|
84
|
+
# value of `default_xxxx_notification_protocol_version` for the protocol in
|
|
85
|
+
# the [Service](https://www.twilio.com/docs/notify/api/service-resource).
|
|
86
|
+
# The current version is `"3"` for `apn`, `fcm`, and `gcm` type Bindings.
|
|
87
|
+
# The parameter is not applicable to `sms` and `facebook-messenger` type
|
|
88
|
+
# Bindings as the data format is fixed.
|
|
89
|
+
# @param [String] credential_sid Optional parameter: The SID of the
|
|
90
|
+
# [Credential](https://www.twilio.com/docs/notify/api/credential-resource)
|
|
91
|
+
# resource to be used to send notifications to this Binding. If present,
|
|
92
|
+
# this overrides the Credential specified in the Service resource. Applies
|
|
93
|
+
# to only `apn`, `fcm`, and `gcm` type Bindings.
|
|
94
|
+
# @param [String] endpoint Optional parameter: Deprecated.
|
|
95
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
96
|
+
def create_binding(service_sid,
|
|
97
|
+
identity,
|
|
98
|
+
binding_type,
|
|
99
|
+
address,
|
|
100
|
+
tag: nil,
|
|
101
|
+
notification_protocol_version: nil,
|
|
102
|
+
credential_sid: nil,
|
|
103
|
+
endpoint: nil)
|
|
104
|
+
@api_call
|
|
105
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
106
|
+
'/v1/Services/{ServiceSid}/Bindings',
|
|
107
|
+
Server::DEFAULT3)
|
|
108
|
+
.template_param(new_parameter(service_sid, key: 'ServiceSid')
|
|
109
|
+
.is_required(true)
|
|
110
|
+
.should_encode(true))
|
|
111
|
+
.form_param(new_parameter(identity, key: 'Identity')
|
|
112
|
+
.is_required(true))
|
|
113
|
+
.form_param(new_parameter(binding_type, key: 'BindingType')
|
|
114
|
+
.is_required(true))
|
|
115
|
+
.form_param(new_parameter(address, key: 'Address')
|
|
116
|
+
.is_required(true))
|
|
117
|
+
.form_param(new_parameter(tag, key: 'Tag'))
|
|
118
|
+
.form_param(new_parameter(notification_protocol_version, key: 'NotificationProtocolVersion'))
|
|
119
|
+
.form_param(new_parameter(credential_sid, key: 'CredentialSid'))
|
|
120
|
+
.form_param(new_parameter(endpoint, key: 'Endpoint'))
|
|
121
|
+
.header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type'))
|
|
122
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
123
|
+
.auth(Single.new('accountSid_authToken')))
|
|
124
|
+
.response(new_response_handler
|
|
125
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
126
|
+
.deserialize_into(Binding.method(:from_hash))
|
|
127
|
+
.is_api_response(true))
|
|
128
|
+
.execute
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# TODO: type endpoint description here
|
|
132
|
+
# @param [String] service_sid Required parameter: The SID of the
|
|
133
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource) to read
|
|
134
|
+
# the resource from.
|
|
135
|
+
# @param [Date] start_date Optional parameter: Only include usage that has
|
|
136
|
+
# occurred on or after this date. Specify the date in GMT and format as
|
|
137
|
+
# `YYYY-MM-DD`.
|
|
138
|
+
# @param [Date] end_date Optional parameter: Only include usage that
|
|
139
|
+
# occurred on or before this date. Specify the date in GMT and format as
|
|
140
|
+
# `YYYY-MM-DD`.
|
|
141
|
+
# @param [Array[String]] identity Optional parameter: The
|
|
142
|
+
# [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity`
|
|
143
|
+
# value of the resources to read.
|
|
144
|
+
# @param [Array[String]] tag Optional parameter: Only list Bindings that
|
|
145
|
+
# have all of the specified Tags. The following implicit tags are available:
|
|
146
|
+
# `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are
|
|
147
|
+
# allowed.
|
|
148
|
+
# @param [Integer] page_size Optional parameter: How many resources to
|
|
149
|
+
# return in each list page. The default is 50, and the maximum is 1000.
|
|
150
|
+
# @param [Integer] page Optional parameter: The page index. This value is
|
|
151
|
+
# simply for client state.
|
|
152
|
+
# @param [String] page_token Optional parameter: The page token. This is
|
|
153
|
+
# provided by the API.
|
|
154
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
155
|
+
def list_binding(service_sid,
|
|
156
|
+
start_date: nil,
|
|
157
|
+
end_date: nil,
|
|
158
|
+
identity: nil,
|
|
159
|
+
tag: nil,
|
|
160
|
+
page_size: nil,
|
|
161
|
+
page: nil,
|
|
162
|
+
page_token: nil)
|
|
163
|
+
@api_call
|
|
164
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
165
|
+
'/v1/Services/{ServiceSid}/Bindings',
|
|
166
|
+
Server::DEFAULT3)
|
|
167
|
+
.template_param(new_parameter(service_sid, key: 'ServiceSid')
|
|
168
|
+
.is_required(true)
|
|
169
|
+
.should_encode(true))
|
|
170
|
+
.query_param(new_parameter(start_date, key: 'StartDate'))
|
|
171
|
+
.query_param(new_parameter(end_date, key: 'EndDate'))
|
|
172
|
+
.query_param(new_parameter(identity, key: 'Identity'))
|
|
173
|
+
.query_param(new_parameter(tag, key: 'Tag'))
|
|
174
|
+
.query_param(new_parameter(page_size, key: 'PageSize'))
|
|
175
|
+
.query_param(new_parameter(page, key: 'Page'))
|
|
176
|
+
.query_param(new_parameter(page_token, key: 'PageToken'))
|
|
177
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
178
|
+
.auth(Single.new('accountSid_authToken')))
|
|
179
|
+
.response(new_response_handler
|
|
180
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
181
|
+
.deserialize_into(ListBindingResponse.method(:from_hash))
|
|
182
|
+
.is_api_response(true))
|
|
183
|
+
.execute
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
end
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# twilio_ap_is
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module TwilioApIs
|
|
7
|
+
# NotifyV1CredentialApi
|
|
8
|
+
class NotifyV1CredentialApi < BaseApi
|
|
9
|
+
# TODO: type endpoint description here
|
|
10
|
+
# @param [Integer] page_size Optional parameter: How many resources to
|
|
11
|
+
# return in each list page. The default is 50, and the maximum is 1000.
|
|
12
|
+
# @param [Integer] page Optional parameter: The page index. This value is
|
|
13
|
+
# simply for client state.
|
|
14
|
+
# @param [String] page_token Optional parameter: The page token. This is
|
|
15
|
+
# provided by the API.
|
|
16
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
17
|
+
def list_credential(page_size: nil,
|
|
18
|
+
page: nil,
|
|
19
|
+
page_token: nil)
|
|
20
|
+
@api_call
|
|
21
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
22
|
+
'/v1/Credentials',
|
|
23
|
+
Server::DEFAULT3)
|
|
24
|
+
.query_param(new_parameter(page_size, key: 'PageSize'))
|
|
25
|
+
.query_param(new_parameter(page, key: 'Page'))
|
|
26
|
+
.query_param(new_parameter(page_token, key: 'PageToken'))
|
|
27
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
28
|
+
.auth(Single.new('accountSid_authToken')))
|
|
29
|
+
.response(new_response_handler
|
|
30
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
31
|
+
.deserialize_into(ListCredentialResponse.method(:from_hash))
|
|
32
|
+
.is_api_response(true))
|
|
33
|
+
.execute
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# TODO: type endpoint description here
|
|
37
|
+
# @param [CredentialPushType] type Required parameter: The Credential type.
|
|
38
|
+
# Can be: `gcm`, `fcm`, or `apn`.
|
|
39
|
+
# @param [String] friendly_name Optional parameter: A descriptive string
|
|
40
|
+
# that you create to describe the resource. It can be up to 64 characters
|
|
41
|
+
# long.
|
|
42
|
+
# @param [String] certificate Optional parameter: [APN only] The URL-encoded
|
|
43
|
+
# representation of the certificate. Strip everything outside of the
|
|
44
|
+
# headers, e.g. `-----BEGIN
|
|
45
|
+
# CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCz
|
|
46
|
+
# AJBgNV.....A==-----END CERTIFICATE-----`
|
|
47
|
+
# @param [String] private_key Optional parameter: [APN only] The URL-encoded
|
|
48
|
+
# representation of the private key. Strip everything outside of the
|
|
49
|
+
# headers, e.g. `-----BEGIN RSA PRIVATE
|
|
50
|
+
# KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\n
|
|
51
|
+
# .-----END RSA PRIVATE KEY-----`
|
|
52
|
+
# @param [TrueClass | FalseClass] sandbox Optional parameter: [APN only]
|
|
53
|
+
# Whether to send the credential to sandbox APNs. Can be `true` to send to
|
|
54
|
+
# sandbox APNs or `false` to send to production.
|
|
55
|
+
# @param [String] api_key Optional parameter: [GCM only] The `Server key` of
|
|
56
|
+
# your project from Firebase console under Settings / Cloud messaging.
|
|
57
|
+
# @param [String] secret Optional parameter: [FCM only] The `Server key` of
|
|
58
|
+
# your project from Firebase console under Settings / Cloud messaging.
|
|
59
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
60
|
+
def create_credential(type,
|
|
61
|
+
friendly_name: nil,
|
|
62
|
+
certificate: nil,
|
|
63
|
+
private_key: nil,
|
|
64
|
+
sandbox: nil,
|
|
65
|
+
api_key: nil,
|
|
66
|
+
secret: nil)
|
|
67
|
+
@api_call
|
|
68
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
69
|
+
'/v1/Credentials',
|
|
70
|
+
Server::DEFAULT3)
|
|
71
|
+
.form_param(new_parameter(type, key: 'Type')
|
|
72
|
+
.is_required(true))
|
|
73
|
+
.form_param(new_parameter(friendly_name, key: 'FriendlyName'))
|
|
74
|
+
.form_param(new_parameter(certificate, key: 'Certificate'))
|
|
75
|
+
.form_param(new_parameter(private_key, key: 'PrivateKey'))
|
|
76
|
+
.form_param(new_parameter(sandbox, key: 'Sandbox'))
|
|
77
|
+
.form_param(new_parameter(api_key, key: 'ApiKey'))
|
|
78
|
+
.form_param(new_parameter(secret, key: 'Secret'))
|
|
79
|
+
.header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type'))
|
|
80
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
81
|
+
.auth(Single.new('accountSid_authToken')))
|
|
82
|
+
.response(new_response_handler
|
|
83
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
84
|
+
.deserialize_into(Credential1.method(:from_hash))
|
|
85
|
+
.is_api_response(true))
|
|
86
|
+
.execute
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# TODO: type endpoint description here
|
|
90
|
+
# @param [String] sid Required parameter: The Twilio-provided string that
|
|
91
|
+
# uniquely identifies the Credential resource to fetch.
|
|
92
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
93
|
+
def fetch_credential(sid)
|
|
94
|
+
@api_call
|
|
95
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
96
|
+
'/v1/Credentials/{Sid}',
|
|
97
|
+
Server::DEFAULT3)
|
|
98
|
+
.template_param(new_parameter(sid, key: 'Sid')
|
|
99
|
+
.is_required(true)
|
|
100
|
+
.should_encode(true))
|
|
101
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
102
|
+
.auth(Single.new('accountSid_authToken')))
|
|
103
|
+
.response(new_response_handler
|
|
104
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
105
|
+
.deserialize_into(Credential1.method(:from_hash))
|
|
106
|
+
.is_api_response(true))
|
|
107
|
+
.execute
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# TODO: type endpoint description here
|
|
111
|
+
# @param [String] sid Required parameter: The Twilio-provided string that
|
|
112
|
+
# uniquely identifies the Credential resource to update.
|
|
113
|
+
# @param [String] friendly_name Optional parameter: A descriptive string
|
|
114
|
+
# that you create to describe the resource. It can be up to 64 characters
|
|
115
|
+
# long.
|
|
116
|
+
# @param [String] certificate Optional parameter: [APN only] The URL-encoded
|
|
117
|
+
# representation of the certificate. Strip everything outside of the
|
|
118
|
+
# headers, e.g. `-----BEGIN
|
|
119
|
+
# CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCz
|
|
120
|
+
# AJBgNV.....A==-----END CERTIFICATE-----`
|
|
121
|
+
# @param [String] private_key Optional parameter: [APN only] The URL-encoded
|
|
122
|
+
# representation of the private key. Strip everything outside of the
|
|
123
|
+
# headers, e.g. `-----BEGIN RSA PRIVATE
|
|
124
|
+
# KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\n
|
|
125
|
+
# .-----END RSA PRIVATE KEY-----`
|
|
126
|
+
# @param [TrueClass | FalseClass] sandbox Optional parameter: [APN only]
|
|
127
|
+
# Whether to send the credential to sandbox APNs. Can be `true` to send to
|
|
128
|
+
# sandbox APNs or `false` to send to production.
|
|
129
|
+
# @param [String] api_key Optional parameter: [GCM only] The `Server key` of
|
|
130
|
+
# your project from Firebase console under Settings / Cloud messaging.
|
|
131
|
+
# @param [String] secret Optional parameter: [FCM only] The `Server key` of
|
|
132
|
+
# your project from Firebase console under Settings / Cloud messaging.
|
|
133
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
134
|
+
def update_credential(sid,
|
|
135
|
+
friendly_name: nil,
|
|
136
|
+
certificate: nil,
|
|
137
|
+
private_key: nil,
|
|
138
|
+
sandbox: nil,
|
|
139
|
+
api_key: nil,
|
|
140
|
+
secret: nil)
|
|
141
|
+
@api_call
|
|
142
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
143
|
+
'/v1/Credentials/{Sid}',
|
|
144
|
+
Server::DEFAULT3)
|
|
145
|
+
.template_param(new_parameter(sid, key: 'Sid')
|
|
146
|
+
.is_required(true)
|
|
147
|
+
.should_encode(true))
|
|
148
|
+
.form_param(new_parameter(friendly_name, key: 'FriendlyName'))
|
|
149
|
+
.form_param(new_parameter(certificate, key: 'Certificate'))
|
|
150
|
+
.form_param(new_parameter(private_key, key: 'PrivateKey'))
|
|
151
|
+
.form_param(new_parameter(sandbox, key: 'Sandbox'))
|
|
152
|
+
.form_param(new_parameter(api_key, key: 'ApiKey'))
|
|
153
|
+
.form_param(new_parameter(secret, key: 'Secret'))
|
|
154
|
+
.header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type'))
|
|
155
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
156
|
+
.auth(Single.new('accountSid_authToken')))
|
|
157
|
+
.response(new_response_handler
|
|
158
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
159
|
+
.deserialize_into(Credential1.method(:from_hash))
|
|
160
|
+
.is_api_response(true))
|
|
161
|
+
.execute
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# TODO: type endpoint description here
|
|
165
|
+
# @param [String] sid Required parameter: The Twilio-provided string that
|
|
166
|
+
# uniquely identifies the Credential resource to delete.
|
|
167
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
168
|
+
def delete_credential(sid)
|
|
169
|
+
@api_call
|
|
170
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
171
|
+
'/v1/Credentials/{Sid}',
|
|
172
|
+
Server::DEFAULT3)
|
|
173
|
+
.template_param(new_parameter(sid, key: 'Sid')
|
|
174
|
+
.is_required(true)
|
|
175
|
+
.should_encode(true))
|
|
176
|
+
.auth(Single.new('accountSid_authToken')))
|
|
177
|
+
.response(new_response_handler
|
|
178
|
+
.is_response_void(true)
|
|
179
|
+
.is_api_response(true))
|
|
180
|
+
.execute
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# twilio_ap_is
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module TwilioApIs
|
|
7
|
+
# NotifyV1NotificationApi
|
|
8
|
+
class NotifyV1NotificationApi < BaseApi
|
|
9
|
+
# TODO: type endpoint description here
|
|
10
|
+
# @param [String] service_sid Required parameter: The SID of the
|
|
11
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource) to
|
|
12
|
+
# create the resource under.
|
|
13
|
+
# @param [String] body Optional parameter: The notification text. For FCM
|
|
14
|
+
# and GCM, translates to `data.twi_body`. For APNS, translates to
|
|
15
|
+
# `aps.alert.body`. For SMS, translates to `body`. SMS requires either this
|
|
16
|
+
# `body` value, or `media_urls` attribute defined in the `sms` parameter of
|
|
17
|
+
# the notification.
|
|
18
|
+
# @param [NotifPriority] priority Optional parameter: The priority of the
|
|
19
|
+
# notification. Can be: `low` or `high` and the default is `high`. A value
|
|
20
|
+
# of `low` optimizes the client app's battery consumption; however,
|
|
21
|
+
# notifications may be delivered with unspecified delay. For FCM and GCM,
|
|
22
|
+
# `low` priority is the same as `Normal` priority. For APNS `low` priority
|
|
23
|
+
# is the same as `5`. A value of `high` sends the notification immediately,
|
|
24
|
+
# and can wake up a sleeping device. For FCM and GCM, `high` is the same as
|
|
25
|
+
# `High` priority. For APNS, `high` is a priority `10`. SMS does not support
|
|
26
|
+
# this property.
|
|
27
|
+
# @param [Integer] ttl Optional parameter: How long, in seconds, the
|
|
28
|
+
# notification is valid. Can be an integer between 0 and 2,419,200, which is
|
|
29
|
+
# 4 weeks, the default and the maximum supported time to live (TTL).
|
|
30
|
+
# Delivery should be attempted if the device is offline until the TTL
|
|
31
|
+
# elapses. Zero means that the notification delivery is attempted
|
|
32
|
+
# immediately, only once, and is not stored for future delivery. SMS does
|
|
33
|
+
# not support this property.
|
|
34
|
+
# @param [String] title Optional parameter: The notification title. For FCM
|
|
35
|
+
# and GCM, this translates to the `data.twi_title` value. For APNS, this
|
|
36
|
+
# translates to the `aps.alert.title` value. SMS does not support this
|
|
37
|
+
# property. This field is not visible on iOS phones and tablets but appears
|
|
38
|
+
# on Apple Watch and Android devices.
|
|
39
|
+
# @param [String] sound Optional parameter: The name of the sound to be
|
|
40
|
+
# played for the notification. For FCM and GCM, this Translates to
|
|
41
|
+
# `data.twi_sound`. For APNS, this translates to `aps.sound`. SMS does not
|
|
42
|
+
# support this property.
|
|
43
|
+
# @param [String] action Optional parameter: The actions to display for the
|
|
44
|
+
# notification. For APNS, translates to the `aps.category` value. For GCM,
|
|
45
|
+
# translates to the `data.twi_action` value. For SMS, this parameter is not
|
|
46
|
+
# supported and is omitted from deliveries to those channels.
|
|
47
|
+
# @param [Object] data Optional parameter: The custom key-value pairs of the
|
|
48
|
+
# notification's payload. For FCM and GCM, this value translates to `data`
|
|
49
|
+
# in the FCM and GCM payloads. FCM and GCM [reserve certain
|
|
50
|
+
# keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref)
|
|
51
|
+
# that cannot be used in those channels. For APNS, attributes of `data` are
|
|
52
|
+
# inserted into the APNS payload as custom properties outside of the `aps`
|
|
53
|
+
# dictionary. In all channels, we reserve keys that start with `twi_` for
|
|
54
|
+
# future use. Custom keys that start with `twi_` are not allowed and are
|
|
55
|
+
# rejected as 400 Bad request with no delivery attempted. For SMS, this
|
|
56
|
+
# parameter is not supported and is omitted from deliveries to those
|
|
57
|
+
# channels.
|
|
58
|
+
# @param [Object] apn Optional parameter: The APNS-specific payload that
|
|
59
|
+
# overrides corresponding attributes in the generic payload for APNS
|
|
60
|
+
# Bindings. This property maps to the APNS `Payload` item, therefore the
|
|
61
|
+
# `aps` key must be used to change standard attributes. Adds custom
|
|
62
|
+
# key-value pairs to the root of the dictionary. See the [APNS
|
|
63
|
+
# documentation](https://developer.apple.com/library/content/documentation/N
|
|
64
|
+
# etworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.h
|
|
65
|
+
# tml) for more details. We reserve keys that start with `twi_` for future
|
|
66
|
+
# use. Custom keys that start with `twi_` are not allowed.
|
|
67
|
+
# @param [Object] gcm Optional parameter: The GCM-specific payload that
|
|
68
|
+
# overrides corresponding attributes in the generic payload for GCM
|
|
69
|
+
# Bindings. This property maps to the root JSON dictionary. See the [GCM
|
|
70
|
+
# documentation](https://firebase.google.com/docs/cloud-messaging/http-serve
|
|
71
|
+
# r-ref) for more details. Target parameters `to`, `registration_ids`, and
|
|
72
|
+
# `notification_key` are not allowed. We reserve keys that start with `twi_`
|
|
73
|
+
# for future use. Custom keys that start with `twi_` are not allowed. GCM
|
|
74
|
+
# also [reserves certain
|
|
75
|
+
# keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref).
|
|
76
|
+
# @param [Object] sms Optional parameter: The SMS-specific payload that
|
|
77
|
+
# overrides corresponding attributes in the generic payload for SMS
|
|
78
|
+
# Bindings. Each attribute in this value maps to the corresponding `form`
|
|
79
|
+
# parameter of the Twilio
|
|
80
|
+
# [Message](https://www.twilio.com/docs/sms/quickstart) resource. These
|
|
81
|
+
# parameters of the Message resource are supported in snake case format:
|
|
82
|
+
# `body`, `media_urls`, `status_callback`, and `max_price`. The
|
|
83
|
+
# `status_callback` parameter overrides the corresponding parameter in the
|
|
84
|
+
# messaging service, if configured. The `media_urls` property expects a JSON
|
|
85
|
+
# array.
|
|
86
|
+
# @param [Object] facebook_messenger Optional parameter: Deprecated.
|
|
87
|
+
# @param [Object] fcm Optional parameter: The FCM-specific payload that
|
|
88
|
+
# overrides corresponding attributes in the generic payload for FCM
|
|
89
|
+
# Bindings. This property maps to the root JSON dictionary. See the [FCM
|
|
90
|
+
# documentation](https://firebase.google.com/docs/cloud-messaging/http-serve
|
|
91
|
+
# r-ref#downstream) for more details. Target parameters `to`,
|
|
92
|
+
# `registration_ids`, `condition`, and `notification_key` are not allowed in
|
|
93
|
+
# this parameter. We reserve keys that start with `twi_` for future use.
|
|
94
|
+
# Custom keys that start with `twi_` are not allowed. FCM also [reserves
|
|
95
|
+
# certain
|
|
96
|
+
# keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref),
|
|
97
|
+
# which cannot be used in that channel.
|
|
98
|
+
# @param [Array[String]] segment Optional parameter: The Segment resource is
|
|
99
|
+
# deprecated. Use the `tag` parameter, instead.
|
|
100
|
+
# @param [Object] alexa Optional parameter: Deprecated.
|
|
101
|
+
# @param [Array[String]] to_binding Optional parameter: The destination
|
|
102
|
+
# address specified as a JSON string. Multiple `to_binding` parameters can
|
|
103
|
+
# be included but the total size of the request entity should not exceed
|
|
104
|
+
# 1MB. This is typically sufficient for 10,000 phone numbers.
|
|
105
|
+
# @param [String] delivery_callback_url Optional parameter: URL to send
|
|
106
|
+
# webhooks.
|
|
107
|
+
# @param [Array[String]] identity Optional parameter: The `identity` value
|
|
108
|
+
# that uniquely identifies the new resource's
|
|
109
|
+
# [User](https://www.twilio.com/docs/chat/rest/user-resource) within the
|
|
110
|
+
# [Service](https://www.twilio.com/docs/notify/api/service-resource).
|
|
111
|
+
# Delivery will be attempted only to Bindings with an Identity in this list.
|
|
112
|
+
# No more than 20 items are allowed in this list.
|
|
113
|
+
# @param [Array[String]] tag Optional parameter: A tag that selects the
|
|
114
|
+
# Bindings to notify. Repeat this parameter to specify more than one tag, up
|
|
115
|
+
# to a total of 5 tags. The implicit tag `all` is available to notify all
|
|
116
|
+
# Bindings in a Service instance. Similarly, the implicit tags `apn`, `fcm`,
|
|
117
|
+
# `gcm`, `sms` and `facebook-messenger` are available to notify all Bindings
|
|
118
|
+
# in a specific channel.
|
|
119
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
120
|
+
def create_notification(service_sid,
|
|
121
|
+
body: nil,
|
|
122
|
+
priority: nil,
|
|
123
|
+
ttl: nil,
|
|
124
|
+
title: nil,
|
|
125
|
+
sound: nil,
|
|
126
|
+
action: nil,
|
|
127
|
+
data: nil,
|
|
128
|
+
apn: nil,
|
|
129
|
+
gcm: nil,
|
|
130
|
+
sms: nil,
|
|
131
|
+
facebook_messenger: nil,
|
|
132
|
+
fcm: nil,
|
|
133
|
+
segment: nil,
|
|
134
|
+
alexa: nil,
|
|
135
|
+
to_binding: nil,
|
|
136
|
+
delivery_callback_url: nil,
|
|
137
|
+
identity: nil,
|
|
138
|
+
tag: nil)
|
|
139
|
+
@api_call
|
|
140
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
141
|
+
'/v1/Services/{ServiceSid}/Notifications',
|
|
142
|
+
Server::DEFAULT3)
|
|
143
|
+
.template_param(new_parameter(service_sid, key: 'ServiceSid')
|
|
144
|
+
.is_required(true)
|
|
145
|
+
.should_encode(true))
|
|
146
|
+
.form_param(new_parameter(body, key: 'Body'))
|
|
147
|
+
.form_param(new_parameter(priority, key: 'Priority'))
|
|
148
|
+
.form_param(new_parameter(ttl, key: 'Ttl'))
|
|
149
|
+
.form_param(new_parameter(title, key: 'Title'))
|
|
150
|
+
.form_param(new_parameter(sound, key: 'Sound'))
|
|
151
|
+
.form_param(new_parameter(action, key: 'Action'))
|
|
152
|
+
.form_param(new_parameter(data, key: 'Data'))
|
|
153
|
+
.form_param(new_parameter(apn, key: 'Apn'))
|
|
154
|
+
.form_param(new_parameter(gcm, key: 'Gcm'))
|
|
155
|
+
.form_param(new_parameter(sms, key: 'Sms'))
|
|
156
|
+
.form_param(new_parameter(facebook_messenger, key: 'FacebookMessenger'))
|
|
157
|
+
.form_param(new_parameter(fcm, key: 'Fcm'))
|
|
158
|
+
.form_param(new_parameter(segment, key: 'Segment'))
|
|
159
|
+
.form_param(new_parameter(alexa, key: 'Alexa'))
|
|
160
|
+
.form_param(new_parameter(to_binding, key: 'ToBinding'))
|
|
161
|
+
.form_param(new_parameter(delivery_callback_url, key: 'DeliveryCallbackUrl'))
|
|
162
|
+
.form_param(new_parameter(identity, key: 'Identity'))
|
|
163
|
+
.form_param(new_parameter(tag, key: 'Tag'))
|
|
164
|
+
.header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type'))
|
|
165
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
166
|
+
.auth(Single.new('accountSid_authToken')))
|
|
167
|
+
.response(new_response_handler
|
|
168
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
169
|
+
.deserialize_into(Notification.method(:from_hash))
|
|
170
|
+
.is_api_response(true))
|
|
171
|
+
.execute
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
end
|