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.



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 263

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_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Flex Plugin Version resource and owns this resource.

Returns:



311
312
313
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 311

def 
    @properties['account_sid']
end

#archivedBoolean

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.



341
342
343
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 341

def archived
    @properties['archived']
end

#changelogString

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.



329
330
331
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 329

def changelog
    @properties['changelog']
end

#contextPluginVersionsContext

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

Returns:



290
291
292
293
294
295
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 290

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

#date_createdTime

Returns The date and time in GMT when the Flex Plugin Version was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



353
354
355
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 353

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:



367
368
369
370
371
372
373
374
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 367

def fetch(
    flex_metadata: :unset
)

    context.fetch(
        flex_metadata: , 
    )
end

#inspectObject

Provide a detailed, user friendly representation



385
386
387
388
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 385

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

#plugin_sidString

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.



305
306
307
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 305

def plugin_sid
    @properties['plugin_sid']
end

#plugin_urlString

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.



323
324
325
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 323

def plugin_url
    @properties['plugin_url']
end

#privateBoolean

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.



335
336
337
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 335

def private
    @properties['private']
end

#sidString

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.



299
300
301
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 299

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



378
379
380
381
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 378

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

#urlString

Returns The absolute URL of the Flex Plugin Version resource.

Returns:

  • (String)

    The absolute URL of the Flex Plugin Version resource.



359
360
361
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 359

def url
    @properties['url']
end

#validatedBoolean

Returns:

  • (Boolean)


347
348
349
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 347

def validated
    @properties['validated']
end

#versionString

Returns The unique version of this Flex Plugin Version.

Returns:

  • (String)

    The unique version of this Flex Plugin Version.



317
318
319
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 317

def version
    @properties['version']
end