twilio-ruby 5.7.2 → 5.8.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 +4 -4
- data/.travis.yml +4 -0
- data/CHANGES.md +19 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/framework/error.rb +20 -6
- data/lib/twilio-ruby/framework/version.rb +1 -10
- data/lib/twilio-ruby/jwt/access_token.rb +3 -1
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +0 -7
- data/lib/twilio-ruby/rest/preview.rb +11 -3
- data/lib/twilio-ruby/rest/preview/understand.rb +6 -6
- data/lib/twilio-ruby/rest/preview/understand/{service.rb → assistant.rb} +94 -55
- data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/field_type.rb +33 -23
- data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/field_type/field_value.rb +30 -22
- data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/intent.rb +39 -25
- data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/intent/field.rb +20 -20
- data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/intent/sample.rb +45 -27
- data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/model_build.rb +21 -21
- data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/query.rb +31 -26
- data/lib/twilio-ruby/rest/studio/v1/flow/engagement.rb +6 -2
- data/lib/twilio-ruby/rest/video/v1/recording.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/accounts/v1/credential/aws_spec.rb +9 -9
- data/spec/integration/accounts/v1/credential/public_key_spec.rb +9 -9
- data/spec/integration/api/v2010/account/address/dependent_phone_number_spec.rb +7 -7
- data/spec/integration/api/v2010/account/address_spec.rb +22 -22
- data/spec/integration/api/v2010/account/application_spec.rb +22 -22
- data/spec/integration/api/v2010/account/authorized_connect_app_spec.rb +9 -9
- data/spec/integration/api/v2010/account/available_phone_number/local_spec.rb +4 -4
- data/spec/integration/api/v2010/account/available_phone_number/machine_to_machine_spec.rb +4 -4
- data/spec/integration/api/v2010/account/available_phone_number/mobile_spec.rb +4 -4
- data/spec/integration/api/v2010/account/available_phone_number/national_spec.rb +4 -4
- data/spec/integration/api/v2010/account/available_phone_number/shared_cost_spec.rb +4 -4
- data/spec/integration/api/v2010/account/available_phone_number/toll_free_spec.rb +4 -4
- data/spec/integration/api/v2010/account/available_phone_number/voip_spec.rb +4 -4
- data/spec/integration/api/v2010/account/available_phone_number_spec.rb +7 -7
- data/spec/integration/api/v2010/account/call/feedback_spec.rb +15 -15
- data/spec/integration/api/v2010/account/call/feedback_summary_spec.rb +13 -13
- data/spec/integration/api/v2010/account/call/notification_spec.rb +21 -21
- data/spec/integration/api/v2010/account/call/recording_spec.rb +21 -21
- data/spec/integration/api/v2010/account/call_spec.rb +22 -22
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +35 -35
- data/spec/integration/api/v2010/account/conference_spec.rb +14 -14
- data/spec/integration/api/v2010/account/connect_app_spec.rb +14 -14
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +19 -19
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +29 -29
- data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +7 -7
- data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +7 -7
- data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +7 -7
- data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +22 -22
- data/spec/integration/api/v2010/account/key_spec.rb +19 -19
- data/spec/integration/api/v2010/account/message/feedback_spec.rb +5 -5
- data/spec/integration/api/v2010/account/message/media_spec.rb +21 -21
- data/spec/integration/api/v2010/account/message_spec.rb +22 -22
- data/spec/integration/api/v2010/account/new_key_spec.rb +3 -3
- data/spec/integration/api/v2010/account/new_signing_key_spec.rb +3 -3
- data/spec/integration/api/v2010/account/notification_spec.rb +14 -14
- data/spec/integration/api/v2010/account/outgoing_caller_id_spec.rb +19 -19
- data/spec/integration/api/v2010/account/queue/member_spec.rb +21 -21
- data/spec/integration/api/v2010/account/queue_spec.rb +22 -22
- data/spec/integration/api/v2010/account/recording/add_on_result/payload_spec.rb +28 -28
- data/spec/integration/api/v2010/account/recording/add_on_result_spec.rb +21 -21
- data/spec/integration/api/v2010/account/recording/transcription_spec.rb +21 -21
- data/spec/integration/api/v2010/account/recording_spec.rb +14 -14
- data/spec/integration/api/v2010/account/short_code_spec.rb +14 -14
- data/spec/integration/api/v2010/account/signing_key_spec.rb +19 -19
- data/spec/integration/api/v2010/account/sip/credential_list/credential_spec.rb +33 -33
- data/spec/integration/api/v2010/account/sip/credential_list_spec.rb +22 -22
- data/spec/integration/api/v2010/account/sip/domain/credential_list_mapping_spec.rb +29 -29
- data/spec/integration/api/v2010/account/sip/domain/ip_access_control_list_mapping_spec.rb +29 -29
- data/spec/integration/api/v2010/account/sip/domain_spec.rb +22 -22
- data/spec/integration/api/v2010/account/sip/ip_access_control_list/ip_address_spec.rb +33 -33
- data/spec/integration/api/v2010/account/sip/ip_access_control_list_spec.rb +22 -22
- data/spec/integration/api/v2010/account/token_spec.rb +3 -3
- data/spec/integration/api/v2010/account/transcription_spec.rb +14 -14
- data/spec/integration/api/v2010/account/usage/record/all_time_spec.rb +4 -4
- data/spec/integration/api/v2010/account/usage/record/daily_spec.rb +4 -4
- data/spec/integration/api/v2010/account/usage/record/last_month_spec.rb +4 -4
- data/spec/integration/api/v2010/account/usage/record/monthly_spec.rb +4 -4
- data/spec/integration/api/v2010/account/usage/record/this_month_spec.rb +4 -4
- data/spec/integration/api/v2010/account/usage/record/today_spec.rb +4 -4
- data/spec/integration/api/v2010/account/usage/record/yearly_spec.rb +4 -4
- data/spec/integration/api/v2010/account/usage/record/yesterday_spec.rb +4 -4
- data/spec/integration/api/v2010/account/usage/record_spec.rb +4 -4
- data/spec/integration/api/v2010/account/usage/trigger_spec.rb +22 -22
- data/spec/integration/api/v2010/account/validation_request_spec.rb +3 -3
- data/spec/integration/api/v2010/account_spec.rb +84 -68
- data/spec/integration/chat/v1/credential_spec.rb +9 -9
- data/spec/integration/chat/v1/service/channel/invite_spec.rb +26 -26
- data/spec/integration/chat/v1/service/channel/member_spec.rb +36 -36
- data/spec/integration/chat/v1/service/channel/message_spec.rb +35 -35
- data/spec/integration/chat/v1/service/channel_spec.rb +22 -22
- data/spec/integration/chat/v1/service/role_spec.rb +22 -22
- data/spec/integration/chat/v1/service/user/user_channel_spec.rb +7 -7
- data/spec/integration/chat/v1/service/user_spec.rb +22 -22
- data/spec/integration/chat/v1/service_spec.rb +9 -9
- data/spec/integration/chat/v2/credential_spec.rb +9 -9
- data/spec/integration/chat/v2/service/binding_spec.rb +14 -14
- data/spec/integration/chat/v2/service/channel/invite_spec.rb +26 -26
- data/spec/integration/chat/v2/service/channel/member_spec.rb +33 -33
- data/spec/integration/chat/v2/service/channel/message_spec.rb +40 -40
- data/spec/integration/chat/v2/service/channel_spec.rb +22 -22
- data/spec/integration/chat/v2/service/role_spec.rb +22 -22
- data/spec/integration/chat/v2/service/user/user_binding_spec.rb +21 -21
- data/spec/integration/chat/v2/service/user/user_channel_spec.rb +7 -7
- data/spec/integration/chat/v2/service/user_spec.rb +22 -22
- data/spec/integration/chat/v2/service_spec.rb +9 -9
- data/spec/integration/fax/v1/fax/fax_media_spec.rb +13 -13
- data/spec/integration/fax/v1/fax_spec.rb +9 -9
- data/spec/integration/ip_messaging/v1/credential_spec.rb +9 -9
- data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +26 -26
- data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +36 -36
- data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +35 -35
- data/spec/integration/ip_messaging/v1/service/channel_spec.rb +22 -22
- data/spec/integration/ip_messaging/v1/service/role_spec.rb +22 -22
- data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +7 -7
- data/spec/integration/ip_messaging/v1/service/user_spec.rb +22 -22
- data/spec/integration/ip_messaging/v1/service_spec.rb +9 -9
- data/spec/integration/ip_messaging/v2/credential_spec.rb +9 -9
- data/spec/integration/ip_messaging/v2/service/binding_spec.rb +14 -14
- data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +26 -26
- data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +33 -33
- data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +40 -40
- data/spec/integration/ip_messaging/v2/service/channel_spec.rb +22 -22
- data/spec/integration/ip_messaging/v2/service/role_spec.rb +22 -22
- data/spec/integration/ip_messaging/v2/service/user/user_binding_spec.rb +21 -21
- data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +7 -7
- data/spec/integration/ip_messaging/v2/service/user_spec.rb +22 -22
- data/spec/integration/ip_messaging/v2/service_spec.rb +9 -9
- data/spec/integration/lookups/v1/phone_number_spec.rb +0 -10
- data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +16 -16
- data/spec/integration/messaging/v1/service/phone_number_spec.rb +21 -21
- data/spec/integration/messaging/v1/service/short_code_spec.rb +19 -19
- data/spec/integration/messaging/v1/service_spec.rb +9 -9
- data/spec/integration/monitor/v1/alert_spec.rb +6 -6
- data/spec/integration/monitor/v1/event_spec.rb +3 -3
- data/spec/integration/notify/v1/credential_spec.rb +9 -9
- data/spec/integration/notify/v1/service/binding_spec.rb +17 -17
- data/spec/integration/notify/v1/service/notification_spec.rb +4 -4
- data/spec/integration/notify/v1/service/segment_spec.rb +4 -4
- data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +15 -15
- data/spec/integration/notify/v1/service/user/user_binding_spec.rb +28 -28
- data/spec/integration/notify/v1/service/user_spec.rb +17 -17
- data/spec/integration/notify/v1/service_spec.rb +9 -9
- data/spec/integration/preview/acc_security/service/verification_check_spec.rb +3 -3
- data/spec/integration/preview/acc_security/service/verification_spec.rb +3 -3
- data/spec/integration/preview/acc_security/service_spec.rb +6 -6
- data/spec/integration/preview/deployed_devices/fleet/certificate_spec.rb +22 -22
- data/spec/integration/preview/deployed_devices/fleet/deployment_spec.rb +22 -22
- data/spec/integration/preview/deployed_devices/fleet/device_spec.rb +22 -22
- data/spec/integration/preview/deployed_devices/fleet/key_spec.rb +22 -22
- data/spec/integration/preview/deployed_devices/fleet_spec.rb +9 -9
- data/spec/integration/preview/hosted_numbers/authorization_document/dependent_hosted_number_order_spec.rb +4 -4
- data/spec/integration/preview/hosted_numbers/authorization_document_spec.rb +9 -9
- data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +9 -9
- data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +9 -9
- data/spec/integration/preview/marketplace/available_add_on_spec.rb +3 -3
- data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +14 -14
- data/spec/integration/preview/marketplace/installed_add_on_spec.rb +12 -12
- data/spec/integration/preview/proxy/service/phone_number_spec.rb +19 -19
- data/spec/integration/preview/proxy/service/session/interaction_spec.rb +12 -12
- data/spec/integration/preview/proxy/service/session/participant/message_interaction_spec.rb +23 -23
- data/spec/integration/preview/proxy/service/session/participant_spec.rb +31 -31
- data/spec/integration/preview/proxy/service/session_spec.rb +21 -21
- data/spec/integration/preview/proxy/service/short_code_spec.rb +19 -19
- data/spec/integration/preview/proxy/service_spec.rb +9 -9
- data/spec/integration/preview/studio/flow/engagement/step_spec.rb +12 -12
- data/spec/integration/preview/studio/flow/engagement_spec.rb +11 -11
- data/spec/integration/preview/studio/flow_spec.rb +6 -6
- data/spec/integration/preview/sync/service/document/document_permission_spec.rb +22 -22
- data/spec/integration/preview/sync/service/document_spec.rb +23 -23
- data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +33 -33
- data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +22 -22
- data/spec/integration/preview/sync/service/sync_list_spec.rb +17 -17
- data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +33 -33
- data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +22 -22
- data/spec/integration/preview/sync/service/sync_map_spec.rb +17 -17
- data/spec/integration/preview/sync/service_spec.rb +9 -9
- data/spec/integration/preview/understand/assistant/field_type/field_value_spec.rb +208 -0
- data/spec/integration/preview/understand/{service → assistant}/field_type_spec.rb +38 -38
- data/spec/integration/preview/understand/{service → assistant}/intent/field_spec.rb +36 -36
- data/spec/integration/preview/understand/assistant/intent/sample_spec.rb +251 -0
- data/spec/integration/preview/understand/{service → assistant}/intent_spec.rb +42 -46
- data/spec/integration/preview/understand/{service → assistant}/model_build_spec.rb +34 -34
- data/spec/integration/preview/understand/{service → assistant}/query_spec.rb +42 -38
- data/spec/integration/preview/understand/{service_spec.rb → assistant_spec.rb} +57 -49
- data/spec/integration/preview/wireless/command_spec.rb +3 -3
- data/spec/integration/preview/wireless/rate_plan_spec.rb +9 -9
- data/spec/integration/preview/wireless/sim/usage_spec.rb +3 -3
- data/spec/integration/preview/wireless/sim_spec.rb +6 -6
- data/spec/integration/proxy/v1/service/phone_number_spec.rb +16 -16
- data/spec/integration/proxy/v1/service/session/interaction_spec.rb +19 -19
- data/spec/integration/proxy/v1/service/session/participant/message_interaction_spec.rb +23 -23
- data/spec/integration/proxy/v1/service/session/participant_spec.rb +31 -31
- data/spec/integration/proxy/v1/service/session_spec.rb +21 -21
- data/spec/integration/proxy/v1/service/short_code_spec.rb +19 -19
- data/spec/integration/proxy/v1/service_spec.rb +9 -9
- data/spec/integration/studio/v1/flow/engagement/engagement_context_spec.rb +5 -5
- data/spec/integration/studio/v1/flow/engagement/step/step_context_spec.rb +7 -7
- data/spec/integration/studio/v1/flow/engagement/step_spec.rb +12 -12
- data/spec/integration/studio/v1/flow/engagement_spec.rb +11 -11
- data/spec/integration/studio/v1/flow_spec.rb +6 -6
- data/spec/integration/sync/v1/service/document/document_permission_spec.rb +22 -22
- data/spec/integration/sync/v1/service/document_spec.rb +22 -22
- data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +30 -30
- data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +22 -22
- data/spec/integration/sync/v1/service/sync_list_spec.rb +22 -22
- data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +30 -30
- data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +22 -22
- data/spec/integration/sync/v1/service/sync_map_spec.rb +22 -22
- data/spec/integration/sync/v1/service/sync_stream/stream_message_spec.rb +8 -8
- data/spec/integration/sync/v1/service/sync_stream_spec.rb +22 -22
- data/spec/integration/sync/v1/service_spec.rb +9 -9
- data/spec/integration/taskrouter/v1/workspace/activity_spec.rb +22 -22
- data/spec/integration/taskrouter/v1/workspace/event_spec.rb +9 -9
- data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +21 -21
- data/spec/integration/taskrouter/v1/workspace/task_channel_spec.rb +9 -9
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_statistics_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queues_statistics_spec.rb +4 -4
- data/spec/integration/taskrouter/v1/workspace/task_queue_spec.rb +26 -26
- data/spec/integration/taskrouter/v1/workspace/task_spec.rb +23 -23
- data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +21 -21
- data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +21 -21
- data/spec/integration/taskrouter/v1/workspace/worker/worker_statistics_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/worker/workers_cumulative_statistics_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/worker/workers_real_time_statistics_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/worker/workers_statistics_spec.rb +3 -3
- data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +22 -22
- data/spec/integration/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/workflow/workflow_real_time_statistics_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/workflow/workflow_statistics_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +22 -22
- data/spec/integration/taskrouter/v1/workspace/workspace_cumulative_statistics_spec.rb +3 -3
- data/spec/integration/taskrouter/v1/workspace/workspace_real_time_statistics_spec.rb +3 -3
- data/spec/integration/taskrouter/v1/workspace/workspace_statistics_spec.rb +3 -3
- data/spec/integration/taskrouter/v1/workspace_spec.rb +9 -9
- data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +20 -20
- data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +20 -20
- data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +22 -22
- data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +20 -20
- data/spec/integration/trunking/v1/trunk_spec.rb +9 -9
- data/spec/integration/video/v1/composition_spec.rb +6 -6
- data/spec/integration/video/v1/recording_spec.rb +10 -6
- data/spec/integration/video/v1/room/recording_spec.rb +9 -9
- data/spec/integration/video/v1/room/room_participant/room_participant_published_track_spec.rb +12 -12
- data/spec/integration/video/v1/room/room_participant/room_participant_subscribed_track_spec.rb +12 -12
- data/spec/integration/video/v1/room/room_participant_spec.rb +14 -14
- data/spec/integration/video/v1/room_spec.rb +6 -6
- data/spec/integration/wireless/v1/command_spec.rb +3 -3
- data/spec/integration/wireless/v1/rate_plan_spec.rb +9 -9
- data/spec/integration/wireless/v1/sim/data_session_spec.rb +3 -3
- data/spec/integration/wireless/v1/sim/usage_record_spec.rb +3 -3
- data/spec/integration/wireless/v1/sim_spec.rb +6 -6
- data/spec/jwt/access_token_spec.rb +2 -0
- metadata +26 -26
- data/spec/integration/preview/understand/service/field_type/field_value_spec.rb +0 -205
- data/spec/integration/preview/understand/service/intent/sample_spec.rb +0 -247
|
@@ -8,21 +8,21 @@ module Twilio
|
|
|
8
8
|
module REST
|
|
9
9
|
class Preview < Domain
|
|
10
10
|
class Understand < Version
|
|
11
|
-
class
|
|
11
|
+
class AssistantContext < InstanceContext
|
|
12
12
|
##
|
|
13
13
|
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
14
14
|
class FieldTypeList < ListResource
|
|
15
15
|
##
|
|
16
16
|
# Initialize the FieldTypeList
|
|
17
17
|
# @param [Version] version Version that contains the resource
|
|
18
|
-
# @param [String]
|
|
18
|
+
# @param [String] assistant_sid The assistant_sid
|
|
19
19
|
# @return [FieldTypeList] FieldTypeList
|
|
20
|
-
def initialize(version,
|
|
20
|
+
def initialize(version, assistant_sid: nil)
|
|
21
21
|
super(version)
|
|
22
22
|
|
|
23
23
|
# Path Solution
|
|
24
|
-
@solution = {
|
|
25
|
-
@uri = "/
|
|
24
|
+
@solution = {assistant_sid: assistant_sid}
|
|
25
|
+
@uri = "/Assistants/#{@solution[:assistant_sid]}/FieldTypes"
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
##
|
|
@@ -122,7 +122,7 @@ module Twilio
|
|
|
122
122
|
data: data
|
|
123
123
|
)
|
|
124
124
|
|
|
125
|
-
FieldTypeInstance.new(@version, payload,
|
|
125
|
+
FieldTypeInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
|
|
126
126
|
end
|
|
127
127
|
|
|
128
128
|
##
|
|
@@ -153,7 +153,7 @@ module Twilio
|
|
|
153
153
|
# @param [Hash] payload Payload response from the API
|
|
154
154
|
# @return [FieldTypeInstance] FieldTypeInstance
|
|
155
155
|
def get_instance(payload)
|
|
156
|
-
FieldTypeInstance.new(@version, payload,
|
|
156
|
+
FieldTypeInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
|
|
157
157
|
end
|
|
158
158
|
|
|
159
159
|
##
|
|
@@ -169,15 +169,15 @@ module Twilio
|
|
|
169
169
|
##
|
|
170
170
|
# Initialize the FieldTypeContext
|
|
171
171
|
# @param [Version] version Version that contains the resource
|
|
172
|
-
# @param [String]
|
|
172
|
+
# @param [String] assistant_sid The assistant_sid
|
|
173
173
|
# @param [String] sid The sid
|
|
174
174
|
# @return [FieldTypeContext] FieldTypeContext
|
|
175
|
-
def initialize(version,
|
|
175
|
+
def initialize(version, assistant_sid, sid)
|
|
176
176
|
super(version)
|
|
177
177
|
|
|
178
178
|
# Path Solution
|
|
179
|
-
@solution = {
|
|
180
|
-
@uri = "/
|
|
179
|
+
@solution = {assistant_sid: assistant_sid, sid: sid, }
|
|
180
|
+
@uri = "/Assistants/#{@solution[:assistant_sid]}/FieldTypes/#{@solution[:sid]}"
|
|
181
181
|
|
|
182
182
|
# Dependents
|
|
183
183
|
@field_values = nil
|
|
@@ -195,7 +195,12 @@ module Twilio
|
|
|
195
195
|
params,
|
|
196
196
|
)
|
|
197
197
|
|
|
198
|
-
FieldTypeInstance.new(
|
|
198
|
+
FieldTypeInstance.new(
|
|
199
|
+
@version,
|
|
200
|
+
payload,
|
|
201
|
+
assistant_sid: @solution[:assistant_sid],
|
|
202
|
+
sid: @solution[:sid],
|
|
203
|
+
)
|
|
199
204
|
end
|
|
200
205
|
|
|
201
206
|
##
|
|
@@ -212,7 +217,12 @@ module Twilio
|
|
|
212
217
|
data: data,
|
|
213
218
|
)
|
|
214
219
|
|
|
215
|
-
FieldTypeInstance.new(
|
|
220
|
+
FieldTypeInstance.new(
|
|
221
|
+
@version,
|
|
222
|
+
payload,
|
|
223
|
+
assistant_sid: @solution[:assistant_sid],
|
|
224
|
+
sid: @solution[:sid],
|
|
225
|
+
)
|
|
216
226
|
end
|
|
217
227
|
|
|
218
228
|
##
|
|
@@ -230,13 +240,13 @@ module Twilio
|
|
|
230
240
|
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
|
231
241
|
|
|
232
242
|
if sid != :unset
|
|
233
|
-
return FieldValueContext.new(@version, @solution[:
|
|
243
|
+
return FieldValueContext.new(@version, @solution[:assistant_sid], @solution[:sid], sid, )
|
|
234
244
|
end
|
|
235
245
|
|
|
236
246
|
unless @field_values
|
|
237
247
|
@field_values = FieldValueList.new(
|
|
238
248
|
@version,
|
|
239
|
-
|
|
249
|
+
assistant_sid: @solution[:assistant_sid],
|
|
240
250
|
field_type_sid: @solution[:sid],
|
|
241
251
|
)
|
|
242
252
|
end
|
|
@@ -259,10 +269,10 @@ module Twilio
|
|
|
259
269
|
# Initialize the FieldTypeInstance
|
|
260
270
|
# @param [Version] version Version that contains the resource
|
|
261
271
|
# @param [Hash] payload payload that contains response from Twilio
|
|
262
|
-
# @param [String]
|
|
272
|
+
# @param [String] assistant_sid The assistant_sid
|
|
263
273
|
# @param [String] sid The sid
|
|
264
274
|
# @return [FieldTypeInstance] FieldTypeInstance
|
|
265
|
-
def initialize(version, payload,
|
|
275
|
+
def initialize(version, payload, assistant_sid: nil, sid: nil)
|
|
266
276
|
super(version)
|
|
267
277
|
|
|
268
278
|
# Marshaled Properties
|
|
@@ -272,7 +282,7 @@ module Twilio
|
|
|
272
282
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
273
283
|
'friendly_name' => payload['friendly_name'],
|
|
274
284
|
'links' => payload['links'],
|
|
275
|
-
'
|
|
285
|
+
'assistant_sid' => payload['assistant_sid'],
|
|
276
286
|
'sid' => payload['sid'],
|
|
277
287
|
'unique_name' => payload['unique_name'],
|
|
278
288
|
'url' => payload['url'],
|
|
@@ -280,7 +290,7 @@ module Twilio
|
|
|
280
290
|
|
|
281
291
|
# Context
|
|
282
292
|
@instance_context = nil
|
|
283
|
-
@params = {'
|
|
293
|
+
@params = {'assistant_sid' => assistant_sid, 'sid' => sid || @properties['sid'], }
|
|
284
294
|
end
|
|
285
295
|
|
|
286
296
|
##
|
|
@@ -289,7 +299,7 @@ module Twilio
|
|
|
289
299
|
# @return [FieldTypeContext] FieldTypeContext for this FieldTypeInstance
|
|
290
300
|
def context
|
|
291
301
|
unless @instance_context
|
|
292
|
-
@instance_context = FieldTypeContext.new(@version, @params['
|
|
302
|
+
@instance_context = FieldTypeContext.new(@version, @params['assistant_sid'], @params['sid'], )
|
|
293
303
|
end
|
|
294
304
|
@instance_context
|
|
295
305
|
end
|
|
@@ -325,9 +335,9 @@ module Twilio
|
|
|
325
335
|
end
|
|
326
336
|
|
|
327
337
|
##
|
|
328
|
-
# @return [String] The
|
|
329
|
-
def
|
|
330
|
-
@properties['
|
|
338
|
+
# @return [String] The assistant_sid
|
|
339
|
+
def assistant_sid
|
|
340
|
+
@properties['assistant_sid']
|
|
331
341
|
end
|
|
332
342
|
|
|
333
343
|
##
|
data/lib/twilio-ruby/rest/preview/understand/{service → assistant}/field_type/field_value.rb
RENAMED
|
@@ -8,7 +8,7 @@ module Twilio
|
|
|
8
8
|
module REST
|
|
9
9
|
class Preview < Domain
|
|
10
10
|
class Understand < Version
|
|
11
|
-
class
|
|
11
|
+
class AssistantContext < InstanceContext
|
|
12
12
|
class FieldTypeContext < InstanceContext
|
|
13
13
|
##
|
|
14
14
|
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
@@ -16,15 +16,15 @@ module Twilio
|
|
|
16
16
|
##
|
|
17
17
|
# Initialize the FieldValueList
|
|
18
18
|
# @param [Version] version Version that contains the resource
|
|
19
|
-
# @param [String]
|
|
19
|
+
# @param [String] assistant_sid The assistant_sid
|
|
20
20
|
# @param [String] field_type_sid The field_type_sid
|
|
21
21
|
# @return [FieldValueList] FieldValueList
|
|
22
|
-
def initialize(version,
|
|
22
|
+
def initialize(version, assistant_sid: nil, field_type_sid: nil)
|
|
23
23
|
super(version)
|
|
24
24
|
|
|
25
25
|
# Path Solution
|
|
26
|
-
@solution = {
|
|
27
|
-
@uri = "/
|
|
26
|
+
@solution = {assistant_sid: assistant_sid, field_type_sid: field_type_sid}
|
|
27
|
+
@uri = "/Assistants/#{@solution[:assistant_sid]}/FieldTypes/#{@solution[:field_type_sid]}/FieldValues"
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
##
|
|
@@ -118,9 +118,10 @@ module Twilio
|
|
|
118
118
|
# Request is executed immediately.
|
|
119
119
|
# @param [String] language The language
|
|
120
120
|
# @param [String] value The value
|
|
121
|
+
# @param [String] synonym_of The synonym_of
|
|
121
122
|
# @return [FieldValueInstance] Newly created FieldValueInstance
|
|
122
|
-
def create(language: nil, value: nil)
|
|
123
|
-
data = Twilio::Values.of({'Language' => language, 'Value' => value, })
|
|
123
|
+
def create(language: nil, value: nil, synonym_of: :unset)
|
|
124
|
+
data = Twilio::Values.of({'Language' => language, 'Value' => value, 'SynonymOf' => synonym_of, })
|
|
124
125
|
|
|
125
126
|
payload = @version.create(
|
|
126
127
|
'POST',
|
|
@@ -131,7 +132,7 @@ module Twilio
|
|
|
131
132
|
FieldValueInstance.new(
|
|
132
133
|
@version,
|
|
133
134
|
payload,
|
|
134
|
-
|
|
135
|
+
assistant_sid: @solution[:assistant_sid],
|
|
135
136
|
field_type_sid: @solution[:field_type_sid],
|
|
136
137
|
)
|
|
137
138
|
end
|
|
@@ -167,7 +168,7 @@ module Twilio
|
|
|
167
168
|
FieldValueInstance.new(
|
|
168
169
|
@version,
|
|
169
170
|
payload,
|
|
170
|
-
|
|
171
|
+
assistant_sid: @solution[:assistant_sid],
|
|
171
172
|
field_type_sid: @solution[:field_type_sid],
|
|
172
173
|
)
|
|
173
174
|
end
|
|
@@ -185,16 +186,16 @@ module Twilio
|
|
|
185
186
|
##
|
|
186
187
|
# Initialize the FieldValueContext
|
|
187
188
|
# @param [Version] version Version that contains the resource
|
|
188
|
-
# @param [String]
|
|
189
|
+
# @param [String] assistant_sid The assistant_sid
|
|
189
190
|
# @param [String] field_type_sid The field_type_sid
|
|
190
191
|
# @param [String] sid The sid
|
|
191
192
|
# @return [FieldValueContext] FieldValueContext
|
|
192
|
-
def initialize(version,
|
|
193
|
+
def initialize(version, assistant_sid, field_type_sid, sid)
|
|
193
194
|
super(version)
|
|
194
195
|
|
|
195
196
|
# Path Solution
|
|
196
|
-
@solution = {
|
|
197
|
-
@uri = "/
|
|
197
|
+
@solution = {assistant_sid: assistant_sid, field_type_sid: field_type_sid, sid: sid, }
|
|
198
|
+
@uri = "/Assistants/#{@solution[:assistant_sid]}/FieldTypes/#{@solution[:field_type_sid]}/FieldValues/#{@solution[:sid]}"
|
|
198
199
|
end
|
|
199
200
|
|
|
200
201
|
##
|
|
@@ -212,7 +213,7 @@ module Twilio
|
|
|
212
213
|
FieldValueInstance.new(
|
|
213
214
|
@version,
|
|
214
215
|
payload,
|
|
215
|
-
|
|
216
|
+
assistant_sid: @solution[:assistant_sid],
|
|
216
217
|
field_type_sid: @solution[:field_type_sid],
|
|
217
218
|
sid: @solution[:sid],
|
|
218
219
|
)
|
|
@@ -240,11 +241,11 @@ module Twilio
|
|
|
240
241
|
# Initialize the FieldValueInstance
|
|
241
242
|
# @param [Version] version Version that contains the resource
|
|
242
243
|
# @param [Hash] payload payload that contains response from Twilio
|
|
243
|
-
# @param [String]
|
|
244
|
+
# @param [String] assistant_sid The assistant_sid
|
|
244
245
|
# @param [String] field_type_sid The field_type_sid
|
|
245
246
|
# @param [String] sid The sid
|
|
246
247
|
# @return [FieldValueInstance] FieldValueInstance
|
|
247
|
-
def initialize(version, payload,
|
|
248
|
+
def initialize(version, payload, assistant_sid: nil, field_type_sid: nil, sid: nil)
|
|
248
249
|
super(version)
|
|
249
250
|
|
|
250
251
|
# Marshaled Properties
|
|
@@ -254,16 +255,17 @@ module Twilio
|
|
|
254
255
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
255
256
|
'field_type_sid' => payload['field_type_sid'],
|
|
256
257
|
'language' => payload['language'],
|
|
257
|
-
'
|
|
258
|
+
'assistant_sid' => payload['assistant_sid'],
|
|
258
259
|
'sid' => payload['sid'],
|
|
259
260
|
'value' => payload['value'],
|
|
260
261
|
'url' => payload['url'],
|
|
262
|
+
'synonym_of' => payload['synonym_of'],
|
|
261
263
|
}
|
|
262
264
|
|
|
263
265
|
# Context
|
|
264
266
|
@instance_context = nil
|
|
265
267
|
@params = {
|
|
266
|
-
'
|
|
268
|
+
'assistant_sid' => assistant_sid,
|
|
267
269
|
'field_type_sid' => field_type_sid,
|
|
268
270
|
'sid' => sid || @properties['sid'],
|
|
269
271
|
}
|
|
@@ -277,7 +279,7 @@ module Twilio
|
|
|
277
279
|
unless @instance_context
|
|
278
280
|
@instance_context = FieldValueContext.new(
|
|
279
281
|
@version,
|
|
280
|
-
@params['
|
|
282
|
+
@params['assistant_sid'],
|
|
281
283
|
@params['field_type_sid'],
|
|
282
284
|
@params['sid'],
|
|
283
285
|
)
|
|
@@ -316,9 +318,9 @@ module Twilio
|
|
|
316
318
|
end
|
|
317
319
|
|
|
318
320
|
##
|
|
319
|
-
# @return [String] The
|
|
320
|
-
def
|
|
321
|
-
@properties['
|
|
321
|
+
# @return [String] The assistant_sid
|
|
322
|
+
def assistant_sid
|
|
323
|
+
@properties['assistant_sid']
|
|
322
324
|
end
|
|
323
325
|
|
|
324
326
|
##
|
|
@@ -339,6 +341,12 @@ module Twilio
|
|
|
339
341
|
@properties['url']
|
|
340
342
|
end
|
|
341
343
|
|
|
344
|
+
##
|
|
345
|
+
# @return [String] The synonym_of
|
|
346
|
+
def synonym_of
|
|
347
|
+
@properties['synonym_of']
|
|
348
|
+
end
|
|
349
|
+
|
|
342
350
|
##
|
|
343
351
|
# Fetch a FieldValueInstance
|
|
344
352
|
# @return [FieldValueInstance] Fetched FieldValueInstance
|
|
@@ -8,21 +8,21 @@ module Twilio
|
|
|
8
8
|
module REST
|
|
9
9
|
class Preview < Domain
|
|
10
10
|
class Understand < Version
|
|
11
|
-
class
|
|
11
|
+
class AssistantContext < InstanceContext
|
|
12
12
|
##
|
|
13
13
|
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
14
14
|
class IntentList < ListResource
|
|
15
15
|
##
|
|
16
16
|
# Initialize the IntentList
|
|
17
17
|
# @param [Version] version Version that contains the resource
|
|
18
|
-
# @param [String]
|
|
18
|
+
# @param [String] assistant_sid The assistant_sid
|
|
19
19
|
# @return [IntentList] IntentList
|
|
20
|
-
def initialize(version,
|
|
20
|
+
def initialize(version, assistant_sid: nil)
|
|
21
21
|
super(version)
|
|
22
22
|
|
|
23
23
|
# Path Solution
|
|
24
|
-
@solution = {
|
|
25
|
-
@uri = "/
|
|
24
|
+
@solution = {assistant_sid: assistant_sid}
|
|
25
|
+
@uri = "/Assistants/#{@solution[:assistant_sid]}/Intents"
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
##
|
|
@@ -122,7 +122,7 @@ module Twilio
|
|
|
122
122
|
data: data
|
|
123
123
|
)
|
|
124
124
|
|
|
125
|
-
IntentInstance.new(@version, payload,
|
|
125
|
+
IntentInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
|
|
126
126
|
end
|
|
127
127
|
|
|
128
128
|
##
|
|
@@ -153,7 +153,7 @@ module Twilio
|
|
|
153
153
|
# @param [Hash] payload Payload response from the API
|
|
154
154
|
# @return [IntentInstance] IntentInstance
|
|
155
155
|
def get_instance(payload)
|
|
156
|
-
IntentInstance.new(@version, payload,
|
|
156
|
+
IntentInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
|
|
157
157
|
end
|
|
158
158
|
|
|
159
159
|
##
|
|
@@ -169,15 +169,15 @@ module Twilio
|
|
|
169
169
|
##
|
|
170
170
|
# Initialize the IntentContext
|
|
171
171
|
# @param [Version] version Version that contains the resource
|
|
172
|
-
# @param [String]
|
|
172
|
+
# @param [String] assistant_sid The assistant_sid
|
|
173
173
|
# @param [String] sid The sid
|
|
174
174
|
# @return [IntentContext] IntentContext
|
|
175
|
-
def initialize(version,
|
|
175
|
+
def initialize(version, assistant_sid, sid)
|
|
176
176
|
super(version)
|
|
177
177
|
|
|
178
178
|
# Path Solution
|
|
179
|
-
@solution = {
|
|
180
|
-
@uri = "/
|
|
179
|
+
@solution = {assistant_sid: assistant_sid, sid: sid, }
|
|
180
|
+
@uri = "/Assistants/#{@solution[:assistant_sid]}/Intents/#{@solution[:sid]}"
|
|
181
181
|
|
|
182
182
|
# Dependents
|
|
183
183
|
@fields = nil
|
|
@@ -196,7 +196,12 @@ module Twilio
|
|
|
196
196
|
params,
|
|
197
197
|
)
|
|
198
198
|
|
|
199
|
-
IntentInstance.new(
|
|
199
|
+
IntentInstance.new(
|
|
200
|
+
@version,
|
|
201
|
+
payload,
|
|
202
|
+
assistant_sid: @solution[:assistant_sid],
|
|
203
|
+
sid: @solution[:sid],
|
|
204
|
+
)
|
|
200
205
|
end
|
|
201
206
|
|
|
202
207
|
##
|
|
@@ -213,7 +218,12 @@ module Twilio
|
|
|
213
218
|
data: data,
|
|
214
219
|
)
|
|
215
220
|
|
|
216
|
-
IntentInstance.new(
|
|
221
|
+
IntentInstance.new(
|
|
222
|
+
@version,
|
|
223
|
+
payload,
|
|
224
|
+
assistant_sid: @solution[:assistant_sid],
|
|
225
|
+
sid: @solution[:sid],
|
|
226
|
+
)
|
|
217
227
|
end
|
|
218
228
|
|
|
219
229
|
##
|
|
@@ -231,11 +241,15 @@ module Twilio
|
|
|
231
241
|
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
|
232
242
|
|
|
233
243
|
if sid != :unset
|
|
234
|
-
return FieldContext.new(@version, @solution[:
|
|
244
|
+
return FieldContext.new(@version, @solution[:assistant_sid], @solution[:sid], sid, )
|
|
235
245
|
end
|
|
236
246
|
|
|
237
247
|
unless @fields
|
|
238
|
-
@fields = FieldList.new(
|
|
248
|
+
@fields = FieldList.new(
|
|
249
|
+
@version,
|
|
250
|
+
assistant_sid: @solution[:assistant_sid],
|
|
251
|
+
intent_sid: @solution[:sid],
|
|
252
|
+
)
|
|
239
253
|
end
|
|
240
254
|
|
|
241
255
|
@fields
|
|
@@ -249,13 +263,13 @@ module Twilio
|
|
|
249
263
|
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
|
250
264
|
|
|
251
265
|
if sid != :unset
|
|
252
|
-
return SampleContext.new(@version, @solution[:
|
|
266
|
+
return SampleContext.new(@version, @solution[:assistant_sid], @solution[:sid], sid, )
|
|
253
267
|
end
|
|
254
268
|
|
|
255
269
|
unless @samples
|
|
256
270
|
@samples = SampleList.new(
|
|
257
271
|
@version,
|
|
258
|
-
|
|
272
|
+
assistant_sid: @solution[:assistant_sid],
|
|
259
273
|
intent_sid: @solution[:sid],
|
|
260
274
|
)
|
|
261
275
|
end
|
|
@@ -278,10 +292,10 @@ module Twilio
|
|
|
278
292
|
# Initialize the IntentInstance
|
|
279
293
|
# @param [Version] version Version that contains the resource
|
|
280
294
|
# @param [Hash] payload payload that contains response from Twilio
|
|
281
|
-
# @param [String]
|
|
295
|
+
# @param [String] assistant_sid The assistant_sid
|
|
282
296
|
# @param [String] sid The sid
|
|
283
297
|
# @return [IntentInstance] IntentInstance
|
|
284
|
-
def initialize(version, payload,
|
|
298
|
+
def initialize(version, payload, assistant_sid: nil, sid: nil)
|
|
285
299
|
super(version)
|
|
286
300
|
|
|
287
301
|
# Marshaled Properties
|
|
@@ -291,7 +305,7 @@ module Twilio
|
|
|
291
305
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
292
306
|
'friendly_name' => payload['friendly_name'],
|
|
293
307
|
'links' => payload['links'],
|
|
294
|
-
'
|
|
308
|
+
'assistant_sid' => payload['assistant_sid'],
|
|
295
309
|
'sid' => payload['sid'],
|
|
296
310
|
'unique_name' => payload['unique_name'],
|
|
297
311
|
'url' => payload['url'],
|
|
@@ -299,7 +313,7 @@ module Twilio
|
|
|
299
313
|
|
|
300
314
|
# Context
|
|
301
315
|
@instance_context = nil
|
|
302
|
-
@params = {'
|
|
316
|
+
@params = {'assistant_sid' => assistant_sid, 'sid' => sid || @properties['sid'], }
|
|
303
317
|
end
|
|
304
318
|
|
|
305
319
|
##
|
|
@@ -308,7 +322,7 @@ module Twilio
|
|
|
308
322
|
# @return [IntentContext] IntentContext for this IntentInstance
|
|
309
323
|
def context
|
|
310
324
|
unless @instance_context
|
|
311
|
-
@instance_context = IntentContext.new(@version, @params['
|
|
325
|
+
@instance_context = IntentContext.new(@version, @params['assistant_sid'], @params['sid'], )
|
|
312
326
|
end
|
|
313
327
|
@instance_context
|
|
314
328
|
end
|
|
@@ -344,9 +358,9 @@ module Twilio
|
|
|
344
358
|
end
|
|
345
359
|
|
|
346
360
|
##
|
|
347
|
-
# @return [String] The
|
|
348
|
-
def
|
|
349
|
-
@properties['
|
|
361
|
+
# @return [String] The assistant_sid
|
|
362
|
+
def assistant_sid
|
|
363
|
+
@properties['assistant_sid']
|
|
350
364
|
end
|
|
351
365
|
|
|
352
366
|
##
|