class Twilio::REST::Preview::Sync::ServiceContext::SyncMapContext
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 help@twilio.com.
Public Class Methods
Initialize the SyncMapContext
@param [Version] version Version
that contains the resource @param [String] service_sid The service_sid @param [String] sid The sid @return [SyncMapContext] SyncMapContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/preview/sync/service/sync_map.rb 169 def initialize(version, service_sid, sid) 170 super(version) 171 172 # Path Solution 173 @solution = {service_sid: service_sid, sid: sid, } 174 @uri = "/Services/#{@solution[:service_sid]}/Maps/#{@solution[:sid]}" 175 176 # Dependents 177 @sync_map_items = nil 178 @sync_map_permissions = nil 179 end
Public Instance Methods
Delete the SyncMapInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/sync/service/sync_map.rb 193 def delete 194 @version.delete('DELETE', @uri) 195 end
Fetch the SyncMapInstance
@return [SyncMapInstance] Fetched SyncMapInstance
# File lib/twilio-ruby/rest/preview/sync/service/sync_map.rb 184 def fetch 185 payload = @version.fetch('GET', @uri) 186 187 SyncMapInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], ) 188 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/sync/service/sync_map.rb 250 def inspect 251 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 252 "#<Twilio.Preview.Sync.SyncMapContext #{context}>" 253 end
Access the sync_map_items
@return [SyncMapItemList] @return [SyncMapItemContext] if key was passed.
# File lib/twilio-ruby/rest/preview/sync/service/sync_map.rb 201 def sync_map_items(key=:unset) 202 raise ArgumentError, 'key cannot be nil' if key.nil? 203 204 if key != :unset 205 return SyncMapItemContext.new(@version, @solution[:service_sid], @solution[:sid], key, ) 206 end 207 208 unless @sync_map_items 209 @sync_map_items = SyncMapItemList.new( 210 @version, 211 service_sid: @solution[:service_sid], 212 map_sid: @solution[:sid], 213 ) 214 end 215 216 @sync_map_items 217 end
Access the sync_map_permissions
@return [SyncMapPermissionList] @return [SyncMapPermissionContext] if identity was passed.
# File lib/twilio-ruby/rest/preview/sync/service/sync_map.rb 223 def sync_map_permissions(identity=:unset) 224 raise ArgumentError, 'identity cannot be nil' if identity.nil? 225 226 if identity != :unset 227 return SyncMapPermissionContext.new(@version, @solution[:service_sid], @solution[:sid], identity, ) 228 end 229 230 unless @sync_map_permissions 231 @sync_map_permissions = SyncMapPermissionList.new( 232 @version, 233 service_sid: @solution[:service_sid], 234 map_sid: @solution[:sid], 235 ) 236 end 237 238 @sync_map_permissions 239 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/sync/service/sync_map.rb 243 def to_s 244 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 245 "#<Twilio.Preview.Sync.SyncMapContext #{context}>" 246 end