Class: Twilio::REST::Preview::Sync::ServiceContext::DocumentInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::Sync::ServiceContext::DocumentInstance
- Defined in:
- lib/twilio-ruby/rest/preview/sync/service/document.rb
Instance Method Summary collapse
- #account_sid ⇒ String
-
#context ⇒ DocumentContext
Generate an instance context for the instance, the context is capable of performing various actions.
- #created_by ⇒ String
- #data ⇒ Hash
- #date_created ⇒ Time
- #date_updated ⇒ Time
-
#delete ⇒ Boolean
Delete the DocumentInstance.
-
#document_permissions ⇒ document_permissions
Access the document_permissions.
-
#fetch ⇒ DocumentInstance
Fetch the DocumentInstance.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ DocumentInstance
constructor
Initialize the DocumentInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #links ⇒ Hash
- #revision ⇒ String
- #service_sid ⇒ String
- #sid ⇒ String
-
#to_s ⇒ Object
Provide a user friendly representation.
- #unique_name ⇒ String
-
#update(data: nil, if_match: :unset) ⇒ DocumentInstance
Update the DocumentInstance.
- #url ⇒ String
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ DocumentInstance
Initialize the DocumentInstance
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 312 def initialize(version, payload , service_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'unique_name' => payload['unique_name'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'url' => payload['url'], 'links' => payload['links'], 'revision' => payload['revision'], 'data' => payload['data'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'created_by' => payload['created_by'], } # Context @instance_context = nil @params = { 'service_sid' => service_sid || @properties['service_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
360 361 362 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 360 def account_sid @properties['account_sid'] end |
#context ⇒ DocumentContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
339 340 341 342 343 344 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 339 def context unless @instance_context @instance_context = DocumentContext.new(@version , @params['service_sid'], @params['sid']) end @instance_context end |
#created_by ⇒ String
408 409 410 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 408 def created_by @properties['created_by'] end |
#data ⇒ Hash
390 391 392 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 390 def data @properties['data'] end |
#date_created ⇒ Time
396 397 398 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 396 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
402 403 404 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 402 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the DocumentInstance
415 416 417 418 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 415 def delete context.delete end |
#document_permissions ⇒ document_permissions
Access the document_permissions
447 448 449 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 447 def context. end |
#fetch ⇒ DocumentInstance
Fetch the DocumentInstance
423 424 425 426 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 423 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
460 461 462 463 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 460 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Sync.DocumentInstance #{values}>" end |
#links ⇒ Hash
378 379 380 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 378 def links @properties['links'] end |
#revision ⇒ String
384 385 386 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 384 def revision @properties['revision'] end |
#service_sid ⇒ String
366 367 368 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 366 def service_sid @properties['service_sid'] end |
#sid ⇒ String
348 349 350 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 348 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
453 454 455 456 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 453 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Sync.DocumentInstance #{values}>" end |
#unique_name ⇒ String
354 355 356 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 354 def unique_name @properties['unique_name'] end |
#update(data: nil, if_match: :unset) ⇒ DocumentInstance
Update the DocumentInstance
433 434 435 436 437 438 439 440 441 442 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 433 def update( data: nil, if_match: :unset ) context.update( data: data, if_match: if_match, ) end |
#url ⇒ String
372 373 374 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document.rb', line 372 def url @properties['url'] end |