Class: Twilio::REST::FlexApi::V1::PluginArchiveInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the PluginArchiveInstance

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

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

    The SID of the Call resource to fetch.



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb', line 213

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'],
    }

    # 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.



254
255
256
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb', line 254

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.



278
279
280
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb', line 278

def archived
    @properties['archived']
end

#context ⇒ PluginArchiveContext

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

Returns:



239
240
241
242
243
244
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb', line 239

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

#date_created ⇒ Time

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

Returns:

  • (Time) —

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



284
285
286
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb', line 284

def date_created
    @properties['date_created']
end

#date_updated ⇒ Time

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

Returns:

  • (Time) —

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



290
291
292
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb', line 290

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



272
273
274
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb', line 272

def description
    @properties['description']
end

#friendly_name ⇒ String

Returns The friendly name this Flex Plugin resource.

Returns:

  • (String) —

    The friendly name this Flex Plugin resource.



266
267
268
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb', line 266

def friendly_name
    @properties['friendly_name']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



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

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.FlexApi.V1.PluginArchiveInstance #{values}>"
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.



248
249
250
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb', line 248

def sid
    @properties['sid']
end

#to_s ⇒ Object

Provide a user friendly representation



315
316
317
318
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb', line 315

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.FlexApi.V1.PluginArchiveInstance #{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.



260
261
262
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb', line 260

def unique_name
    @properties['unique_name']
end

#update(flex_metadata: :unset) ⇒ PluginArchiveInstance

Update the PluginArchiveInstance

Parameters:

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

    The Flex-Metadata HTTP request header

Returns:



304
305
306
307
308
309
310
311
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb', line 304

def update(
  flex_metadata: :unset
)

    context.update(
        flex_metadata: , 
    )
end

#url ⇒ String

Returns The absolute URL of the Flex Plugin resource.

Returns:

  • (String) —

    The absolute URL of the Flex Plugin resource.



296
297
298
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb', line 296

def url
    @properties['url']
end