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.



1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1570

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_settings ⇒ Hash<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).



1654
1655
1656
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1654

def channel_settings
    @properties['channel_settings']
end

#context ⇒ ConfigurationContext

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

Returns:



1603
1604
1605
1606
1607
1608
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1603

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

#conversation_grouping_type ⇒ ConversationsV2ConversationGroupingType

Returns:

  • (ConversationsV2ConversationGroupingType)


1642
1643
1644
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1642

def conversation_grouping_type
    @properties['conversation_grouping_type']
end

#conversations_v1_bridge ⇒ ConversationsV2ConversationsV1Bridge

Returns:

  • (ConversationsV2ConversationsV1Bridge)


1678
1679
1680
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1678

def conversations_v1_bridge
    @properties['conversations_v1_bridge']
end

#created_at ⇒ Time

Returns Timestamp when this Configuration was created.

Returns:

  • (Time) —

    Timestamp when this Configuration was created.



1684
1685
1686
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1684

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



1704
1705
1706
1707
1708
1709
1710
1711
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1704

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.

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.



1636
1637
1638
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1636

def description
    @properties['description']
end

#display_name ⇒ String

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.



1630
1631
1632
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1630

def display_name
    @properties['display_name']
end

#fetch ⇒ ConfigurationInstance

Fetch the ConfigurationInstance

Returns:



1716
1717
1718
1719
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1716

def fetch

    context.fetch
end

#id ⇒ String

Returns Configuration ID.

Returns:

  • (String) —

    Configuration ID.



1624
1625
1626
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1624

def id
    @properties['id']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



1762
1763
1764
1765
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1762

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

#intelligence_configuration_ids ⇒ Array<String>

Returns A list of Conversational Intelligence configuration IDs.

Returns:

  • (Array<String>) —

    A list of Conversational Intelligence configuration IDs.



1666
1667
1668
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1666

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.

Returns:

  • (Boolean) —

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



1672
1673
1674
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1672

def memory_extraction_enabled
    @properties['memory_extraction_enabled']
end

#memory_store_id ⇒ String

Returns Memory Store ID for Profile resolution.

Returns:

  • (String) —

    Memory Store ID for Profile resolution.



1648
1649
1650
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1648

def memory_store_id
    @properties['memory_store_id']
end

#patch(idempotency_key: :unset, patch_configuration_request: :unset) ⇒ ConfigurationInstance

Patch 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.

  • patch_configuration_request (PatchConfigurationRequest) (defaults to: :unset) —

    The partial configuration update.

Returns:



1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1726

def patch(
  idempotency_key: :unset,
  patch_configuration_request: :unset
)

    context.patch(
        idempotency_key: idempotency_key, 
        patch_configuration_request: patch_configuration_request, 
    )
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



1618
1619
1620
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1618

def related
    @properties['related']
end

#status_callbacks ⇒ Array<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.



1660
1661
1662
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1660

def status_callbacks
    @properties['status_callbacks']
end

#status_url ⇒ String

Returns URL to poll for operation status.

Returns:

  • (String) —

    URL to poll for operation status.



1612
1613
1614
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1612

def status_url
    @properties['status_url']
end

#to_s ⇒ Object

Provide a user friendly representation



1755
1756
1757
1758
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1755

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:



1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1742

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

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

#updated_at ⇒ Time

Returns Timestamp when this Configuration was last updated.

Returns:

  • (Time) —

    Timestamp when this Configuration was last updated.



1690
1691
1692
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1690

def updated_at
    @properties['updated_at']
end

#version ⇒ String

Returns Version number used for optimistic locking.

Returns:

  • (String) —

    Version number used for optimistic locking.



1696
1697
1698
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1696

def version
    @properties['version']
end