Class: Twilio::REST::Content::V1::ContentInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Content::V1::ContentInstance
- Defined in:
- lib/twilio-ruby/rest/content/v1/content.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#approval_fetch ⇒ approval_fetch
Access the approval_fetch.
-
#context ⇒ ContentContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The RFC 2822 date and time in GMT that the resource was created.
-
#date_updated ⇒ Time
The RFC 2822 date and time in GMT that the resource was last updated.
-
#delete ⇒ Boolean
Delete the ContentInstance.
-
#fetch ⇒ ContentInstance
Fetch the ContentInstance.
-
#friendly_name ⇒ String
A string name used to describe the Content resource.
-
#initialize(version, payload, sid: nil) ⇒ ContentInstance
constructor
Initialize the ContentInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#language ⇒ String
Two-letter language code identifying the language the Content resource is in.
-
#links ⇒ String
A list of links related to the Content resource.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#types ⇒ Hash
The Content types (e.g. twilio/text) for this Content resource.
-
#url ⇒ String
The URL of the resource, relative to ‘content.twilio.com`.
-
#variables ⇒ Hash
Defines the default placeholder values for variables included in the Content resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ContentInstance
Initialize the ContentInstance
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 215 def initialize(version, payload, sid: nil) 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'], } # 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 resource.
268 269 270 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 268 def account_sid @properties['account_sid'] end |
#approval_fetch ⇒ approval_fetch
Access the approval_fetch
325 326 327 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 325 def approval_fetch context.approval_fetch end |
#context ⇒ ContentContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
241 242 243 244 245 246 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 241 def context unless @instance_context @instance_context = ContentContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The RFC 2822 date and time in GMT that the resource was created.
250 251 252 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 250 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The RFC 2822 date and time in GMT that the resource was last updated.
256 257 258 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 256 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ContentInstance
318 319 320 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 318 def delete context.delete end |
#fetch ⇒ ContentInstance
Fetch the ContentInstance
311 312 313 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 311 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A string name used to describe the Content resource.
274 275 276 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 274 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
338 339 340 341 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 338 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Content.V1.ContentInstance #{values}>" end |
#language ⇒ String
Returns Two-letter language code identifying the language the Content resource is in.
280 281 282 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 280 def language @properties['language'] end |
#links ⇒ String
Returns A list of links related to the Content resource.
304 305 306 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 304 def links @properties['links'] end |
#sid ⇒ String
Returns The unique string that identifies the resource.
262 263 264 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 262 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
331 332 333 334 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 331 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Content.V1.ContentInstance #{values}>" end |
#types ⇒ Hash
Returns The Content types (e.g. twilio/text) for this Content resource.
292 293 294 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 292 def types @properties['types'] end |
#url ⇒ String
Returns The URL of the resource, relative to ‘content.twilio.com`.
298 299 300 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 298 def url @properties['url'] end |
#variables ⇒ Hash
Returns Defines the default placeholder values for variables included in the Content resource.
286 287 288 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 286 def variables @properties['variables'] end |