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,188 @@
|
|
|
1
|
+
# twilio_ap_is
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module TwilioApIs
|
|
8
|
+
# AccessToken Model.
|
|
9
|
+
class AccessToken < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# A 34 character string that uniquely identifies this Access Token.
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :sid
|
|
16
|
+
|
|
17
|
+
# The unique SID identifier of the Account.
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :account_sid
|
|
20
|
+
|
|
21
|
+
# The unique SID identifier of the Verify Service.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :service_sid
|
|
24
|
+
|
|
25
|
+
# The unique external identifier for the Entity of the Service.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :entity_identity
|
|
28
|
+
|
|
29
|
+
# The Type of the Factor. Currently only `push` is supported.
|
|
30
|
+
# @return [AccessTokenEnumFactorTypes]
|
|
31
|
+
attr_accessor :factor_type
|
|
32
|
+
|
|
33
|
+
# A human readable description of this factor, up to 64 characters. For a
|
|
34
|
+
# push factor, this can be the device's name.
|
|
35
|
+
# @return [String]
|
|
36
|
+
attr_accessor :factor_friendly_name
|
|
37
|
+
|
|
38
|
+
# The access token generated for enrollment, this is an encrypted json web
|
|
39
|
+
# token.
|
|
40
|
+
# @return [String]
|
|
41
|
+
attr_accessor :token
|
|
42
|
+
|
|
43
|
+
# The URL of this resource.
|
|
44
|
+
# @return [String]
|
|
45
|
+
attr_accessor :url
|
|
46
|
+
|
|
47
|
+
# How long, in seconds, the access token is valid. Max: 5 minutes
|
|
48
|
+
# @return [Integer]
|
|
49
|
+
attr_accessor :ttl
|
|
50
|
+
|
|
51
|
+
# The date that this access token was created, given in [ISO
|
|
52
|
+
# 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
53
|
+
# @return [DateTime]
|
|
54
|
+
attr_accessor :date_created
|
|
55
|
+
|
|
56
|
+
# A mapping from model property names to API property names.
|
|
57
|
+
def self.names
|
|
58
|
+
@_hash = {} if @_hash.nil?
|
|
59
|
+
@_hash['sid'] = 'sid'
|
|
60
|
+
@_hash['account_sid'] = 'account_sid'
|
|
61
|
+
@_hash['service_sid'] = 'service_sid'
|
|
62
|
+
@_hash['entity_identity'] = 'entity_identity'
|
|
63
|
+
@_hash['factor_type'] = 'factor_type'
|
|
64
|
+
@_hash['factor_friendly_name'] = 'factor_friendly_name'
|
|
65
|
+
@_hash['token'] = 'token'
|
|
66
|
+
@_hash['url'] = 'url'
|
|
67
|
+
@_hash['ttl'] = 'ttl'
|
|
68
|
+
@_hash['date_created'] = 'date_created'
|
|
69
|
+
@_hash
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# An array for optional fields
|
|
73
|
+
def self.optionals
|
|
74
|
+
%w[
|
|
75
|
+
sid
|
|
76
|
+
account_sid
|
|
77
|
+
service_sid
|
|
78
|
+
entity_identity
|
|
79
|
+
factor_type
|
|
80
|
+
factor_friendly_name
|
|
81
|
+
token
|
|
82
|
+
url
|
|
83
|
+
ttl
|
|
84
|
+
date_created
|
|
85
|
+
]
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# An array for nullable fields
|
|
89
|
+
def self.nullables
|
|
90
|
+
%w[
|
|
91
|
+
sid
|
|
92
|
+
account_sid
|
|
93
|
+
service_sid
|
|
94
|
+
entity_identity
|
|
95
|
+
factor_friendly_name
|
|
96
|
+
token
|
|
97
|
+
url
|
|
98
|
+
date_created
|
|
99
|
+
]
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def initialize(sid: SKIP, account_sid: SKIP, service_sid: SKIP,
|
|
103
|
+
entity_identity: SKIP, factor_type: SKIP,
|
|
104
|
+
factor_friendly_name: SKIP, token: SKIP, url: SKIP, ttl: 0,
|
|
105
|
+
date_created: SKIP, additional_properties: nil)
|
|
106
|
+
# Add additional model properties to the instance
|
|
107
|
+
additional_properties = {} if additional_properties.nil?
|
|
108
|
+
|
|
109
|
+
@sid = sid unless sid == SKIP
|
|
110
|
+
@account_sid = account_sid unless account_sid == SKIP
|
|
111
|
+
@service_sid = service_sid unless service_sid == SKIP
|
|
112
|
+
@entity_identity = entity_identity unless entity_identity == SKIP
|
|
113
|
+
@factor_type = factor_type unless factor_type == SKIP
|
|
114
|
+
@factor_friendly_name = factor_friendly_name unless factor_friendly_name == SKIP
|
|
115
|
+
@token = token unless token == SKIP
|
|
116
|
+
@url = url unless url == SKIP
|
|
117
|
+
@ttl = ttl unless ttl == SKIP
|
|
118
|
+
@date_created = date_created unless date_created == SKIP
|
|
119
|
+
@additional_properties = additional_properties
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Creates an instance of the object from a hash.
|
|
123
|
+
def self.from_hash(hash)
|
|
124
|
+
return nil unless hash
|
|
125
|
+
|
|
126
|
+
# Extract variables from the hash.
|
|
127
|
+
sid = hash.key?('sid') ? hash['sid'] : SKIP
|
|
128
|
+
account_sid = hash.key?('account_sid') ? hash['account_sid'] : SKIP
|
|
129
|
+
service_sid = hash.key?('service_sid') ? hash['service_sid'] : SKIP
|
|
130
|
+
entity_identity =
|
|
131
|
+
hash.key?('entity_identity') ? hash['entity_identity'] : SKIP
|
|
132
|
+
factor_type = hash.key?('factor_type') ? hash['factor_type'] : SKIP
|
|
133
|
+
factor_friendly_name =
|
|
134
|
+
hash.key?('factor_friendly_name') ? hash['factor_friendly_name'] : SKIP
|
|
135
|
+
token = hash.key?('token') ? hash['token'] : SKIP
|
|
136
|
+
url = hash.key?('url') ? hash['url'] : SKIP
|
|
137
|
+
ttl = hash['ttl'] ||= 0
|
|
138
|
+
date_created = if hash.key?('date_created')
|
|
139
|
+
(DateTimeHelper.from_rfc3339(hash['date_created']) if hash['date_created'])
|
|
140
|
+
else
|
|
141
|
+
SKIP
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Create a new hash for additional properties, removing known properties.
|
|
145
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
146
|
+
|
|
147
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
148
|
+
new_hash, proc { |value| value }
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
# Create object from extracted values.
|
|
152
|
+
AccessToken.new(sid: sid,
|
|
153
|
+
account_sid: account_sid,
|
|
154
|
+
service_sid: service_sid,
|
|
155
|
+
entity_identity: entity_identity,
|
|
156
|
+
factor_type: factor_type,
|
|
157
|
+
factor_friendly_name: factor_friendly_name,
|
|
158
|
+
token: token,
|
|
159
|
+
url: url,
|
|
160
|
+
ttl: ttl,
|
|
161
|
+
date_created: date_created,
|
|
162
|
+
additional_properties: additional_properties)
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
def to_custom_date_created
|
|
166
|
+
DateTimeHelper.to_rfc3339(date_created)
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Provides a human-readable string representation of the object.
|
|
170
|
+
def to_s
|
|
171
|
+
class_name = self.class.name.split('::').last
|
|
172
|
+
"<#{class_name} sid: #{@sid}, account_sid: #{@account_sid}, service_sid: #{@service_sid},"\
|
|
173
|
+
" entity_identity: #{@entity_identity}, factor_type: #{@factor_type}, factor_friendly_name:"\
|
|
174
|
+
" #{@factor_friendly_name}, token: #{@token}, url: #{@url}, ttl: #{@ttl}, date_created:"\
|
|
175
|
+
" #{@date_created}, additional_properties: #{@additional_properties}>"
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
179
|
+
def inspect
|
|
180
|
+
class_name = self.class.name.split('::').last
|
|
181
|
+
"<#{class_name} sid: #{@sid.inspect}, account_sid: #{@account_sid.inspect}, service_sid:"\
|
|
182
|
+
" #{@service_sid.inspect}, entity_identity: #{@entity_identity.inspect}, factor_type:"\
|
|
183
|
+
" #{@factor_type.inspect}, factor_friendly_name: #{@factor_friendly_name.inspect}, token:"\
|
|
184
|
+
" #{@token.inspect}, url: #{@url.inspect}, ttl: #{@ttl.inspect}, date_created:"\
|
|
185
|
+
" #{@date_created.inspect}, additional_properties: #{@additional_properties}>"
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
# The Type of the Factor. Currently only `push` is supported.
|
|
8
|
+
class AccessTokenEnumFactorTypes
|
|
9
|
+
ACCESS_TOKEN_ENUM_FACTOR_TYPES = [
|
|
10
|
+
# TODO: Write general description for PUSH
|
|
11
|
+
PUSH = 'push'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
ACCESS_TOKEN_ENUM_FACTOR_TYPES.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = PUSH)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# twilio_ap_is
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module TwilioApIs
|
|
8
|
+
# Activity Model.
|
|
9
|
+
class Activity < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that
|
|
14
|
+
# created the Activity resource.
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_accessor :account_sid
|
|
17
|
+
|
|
18
|
+
# Whether the Worker is eligible to receive a Task when it occupies the
|
|
19
|
+
# Activity. A value of `true`, `1`, or `yes` indicates the Activity is
|
|
20
|
+
# available. All other values indicate that it is not. The value cannot be
|
|
21
|
+
# changed after the Activity is created.
|
|
22
|
+
# @return [TrueClass | FalseClass]
|
|
23
|
+
attr_accessor :available
|
|
24
|
+
|
|
25
|
+
# The date and time in GMT when the resource was created specified in [ISO
|
|
26
|
+
# 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
27
|
+
# @return [DateTime]
|
|
28
|
+
attr_accessor :date_created
|
|
29
|
+
|
|
30
|
+
# The date and time in GMT when the resource was last updated specified in
|
|
31
|
+
# [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
32
|
+
# @return [DateTime]
|
|
33
|
+
attr_accessor :date_updated
|
|
34
|
+
|
|
35
|
+
# The string that you assigned to describe the Activity resource.
|
|
36
|
+
# @return [String]
|
|
37
|
+
attr_accessor :friendly_name
|
|
38
|
+
|
|
39
|
+
# The unique string that we created to identify the Activity resource.
|
|
40
|
+
# @return [String]
|
|
41
|
+
attr_accessor :sid
|
|
42
|
+
|
|
43
|
+
# The SID of the Workspace that contains the Activity.
|
|
44
|
+
# @return [String]
|
|
45
|
+
attr_accessor :workspace_sid
|
|
46
|
+
|
|
47
|
+
# The absolute URL of the Activity resource.
|
|
48
|
+
# @return [String]
|
|
49
|
+
attr_accessor :url
|
|
50
|
+
|
|
51
|
+
# The absolute URL of the Activity resource.
|
|
52
|
+
# @return [Object]
|
|
53
|
+
attr_accessor :links
|
|
54
|
+
|
|
55
|
+
# A mapping from model property names to API property names.
|
|
56
|
+
def self.names
|
|
57
|
+
@_hash = {} if @_hash.nil?
|
|
58
|
+
@_hash['account_sid'] = 'account_sid'
|
|
59
|
+
@_hash['available'] = 'available'
|
|
60
|
+
@_hash['date_created'] = 'date_created'
|
|
61
|
+
@_hash['date_updated'] = 'date_updated'
|
|
62
|
+
@_hash['friendly_name'] = 'friendly_name'
|
|
63
|
+
@_hash['sid'] = 'sid'
|
|
64
|
+
@_hash['workspace_sid'] = 'workspace_sid'
|
|
65
|
+
@_hash['url'] = 'url'
|
|
66
|
+
@_hash['links'] = 'links'
|
|
67
|
+
@_hash
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# An array for optional fields
|
|
71
|
+
def self.optionals
|
|
72
|
+
%w[
|
|
73
|
+
account_sid
|
|
74
|
+
available
|
|
75
|
+
date_created
|
|
76
|
+
date_updated
|
|
77
|
+
friendly_name
|
|
78
|
+
sid
|
|
79
|
+
workspace_sid
|
|
80
|
+
url
|
|
81
|
+
links
|
|
82
|
+
]
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# An array for nullable fields
|
|
86
|
+
def self.nullables
|
|
87
|
+
%w[
|
|
88
|
+
account_sid
|
|
89
|
+
available
|
|
90
|
+
date_created
|
|
91
|
+
date_updated
|
|
92
|
+
friendly_name
|
|
93
|
+
sid
|
|
94
|
+
workspace_sid
|
|
95
|
+
url
|
|
96
|
+
links
|
|
97
|
+
]
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def initialize(account_sid: SKIP, available: SKIP, date_created: SKIP,
|
|
101
|
+
date_updated: SKIP, friendly_name: SKIP, sid: SKIP,
|
|
102
|
+
workspace_sid: SKIP, url: SKIP, links: SKIP,
|
|
103
|
+
additional_properties: nil)
|
|
104
|
+
# Add additional model properties to the instance
|
|
105
|
+
additional_properties = {} if additional_properties.nil?
|
|
106
|
+
|
|
107
|
+
@account_sid = account_sid unless account_sid == SKIP
|
|
108
|
+
@available = available unless available == SKIP
|
|
109
|
+
@date_created = date_created unless date_created == SKIP
|
|
110
|
+
@date_updated = date_updated unless date_updated == SKIP
|
|
111
|
+
@friendly_name = friendly_name unless friendly_name == SKIP
|
|
112
|
+
@sid = sid unless sid == SKIP
|
|
113
|
+
@workspace_sid = workspace_sid unless workspace_sid == SKIP
|
|
114
|
+
@url = url unless url == SKIP
|
|
115
|
+
@links = links unless links == SKIP
|
|
116
|
+
@additional_properties = additional_properties
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Creates an instance of the object from a hash.
|
|
120
|
+
def self.from_hash(hash)
|
|
121
|
+
return nil unless hash
|
|
122
|
+
|
|
123
|
+
# Extract variables from the hash.
|
|
124
|
+
account_sid = hash.key?('account_sid') ? hash['account_sid'] : SKIP
|
|
125
|
+
available = hash.key?('available') ? hash['available'] : SKIP
|
|
126
|
+
date_created = if hash.key?('date_created')
|
|
127
|
+
(DateTimeHelper.from_rfc3339(hash['date_created']) if hash['date_created'])
|
|
128
|
+
else
|
|
129
|
+
SKIP
|
|
130
|
+
end
|
|
131
|
+
date_updated = if hash.key?('date_updated')
|
|
132
|
+
(DateTimeHelper.from_rfc3339(hash['date_updated']) if hash['date_updated'])
|
|
133
|
+
else
|
|
134
|
+
SKIP
|
|
135
|
+
end
|
|
136
|
+
friendly_name = hash.key?('friendly_name') ? hash['friendly_name'] : SKIP
|
|
137
|
+
sid = hash.key?('sid') ? hash['sid'] : SKIP
|
|
138
|
+
workspace_sid = hash.key?('workspace_sid') ? hash['workspace_sid'] : SKIP
|
|
139
|
+
url = hash.key?('url') ? hash['url'] : SKIP
|
|
140
|
+
links = hash.key?('links') ? hash['links'] : SKIP
|
|
141
|
+
|
|
142
|
+
# Create a new hash for additional properties, removing known properties.
|
|
143
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
144
|
+
|
|
145
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
146
|
+
new_hash, proc { |value| value }
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
# Create object from extracted values.
|
|
150
|
+
Activity.new(account_sid: account_sid,
|
|
151
|
+
available: available,
|
|
152
|
+
date_created: date_created,
|
|
153
|
+
date_updated: date_updated,
|
|
154
|
+
friendly_name: friendly_name,
|
|
155
|
+
sid: sid,
|
|
156
|
+
workspace_sid: workspace_sid,
|
|
157
|
+
url: url,
|
|
158
|
+
links: links,
|
|
159
|
+
additional_properties: additional_properties)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
def to_custom_date_created
|
|
163
|
+
DateTimeHelper.to_rfc3339(date_created)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def to_custom_date_updated
|
|
167
|
+
DateTimeHelper.to_rfc3339(date_updated)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Provides a human-readable string representation of the object.
|
|
171
|
+
def to_s
|
|
172
|
+
class_name = self.class.name.split('::').last
|
|
173
|
+
"<#{class_name} account_sid: #{@account_sid}, available: #{@available}, date_created:"\
|
|
174
|
+
" #{@date_created}, date_updated: #{@date_updated}, friendly_name: #{@friendly_name}, sid:"\
|
|
175
|
+
" #{@sid}, workspace_sid: #{@workspace_sid}, url: #{@url}, links: #{@links},"\
|
|
176
|
+
" additional_properties: #{@additional_properties}>"
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
180
|
+
def inspect
|
|
181
|
+
class_name = self.class.name.split('::').last
|
|
182
|
+
"<#{class_name} account_sid: #{@account_sid.inspect}, available: #{@available.inspect},"\
|
|
183
|
+
" date_created: #{@date_created.inspect}, date_updated: #{@date_updated.inspect},"\
|
|
184
|
+
" friendly_name: #{@friendly_name.inspect}, sid: #{@sid.inspect}, workspace_sid:"\
|
|
185
|
+
" #{@workspace_sid.inspect}, url: #{@url.inspect}, links: #{@links.inspect},"\
|
|
186
|
+
" additional_properties: #{@additional_properties}>"
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
end
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# twilio_ap_is
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module TwilioApIs
|
|
8
|
+
# AuthTokenPromotion Model.
|
|
9
|
+
class AuthTokenPromotion < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that
|
|
14
|
+
# the secondary Auth Token was created for.
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_accessor :account_sid
|
|
17
|
+
|
|
18
|
+
# The promoted Auth Token that must be used to authenticate future API
|
|
19
|
+
# requests.
|
|
20
|
+
# @return [String]
|
|
21
|
+
attr_accessor :auth_token
|
|
22
|
+
|
|
23
|
+
# The date and time in UTC when the resource was created specified in [ISO
|
|
24
|
+
# 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
25
|
+
# @return [DateTime]
|
|
26
|
+
attr_accessor :date_created
|
|
27
|
+
|
|
28
|
+
# The date and time in GMT when the resource was last updated specified in
|
|
29
|
+
# [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
30
|
+
# @return [DateTime]
|
|
31
|
+
attr_accessor :date_updated
|
|
32
|
+
|
|
33
|
+
# The URI for this resource, relative to `https://accounts.twilio.com`
|
|
34
|
+
# @return [String]
|
|
35
|
+
attr_accessor :url
|
|
36
|
+
|
|
37
|
+
# A mapping from model property names to API property names.
|
|
38
|
+
def self.names
|
|
39
|
+
@_hash = {} if @_hash.nil?
|
|
40
|
+
@_hash['account_sid'] = 'account_sid'
|
|
41
|
+
@_hash['auth_token'] = 'auth_token'
|
|
42
|
+
@_hash['date_created'] = 'date_created'
|
|
43
|
+
@_hash['date_updated'] = 'date_updated'
|
|
44
|
+
@_hash['url'] = 'url'
|
|
45
|
+
@_hash
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for optional fields
|
|
49
|
+
def self.optionals
|
|
50
|
+
%w[
|
|
51
|
+
account_sid
|
|
52
|
+
auth_token
|
|
53
|
+
date_created
|
|
54
|
+
date_updated
|
|
55
|
+
url
|
|
56
|
+
]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# An array for nullable fields
|
|
60
|
+
def self.nullables
|
|
61
|
+
%w[
|
|
62
|
+
account_sid
|
|
63
|
+
auth_token
|
|
64
|
+
date_created
|
|
65
|
+
date_updated
|
|
66
|
+
url
|
|
67
|
+
]
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def initialize(account_sid: SKIP, auth_token: SKIP, date_created: SKIP,
|
|
71
|
+
date_updated: SKIP, url: SKIP, additional_properties: nil)
|
|
72
|
+
# Add additional model properties to the instance
|
|
73
|
+
additional_properties = {} if additional_properties.nil?
|
|
74
|
+
|
|
75
|
+
@account_sid = account_sid unless account_sid == SKIP
|
|
76
|
+
@auth_token = auth_token unless auth_token == SKIP
|
|
77
|
+
@date_created = date_created unless date_created == SKIP
|
|
78
|
+
@date_updated = date_updated unless date_updated == SKIP
|
|
79
|
+
@url = url unless url == SKIP
|
|
80
|
+
@additional_properties = additional_properties
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Creates an instance of the object from a hash.
|
|
84
|
+
def self.from_hash(hash)
|
|
85
|
+
return nil unless hash
|
|
86
|
+
|
|
87
|
+
# Extract variables from the hash.
|
|
88
|
+
account_sid = hash.key?('account_sid') ? hash['account_sid'] : SKIP
|
|
89
|
+
auth_token = hash.key?('auth_token') ? hash['auth_token'] : SKIP
|
|
90
|
+
date_created = if hash.key?('date_created')
|
|
91
|
+
(DateTimeHelper.from_rfc3339(hash['date_created']) if hash['date_created'])
|
|
92
|
+
else
|
|
93
|
+
SKIP
|
|
94
|
+
end
|
|
95
|
+
date_updated = if hash.key?('date_updated')
|
|
96
|
+
(DateTimeHelper.from_rfc3339(hash['date_updated']) if hash['date_updated'])
|
|
97
|
+
else
|
|
98
|
+
SKIP
|
|
99
|
+
end
|
|
100
|
+
url = hash.key?('url') ? hash['url'] : SKIP
|
|
101
|
+
|
|
102
|
+
# Create a new hash for additional properties, removing known properties.
|
|
103
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
104
|
+
|
|
105
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
106
|
+
new_hash, proc { |value| value }
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
# Create object from extracted values.
|
|
110
|
+
AuthTokenPromotion.new(account_sid: account_sid,
|
|
111
|
+
auth_token: auth_token,
|
|
112
|
+
date_created: date_created,
|
|
113
|
+
date_updated: date_updated,
|
|
114
|
+
url: url,
|
|
115
|
+
additional_properties: additional_properties)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def to_custom_date_created
|
|
119
|
+
DateTimeHelper.to_rfc3339(date_created)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def to_custom_date_updated
|
|
123
|
+
DateTimeHelper.to_rfc3339(date_updated)
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Provides a human-readable string representation of the object.
|
|
127
|
+
def to_s
|
|
128
|
+
class_name = self.class.name.split('::').last
|
|
129
|
+
"<#{class_name} account_sid: #{@account_sid}, auth_token: #{@auth_token}, date_created:"\
|
|
130
|
+
" #{@date_created}, date_updated: #{@date_updated}, url: #{@url}, additional_properties:"\
|
|
131
|
+
" #{@additional_properties}>"
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
135
|
+
def inspect
|
|
136
|
+
class_name = self.class.name.split('::').last
|
|
137
|
+
"<#{class_name} account_sid: #{@account_sid.inspect}, auth_token: #{@auth_token.inspect},"\
|
|
138
|
+
" date_created: #{@date_created.inspect}, date_updated: #{@date_updated.inspect}, url:"\
|
|
139
|
+
" #{@url.inspect}, additional_properties: #{@additional_properties}>"
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
# Base model.
|
|
8
|
+
# rubocop:disable all
|
|
9
|
+
class BaseModel < CoreLibrary::BaseModel
|
|
10
|
+
# Returns a Hash representation of the current object.
|
|
11
|
+
def to_hash
|
|
12
|
+
# validating the model being serialized
|
|
13
|
+
self.class.validate(self) if self.class.respond_to?(:validate)
|
|
14
|
+
|
|
15
|
+
hash = {}
|
|
16
|
+
instance_variables.each do |name|
|
|
17
|
+
value = instance_variable_get(name)
|
|
18
|
+
name = name[1..]
|
|
19
|
+
if name == 'additional_properties'
|
|
20
|
+
additional_properties = process_additional_properties(value, self.class.names)
|
|
21
|
+
hash.merge!(additional_properties)
|
|
22
|
+
else
|
|
23
|
+
key = self.class.names.key?(name) ? self.class.names[name] : name
|
|
24
|
+
optional_fields = self.class.optionals
|
|
25
|
+
nullable_fields = self.class.nullables
|
|
26
|
+
if value.nil?
|
|
27
|
+
next unless nullable_fields.include?(name)
|
|
28
|
+
|
|
29
|
+
if !optional_fields.include?(name) && !nullable_fields.include?(name)
|
|
30
|
+
raise ArgumentError,
|
|
31
|
+
"`#{name}` cannot be nil in `#{self.class}`. Please specify a valid value."
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
hash[key] = nil
|
|
36
|
+
unless value.nil?
|
|
37
|
+
if respond_to?("to_custom_#{name}")
|
|
38
|
+
if (value.instance_of? Array) || (value.instance_of? Hash)
|
|
39
|
+
params = [hash, key]
|
|
40
|
+
hash[key] = send("to_custom_#{name}", *params)
|
|
41
|
+
else
|
|
42
|
+
hash[key] = send("to_custom_#{name}")
|
|
43
|
+
end
|
|
44
|
+
elsif respond_to?("to_union_type_#{name}")
|
|
45
|
+
hash[key] = send("to_union_type_#{name}")
|
|
46
|
+
elsif value.instance_of? Array
|
|
47
|
+
hash[key] = value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
|
|
48
|
+
elsif value.instance_of? Hash
|
|
49
|
+
hash[key] = {}
|
|
50
|
+
value.each do |k, v|
|
|
51
|
+
hash[key][k] = v.is_a?(BaseModel) ? v.to_hash : v
|
|
52
|
+
end
|
|
53
|
+
else
|
|
54
|
+
hash[key] = value.is_a?(BaseModel) ? value.to_hash : value
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
hash
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Processes additional properties, ensuring no conflicts with existing properties.
|
|
63
|
+
def process_additional_properties(additional_properties, existing_prop_names)
|
|
64
|
+
hash = {}
|
|
65
|
+
additional_properties.each do |name, value|
|
|
66
|
+
check_for_conflict(name, existing_prop_names)
|
|
67
|
+
|
|
68
|
+
hash[name] = if value.is_a?(Array)
|
|
69
|
+
process_array(value)
|
|
70
|
+
elsif value.is_a?(Hash)
|
|
71
|
+
process_hash(value)
|
|
72
|
+
else
|
|
73
|
+
process_basic_value(value)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
hash
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Checks if an additional property conflicts with a model's existing property.
|
|
80
|
+
def check_for_conflict(name, existing_prop_names)
|
|
81
|
+
return unless existing_prop_names.key?(name)
|
|
82
|
+
|
|
83
|
+
raise ArgumentError, "An additional property key, '#{name}' conflicts with one of the model's properties"
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Processes an array of values, recursively calling `to_hash` on BaseModel objects.
|
|
87
|
+
def process_array(value)
|
|
88
|
+
value.map { |v| v.is_a?(BaseModel) ? v.to_hash : v }
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Processes a hash of values, recursively calling `to_hash` on BaseModel objects.
|
|
92
|
+
def process_hash(value)
|
|
93
|
+
value.transform_values do |v|
|
|
94
|
+
v.is_a?(BaseModel) ? v.to_hash : v
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Processes a basic value (non-array, non-hash).
|
|
99
|
+
def process_basic_value(value)
|
|
100
|
+
value.is_a?(BaseModel) ? value.to_hash : value
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Returns a JSON representation of the curent object.
|
|
104
|
+
def to_json(options = {})
|
|
105
|
+
hash = to_hash
|
|
106
|
+
hash.to_json(options)
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
# rubocop:enable all
|
|
110
|
+
end
|