Class: Twilio::REST::Intelligence::V2::OperatorTypeInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/intelligence/v2/operator_type.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ OperatorTypeInstance

Initialize the OperatorTypeInstance

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) —

    The SID of the Account that created this OperatorType resource.

  • sid (String) (defaults to: nil) —

    The SID of the Call resource to fetch.



391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 391

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'name' => payload['name'],
        'sid' => payload['sid'],
        'friendly_name' => payload['friendly_name'],
        'description' => payload['description'],
        'docs_link' => payload['docs_link'],
        'output_type' => payload['output_type'],
        'supported_languages' => payload['supported_languages'],
        'provider' => payload['provider'],
        'availability' => payload['availability'],
        'configurable' => payload['configurable'],
        'config_schema' => payload['config_schema'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
    }

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

Instance Method Details

#availability ⇒ Availability

Returns:

  • (Availability)


479
480
481
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 479

def availability
    @properties['availability']
end

#config_schema ⇒ Hash

Returns JSON Schema for configuring an Operator with this Operator Type. Following https://json-schema.org/.

Returns:



491
492
493
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 491

def config_schema
    @properties['config_schema']
end

#configurable ⇒ Boolean

Returns Operators can be created from configurable Operator Types.

Returns:

  • (Boolean) —

    Operators can be created from configurable Operator Types.



485
486
487
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 485

def configurable
    @properties['configurable']
end

#context ⇒ OperatorTypeContext

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

Returns:



422
423
424
425
426
427
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 422

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

#date_created ⇒ Time

Returns The date that this Operator Type was created, given in ISO 8601 format.

Returns:

  • (Time) —

    The date that this Operator Type was created, given in ISO 8601 format.



497
498
499
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 497

def date_created
    @properties['date_created']
end

#date_updated ⇒ Time

Returns The date that this Operator Type was updated, given in ISO 8601 format.

Returns:

  • (Time) —

    The date that this Operator Type was updated, given in ISO 8601 format.



503
504
505
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 503

def date_updated
    @properties['date_updated']
end

#description ⇒ String

Returns A human-readable description of this resource, longer than the friendly name.

Returns:

  • (String) —

    A human-readable description of this resource, longer than the friendly name.



449
450
451
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 449

def description
    @properties['description']
end

Returns Additional documentation for the Operator Type.

Returns:

  • (String) —

    Additional documentation for the Operator Type.



455
456
457
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 455

def docs_link
    @properties['docs_link']
end

#fetch ⇒ OperatorTypeInstance

Fetch the OperatorTypeInstance

Returns:



516
517
518
519
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 516

def fetch

    context.fetch
end

#friendly_name ⇒ String

Returns A human-readable name of this resource, up to 64 characters.

Returns:

  • (String) —

    A human-readable name of this resource, up to 64 characters.



443
444
445
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 443

def friendly_name
    @properties['friendly_name']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



530
531
532
533
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 530

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

#name ⇒ String

Returns A unique name that references an Operator's Operator Type.

Returns:

  • (String) —

    A unique name that references an Operator's Operator Type.



431
432
433
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 431

def name
    @properties['name']
end

#output_type ⇒ OutputType

Returns:

  • (OutputType)


461
462
463
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 461

def output_type
    @properties['output_type']
end

#provider ⇒ Provider

Returns:

  • (Provider)


473
474
475
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 473

def provider
    @properties['provider']
end

#sid ⇒ String

Returns A 34 character string that uniquely identifies this Operator Type.

Returns:

  • (String) —

    A 34 character string that uniquely identifies this Operator Type.



437
438
439
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 437

def sid
    @properties['sid']
end

#supported_languages ⇒ Array<String>

Returns List of languages this Operator Type supports.

Returns:

  • (Array<String>) —

    List of languages this Operator Type supports.



467
468
469
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 467

def supported_languages
    @properties['supported_languages']
end

#to_s ⇒ Object

Provide a user friendly representation



523
524
525
526
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 523

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

#url ⇒ String

Returns The URL of this resource.

Returns:

  • (String) —

    The URL of this resource.



509
510
511
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 509

def url
    @properties['url']
end