Class: Twilio::REST::Preview::Sync::ServiceContext::SyncListContext::SyncListItemInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::Sync::ServiceContext::SyncListContext::SyncListItemInstance
- Defined in:
- lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb
Instance Method Summary collapse
- #account_sid ⇒ String
-
#context ⇒ SyncListItemContext
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(if_match: :unset) ⇒ Boolean
Delete the SyncListItemInstance.
-
#fetch ⇒ SyncListItemInstance
Fetch the SyncListItemInstance.
- #index ⇒ String
-
#initialize(version, payload, service_sid: nil, list_sid: nil, index: nil) ⇒ SyncListItemInstance
constructor
Initialize the SyncListItemInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #list_sid ⇒ String
- #revision ⇒ String
- #service_sid ⇒ String
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(data: nil, if_match: :unset) ⇒ SyncListItemInstance
Update the SyncListItemInstance.
- #url ⇒ String
Constructor Details
#initialize(version, payload, service_sid: nil, list_sid: nil, index: nil) ⇒ SyncListItemInstance
Initialize the SyncListItemInstance
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 298 def initialize(version, payload , service_sid: nil, list_sid: nil, index: nil) super(version) # Marshaled Properties @properties = { 'index' => payload['index'] == nil ? payload['index'] : payload['index'].to_i, 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'list_sid' => payload['list_sid'], 'url' => payload['url'], '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'] ,'list_sid' => list_sid || @properties['list_sid'] ,'index' => index || @properties['index'] , } end |
Instance Method Details
#account_sid ⇒ String
339 340 341 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 339 def account_sid @properties['account_sid'] end |
#context ⇒ SyncListItemContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
324 325 326 327 328 329 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 324 def context unless @instance_context @instance_context = SyncListItemContext.new(@version , @params['service_sid'], @params['list_sid'], @params['index']) end @instance_context end |
#created_by ⇒ String
387 388 389 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 387 def created_by @properties['created_by'] end |
#data ⇒ Hash
369 370 371 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 369 def data @properties['data'] end |
#date_created ⇒ Time
375 376 377 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 375 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
381 382 383 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 381 def date_updated @properties['date_updated'] end |
#delete(if_match: :unset) ⇒ Boolean
Delete the SyncListItemInstance
395 396 397 398 399 400 401 402 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 395 def delete( if_match: :unset ) context.delete( if_match: if_match, ) end |
#fetch ⇒ SyncListItemInstance
Fetch the SyncListItemInstance
407 408 409 410 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 407 def fetch context.fetch end |
#index ⇒ String
333 334 335 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 333 def index @properties['index'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
437 438 439 440 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 437 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Sync.SyncListItemInstance #{values}>" end |
#list_sid ⇒ String
351 352 353 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 351 def list_sid @properties['list_sid'] end |
#revision ⇒ String
363 364 365 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 363 def revision @properties['revision'] end |
#service_sid ⇒ String
345 346 347 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 345 def service_sid @properties['service_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
430 431 432 433 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 430 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Sync.SyncListItemInstance #{values}>" end |
#update(data: nil, if_match: :unset) ⇒ SyncListItemInstance
Update the SyncListItemInstance
417 418 419 420 421 422 423 424 425 426 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 417 def update( data: nil, if_match: :unset ) context.update( data: data, if_match: if_match, ) end |
#url ⇒ String
357 358 359 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 357 def url @properties['url'] end |