Class: Twilio::REST::Assistants::V1::ToolInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, id: nil) ⇒ ToolInstance

Initialize the ToolInstance



453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 453

def initialize(version, payload , id: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'description' => payload['description'],
        'enabled' => payload['enabled'],
        'id' => payload['id'],
        'meta' => payload['meta'],
        'name' => payload['name'],
        'requires_auth' => payload['requires_auth'],
        'type' => payload['type'],
        'url' => payload['url'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'policies' => payload['policies'],
    }

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

Instance Method Details

#account_sidString



490
491
492
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 490

def 
    @properties['account_sid']
end

#contextToolContext

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



481
482
483
484
485
486
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 481

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

#date_createdTime



544
545
546
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 544

def date_created
    @properties['date_created']
end

#date_updatedTime



550
551
552
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 550

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the ToolInstance



563
564
565
566
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 563

def delete

    context.delete
end

#descriptionString



496
497
498
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 496

def description
    @properties['description']
end

#enabledBoolean



502
503
504
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 502

def enabled
    @properties['enabled']
end

#fetchToolInstance

Fetch the ToolInstance



571
572
573
574
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 571

def fetch

    context.fetch
end

#idString



508
509
510
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 508

def id
    @properties['id']
end

#inspectObject

Provide a detailed, user friendly representation



596
597
598
599
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 596

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

#metaHash



514
515
516
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 514

def meta
    @properties['meta']
end

#nameString



520
521
522
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 520

def name
    @properties['name']
end

#policiesArray<AssistantsV1ServicePolicy>



556
557
558
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 556

def policies
    @properties['policies']
end

#requires_authBoolean



526
527
528
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 526

def requires_auth
    @properties['requires_auth']
end

#to_sObject

Provide a user friendly representation



589
590
591
592
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 589

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

#typeString



532
533
534
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 532

def type
    @properties['type']
end

#update(assistants_v1_service_update_tool_request: :unset) ⇒ ToolInstance

Update the ToolInstance



580
581
582
583
584
585
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 580

def update(assistants_v1_service_update_tool_request: :unset
)

    context.update(
    )
end

#urlString



538
539
540
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 538

def url
    @properties['url']
end