Class: Twilio::REST::Preview::Sync::ServiceContext::SyncMapContext::SyncMapItemContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::Sync::ServiceContext::SyncMapContext::SyncMapItemContext
- Defined in:
- lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_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(if_match: :unset) ⇒ Boolean
Delete the SyncMapItemInstance.
-
#fetch ⇒ SyncMapItemInstance
Fetch the SyncMapItemInstance.
-
#initialize(version, service_sid, map_sid, key) ⇒ SyncMapItemContext
constructor
Initialize the SyncMapItemContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(data: nil, if_match: :unset) ⇒ SyncMapItemInstance
Update the SyncMapItemInstance.
Constructor Details
#initialize(version, service_sid, map_sid, key) ⇒ SyncMapItemContext
Initialize the SyncMapItemContext
195 196 197 198 199 200 201 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb', line 195 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(if_match: :unset) ⇒ Boolean
Delete the SyncMapItemInstance
222 223 224 225 226 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb', line 222 def delete(if_match: :unset) headers = Twilio::Values.of({'If-Match' => if_match, }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ SyncMapItemInstance
Fetch the SyncMapItemInstance
206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb', line 206 def fetch payload = @version.fetch('GET', @uri) SyncMapItemInstance.new( @version, payload, service_sid: @solution[:service_sid], map_sid: @solution[:map_sid], key: @solution[:key], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
257 258 259 260 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb', line 257 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Sync.SyncMapItemContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
250 251 252 253 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb', line 250 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Sync.SyncMapItemContext #{context}>" end |
#update(data: nil, if_match: :unset) ⇒ SyncMapItemInstance
Update the SyncMapItemInstance
233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb', line 233 def update(data: nil, if_match: :unset) data = Twilio::Values.of({'Data' => Twilio.serialize_object(data), }) headers = Twilio::Values.of({'If-Match' => if_match, }) payload = @version.update('POST', @uri, data: data, headers: headers) SyncMapItemInstance.new( @version, payload, service_sid: @solution[:service_sid], map_sid: @solution[:map_sid], key: @solution[:key], ) end |