class Twilio::REST::FlexApi::V1::FlexFlowInstance

Public Class Methods

new(version, payload, sid: nil) click to toggle source

Initialize the FlexFlowInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The SID of the Flex Flow resource to fetch. @return [FlexFlowInstance] FlexFlowInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
345 def initialize(version, payload, sid: nil)
346   super(version)
347 
348   # Marshaled Properties
349   @properties = {
350       'account_sid' => payload['account_sid'],
351       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
352       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
353       'sid' => payload['sid'],
354       'friendly_name' => payload['friendly_name'],
355       'chat_service_sid' => payload['chat_service_sid'],
356       'channel_type' => payload['channel_type'],
357       'contact_identity' => payload['contact_identity'],
358       'enabled' => payload['enabled'],
359       'integration_type' => payload['integration_type'],
360       'integration' => payload['integration'],
361       'long_lived' => payload['long_lived'],
362       'janitor_enabled' => payload['janitor_enabled'],
363       'url' => payload['url'],
364   }
365 
366   # Context
367   @instance_context = nil
368   @params = {'sid' => sid || @properties['sid'], }
369 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
384 def account_sid
385   @properties['account_sid']
386 end
channel_type() click to toggle source

@return [flex_flow.ChannelType] The channel type

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
420 def channel_type
421   @properties['channel_type']
422 end
chat_service_sid() click to toggle source

@return [String] The SID of the chat service

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
414 def chat_service_sid
415   @properties['chat_service_sid']
416 end
contact_identity() click to toggle source

@return [String] The channel contact's Identity

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
426 def contact_identity
427   @properties['contact_identity']
428 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [FlexFlowContext] FlexFlowContext for this FlexFlowInstance

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
375 def context
376   unless @instance_context
377     @instance_context = FlexFlowContext.new(@version, @params['sid'], )
378   end
379   @instance_context
380 end
date_created() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was created

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
390 def date_created
391   @properties['date_created']
392 end
date_updated() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was last updated

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
396 def date_updated
397   @properties['date_updated']
398 end
delete() click to toggle source

Delete the FlexFlowInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
544 def delete
545   context.delete
546 end
enabled() click to toggle source

@return [Boolean] Whether the Flex Flow is enabled

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
432 def enabled
433   @properties['enabled']
434 end
fetch() click to toggle source

Fetch the FlexFlowInstance @return [FlexFlowInstance] Fetched FlexFlowInstance

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
469 def fetch
470   context.fetch
471 end
friendly_name() click to toggle source

@return [String] The string that you assigned to describe the resource

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
408 def friendly_name
409   @properties['friendly_name']
410 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
557 def inspect
558   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
559   "<Twilio.FlexApi.V1.FlexFlowInstance #{values}>"
560 end
integration() click to toggle source

@return [Hash] An object that contains specific parameters for the integration

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
444 def integration
445   @properties['integration']
446 end
integration_type() click to toggle source

@return [flex_flow.IntegrationType] The software that will handle inbound messages.

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
438 def integration_type
439   @properties['integration_type']
440 end
janitor_enabled() click to toggle source

@return [Boolean] Remove active Proxy sessions if the corresponding Task is deleted.

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
456 def janitor_enabled
457   @properties['janitor_enabled']
458 end
long_lived() click to toggle source

@return [Boolean] Re-use this chat channel for future interactions with a contact

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
450 def long_lived
451   @properties['long_lived']
452 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
402 def sid
403   @properties['sid']
404 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
550 def to_s
551   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
552   "<Twilio.FlexApi.V1.FlexFlowInstance #{values}>"
553 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) click to toggle source

Update the FlexFlowInstance @param [String] friendly_name A descriptive string that you create to describe

the Flex Flow resource.

@param [String] chat_service_sid The SID of the chat service. @param [flex_flow.ChannelType] channel_type The channel type. Can be: `web`,

`facebook`, `sms`, `whatsapp`, `line` or `custom`.

@param [String] contact_identity The channel contact's Identity. @param [Boolean] enabled Whether the new Flex Flow is enabled. @param [flex_flow.IntegrationType] integration_type The software that will

handle inbound messages. {Integration
Type}[https://www.twilio.com/docs/flex/developer/messaging/manage-flows#integration-types]
can be: `studio`, `external`, or `task`.

@param [String] integration_flow_sid The SID of the Studio Flow. Required when

`integrationType` is `studio`.

@param [String] integration_url The URL of the external webhook. Required when

`integrationType` is `external`.

@param [String] integration_workspace_sid The Workspace SID for a new Task.

Required when `integrationType` is `task`.

@param [String] integration_workflow_sid The Workflow SID for a new Task.

Required when `integrationType` is `task`.

@param [String] integration_channel 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`.

@param [String] integration_timeout The Task timeout in seconds for a new Task.

Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`,
not applicable otherwise.

@param [String] integration_priority The Task priority of a new Task. The

default priority is 0. Optional when `integrationType` is `task`, not applicable
otherwise.

@param [Boolean] integration_creation_on_message 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.

@param [Boolean] long_lived 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`.

@param [Boolean] janitor_enabled 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`.

@param [String] integration_retry_count The number of times to retry the webhook

if the first attempt fails. Can be an integer between 0 and 3 (inclusive),
default is 3. Optional when `integrationType` is `external`, not applicable
otherwise.

@return [FlexFlowInstance] Updated FlexFlowInstance

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
519 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)
520   context.update(
521       friendly_name: friendly_name,
522       chat_service_sid: chat_service_sid,
523       channel_type: channel_type,
524       contact_identity: contact_identity,
525       enabled: enabled,
526       integration_type: integration_type,
527       integration_flow_sid: integration_flow_sid,
528       integration_url: integration_url,
529       integration_workspace_sid: integration_workspace_sid,
530       integration_workflow_sid: integration_workflow_sid,
531       integration_channel: integration_channel,
532       integration_timeout: integration_timeout,
533       integration_priority: integration_priority,
534       integration_creation_on_message: integration_creation_on_message,
535       long_lived: long_lived,
536       janitor_enabled: janitor_enabled,
537       integration_retry_count: integration_retry_count,
538   )
539 end
url() click to toggle source

@return [String] The absolute URL of the Flex Flow resource

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
462 def url
463   @properties['url']
464 end