Class: Twilio::REST::Sync::V1::ServiceContext::SyncMapContext::SyncMapItemContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Sync::V1::ServiceContext::SyncMapContext::SyncMapItemContext
- Defined in:
- lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_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 SyncMapItemInstance.
-
#fetch ⇒ SyncMapItemInstance
Fetch a SyncMapItemInstance.
-
#initialize(version, service_sid, map_sid, key) ⇒ SyncMapItemContext
constructor
Initialize the SyncMapItemContext.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(data: :unset, ttl: :unset) ⇒ SyncMapItemInstance
Update the SyncMapItemInstance.
Constructor Details
#initialize(version, service_sid, map_sid, key) ⇒ SyncMapItemContext
Initialize the SyncMapItemContext
201 202 203 204 205 206 207 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb', line 201 def initialize(version, service_sid, map_sid, key) super(version) # Path Solution @solution = {service_sid: service_sid, map_sid: map_sid, key: key, } @uri = "/Services/#{@solution[:service_sid]}/Maps/#{@solution[:map_sid]}/Items/#{@solution[:key]}" end |
Instance Method Details
#delete ⇒ Boolean
Deletes the SyncMapItemInstance
233 234 235 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb', line 233 def delete @version.delete('delete', @uri) end |
#fetch ⇒ SyncMapItemInstance
Fetch a SyncMapItemInstance
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb', line 212 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) SyncMapItemInstance.new( @version, payload, service_sid: @solution[:service_sid], map_sid: @solution[:map_sid], key: @solution[:key], ) end |
#to_s ⇒ Object
Provide a user friendly representation
262 263 264 265 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb', line 262 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Sync.V1.SyncMapItemContext #{context}>" end |
#update(data: :unset, ttl: :unset) ⇒ SyncMapItemInstance
Update the SyncMapItemInstance
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb', line 242 def update(data: :unset, ttl: :unset) data = Twilio::Values.of({'Data' => Twilio.serialize_object(data), 'Ttl' => ttl, }) payload = @version.update( 'POST', @uri, data: data, ) SyncMapItemInstance.new( @version, payload, service_sid: @solution[:service_sid], map_sid: @solution[:map_sid], key: @solution[:key], ) end |