class Twilio::REST::Preview::Sync::ServiceContext::SyncMapContext::SyncMapPermissionContext
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 SyncMapPermissionContext
@param [Version] version Version
that contains the resource @param [String] service_sid The service_sid @param [String] map_sid Identifier of the Sync
Map. Either a SID or a unique
name.
@param [String] identity Arbitrary string identifier representing a user
associated with an FPA token, assigned by the developer.
@return [SyncMapPermissionContext] SyncMapPermissionContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb 169 def initialize(version, service_sid, map_sid, identity) 170 super(version) 171 172 # Path Solution 173 @solution = {service_sid: service_sid, map_sid: map_sid, identity: identity, } 174 @uri = "/Services/#{@solution[:service_sid]}/Maps/#{@solution[:map_sid]}/Permissions/#{@solution[:identity]}" 175 end
Public Instance Methods
Delete the SyncMapPermissionInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb 195 def delete 196 @version.delete('DELETE', @uri) 197 end
Fetch the SyncMapPermissionInstance
@return [SyncMapPermissionInstance] Fetched SyncMapPermissionInstance
# File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb 180 def fetch 181 payload = @version.fetch('GET', @uri) 182 183 SyncMapPermissionInstance.new( 184 @version, 185 payload, 186 service_sid: @solution[:service_sid], 187 map_sid: @solution[:map_sid], 188 identity: @solution[:identity], 189 ) 190 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb 231 def inspect 232 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 233 "#<Twilio.Preview.Sync.SyncMapPermissionContext #{context}>" 234 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb 224 def to_s 225 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 226 "#<Twilio.Preview.Sync.SyncMapPermissionContext #{context}>" 227 end
Update the SyncMapPermissionInstance
@param [Boolean] read Boolean flag specifying whether the identity can read the
Sync Map.
@param [Boolean] write Boolean flag specifying whether the identity can create,
update and delete Items of the Sync Map.
@param [Boolean] manage Boolean flag specifying whether the identity can delete
the Sync Map.
@return [SyncMapPermissionInstance] Updated SyncMapPermissionInstance
# File lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb 208 def update(read: nil, write: nil, manage: nil) 209 data = Twilio::Values.of({'Read' => read, 'Write' => write, 'Manage' => manage, }) 210 211 payload = @version.update('POST', @uri, data: data) 212 213 SyncMapPermissionInstance.new( 214 @version, 215 payload, 216 service_sid: @solution[:service_sid], 217 map_sid: @solution[:map_sid], 218 identity: @solution[:identity], 219 ) 220 end