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, id: 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)

    The SID of the Call resource to fetch.



1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1061

def initialize(version, payload , id: 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 = { 'id' => id  || @properties['id']  , }
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).



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

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:



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

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

#conversation_grouping_typeConversationsV2ConversationGroupingType

Returns:

  • (ConversationsV2ConversationGroupingType)


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

def conversation_grouping_type
    @properties['conversation_grouping_type']
end

#conversations_v1_bridgeConversationsV2ConversationsV1Bridge

Returns:

  • (ConversationsV2ConversationsV1Bridge)


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

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.



1175
1176
1177
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1175

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



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

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.



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

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.



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

def display_name
    @properties['display_name']
end

#fetchConfigurationInstance

Fetch the ConfigurationInstance

Returns:



1207
1208
1209
1210
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1207

def fetch

    context.fetch
end

#idString

Returns Configuration ID.

Returns:

  • (String)

    Configuration ID.



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

def id
    @properties['id']
end

#inspectObject

Provide a detailed, user friendly representation



1237
1238
1239
1240
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1237

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.



1157
1158
1159
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1157

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.



1163
1164
1165
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1163

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.



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

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



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

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.



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

def status_callbacks
    @properties['status_callbacks']
end

#status_urlString

Returns URL to poll for operation status.

Returns:

  • (String)

    URL to poll for operation status.



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

def status_url
    @properties['status_url']
end

#to_sObject

Provide a user friendly representation



1230
1231
1232
1233
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1230

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:



1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1217

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.



1181
1182
1183
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1181

def updated_at
    @properties['updated_at']
end

#versionString

Returns Version number used for optimistic locking.

Returns:

  • (String)

    Version number used for optimistic locking.



1187
1188
1189
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1187

def version
    @properties['version']
end