twilio-ruby 7.11.1 → 7.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +221 -0
- data/Gemfile.lock +2 -2
- data/README.md +2 -2
- data/lib/rack/twilio_webhook_authentication.rb +45 -2
- data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +0 -59
- data/lib/twilio-ruby/rest/accounts/v1/bulk_consents.rb +0 -59
- data/lib/twilio-ruby/rest/accounts/v1/bulk_contacts.rb +0 -59
- data/lib/twilio-ruby/rest/accounts/v1/credential.rb +0 -59
- data/lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb +0 -59
- data/lib/twilio-ruby/rest/accounts/v1/safelist.rb +0 -59
- data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/balance.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message_subscription.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +6 -0
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +0 -59
- data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +0 -59
- data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +0 -59
- data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +0 -59
- data/lib/twilio-ruby/rest/chat/v3/channel.rb +0 -59
- data/lib/twilio-ruby/rest/content/v1/content/approval_create.rb +0 -59
- data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/conversation_with_participants.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation_with_participants.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v2/action.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v2/configuration.rb +525 -0
- data/lib/twilio-ruby/rest/conversations/v2/operation.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v2.rb +10 -4
- data/lib/twilio-ruby/rest/events/v1/schema.rb +0 -59
- data/lib/twilio-ruby/rest/events/v1/sink/sink_test.rb +0 -59
- data/lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +12 -14
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/insights_assessments_comment.rb +12 -14
- data/lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb +12 -14
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb +12 -14
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb +2 -4
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +12 -14
- data/lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb +12 -14
- data/lib/twilio-ruby/rest/flex_api/v1/insights_session.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_answer_sets.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_comment.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_transfer.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +2 -4
- data/lib/twilio-ruby/rest/flex_api/v1/plugin.rb +2 -4
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration/configured_plugin.rb +2 -4
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration.rb +2 -4
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration_archive.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb +2 -4
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_version_archive.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/provisioning_status.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v2/flex_user.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v2/web_channels.rb +0 -59
- data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +0 -59
- data/lib/twilio-ruby/rest/iam/v1/api_key.rb +0 -59
- data/lib/twilio-ruby/rest/iam/v1/new_api_key.rb +0 -59
- data/lib/twilio-ruby/rest/iam/v1/o_auth_app.rb +0 -59
- data/lib/twilio-ruby/rest/iam/v1/token.rb +0 -59
- data/lib/twilio-ruby/rest/insights/v1/call/annotation.rb +0 -59
- data/lib/twilio-ruby/rest/insights/v1/call/call_summary.rb +0 -59
- data/lib/twilio-ruby/rest/insights/v1/call.rb +0 -59
- data/lib/twilio-ruby/rest/insights/v1/setting.rb +0 -59
- data/lib/twilio-ruby/rest/insights/v2/inbound.rb +2 -261
- data/lib/twilio-ruby/rest/insights/v2/inbound_report.rb +258 -0
- data/lib/twilio-ruby/rest/insights/v2/outbound.rb +18 -299
- data/lib/twilio-ruby/rest/insights/v2/outbound_report.rb +258 -0
- data/lib/twilio-ruby/rest/insights/v2/report.rb +27 -184
- data/lib/twilio-ruby/rest/insights/v2.rb +14 -4
- data/lib/twilio-ruby/rest/insights/v3/metadata.rb +1 -60
- data/lib/twilio-ruby/rest/insights/v3/query.rb +1 -60
- data/lib/twilio-ruby/rest/insights/v3/query_job.rb +654 -0
- data/lib/twilio-ruby/rest/insights/v3/result.rb +195 -0
- data/lib/twilio-ruby/rest/insights/v3.rb +17 -1
- data/lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb +0 -59
- data/lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb +0 -59
- data/lib/twilio-ruby/rest/intelligence/v2/transcript/encrypted_operator_results.rb +0 -59
- data/lib/twilio-ruby/rest/intelligence/v2/transcript/encrypted_sentences.rb +0 -59
- data/lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb +0 -59
- data/lib/twilio-ruby/rest/intelligence/v3/rule_execution.rb +0 -59
- data/lib/twilio-ruby/rest/knowledge/v1/knowledge/knowledge_status.rb +0 -59
- data/lib/twilio-ruby/rest/knowledge/v2/operation.rb +0 -59
- data/lib/twilio-ruby/rest/knowledge/v2/search.rb +0 -59
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +0 -59
- data/lib/twilio-ruby/rest/lookups/v2/bucket.rb +0 -59
- data/lib/twilio-ruby/rest/lookups/v2/lookup_override.rb +0 -59
- data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +0 -59
- data/lib/twilio-ruby/rest/lookups/v2/query.rb +0 -59
- data/lib/twilio-ruby/rest/lookups/v2/rate_limit.rb +0 -59
- data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_usage.rb +0 -59
- data/lib/twilio-ruby/rest/marketplace/v1/module_data.rb +0 -59
- data/lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb +0 -59
- data/lib/twilio-ruby/rest/marketplace/v1/referral_conversion.rb +0 -59
- data/lib/twilio-ruby/rest/memory/v1/bulk.rb +0 -59
- data/lib/twilio-ruby/rest/memory/v1/conversation_summary.rb +2 -4
- data/lib/twilio-ruby/rest/memory/v1/identifier.rb +0 -80
- data/lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb +0 -59
- data/lib/twilio-ruby/rest/memory/v1/lookup.rb +0 -59
- data/lib/twilio-ruby/rest/memory/v1/observation.rb +2 -4
- data/lib/twilio-ruby/rest/memory/v1/operation.rb +0 -59
- data/lib/twilio-ruby/rest/memory/v1/recall.rb +0 -59
- data/lib/twilio-ruby/rest/memory/v1/revision.rb +2 -4
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_registration_otp.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/deactivations.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/domain_certs.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/domain_validate_dn.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/external_campaign.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service_domain_association.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +2 -4
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/usecase.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v2/domain_certs.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v2/typing_indicator.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v3/typing_indicator.rb +0 -59
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/bulk_eligibility.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/eligibility.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/embedded_session.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/porting_portability.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_delete.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/sender_id_registration.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification_check.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification_check.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/webhook.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/replace_items.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v2.rb +0 -16
- data/lib/twilio-ruby/rest/numbers/v3/hosted_number_order.rb +0 -59
- data/lib/twilio-ruby/rest/oauth/v1/authorize.rb +0 -59
- data/lib/twilio-ruby/rest/oauth/v1/token.rb +0 -59
- data/lib/twilio-ruby/rest/oauth/v2/authorize.rb +0 -59
- data/lib/twilio-ruby/rest/oauth/v2/oauth_authorization_server.rb +0 -59
- data/lib/twilio-ruby/rest/oauth/v2/token.rb +2 -61
- data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +0 -59
- data/lib/twilio-ruby/rest/preview_iam/v1/authorize.rb +0 -59
- data/lib/twilio-ruby/rest/preview_iam/v1/token.rb +0 -59
- data/lib/twilio-ruby/rest/preview_iam/versionless/organization.rb +0 -59
- data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +0 -59
- data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +0 -59
- data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +0 -59
- data/lib/twilio-ruby/rest/pricing/v1/voice.rb +0 -59
- data/lib/twilio-ruby/rest/pricing/v2/number.rb +0 -59
- data/lib/twilio-ruby/rest/pricing/v2/voice/number.rb +0 -59
- data/lib/twilio-ruby/rest/pricing/v2/voice.rb +0 -59
- data/lib/twilio-ruby/rest/routes/v2/phone_number.rb +0 -59
- data/lib/twilio-ruby/rest/routes/v2/sip_domain.rb +0 -59
- data/lib/twilio-ruby/rest/routes/v2/trunk.rb +0 -59
- data/lib/twilio-ruby/rest/routes/v3/phone_number.rb +0 -59
- data/lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb +0 -59
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_context.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step/execution_step_context.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v2/flow_validate.rb +0 -59
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +0 -59
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration.rb +0 -59
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration_embedded_session.rb +0 -59
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration.rb +0 -59
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration_embedded_session.rb +0 -59
- data/lib/twilio-ruby/rest/trusthub/v1/compliance_inquiries.rb +0 -59
- data/lib/twilio-ruby/rest/trusthub/v1/compliance_registration_inquiries.rb +0 -59
- data/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +0 -59
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb +0 -59
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products_provisional_copy.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/form.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/safelist.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/approve_challenge.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/new_challenge.rb +3 -62
- data/lib/twilio-ruby/rest/verify/v2/service/new_factor.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/new_verify_factor.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +8 -61
- data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +0 -59
- data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +0 -59
- data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +0 -59
- data/lib/twilio-ruby/rest/video/v1/room/participant/anonymize.rb +0 -59
- data/lib/twilio-ruby/rest/video/v1/room/participant/subscribe_rules.rb +0 -59
- data/lib/twilio-ruby/rest/video/v1/room/recording_rules.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/bulk_country_update.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v2/configuration/default.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v2/configuration.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v2/recording.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v2/transcription.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v2/type.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v3/transcription.rb +259 -50
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +6 -4
- data/lib/twilio-ruby/rest/memory/v1/event.rb +0 -320
- data/lib/twilio-ruby/rest/numbers/v2/caller_id.rb +0 -515
|
@@ -0,0 +1,654 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
6
|
+
#
|
|
7
|
+
# Twilio - Insights
|
|
8
|
+
# The Twilio Insights v3 API provides semantic query access to Conversations analytics data. Resources include synchronous Query, Metadata, and asynchronous QueryJobs for long-running queries.
|
|
9
|
+
#
|
|
10
|
+
# NOTE: This class is auto generated by OpenAPI Generator.
|
|
11
|
+
# https://openapi-generator.tech
|
|
12
|
+
# Do not edit the class manually.
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
module Twilio
|
|
17
|
+
module REST
|
|
18
|
+
class Insights < InsightsBase
|
|
19
|
+
class V3 < Version
|
|
20
|
+
class QueryJobList < ListResource
|
|
21
|
+
|
|
22
|
+
class InsightsQueryRequest
|
|
23
|
+
# @param [domain]: [String] The business domain to execute the query against
|
|
24
|
+
# @param [query]: [QueryList.QueryDefinition]
|
|
25
|
+
attr_accessor :domain, :query
|
|
26
|
+
def initialize(payload)
|
|
27
|
+
@domain = payload["domain"]
|
|
28
|
+
@query = payload["query"]
|
|
29
|
+
end
|
|
30
|
+
def to_json(options = {})
|
|
31
|
+
{
|
|
32
|
+
"domain": @domain,
|
|
33
|
+
"query": @query,
|
|
34
|
+
}.to_json(options)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
class QueryDefinition
|
|
39
|
+
# @param [measures]: [Array<String>] Array of measures to retrieve, representing quantitative values or metrics to be calculated
|
|
40
|
+
# @param [dimensions]: [Array<String>] Array of dimensions to retrieve, representing categorical attributes for grouping and organizing data
|
|
41
|
+
# @param [filters]: [Array<QueryList.QueryDefinitionFilters>] Nested filter conditions. Always use `op` and `expressions`.
|
|
42
|
+
# @param [order_by]: [Array<QueryList.QueryDefinitionOrderBy>] Specifications for sorting the query results by specific fields in ascending or descending order
|
|
43
|
+
attr_accessor :measures, :dimensions, :filters, :order_by
|
|
44
|
+
def initialize(payload)
|
|
45
|
+
@measures = payload["measures"]
|
|
46
|
+
@dimensions = payload["dimensions"]
|
|
47
|
+
@filters = payload["filters"]
|
|
48
|
+
@order_by = payload["order_by"]
|
|
49
|
+
end
|
|
50
|
+
def to_json(options = {})
|
|
51
|
+
{
|
|
52
|
+
"measures": @measures,
|
|
53
|
+
"dimensions": @dimensions,
|
|
54
|
+
"filters": @filters,
|
|
55
|
+
"orderBy": @order_by,
|
|
56
|
+
}.to_json(options)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
class QueryDefinitionFilters
|
|
61
|
+
# @param [op]: [String]
|
|
62
|
+
# @param [expressions]: [Array<QueryList.QueryDefinitionFiltersExpressions>]
|
|
63
|
+
attr_accessor :op, :expressions
|
|
64
|
+
def initialize(payload)
|
|
65
|
+
@op = payload["op"]
|
|
66
|
+
@expressions = payload["expressions"]
|
|
67
|
+
end
|
|
68
|
+
def to_json(options = {})
|
|
69
|
+
{
|
|
70
|
+
"op": @op,
|
|
71
|
+
"expressions": @expressions,
|
|
72
|
+
}.to_json(options)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
class QueryDefinitionFiltersExpressions
|
|
77
|
+
# @param [op]: [String]
|
|
78
|
+
# @param [field]: [String]
|
|
79
|
+
# @param [values]: [Array<String>]
|
|
80
|
+
attr_accessor :op, :field, :values
|
|
81
|
+
def initialize(payload)
|
|
82
|
+
@op = payload["op"]
|
|
83
|
+
@field = payload["field"]
|
|
84
|
+
@values = payload["values"]
|
|
85
|
+
end
|
|
86
|
+
def to_json(options = {})
|
|
87
|
+
{
|
|
88
|
+
"op": @op,
|
|
89
|
+
"field": @field,
|
|
90
|
+
"values": @values,
|
|
91
|
+
}.to_json(options)
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
class QueryDefinitionOrderBy
|
|
96
|
+
# @param [field]: [String] Dimension or measure to order by
|
|
97
|
+
# @param [direction]: [String] Sort order direction, ascending or descending
|
|
98
|
+
attr_accessor :field, :direction
|
|
99
|
+
def initialize(payload)
|
|
100
|
+
@field = payload["field"]
|
|
101
|
+
@direction = payload["direction"]
|
|
102
|
+
end
|
|
103
|
+
def to_json(options = {})
|
|
104
|
+
{
|
|
105
|
+
"field": @field,
|
|
106
|
+
"direction": @direction,
|
|
107
|
+
}.to_json(options)
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
##
|
|
113
|
+
# Initialize the QueryJobList
|
|
114
|
+
# @param [Version] version Version that contains the resource
|
|
115
|
+
# @return [QueryJobList] QueryJobList
|
|
116
|
+
def initialize(version)
|
|
117
|
+
|
|
118
|
+
apiV1Version = ApiV1Version.new version.domain, version
|
|
119
|
+
super(apiV1Version)
|
|
120
|
+
# Path Solution
|
|
121
|
+
@solution = { }
|
|
122
|
+
@uri = "/InsightsDomains/Conversations/QueryJobs"
|
|
123
|
+
|
|
124
|
+
end
|
|
125
|
+
##
|
|
126
|
+
# Create the QueryJobInstance
|
|
127
|
+
# @param [String] idempotency_key A client-generated UUIDv7 key that ensures idempotent behavior. Submitting the same key with an identical request returns the same operation without re-execution. Scoped to Account + Region. Retained for 24 hours.
|
|
128
|
+
# @param [InsightsQueryRequest] insights_query_request
|
|
129
|
+
# @return [QueryJobInstance] Created QueryJobInstance
|
|
130
|
+
def create(
|
|
131
|
+
idempotency_key: :unset,
|
|
132
|
+
insights_query_request: nil
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Idempotency-Key' => idempotency_key, })
|
|
136
|
+
headers['Content-Type'] = 'application/json'
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
payload = @version.create('POST', @uri, headers: headers, data: insights_query_request.to_json)
|
|
142
|
+
QueryJobInstance.new(
|
|
143
|
+
@version,
|
|
144
|
+
payload,
|
|
145
|
+
)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
##
|
|
149
|
+
# Create the QueryJobInstanceMetadata
|
|
150
|
+
# @param [String] idempotency_key A client-generated UUIDv7 key that ensures idempotent behavior. Submitting the same key with an identical request returns the same operation without re-execution. Scoped to Account + Region. Retained for 24 hours.
|
|
151
|
+
# @param [InsightsQueryRequest] insights_query_request
|
|
152
|
+
# @return [QueryJobInstance] Created QueryJobInstance
|
|
153
|
+
def create_with_metadata(
|
|
154
|
+
idempotency_key: :unset,
|
|
155
|
+
insights_query_request: nil
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Idempotency-Key' => idempotency_key, })
|
|
159
|
+
headers['Content-Type'] = 'application/json'
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
response = @version.create_with_metadata('POST', @uri, headers: headers, data: insights_query_request.to_json)
|
|
165
|
+
query_job_instance = QueryJobInstance.new(
|
|
166
|
+
@version,
|
|
167
|
+
response.body,
|
|
168
|
+
)
|
|
169
|
+
QueryJobInstanceMetadata.new(
|
|
170
|
+
@version,
|
|
171
|
+
query_job_instance,
|
|
172
|
+
response.headers,
|
|
173
|
+
response.status_code
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
##
|
|
179
|
+
# Lists QueryJobInstance records from the API as a list.
|
|
180
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
181
|
+
# memory before returning.
|
|
182
|
+
# @param [String] page_token Token for pagination
|
|
183
|
+
# @param [LongRunningOperationStatus] status The operation status to filter results by.
|
|
184
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
185
|
+
# guarantees to never return more than limit. Default is no limit
|
|
186
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
187
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
188
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
189
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
190
|
+
# @return [Array] Array of up to limit results
|
|
191
|
+
def list(page_token: :unset, status: :unset, limit: nil, page_size: nil)
|
|
192
|
+
self.stream(
|
|
193
|
+
page_token: page_token,
|
|
194
|
+
status: status,
|
|
195
|
+
limit: limit,
|
|
196
|
+
page_size: page_size
|
|
197
|
+
).entries
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
##
|
|
201
|
+
# Streams Instance records from the API as an Enumerable.
|
|
202
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
203
|
+
# is reached.
|
|
204
|
+
# @param [String] page_token Token for pagination
|
|
205
|
+
# @param [LongRunningOperationStatus] status The operation status to filter results by.
|
|
206
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
207
|
+
# guarantees to never return more than limit. Default is no limit
|
|
208
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
209
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
210
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
211
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
212
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
213
|
+
def stream(page_token: :unset, status: :unset, limit: nil, page_size: nil)
|
|
214
|
+
limits = @version.read_limits(limit, page_size)
|
|
215
|
+
|
|
216
|
+
page = self.page(
|
|
217
|
+
page_token: page_token,
|
|
218
|
+
status: status,
|
|
219
|
+
page_size: limits[:page_size], )
|
|
220
|
+
|
|
221
|
+
return [].each if page.nil?
|
|
222
|
+
|
|
223
|
+
result = @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
|
224
|
+
return [].each if result.nil?
|
|
225
|
+
result
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
##
|
|
229
|
+
# Lists QueryJobPageMetadata records from the API as a list.
|
|
230
|
+
# @param [String] page_token Token for pagination
|
|
231
|
+
# @param [LongRunningOperationStatus] status The operation status to filter results by.
|
|
232
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
233
|
+
# guarantees to never return more than limit. Default is no limit
|
|
234
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
235
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
236
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
237
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
238
|
+
# @return [Array] Array of up to limit results
|
|
239
|
+
def list_with_metadata(page_token: :unset, status: :unset, limit: nil, page_size: nil)
|
|
240
|
+
limits = @version.read_limits(limit, page_size)
|
|
241
|
+
params = Twilio::Values.of({
|
|
242
|
+
'pageToken' => page_token,
|
|
243
|
+
'status' => status,
|
|
244
|
+
|
|
245
|
+
'PageSize' => limits[:page_size],
|
|
246
|
+
});
|
|
247
|
+
headers = Twilio::Values.of({})
|
|
248
|
+
|
|
249
|
+
response = @version.page('GET', @uri, params: params, headers: headers)
|
|
250
|
+
|
|
251
|
+
QueryJobPageMetadata.new(@version, response, @solution, limits[:limit])
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
##
|
|
255
|
+
# When passed a block, yields QueryJobInstance records from the API.
|
|
256
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
257
|
+
# is reached.
|
|
258
|
+
def each
|
|
259
|
+
limits = @version.read_limits
|
|
260
|
+
|
|
261
|
+
page = self.page(page_size: limits[:page_size], )
|
|
262
|
+
|
|
263
|
+
return [].each if page.nil?
|
|
264
|
+
|
|
265
|
+
result = @version.stream(page,
|
|
266
|
+
limit: limits[:limit],
|
|
267
|
+
page_limit: limits[:page_limit])
|
|
268
|
+
return [].each if result.nil?
|
|
269
|
+
result.each {|x| yield x}
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
##
|
|
273
|
+
# Retrieve a single page of QueryJobInstance records from the API.
|
|
274
|
+
# Request is executed immediately.
|
|
275
|
+
# @param [String] page_token Token for pagination
|
|
276
|
+
# @param [LongRunningOperationStatus] status The operation status to filter results by.
|
|
277
|
+
|
|
278
|
+
# @return [Page] Page of QueryJobInstance
|
|
279
|
+
def page(page_token: :unset, status: :unset, page_size: :unset)
|
|
280
|
+
params = Twilio::Values.of({
|
|
281
|
+
'pageToken' => page_token,
|
|
282
|
+
'status' => status,
|
|
283
|
+
'PageSize' => page_size,
|
|
284
|
+
})
|
|
285
|
+
headers = Twilio::Values.of({})
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
response = @version.page('GET', @uri, params: params, headers: headers)
|
|
290
|
+
|
|
291
|
+
QueryJobPage.new(@version, response, @solution)
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
##
|
|
295
|
+
# Retrieve a single page of QueryJobInstance records from the API.
|
|
296
|
+
# Request is executed immediately.
|
|
297
|
+
# @param [String] target_url API-generated URL for the requested results page
|
|
298
|
+
# @return [Page] Page of QueryJobInstance
|
|
299
|
+
def get_page(target_url)
|
|
300
|
+
response = @version.domain.request(
|
|
301
|
+
'GET',
|
|
302
|
+
target_url
|
|
303
|
+
)
|
|
304
|
+
QueryJobPage.new(@version, response, @solution)
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
# Provide a user friendly representation
|
|
310
|
+
def to_s
|
|
311
|
+
'#<Twilio.Insights.V3.QueryJobList>'
|
|
312
|
+
end
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
class QueryJobContext < InstanceContext
|
|
317
|
+
##
|
|
318
|
+
# Initialize the QueryJobContext
|
|
319
|
+
# @param [Version] version Version that contains the resource
|
|
320
|
+
# @param [String] operation_id The unique identifier for the asynchronous query operation, in TTID format.
|
|
321
|
+
# @return [QueryJobContext] QueryJobContext
|
|
322
|
+
def initialize(version, operation_id)
|
|
323
|
+
|
|
324
|
+
apiV1Version = ApiV1Version.new version.domain, version
|
|
325
|
+
super(apiV1Version)
|
|
326
|
+
|
|
327
|
+
# Path Solution
|
|
328
|
+
@solution = { operation_id: operation_id, }
|
|
329
|
+
@uri = "/InsightsDomains/Conversations/QueryJobs/#{@solution[:operation_id]}"
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
end
|
|
333
|
+
##
|
|
334
|
+
# Fetch the QueryJobInstance
|
|
335
|
+
# @return [QueryJobInstance] Fetched QueryJobInstance
|
|
336
|
+
def fetch
|
|
337
|
+
|
|
338
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
payload = @version.fetch('GET', @uri, headers: headers)
|
|
345
|
+
QueryJobInstance.new(
|
|
346
|
+
@version,
|
|
347
|
+
payload,
|
|
348
|
+
operation_id: @solution[:operation_id],
|
|
349
|
+
)
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
##
|
|
353
|
+
# Fetch the QueryJobInstanceMetadata
|
|
354
|
+
# @return [QueryJobInstance] Fetched QueryJobInstance
|
|
355
|
+
def fetch_with_metadata
|
|
356
|
+
|
|
357
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
response = @version.fetch_with_metadata('GET', @uri, headers: headers)
|
|
364
|
+
query_job_instance = QueryJobInstance.new(
|
|
365
|
+
@version,
|
|
366
|
+
response.body,
|
|
367
|
+
operation_id: @solution[:operation_id],
|
|
368
|
+
)
|
|
369
|
+
QueryJobInstanceMetadata.new(
|
|
370
|
+
@version,
|
|
371
|
+
query_job_instance,
|
|
372
|
+
response.headers,
|
|
373
|
+
response.status_code
|
|
374
|
+
)
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
##
|
|
379
|
+
# Provide a user friendly representation
|
|
380
|
+
def to_s
|
|
381
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
382
|
+
"#<Twilio.Insights.V3.QueryJobContext #{context}>"
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
##
|
|
386
|
+
# Provide a detailed, user friendly representation
|
|
387
|
+
def inspect
|
|
388
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
389
|
+
"#<Twilio.Insights.V3.QueryJobContext #{context}>"
|
|
390
|
+
end
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
class QueryJobInstanceMetadata < InstanceResourceMetadata
|
|
394
|
+
##
|
|
395
|
+
# Initializes a new QueryJobInstanceMetadata.
|
|
396
|
+
# @param [Version] version Version that contains the resource
|
|
397
|
+
# @param [}QueryJobInstance] query_job_instance The instance associated with the metadata.
|
|
398
|
+
# @param [Hash] headers Header object with response headers.
|
|
399
|
+
# @param [Integer] status_code The HTTP status code of the response.
|
|
400
|
+
# @return [QueryJobInstanceMetadata] The initialized instance with metadata.
|
|
401
|
+
def initialize(version, query_job_instance, headers, status_code)
|
|
402
|
+
super(version, headers, status_code)
|
|
403
|
+
@query_job_instance = query_job_instance
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
def query_job
|
|
407
|
+
@query_job_instance
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
def headers
|
|
411
|
+
@headers
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
def status_code
|
|
415
|
+
@status_code
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
def to_s
|
|
419
|
+
"<Twilio.Api.V2010.QueryJobInstanceMetadata status=#{@status_code}>"
|
|
420
|
+
end
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
class QueryJobListResponse < InstanceListResource
|
|
424
|
+
# @param [Array<QueryJobInstance>] instance
|
|
425
|
+
# @param [Hash{String => Object}] headers
|
|
426
|
+
# @param [Integer] status_code
|
|
427
|
+
def initialize(version, payload, key)
|
|
428
|
+
@query_job_instance = payload.body[key].map do |data|
|
|
429
|
+
QueryJobInstance.new(version, data)
|
|
430
|
+
end
|
|
431
|
+
@headers = payload.headers
|
|
432
|
+
@status_code = payload.status_code
|
|
433
|
+
end
|
|
434
|
+
|
|
435
|
+
def query_job_instance
|
|
436
|
+
@instance
|
|
437
|
+
end
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
class QueryJobPage < TokenPage
|
|
441
|
+
##
|
|
442
|
+
# Initialize the QueryJobPage
|
|
443
|
+
# @param [Version] version Version that contains the resource
|
|
444
|
+
# @param [Response] response Response from the API
|
|
445
|
+
# @param [Hash] solution Path solution for the resource
|
|
446
|
+
# @return [QueryJobPage] QueryJobPage
|
|
447
|
+
def initialize(version, response, solution)
|
|
448
|
+
|
|
449
|
+
apiV1Version = ApiV1Version.new version.domain, version
|
|
450
|
+
super(apiV1Version, response)
|
|
451
|
+
|
|
452
|
+
# Path Solution
|
|
453
|
+
@solution = solution
|
|
454
|
+
end
|
|
455
|
+
|
|
456
|
+
##
|
|
457
|
+
# Build an instance of QueryJobInstance
|
|
458
|
+
# @param [Hash] payload Payload response from the API
|
|
459
|
+
# @return [QueryJobInstance] QueryJobInstance
|
|
460
|
+
def get_instance(payload)
|
|
461
|
+
QueryJobInstance.new(@version, payload)
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
##
|
|
465
|
+
# Provide a user friendly representation
|
|
466
|
+
def to_s
|
|
467
|
+
'<Twilio.Insights.V3.QueryJobPage>'
|
|
468
|
+
end
|
|
469
|
+
end
|
|
470
|
+
|
|
471
|
+
class QueryJobPageMetadata < PageMetadata
|
|
472
|
+
attr_reader :query_job_page
|
|
473
|
+
|
|
474
|
+
def initialize(version, response, solution, limit)
|
|
475
|
+
super(version, response)
|
|
476
|
+
@query_job_page = []
|
|
477
|
+
@limit = limit
|
|
478
|
+
key = get_key(response.body)
|
|
479
|
+
records = 0
|
|
480
|
+
while( limit != :unset && records < limit )
|
|
481
|
+
@query_job_page << QueryJobListResponse.new(version, @payload, key, limit - records)
|
|
482
|
+
@payload = self.next_page
|
|
483
|
+
break unless @payload
|
|
484
|
+
records += (@payload.body[key] || []).size
|
|
485
|
+
end
|
|
486
|
+
# Path Solution
|
|
487
|
+
@solution = solution
|
|
488
|
+
end
|
|
489
|
+
|
|
490
|
+
def each
|
|
491
|
+
@query_job_page.each do |record|
|
|
492
|
+
yield record
|
|
493
|
+
end
|
|
494
|
+
end
|
|
495
|
+
|
|
496
|
+
def to_s
|
|
497
|
+
'<Twilio::REST::Insights::V3PageMetadata>';
|
|
498
|
+
end
|
|
499
|
+
end
|
|
500
|
+
class QueryJobListResponse < InstanceListResource
|
|
501
|
+
|
|
502
|
+
# @param [Array<QueryJobInstance>] instance
|
|
503
|
+
# @param [Hash{String => Object}] headers
|
|
504
|
+
# @param [Integer] status_code
|
|
505
|
+
def initialize(version, payload, key, limit = :unset)
|
|
506
|
+
data_list = payload.body[key] || []
|
|
507
|
+
if limit != :unset
|
|
508
|
+
data_list = data_list[0, limit]
|
|
509
|
+
end
|
|
510
|
+
@query_job = data_list.map do |data|
|
|
511
|
+
QueryJobInstance.new(version, data)
|
|
512
|
+
end
|
|
513
|
+
@headers = payload.headers
|
|
514
|
+
@status_code = payload.status_code
|
|
515
|
+
end
|
|
516
|
+
|
|
517
|
+
def query_job
|
|
518
|
+
@query_job
|
|
519
|
+
end
|
|
520
|
+
|
|
521
|
+
def headers
|
|
522
|
+
@headers
|
|
523
|
+
end
|
|
524
|
+
|
|
525
|
+
def status_code
|
|
526
|
+
@status_code
|
|
527
|
+
end
|
|
528
|
+
end
|
|
529
|
+
|
|
530
|
+
class QueryJobInstance < InstanceResource
|
|
531
|
+
##
|
|
532
|
+
# Initialize the QueryJobInstance
|
|
533
|
+
# @param [Version] version Version that contains the resource
|
|
534
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
535
|
+
# @param [String] account_sid The SID of the
|
|
536
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this QueryJob
|
|
537
|
+
# resource.
|
|
538
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
|
539
|
+
# @return [QueryJobInstance] QueryJobInstance
|
|
540
|
+
def initialize(version, payload , operation_id: nil)
|
|
541
|
+
|
|
542
|
+
apiV1Version = ApiV1Version.new version.domain, version
|
|
543
|
+
super(apiV1Version)
|
|
544
|
+
|
|
545
|
+
# Marshaled Properties
|
|
546
|
+
@properties = {
|
|
547
|
+
'operation_id' => payload['operation_id'],
|
|
548
|
+
'status' => payload['status'],
|
|
549
|
+
'status_url' => payload['status_url'],
|
|
550
|
+
'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
|
|
551
|
+
'completed_at' => Twilio.deserialize_iso8601_datetime(payload['completed_at']),
|
|
552
|
+
'error' => payload['error'],
|
|
553
|
+
'result_url' => payload['result_url'],
|
|
554
|
+
'result_id' => payload['result_id'],
|
|
555
|
+
'result_retention_period' => payload['result_retention_period'],
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
# Context
|
|
559
|
+
@instance_context = nil
|
|
560
|
+
@params = { 'operation_id' => operation_id || @properties['operation_id'] , }
|
|
561
|
+
end
|
|
562
|
+
|
|
563
|
+
##
|
|
564
|
+
# Generate an instance context for the instance, the context is capable of
|
|
565
|
+
# performing various actions. All instance actions are proxied to the context
|
|
566
|
+
# @return [QueryJobContext] CallContext for this CallInstance
|
|
567
|
+
def context
|
|
568
|
+
unless @instance_context
|
|
569
|
+
@instance_context = QueryJobContext.new(@version , @params['operation_id'])
|
|
570
|
+
end
|
|
571
|
+
@instance_context
|
|
572
|
+
end
|
|
573
|
+
|
|
574
|
+
##
|
|
575
|
+
# @return [String] The unique identifier for the asynchronous query operation, in TTID format.
|
|
576
|
+
def operation_id
|
|
577
|
+
@properties['operation_id']
|
|
578
|
+
end
|
|
579
|
+
|
|
580
|
+
##
|
|
581
|
+
# @return [LongRunningOperationStatus]
|
|
582
|
+
def status
|
|
583
|
+
@properties['status']
|
|
584
|
+
end
|
|
585
|
+
|
|
586
|
+
##
|
|
587
|
+
# @return [String] The URI to poll for operation status.
|
|
588
|
+
def status_url
|
|
589
|
+
@properties['status_url']
|
|
590
|
+
end
|
|
591
|
+
|
|
592
|
+
##
|
|
593
|
+
# @return [Time] The time when the operation was accepted, in RFC 3339 UTC format.
|
|
594
|
+
def created_at
|
|
595
|
+
@properties['created_at']
|
|
596
|
+
end
|
|
597
|
+
|
|
598
|
+
##
|
|
599
|
+
# @return [Time] The time when the operation reached a terminal state (CANCELLED, COMPLETED, or FAILED), in RFC 3339 UTC format. Null while the operation is still PENDING or RUNNING.
|
|
600
|
+
def completed_at
|
|
601
|
+
@properties['completed_at']
|
|
602
|
+
end
|
|
603
|
+
|
|
604
|
+
##
|
|
605
|
+
# @return [OperationError] The error details, present only when status is FAILED.
|
|
606
|
+
def error
|
|
607
|
+
@properties['error']
|
|
608
|
+
end
|
|
609
|
+
|
|
610
|
+
##
|
|
611
|
+
# @return [String] The URL to retrieve query results, present only when status is COMPLETED. Supports pagination via the pageSize and pageToken query parameters.
|
|
612
|
+
def result_url
|
|
613
|
+
@properties['result_url']
|
|
614
|
+
end
|
|
615
|
+
|
|
616
|
+
##
|
|
617
|
+
# @return [String] The identifier of the results resource, present only when status is COMPLETED. Equal to operationId, since results are keyed by the operation ID.
|
|
618
|
+
def result_id
|
|
619
|
+
@properties['result_id']
|
|
620
|
+
end
|
|
621
|
+
|
|
622
|
+
##
|
|
623
|
+
# @return [String] The duration for how long results are retained, in ISO 8601 format.
|
|
624
|
+
def result_retention_period
|
|
625
|
+
@properties['result_retention_period']
|
|
626
|
+
end
|
|
627
|
+
|
|
628
|
+
##
|
|
629
|
+
# Fetch the QueryJobInstance
|
|
630
|
+
# @return [QueryJobInstance] Fetched QueryJobInstance
|
|
631
|
+
def fetch
|
|
632
|
+
|
|
633
|
+
context.fetch
|
|
634
|
+
end
|
|
635
|
+
|
|
636
|
+
##
|
|
637
|
+
# Provide a user friendly representation
|
|
638
|
+
def to_s
|
|
639
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
640
|
+
"<Twilio.Insights.V3.QueryJobInstance #{values}>"
|
|
641
|
+
end
|
|
642
|
+
|
|
643
|
+
##
|
|
644
|
+
# Provide a detailed, user friendly representation
|
|
645
|
+
def inspect
|
|
646
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
647
|
+
"<Twilio.Insights.V3.QueryJobInstance #{values}>"
|
|
648
|
+
end
|
|
649
|
+
end
|
|
650
|
+
|
|
651
|
+
end
|
|
652
|
+
end
|
|
653
|
+
end
|
|
654
|
+
end
|