Class: Twilio::REST::FlexApi::V1::PluginReleaseInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the PluginReleaseInstance

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

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

    The SID of the Call resource to fetch.



455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb', line 455

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

    # 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 Plugin Release resource and owns this resource.

Returns:

  • (String) —

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



492
493
494
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb', line 492

def 
    @properties['account_sid']
end

#configuration_sid ⇒ String

Returns The SID of the Plugin Configuration resource to release.

Returns:

  • (String) —

    The SID of the Plugin Configuration resource to release.



498
499
500
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb', line 498

def configuration_sid
    @properties['configuration_sid']
end

#context ⇒ PluginReleaseContext

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

Returns:



477
478
479
480
481
482
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb', line 477

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

#date_created ⇒ Time

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

Returns:

  • (Time) —

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



504
505
506
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb', line 504

def date_created
    @properties['date_created']
end

#fetch(flex_metadata: :unset) ⇒ PluginReleaseInstance

Fetch the PluginReleaseInstance

Parameters:

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

    The Flex-Metadata HTTP request header

Returns:



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

def fetch(
  flex_metadata: :unset
)

    context.fetch(
        flex_metadata: , 
    )
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



536
537
538
539
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb', line 536

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

#sid ⇒ String

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

Returns:

  • (String) —

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



486
487
488
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb', line 486

def sid
    @properties['sid']
end

#to_s ⇒ Object

Provide a user friendly representation



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

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

#url ⇒ String

Returns The absolute URL of the Plugin Release resource.

Returns:

  • (String) —

    The absolute URL of the Plugin Release resource.



510
511
512
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb', line 510

def url
    @properties['url']
end