class Twilio::REST::Preview::Sync::ServiceContext::SyncListContext::SyncListPermissionContext
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 SyncListPermissionContext
@param [Version] version Version
that contains the resource @param [String] service_sid The service_sid @param [String] list_sid Identifier of the Sync
List. 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 [SyncListPermissionContext] SyncListPermissionContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb 169 def initialize(version, service_sid, list_sid, identity) 170 super(version) 171 172 # Path Solution 173 @solution = {service_sid: service_sid, list_sid: list_sid, identity: identity, } 174 @uri = "/Services/#{@solution[:service_sid]}/Lists/#{@solution[:list_sid]}/Permissions/#{@solution[:identity]}" 175 end
Public Instance Methods
Delete the SyncListPermissionInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb 195 def delete 196 @version.delete('DELETE', @uri) 197 end
Fetch the SyncListPermissionInstance
@return [SyncListPermissionInstance] Fetched SyncListPermissionInstance
# File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb 180 def fetch 181 payload = @version.fetch('GET', @uri) 182 183 SyncListPermissionInstance.new( 184 @version, 185 payload, 186 service_sid: @solution[:service_sid], 187 list_sid: @solution[:list_sid], 188 identity: @solution[:identity], 189 ) 190 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb 231 def inspect 232 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 233 "#<Twilio.Preview.Sync.SyncListPermissionContext #{context}>" 234 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb 224 def to_s 225 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 226 "#<Twilio.Preview.Sync.SyncListPermissionContext #{context}>" 227 end
Update the SyncListPermissionInstance
@param [Boolean] read Boolean flag specifying whether the identity can read the
Sync List.
@param [Boolean] write Boolean flag specifying whether the identity can create,
update and delete Items of the Sync List.
@param [Boolean] manage Boolean flag specifying whether the identity can delete
the Sync List.
@return [SyncListPermissionInstance] Updated SyncListPermissionInstance
# File lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_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 SyncListPermissionInstance.new( 214 @version, 215 payload, 216 service_sid: @solution[:service_sid], 217 list_sid: @solution[:list_sid], 218 identity: @solution[:identity], 219 ) 220 end