Class: Twilio::REST::FlexApi::V1::FlexFlowContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ FlexFlowContext

Initialize the FlexFlowContext



319
320
321
322
323
324
325
326
327
328
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 319

def initialize(version, sid)
    super(version)
    

    # Path Solution
    @solution = { sid: sid,  }
    @uri = "/FlexFlows/#{@solution[:sid]}"

    
end

Instance Method Details

#deleteBoolean

Delete the FlexFlowInstance



332
333
334
335
336
337
338
339
340
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 332

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    

    @version.delete('DELETE', @uri, headers: headers)
end

#delete_with_metadataBoolean

Delete the FlexFlowInstanceMetadata



345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 345

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
      response = @version.('DELETE', @uri, headers: headers)
      flexFlow_instance = FlexFlowInstance.new(
          @version,
          response.body,
          account_sid: @solution[:account_sid],
          sid: @solution[:sid],
      )
      .new(@version, flexFlow_instance, response.headers, response.status_code)
end

#fetchFlexFlowInstance

Fetch the FlexFlowInstance



364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 364

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    FlexFlowInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#fetch_with_metadataFlexFlowInstance

Fetch the FlexFlowInstanceMetadata



383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 383

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, headers: headers)
    flex_flow_instance = FlexFlowInstance.new(
        @version,
        response.body,
        sid: @solution[:sid],
    )
    .new(
        @version,
        flex_flow_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



569
570
571
572
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 569

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.FlexApi.V1.FlexFlowContext #{context}>"
end

#to_sObject

Provide a user friendly representation



562
563
564
565
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 562

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.FlexApi.V1.FlexFlowContext #{context}>"
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



425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 425

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
)

    data = Twilio::Values.of({
        'FriendlyName' => friendly_name,
        'ChatServiceSid' => chat_service_sid,
        'ChannelType' => channel_type,
        'ContactIdentity' => contact_identity,
        'Enabled' => enabled,
        'IntegrationType' => integration_type,
        'Integration.FlowSid' => integration_flow_sid,
        'Integration.Url' => integration_url,
        'Integration.WorkspaceSid' => integration_workspace_sid,
        'Integration.WorkflowSid' => integration_workflow_sid,
        'Integration.Channel' => integration_channel,
        'Integration.Timeout' => integration_timeout,
        'Integration.Priority' => integration_priority,
        'Integration.CreationOnMessage' => integration_creation_on_message,
        'LongLived' => long_lived,
        'JanitorEnabled' => janitor_enabled,
        'Integration.RetryCount' => integration_retry_count,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    FlexFlowInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#update_with_metadata(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 FlexFlowInstanceMetadata



499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb', line 499

def (
  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
)

    data = Twilio::Values.of({
        'FriendlyName' => friendly_name,
        'ChatServiceSid' => chat_service_sid,
        'ChannelType' => channel_type,
        'ContactIdentity' => contact_identity,
        'Enabled' => enabled,
        'IntegrationType' => integration_type,
        'Integration.FlowSid' => integration_flow_sid,
        'Integration.Url' => integration_url,
        'Integration.WorkspaceSid' => integration_workspace_sid,
        'Integration.WorkflowSid' => integration_workflow_sid,
        'Integration.Channel' => integration_channel,
        'Integration.Timeout' => integration_timeout,
        'Integration.Priority' => integration_priority,
        'Integration.CreationOnMessage' => integration_creation_on_message,
        'LongLived' => long_lived,
        'JanitorEnabled' => janitor_enabled,
        'Integration.RetryCount' => integration_retry_count,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('POST', @uri, data: data, headers: headers)
    flex_flow_instance = FlexFlowInstance.new(
        @version,
        response.body,
        sid: @solution[:sid],
    )
    .new(
        @version,
        flex_flow_instance,
        response.headers,
        response.status_code
    )
end