Class: Twilio::REST::Conversations::V2::ConversationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V2::ConversationInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v2/conversation.rb
Instance Method Summary collapse
-
#account_id ⇒ String
Account ID.
-
#channel_settings ⇒ Hash<String, ConversationsV2ChannelSetting>
Channel-specific configuration settings by channel type.
- #configuration ⇒ ListConversationByAccount200ResponseConversationsConfiguration
-
#configuration_id ⇒ String
Configuration ID.
-
#context ⇒ ConversationContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#conversation_grouping_type ⇒ String
Type of Conversation grouping strategy: - ‘GROUP_BY_PROFILE`: Groups Communications by resolved Profile from the Memory Store.
- #conversations_v1_bridge ⇒ ConversationsV2ConversationsV1Bridge
-
#created_at ⇒ Time
Timestamp when this Conversation was created.
-
#delete(idempotency_key: :unset) ⇒ Boolean
Delete the ConversationInstance.
-
#description ⇒ String
Human-readable description for the Configuration.
-
#display_name ⇒ String
A human-readable name for the configuration.
-
#fetch ⇒ ConversationInstance
Fetch the ConversationInstance.
-
#id ⇒ String
Conversation ID.
-
#initialize(version, payload, sid: nil) ⇒ ConversationInstance
constructor
Initialize the ConversationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#intelligence_configuration_ids ⇒ Array<String>
A list of Conversational Intelligence configuration IDs.
-
#memory_extraction_enabled ⇒ Boolean
Whether memory extraction is enabled for conversations under this configuration.
-
#memory_store_id ⇒ String
Memory Store ID for Profile resolution.
-
#name ⇒ String
Conversation name.
-
#participants ⇒ Array<ConversationsV2Participant>
Participants in this Conversation.
-
#patch(patch_conversation_by_id_request: :unset) ⇒ ConversationInstance
Patch the ConversationInstance.
-
#related ⇒ Hash<String, String>
Named resource identifiers associated with this operation.
-
#status ⇒ String
Conversation status.
-
#status_callbacks ⇒ Array<ConversationsV2StatusCallbackConfig>
List of default webhook configurations applied to Conversations under this Configuration.
-
#status_url ⇒ String
URL to poll for operation status.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(update_conversation_by_id_request: :unset) ⇒ ConversationInstance
Update the ConversationInstance.
-
#updated_at ⇒ Time
Timestamp when this Conversation was last updated.
-
#version ⇒ String
Version number used for optimistic locking.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ConversationInstance
Initialize the ConversationInstance
1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1130 def initialize(version, payload , sid: nil) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Marshaled Properties @properties = { 'id' => payload['id'], 'account_id' => payload['account_id'], 'configuration_id' => payload['configuration_id'], 'status' => payload['status'], 'name' => payload['name'], 'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']), 'updated_at' => Twilio.deserialize_iso8601_datetime(payload['updated_at']), 'configuration' => payload['configuration'], 'participants' => payload['participants'], 'status_url' => payload['status_url'], 'related' => payload['related'], 'display_name' => payload['display_name'], 'description' => payload['description'], 'conversation_grouping_type' => payload['conversation_grouping_type'], 'memory_store_id' => payload['memory_store_id'], 'channel_settings' => payload['channel_settings'], 'status_callbacks' => payload['status_callbacks'], 'intelligence_configuration_ids' => payload['intelligence_configuration_ids'], 'memory_extraction_enabled' => payload['memory_extraction_enabled'], 'conversations_v1_bridge' => payload['conversations_v1_bridge'], 'version' => payload['version'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_id ⇒ String
Returns Account ID.
1184 1185 1186 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1184 def account_id @properties['account_id'] end |
#channel_settings ⇒ Hash<String, ConversationsV2ChannelSetting>
Returns Channel-specific configuration settings by channel type. Keys should be valid channel types (‘VOICE`, `SMS`, `RCS`, `WHATSAPP`, `CHAT`).
1268 1269 1270 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1268 def channel_settings @properties['channel_settings'] end |
#configuration ⇒ ListConversationByAccount200ResponseConversationsConfiguration
1220 1221 1222 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1220 def configuration @properties['configuration'] end |
#configuration_id ⇒ String
Returns Configuration ID.
1190 1191 1192 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1190 def configuration_id @properties['configuration_id'] end |
#context ⇒ ConversationContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
1169 1170 1171 1172 1173 1174 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1169 def context unless @instance_context @instance_context = ConversationContext.new(@version , @params['sid']) end @instance_context end |
#conversation_grouping_type ⇒ String
Returns Type of Conversation grouping strategy: - ‘GROUP_BY_PROFILE`: Groups Communications by resolved Profile from the Memory Store. A Profile is looked up or created for `CUSTOMER` Participant types. All Communications from the same Profile are in the same Conversation, regardless of address or channel. - `GROUP_BY_PARTICIPANT_ADDRESSES`: Groups Communications by Participant addresses across all channels. A customer using 18005550100 will be in the same Conversation whether they contact by SMS, WhatsApp, or RCS. - `GROUP_BY_PARTICIPANT_ADDRESSES_AND_CHANNEL_TYPE`: Groups Communications by both Participant addresses AND channel. A customer using 18005550100 by SMS will be in a different Conversation than the same customer by Voice.
1256 1257 1258 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1256 def conversation_grouping_type @properties['conversation_grouping_type'] end |
#conversations_v1_bridge ⇒ ConversationsV2ConversationsV1Bridge
1292 1293 1294 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1292 def conversations_v1_bridge @properties['conversations_v1_bridge'] end |
#created_at ⇒ Time
Returns Timestamp when this Conversation was created.
1208 1209 1210 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1208 def created_at @properties['created_at'] end |
#delete(idempotency_key: :unset) ⇒ Boolean
Delete the ConversationInstance
1306 1307 1308 1309 1310 1311 1312 1313 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1306 def delete( idempotency_key: :unset ) context.delete( idempotency_key: idempotency_key, ) end |
#description ⇒ String
Returns Human-readable description for the Configuration. Allows spaces and special characters, typically limited to a paragraph of text. This serves as a descriptive field rather than just a name.
1250 1251 1252 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1250 def description @properties['description'] end |
#display_name ⇒ String
Returns A human-readable name for the configuration. Limited to 32 characters.
1244 1245 1246 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1244 def display_name @properties['display_name'] end |
#fetch ⇒ ConversationInstance
Fetch the ConversationInstance
1318 1319 1320 1321 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1318 def fetch context.fetch end |
#id ⇒ String
Returns Conversation ID.
1178 1179 1180 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1178 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
1356 1357 1358 1359 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1356 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V2.ConversationInstance #{values}>" end |
#intelligence_configuration_ids ⇒ Array<String>
Returns A list of Conversational Intelligence configuration IDs.
1280 1281 1282 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1280 def intelligence_configuration_ids @properties['intelligence_configuration_ids'] end |
#memory_extraction_enabled ⇒ Boolean
Returns Whether memory extraction is enabled for conversations under this configuration. Defaults to false.
1286 1287 1288 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1286 def memory_extraction_enabled @properties['memory_extraction_enabled'] end |
#memory_store_id ⇒ String
Returns Memory Store ID for Profile resolution.
1262 1263 1264 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1262 def memory_store_id @properties['memory_store_id'] end |
#name ⇒ String
Returns Conversation name.
1202 1203 1204 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1202 def name @properties['name'] end |
#participants ⇒ Array<ConversationsV2Participant>
Returns Participants in this Conversation.
1226 1227 1228 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1226 def participants @properties['participants'] end |
#patch(patch_conversation_by_id_request: :unset) ⇒ ConversationInstance
Patch the ConversationInstance
1327 1328 1329 1330 1331 1332 1333 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1327 def patch(patch_conversation_by_id_request: :unset ) context.patch( patch_conversation_by_id_request: patch_conversation_by_id_request, ) end |
#related ⇒ Hash<String, String>
Returns Named resource identifiers associated with this operation. Keys depend on the operation type: - config-create, config-update, config-delete: configurationId - conversation-delete: conversationId.
1238 1239 1240 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1238 def @properties['related'] end |
#status ⇒ String
Returns Conversation status.
1196 1197 1198 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1196 def status @properties['status'] end |
#status_callbacks ⇒ Array<ConversationsV2StatusCallbackConfig>
Returns List of default webhook configurations applied to Conversations under this Configuration.
1274 1275 1276 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1274 def status_callbacks @properties['status_callbacks'] end |
#status_url ⇒ String
Returns URL to poll for operation status.
1232 1233 1234 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1232 def status_url @properties['status_url'] end |
#to_s ⇒ Object
Provide a user friendly representation
1349 1350 1351 1352 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1349 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V2.ConversationInstance #{values}>" end |
#update(update_conversation_by_id_request: :unset) ⇒ ConversationInstance
Update the ConversationInstance
1339 1340 1341 1342 1343 1344 1345 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1339 def update(update_conversation_by_id_request: :unset ) context.update( update_conversation_by_id_request: update_conversation_by_id_request, ) end |
#updated_at ⇒ Time
Returns Timestamp when this Conversation was last updated.
1214 1215 1216 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1214 def updated_at @properties['updated_at'] end |
#version ⇒ String
Returns Version number used for optimistic locking.
1298 1299 1300 |
# File 'lib/twilio-ruby/rest/conversations/v2/conversation.rb', line 1298 def version @properties['version'] end |