Class: Twilio::REST::Conversations::V2::ConfigurationInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/conversations/v2/configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ ConfigurationInstance

Initialize the ConfigurationInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Configuration resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1023

def initialize(version, payload , sid: nil)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    
    # Marshaled Properties
    @properties = { 
        'status_url' => payload['status_url'],
        'related' => payload['related'],
        'id' => payload['id'],
        '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'],
        'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
        'updated_at' => Twilio.deserialize_iso8601_datetime(payload['updated_at']),
        'version' => payload['version'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#channel_settingsHash<String, ConversationsV2ChannelSetting>

Returns Channel-specific configuration settings by channel type. Keys should be valid channel types (‘VOICE`, `SMS`, `RCS`, `WHATSAPP`, `CHAT`).

Returns:

  • (Hash<String, ConversationsV2ChannelSetting>)

    Channel-specific configuration settings by channel type. Keys should be valid channel types (‘VOICE`, `SMS`, `RCS`, `WHATSAPP`, `CHAT`).



1107
1108
1109
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1107

def channel_settings
    @properties['channel_settings']
end

#contextConfigurationContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



1056
1057
1058
1059
1060
1061
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1056

def context
    unless @instance_context
        @instance_context = ConfigurationContext.new(@version , @params['sid'])
    end
    @instance_context
end

#conversation_grouping_typeString

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.

Returns:

  • (String)

    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.



1095
1096
1097
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1095

def conversation_grouping_type
    @properties['conversation_grouping_type']
end

#conversations_v1_bridgeConversationsV2ConversationsV1Bridge

Returns:

  • (ConversationsV2ConversationsV1Bridge)


1131
1132
1133
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1131

def conversations_v1_bridge
    @properties['conversations_v1_bridge']
end

#created_atTime

Returns Timestamp when this Configuration was created.

Returns:

  • (Time)

    Timestamp when this Configuration was created.



1137
1138
1139
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1137

def created_at
    @properties['created_at']
end

#delete(idempotency_key: :unset) ⇒ Boolean

Delete the ConfigurationInstance

Parameters:

  • idempotency_key (String) (defaults to: :unset)

    Client-generated UUID key to ensure idempotent behavior. Submitting the same key returns the original response without creating a duplicate operation. Keys are scoped to account + region with a 24-hour TTL.

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



1157
1158
1159
1160
1161
1162
1163
1164
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1157

def delete(
  idempotency_key: :unset
)

    context.delete(
        idempotency_key: idempotency_key, 
    )
end

#descriptionString

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.

Returns:

  • (String)

    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.



1089
1090
1091
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1089

def description
    @properties['description']
end

#display_nameString

Returns A human-readable name for the configuration. Limited to 32 characters.

Returns:

  • (String)

    A human-readable name for the configuration. Limited to 32 characters.



1083
1084
1085
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1083

def display_name
    @properties['display_name']
end

#fetchConfigurationInstance

Fetch the ConfigurationInstance

Returns:



1169
1170
1171
1172
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1169

def fetch

    context.fetch
end

#idString

Returns Configuration ID.

Returns:

  • (String)

    Configuration ID.



1077
1078
1079
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1077

def id
    @properties['id']
end

#inspectObject

Provide a detailed, user friendly representation



1199
1200
1201
1202
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1199

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Conversations.V2.ConfigurationInstance #{values}>"
end

#intelligence_configuration_idsArray<String>

Returns A list of Conversational Intelligence configuration IDs.

Returns:

  • (Array<String>)

    A list of Conversational Intelligence configuration IDs.



1119
1120
1121
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1119

def intelligence_configuration_ids
    @properties['intelligence_configuration_ids']
end

#memory_extraction_enabledBoolean

Returns Whether memory extraction is enabled for conversations under this configuration. Defaults to false.

Returns:

  • (Boolean)

    Whether memory extraction is enabled for conversations under this configuration. Defaults to false.



1125
1126
1127
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1125

def memory_extraction_enabled
    @properties['memory_extraction_enabled']
end

#memory_store_idString

Returns Memory Store ID for Profile resolution.

Returns:

  • (String)

    Memory Store ID for Profile resolution.



1101
1102
1103
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1101

def memory_store_id
    @properties['memory_store_id']
end

Returns Named resource identifiers associated with this operation. Keys depend on the operation type: - config-create, config-update, config-delete: configurationId - conversation-delete: conversationId.

Returns:

  • (Hash<String, String>)

    Named resource identifiers associated with this operation. Keys depend on the operation type: - config-create, config-update, config-delete: configurationId - conversation-delete: conversationId



1071
1072
1073
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1071

def related
    @properties['related']
end

#status_callbacksArray<ConversationsV2StatusCallbackConfig>

Returns List of default webhook configurations applied to Conversations under this Configuration.

Returns:

  • (Array<ConversationsV2StatusCallbackConfig>)

    List of default webhook configurations applied to Conversations under this Configuration.



1113
1114
1115
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1113

def status_callbacks
    @properties['status_callbacks']
end

#status_urlString

Returns URL to poll for operation status.

Returns:

  • (String)

    URL to poll for operation status.



1065
1066
1067
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1065

def status_url
    @properties['status_url']
end

#to_sObject

Provide a user friendly representation



1192
1193
1194
1195
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1192

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Conversations.V2.ConfigurationInstance #{values}>"
end

#update(idempotency_key: :unset, update_configuration_request: :unset) ⇒ ConfigurationInstance

Update the ConfigurationInstance

Parameters:

  • idempotency_key (String) (defaults to: :unset)

    Client-generated UUID key to ensure idempotent behavior. Submitting the same key returns the original response without creating a duplicate operation. Keys are scoped to account + region with a 24-hour TTL.

  • update_configuration_request (UpdateConfigurationRequest) (defaults to: :unset)

    The configuration to update

Returns:



1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1179

def update(
  idempotency_key: :unset,
  update_configuration_request: :unset
)

    context.update(
        idempotency_key: idempotency_key, 
        update_configuration_request: update_configuration_request, 
    )
end

#updated_atTime

Returns Timestamp when this Configuration was last updated.

Returns:

  • (Time)

    Timestamp when this Configuration was last updated.



1143
1144
1145
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1143

def updated_at
    @properties['updated_at']
end

#versionString

Returns Version number used for optimistic locking.

Returns:

  • (String)

    Version number used for optimistic locking.



1149
1150
1151
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1149

def version
    @properties['version']
end