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.



311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 311

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_sidString

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

Returns:



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

def 
    @properties['account_sid']
end

#archivedBoolean

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.



376
377
378
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 376

def archived
    @properties['archived']
end

#contextPluginContext

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

Returns:



337
338
339
340
341
342
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 337

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

#date_createdTime

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

Returns:



382
383
384
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 382

def date_created
    @properties['date_created']
end

#date_updatedTime

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

Returns:



388
389
390
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 388

def date_updated
    @properties['date_updated']
end

#descriptionString

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



370
371
372
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 370

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:



408
409
410
411
412
413
414
415
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 408

def fetch(
    flex_metadata: :unset
)

    context.fetch(
        flex_metadata: , 
    )
end

#friendly_nameString

Returns The friendly name this Flex Plugin resource.

Returns:

  • (String)

    The friendly name this Flex Plugin resource.



364
365
366
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 364

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



452
453
454
455
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 452

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

Returns:

  • (Hash)


400
401
402
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 400

def links
    @properties['links']
end

#plugin_versionsplugin_versions

Access the plugin_versions

Returns:



439
440
441
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 439

def plugin_versions
    context.plugin_versions
end

#sidString

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.



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

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



445
446
447
448
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 445

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

#unique_nameString

Returns The name that uniquely identifies this Flex Plugin resource.

Returns:

  • (String)

    The name that uniquely identifies this Flex Plugin resource.



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

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:



423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 423

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

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

#urlString

Returns The absolute URL of the Flex Plugin resource.

Returns:

  • (String)

    The absolute URL of the Flex Plugin resource.



394
395
396
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin.rb', line 394

def url
    @properties['url']
end