Class: Twilio::REST::FlexApi::V1::FlexFlowInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb

Instance Method Summary collapse

Constructor Details

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

Initialize the FlexFlowInstance

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 FlexFlow resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 729

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'sid' => payload['sid'],
        'friendly_name' => payload['friendly_name'],
        'chat_service_sid' => payload['chat_service_sid'],
        'channel_type' => payload['channel_type'],
        'contact_identity' => payload['contact_identity'],
        'enabled' => payload['enabled'],
        'integration_type' => payload['integration_type'],
        'integration' => payload['integration'],
        'long_lived' => payload['long_lived'],
        'janitor_enabled' => payload['janitor_enabled'],
        'url' => payload['url'],
    }

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

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Flex Flow resource and owns this Workflow.

Returns:



769
770
771
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 769

def 
    @properties['account_sid']
end

#channel_typeChannelType

Returns:

  • (ChannelType)


805
806
807
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 805

def channel_type
    @properties['channel_type']
end

#chat_service_sidString

Returns The SID of the chat service.

Returns:

  • (String)

    The SID of the chat service.



799
800
801
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 799

def chat_service_sid
    @properties['chat_service_sid']
end

#contact_identityString

Returns The channel contact’s Identity.

Returns:

  • (String)

    The channel contact’s Identity.



811
812
813
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 811

def contact_identity
    @properties['contact_identity']
end

#contextFlexFlowContext

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

Returns:



760
761
762
763
764
765
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 760

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

#date_createdTime

Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



775
776
777
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 775

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



781
782
783
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 781

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the FlexFlowInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



854
855
856
857
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 854

def delete

    context.delete
end

#enabledBoolean

Returns Whether the Flex Flow is enabled.

Returns:

  • (Boolean)

    Whether the Flex Flow is enabled.



817
818
819
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 817

def enabled
    @properties['enabled']
end

#fetchFlexFlowInstance

Fetch the FlexFlowInstance

Returns:



862
863
864
865
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 862

def fetch

    context.fetch
end

#friendly_nameString

Returns The string that you assigned to describe the resource.

Returns:

  • (String)

    The string that you assigned to describe the resource.



793
794
795
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 793

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



937
938
939
940
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 937

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

#integrationHash

Returns An object that contains specific parameters for the integration.

Returns:

  • (Hash)

    An object that contains specific parameters for the integration.



829
830
831
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 829

def integration
    @properties['integration']
end

#integration_typeIntegrationType

Returns:

  • (IntegrationType)


823
824
825
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 823

def integration_type
    @properties['integration_type']
end

#janitor_enabledBoolean

Returns When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to ‘false`.

Returns:

  • (Boolean)

    When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to ‘false`.



841
842
843
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 841

def janitor_enabled
    @properties['janitor_enabled']
end

#long_livedBoolean

Returns When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to ‘false`.

Returns:

  • (Boolean)

    When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to ‘false`.



835
836
837
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 835

def long_lived
    @properties['long_lived']
end

#sidString

Returns The unique string that we created to identify the Flex Flow resource.

Returns:

  • (String)

    The unique string that we created to identify the Flex Flow resource.



787
788
789
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 787

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



930
931
932
933
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 930

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

#update(friendly_name: :unset, chat_service_sid: :unset, channel_type: :unset, contact_identity: :unset, enabled: :unset, integration_type: :unset, integration_flow_sid: :unset, integration_url: :unset, integration_workspace_sid: :unset, integration_workflow_sid: :unset, integration_channel: :unset, integration_timeout: :unset, integration_priority: :unset, integration_creation_on_message: :unset, long_lived: :unset, janitor_enabled: :unset, integration_retry_count: :unset) ⇒ FlexFlowInstance

Update the FlexFlowInstance

Parameters:

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

    A descriptive string that you create to describe the Flex Flow resource.

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

    The SID of the chat service.

  • channel_type (ChannelType) (defaults to: :unset)
  • contact_identity (String) (defaults to: :unset)

    The channel contact’s Identity.

  • enabled (Boolean) (defaults to: :unset)

    Whether the new Flex Flow is enabled.

  • integration_type (IntegrationType) (defaults to: :unset)
  • integration_flow_sid (String) (defaults to: :unset)

    The SID of the Studio Flow. Required when ‘integrationType` is `studio`.

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

    The URL of the external webhook. Required when ‘integrationType` is `external`.

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

    The Workspace SID for a new Task. Required when ‘integrationType` is `task`.

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

    The Workflow SID for a new Task. Required when ‘integrationType` is `task`.

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

    The Task Channel SID (TCXXXX) or unique name (e.g., ‘sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`.

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

    The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when ‘integrationType` is `task`, not applicable otherwise.

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

    The Task priority of a new Task. The default priority is 0. Optional when ‘integrationType` is `task`, not applicable otherwise.

  • integration_creation_on_message (Boolean) (defaults to: :unset)

    In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging.

  • long_lived (Boolean) (defaults to: :unset)

    When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to ‘false`.

  • janitor_enabled (Boolean) (defaults to: :unset)

    When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to ‘false`.

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

    The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when ‘integrationType` is `studio` or `external`, not applicable otherwise.

Returns:



887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 887

def update(
  friendly_name: :unset, 
  chat_service_sid: :unset, 
  channel_type: :unset, 
  contact_identity: :unset, 
  enabled: :unset, 
  integration_type: :unset, 
  integration_flow_sid: :unset, 
  integration_url: :unset, 
  integration_workspace_sid: :unset, 
  integration_workflow_sid: :unset, 
  integration_channel: :unset, 
  integration_timeout: :unset, 
  integration_priority: :unset, 
  integration_creation_on_message: :unset, 
  long_lived: :unset, 
  janitor_enabled: :unset, 
  integration_retry_count: :unset
)

    context.update(
        friendly_name: friendly_name, 
        chat_service_sid: chat_service_sid, 
        channel_type: channel_type, 
        contact_identity: contact_identity, 
        enabled: enabled, 
        integration_type: integration_type, 
        integration_flow_sid: integration_flow_sid, 
        integration_url: integration_url, 
        integration_workspace_sid: integration_workspace_sid, 
        integration_workflow_sid: integration_workflow_sid, 
        integration_channel: integration_channel, 
        integration_timeout: integration_timeout, 
        integration_priority: integration_priority, 
        integration_creation_on_message: integration_creation_on_message, 
        long_lived: long_lived, 
        janitor_enabled: janitor_enabled, 
        integration_retry_count: integration_retry_count, 
    )
end

#urlString

Returns The absolute URL of the Flex Flow resource.

Returns:

  • (String)

    The absolute URL of the Flex Flow resource.



847
848
849
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 847

def url
    @properties['url']
end