Class: Twilio::REST::Preview::Sync::ServiceContext::SyncListContext::SyncListItemContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::Sync::ServiceContext::SyncListContext::SyncListItemContext
- Defined in:
- lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.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
-
#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: nil) ⇒ SyncListItemInstance
Update the SyncListItemInstance.
Constructor Details
#initialize(version, service_sid, list_sid, index) ⇒ SyncListItemContext
Initialize the SyncListItemContext
201 202 203 204 205 206 207 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 201 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
233 234 235 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 233 def delete @version.delete('delete', @uri) end |
#fetch ⇒ SyncListItemInstance
Fetch a SyncListItemInstance
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 212 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
268 269 270 271 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 268 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Sync.SyncListItemContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
261 262 263 264 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 261 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Sync.SyncListItemContext #{context}>" end |
#update(data: nil) ⇒ SyncListItemInstance
Update the SyncListItemInstance
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb', line 241 def update(data: nil) data = Twilio::Values.of({'Data' => Twilio.serialize_object(data), }) 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 |