Class: Twilio::REST::Content::V2::ContentInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/content/v2/content.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ ContentInstance

Initialize the ContentInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/twilio-ruby/rest/content/v2/content.rb', line 329

def initialize(version, payload )
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'friendly_name' => payload['friendly_name'],
        'language' => payload['language'],
        'variables' => payload['variables'],
        'types' => payload['types'],
        'url' => payload['url'],
        'links' => payload['links'],
    }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/usage/api/account) that created Content resource.

Returns:



369
370
371
# File 'lib/twilio-ruby/rest/content/v2/content.rb', line 369

def 
    @properties['account_sid']
end

#date_createdTime

Returns The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



351
352
353
# File 'lib/twilio-ruby/rest/content/v2/content.rb', line 351

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



357
358
359
# File 'lib/twilio-ruby/rest/content/v2/content.rb', line 357

def date_updated
    @properties['date_updated']
end

#friendly_nameString

Returns A string name used to describe the Content resource. Not visible to the end recipient.

Returns:

  • (String)

    A string name used to describe the Content resource. Not visible to the end recipient.



375
376
377
# File 'lib/twilio-ruby/rest/content/v2/content.rb', line 375

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



417
418
419
# File 'lib/twilio-ruby/rest/content/v2/content.rb', line 417

def inspect
    "<Twilio.Content.V2.ContentInstance>"
end

#languageString

Returns Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in.

Returns:

  • (String)

    Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in.



381
382
383
# File 'lib/twilio-ruby/rest/content/v2/content.rb', line 381

def language
    @properties['language']
end

Returns A list of links related to the Content resource, such as approval_fetch and approval_create.

Returns:

  • (Hash)

    A list of links related to the Content resource, such as approval_fetch and approval_create



405
406
407
# File 'lib/twilio-ruby/rest/content/v2/content.rb', line 405

def links
    @properties['links']
end

#sidString

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

Returns:

  • (String)

    The unique string that that we created to identify the Content resource.



363
364
365
# File 'lib/twilio-ruby/rest/content/v2/content.rb', line 363

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



411
412
413
# File 'lib/twilio-ruby/rest/content/v2/content.rb', line 411

def to_s
    "<Twilio.Content.V2.ContentInstance>"
end

#typesHash

Returns The [Content types](www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource.

Returns:



393
394
395
# File 'lib/twilio-ruby/rest/content/v2/content.rb', line 393

def types
    @properties['types']
end

#urlString

Returns The URL of the resource, relative to https://content.twilio.com.

Returns:

  • (String)

    The URL of the resource, relative to https://content.twilio.com.



399
400
401
# File 'lib/twilio-ruby/rest/content/v2/content.rb', line 399

def url
    @properties['url']
end

#variablesHash

Returns Defines the default placeholder values for variables included in the Content resource. e.g. "Customer_Name".

Returns:

  • (Hash)

    Defines the default placeholder values for variables included in the Content resource. e.g. "Customer_Name".



387
388
389
# File 'lib/twilio-ruby/rest/content/v2/content.rb', line 387

def variables
    @properties['variables']
end