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

  • sid (String) (defaults to: nil)

    The unique ID of the FlexFlow



321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 321

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'],
      'url' => payload['url'],
  }

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

Instance Method Details

#account_sidString

Returns The ID of the account that owns this Workflow.

Returns:

  • (String)

    The ID of the account that owns this Workflow



359
360
361
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 359

def 
  @properties['account_sid']
end

#channel_typeflex_flow.ChannelType

Returns Channel type.

Returns:



395
396
397
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 395

def channel_type
  @properties['channel_type']
end

#chat_service_sidString

Returns Service Sid.

Returns:

  • (String)

    Service Sid.



389
390
391
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 389

def chat_service_sid
  @properties['chat_service_sid']
end

#contact_identityString

Returns Channel contact Identity.

Returns:

  • (String)

    Channel contact Identity



401
402
403
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 401

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:



350
351
352
353
354
355
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 350

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

#date_createdTime

Returns The time the FlexFlow was created, given as GMT in ISO 8601 format.

Returns:

  • (Time)

    The time the FlexFlow was created, given as GMT in ISO 8601 format.



365
366
367
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 365

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The time the FlexFlow was last updated, given as GMT in ISO 8601 format.

Returns:

  • (Time)

    The time the FlexFlow was last updated, given as GMT in ISO 8601 format.



371
372
373
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 371

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the FlexFlowInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



494
495
496
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 494

def delete
  context.delete
end

#enabledBoolean

Returns Boolean flag for enabling or disabling the FlexFlow.

Returns:

  • (Boolean)

    Boolean flag for enabling or disabling the FlexFlow



407
408
409
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 407

def enabled
  @properties['enabled']
end

#fetchFlexFlowInstance

Fetch a FlexFlowInstance

Returns:



438
439
440
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 438

def fetch
  context.fetch
end

#friendly_nameString

Returns Human readable description of this FlexFlow.

Returns:

  • (String)

    Human readable description of this FlexFlow



383
384
385
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 383

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



507
508
509
510
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 507

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

#integrationHash

Returns Integration block.

Returns:

  • (Hash)

    Integration block



419
420
421
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 419

def integration
  @properties['integration']
end

#integration_typeflex_flow.IntegrationType

Returns Integration type.

Returns:

  • (flex_flow.IntegrationType)

    Integration type



413
414
415
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 413

def integration_type
  @properties['integration_type']
end

#long_livedBoolean

Returns Long Lived flag for new Channel.

Returns:

  • (Boolean)

    Long Lived flag for new Channel



425
426
427
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 425

def long_lived
  @properties['long_lived']
end

#sidString

Returns The unique ID of the FlexFlow.

Returns:

  • (String)

    The unique ID of the FlexFlow



377
378
379
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 377

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



500
501
502
503
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 500

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) ⇒ FlexFlowInstance

Update the FlexFlowInstance

Parameters:

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

    Human readable description of this FlexFlow

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

    The unique SID identifier of the chat service

  • channel_type (flex_flow.ChannelType) (defaults to: :unset)

    Channel type (web | facebook | sms)

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

    Channel contact Identity (number / contact)

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

    Boolean flag for enabling or disabling the FlexFlow

  • integration_type (flex_flow.IntegrationType) (defaults to: :unset)

    Integration type (studio | external | task)

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

    The unique SID identifier of the Flow for Studio integration type

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

    External Webhook Url for External integration type

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

    Workspace Sid for a new task for Task integration type

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

    Workflow Sid for a new task for Task integration type

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

    Task Channel for a new task for Task integration type (default is ‘default’)

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

    Task timeout in seconds for a new task for Task integration type (default 86400)

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

    Task priority for a new task for Task integration type (default 0)

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

    Flag for task creation, either creating task with the channel, or if true create task whwn first message arrives (for Task integration type)

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

    Default Flag defining whether the new channels created are long lived or not

Returns:



471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 471

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)
  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,
  )
end

#urlString

Returns The url.

Returns:

  • (String)

    The url



431
432
433
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 431

def url
  @properties['url']
end