Class: Twilio::REST::FlexApi::V1::PluginInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the PluginInstance

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 Plugin resource.

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

    The SID of the Call resource to fetch.



555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 555

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'unique_name' => payload['unique_name'],
        'friendly_name' => payload['friendly_name'],
        'description' => payload['description'],
        'archived' => payload['archived'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
        'links' => payload['links'],
    }

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

Instance Method Details

#account_sid ⇒ String

Returns The SID of the Account that created the Flex Plugin resource and owns this resource.

Returns:

  • (String) —

    The SID of the Account that created the Flex Plugin resource and owns this resource.



597
598
599
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 597

def 
    @properties['account_sid']
end

#archived ⇒ Boolean

Returns Whether the Flex Plugin is archived. The default value is false.

Returns:

  • (Boolean) —

    Whether the Flex Plugin is archived. The default value is false.



621
622
623
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 621

def archived
    @properties['archived']
end

#context ⇒ PluginContext

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

Returns:



582
583
584
585
586
587
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 582

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

#date_created ⇒ Time

Returns The date and time in GMT-7 when the Flex Plugin was created specified in ISO 8601 format.

Returns:

  • (Time) —

    The date and time in GMT-7 when the Flex Plugin was created specified in ISO 8601 format.



627
628
629
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 627

def date_created
    @properties['date_created']
end

#date_updated ⇒ Time

Returns The date and time in GMT-7 when the Flex Plugin was last updated specified in ISO 8601 format.

Returns:

  • (Time) —

    The date and time in GMT-7 when the Flex Plugin was last updated specified in ISO 8601 format.



633
634
635
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 633

def date_updated
    @properties['date_updated']
end

#description ⇒ String

Returns A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long.

Returns:

  • (String) —

    A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long



615
616
617
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 615

def description
    @properties['description']
end

#fetch(flex_metadata: :unset) ⇒ PluginInstance

Fetch the PluginInstance

Parameters:

  • flex_metadata (String) (defaults to: :unset) —

    The Flex-Metadata HTTP request header

Returns:



653
654
655
656
657
658
659
660
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 653

def fetch(
  flex_metadata: :unset
)

    context.fetch(
        flex_metadata: , 
    )
end

#friendly_name ⇒ String

Returns The friendly name this Flex Plugin resource.

Returns:

  • (String) —

    The friendly name this Flex Plugin resource.



609
610
611
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 609

def friendly_name
    @properties['friendly_name']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



697
698
699
700
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 697

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

Returns:

  • (Hash)


645
646
647
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 645

def links
    @properties['links']
end

#plugin_versions ⇒ plugin_versions

Access the plugin_versions

Returns:



684
685
686
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 684

def plugin_versions
    context.plugin_versions
end

#sid ⇒ String

Returns The unique string that we created to identify the Flex Plugin resource.

Returns:

  • (String) —

    The unique string that we created to identify the Flex Plugin resource.



591
592
593
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 591

def sid
    @properties['sid']
end

#to_s ⇒ Object

Provide a user friendly representation



690
691
692
693
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 690

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

#unique_name ⇒ String

Returns The name that uniquely identifies this Flex Plugin resource.

Returns:

  • (String) —

    The name that uniquely identifies this Flex Plugin resource.



603
604
605
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 603

def unique_name
    @properties['unique_name']
end

#update(friendly_name: :unset, description: :unset, flex_metadata: :unset) ⇒ PluginInstance

Update the PluginInstance

Parameters:

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

    The Flex Plugin's friendly name.

  • description (String) (defaults to: :unset) —

    A descriptive string that you update to describe the plugin resource. It can be up to 500 characters long

  • flex_metadata (String) (defaults to: :unset) —

    The Flex-Metadata HTTP request header

Returns:



668
669
670
671
672
673
674
675
676
677
678
679
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 668

def update(
  friendly_name: :unset, 
  description: :unset, 
  flex_metadata: :unset
)

    context.update(
        friendly_name: friendly_name, 
        description: description, 
        flex_metadata: , 
    )
end

#url ⇒ String

Returns The absolute URL of the Flex Plugin resource.

Returns:

  • (String) —

    The absolute URL of the Flex Plugin resource.



639
640
641
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 639

def url
    @properties['url']
end