class Twilio::REST::FlexApi::V1::FlexFlowContext

Public Class Methods

new(version, sid) click to toggle source

Initialize the FlexFlowContext @param [Version] version Version that contains the resource @param [String] sid The SID of the Flex Flow resource to fetch. @return [FlexFlowContext] FlexFlowContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
227 def initialize(version, sid)
228   super(version)
229 
230   # Path Solution
231   @solution = {sid: sid, }
232   @uri = "/FlexFlows/#{@solution[:sid]}"
233 end

Public Instance Methods

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
319 def delete
320    @version.delete('DELETE', @uri)
321 end
fetch() click to toggle source

Fetch the FlexFlowInstance @return [FlexFlowInstance] Fetched FlexFlowInstance

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
238 def fetch
239   payload = @version.fetch('GET', @uri)
240 
241   FlexFlowInstance.new(@version, payload, sid: @solution[:sid], )
242 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
332 def inspect
333   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
334   "#<Twilio.FlexApi.V1.FlexFlowContext #{context}>"
335 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb
325 def to_s
326   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
327   "#<Twilio.FlexApi.V1.FlexFlowContext #{context}>"
328 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
290 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)
291   data = Twilio::Values.of({
292       'FriendlyName' => friendly_name,
293       'ChatServiceSid' => chat_service_sid,
294       'ChannelType' => channel_type,
295       'ContactIdentity' => contact_identity,
296       'Enabled' => enabled,
297       'IntegrationType' => integration_type,
298       'Integration.FlowSid' => integration_flow_sid,
299       'Integration.Url' => integration_url,
300       'Integration.WorkspaceSid' => integration_workspace_sid,
301       'Integration.WorkflowSid' => integration_workflow_sid,
302       'Integration.Channel' => integration_channel,
303       'Integration.Timeout' => integration_timeout,
304       'Integration.Priority' => integration_priority,
305       'Integration.CreationOnMessage' => integration_creation_on_message,
306       'LongLived' => long_lived,
307       'JanitorEnabled' => janitor_enabled,
308       'Integration.RetryCount' => integration_retry_count,
309   })
310 
311   payload = @version.update('POST', @uri, data: data)
312 
313   FlexFlowInstance.new(@version, payload, sid: @solution[:sid], )
314 end