Class: Twilio::REST::Sync::V1::ServiceContext::SyncListContext::SyncListItemContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Sync::V1::ServiceContext::SyncListContext::SyncListItemContext
- Defined in:
- lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the SyncListItemInstance.
-
#fetch ⇒ SyncListItemInstance
Fetch a SyncListItemInstance.
-
#initialize(version, service_sid, list_sid, index) ⇒ SyncListItemContext
constructor
Initialize the SyncListItemContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(data: :unset, ttl: :unset, item_ttl: :unset, collection_ttl: :unset) ⇒ SyncListItemInstance
Update the SyncListItemInstance.
Constructor Details
#initialize(version, service_sid, list_sid, index) ⇒ SyncListItemContext
Initialize the SyncListItemContext
225 226 227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb', line 225 def initialize(version, service_sid, list_sid, index) super(version) # Path Solution @solution = {service_sid: service_sid, list_sid: list_sid, index: index, } @uri = "/Services/#{@solution[:service_sid]}/Lists/#{@solution[:list_sid]}/Items/#{@solution[:index]}" end |
Instance Method Details
#delete ⇒ Boolean
Deletes the SyncListItemInstance
257 258 259 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb', line 257 def delete @version.delete('delete', @uri) end |
#fetch ⇒ SyncListItemInstance
Fetch a SyncListItemInstance
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb', line 236 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) SyncListItemInstance.new( @version, payload, service_sid: @solution[:service_sid], list_sid: @solution[:list_sid], index: @solution[:index], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
308 309 310 311 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb', line 308 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Sync.V1.SyncListItemContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
301 302 303 304 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb', line 301 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Sync.V1.SyncListItemContext #{context}>" end |
#update(data: :unset, ttl: :unset, item_ttl: :unset, collection_ttl: :unset) ⇒ SyncListItemInstance
Update the SyncListItemInstance
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb', line 276 def update(data: :unset, ttl: :unset, item_ttl: :unset, collection_ttl: :unset) data = Twilio::Values.of({ 'Data' => Twilio.serialize_object(data), 'Ttl' => ttl, 'ItemTtl' => item_ttl, 'CollectionTtl' => collection_ttl, }) payload = @version.update( 'POST', @uri, data: data, ) SyncListItemInstance.new( @version, payload, service_sid: @solution[:service_sid], list_sid: @solution[:list_sid], index: @solution[:index], ) end |