Class: Twilio::REST::FlexApi::V1::PluginContext::PluginVersionsInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, plugin_sid: nil, sid: nil) ⇒ PluginVersionsInstance

Initialize the PluginVersionsInstance

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

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

    The SID of the Call resource to fetch.



492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 492

def initialize(version, payload , plugin_sid: nil, sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'plugin_sid' => payload['plugin_sid'],
        'account_sid' => payload['account_sid'],
        'version' => payload['version'],
        'plugin_url' => payload['plugin_url'],
        'changelog' => payload['changelog'],
        'private' => payload['private'],
        'archived' => payload['archived'],
        'validated' => payload['validated'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'url' => payload['url'],
    }

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

Instance Method Details

#account_sid ⇒ String

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

Returns:

  • (String) —

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



541
542
543
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 541

def 
    @properties['account_sid']
end

#archived ⇒ Boolean

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

Returns:

  • (Boolean) —

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



571
572
573
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 571

def archived
    @properties['archived']
end

#changelog ⇒ String

Returns A changelog that describes the changes this Flex Plugin Version brings.

Returns:

  • (String) —

    A changelog that describes the changes this Flex Plugin Version brings.



559
560
561
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 559

def changelog
    @properties['changelog']
end

#context ⇒ PluginVersionsContext

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

Returns:



520
521
522
523
524
525
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 520

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

#date_created ⇒ Time

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

Returns:

  • (Time) —

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



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

def date_created
    @properties['date_created']
end

#fetch(flex_metadata: :unset) ⇒ PluginVersionsInstance

Fetch the PluginVersionsInstance

Parameters:

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

    The Flex-Metadata HTTP request header

Returns:



597
598
599
600
601
602
603
604
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 597

def fetch(
  flex_metadata: :unset
)

    context.fetch(
        flex_metadata: , 
    )
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



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

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

#plugin_sid ⇒ String

Returns The SID of the Flex Plugin resource this Flex Plugin Version belongs to.

Returns:

  • (String) —

    The SID of the Flex Plugin resource this Flex Plugin Version belongs to.



535
536
537
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 535

def plugin_sid
    @properties['plugin_sid']
end

#plugin_url ⇒ String

Returns The URL of where the Flex Plugin Version JavaScript bundle is hosted on.

Returns:

  • (String) —

    The URL of where the Flex Plugin Version JavaScript bundle is hosted on.



553
554
555
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 553

def plugin_url
    @properties['plugin_url']
end

#private ⇒ Boolean

Returns Whether the Flex Plugin Version is validated. The default value is false.

Returns:

  • (Boolean) —

    Whether the Flex Plugin Version is validated. The default value is false.



565
566
567
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 565

def private
    @properties['private']
end

#sid ⇒ String

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

Returns:

  • (String) —

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



529
530
531
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 529

def sid
    @properties['sid']
end

#to_s ⇒ Object

Provide a user friendly representation



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

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

#url ⇒ String

Returns The absolute URL of the Flex Plugin Version resource.

Returns:

  • (String) —

    The absolute URL of the Flex Plugin Version resource.



589
590
591
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 589

def url
    @properties['url']
end

#validated ⇒ Boolean

Returns:

  • (Boolean)


577
578
579
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 577

def validated
    @properties['validated']
end

#version ⇒ String

Returns The unique version of this Flex Plugin Version.

Returns:

  • (String) —

    The unique version of this Flex Plugin Version.



547
548
549
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 547

def version
    @properties['version']
end