class Twilio::REST::Sync::V1::ServiceContext::SyncListContext::SyncListPermissionContext
Public Class Methods
Initialize the SyncListPermissionContext
@param [Version] version Version
that contains the resource @param [String] service_sid The SID of the {Sync
Service}[https://www.twilio.com/docs/sync/api/service] with the Sync List Permission resource to fetch.
@param [String] list_sid The SID of the Sync
List with the Sync
List Permission
resource to fetch. Can be the Sync List resource's `sid` or its `unique_name`.
@param [String] identity The application-defined string that uniquely identifies
the User's Sync List Permission resource to fetch.
@return [SyncListPermissionContext] SyncListPermissionContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 166 def initialize(version, service_sid, list_sid, identity) 167 super(version) 168 169 # Path Solution 170 @solution = {service_sid: service_sid, list_sid: list_sid, identity: identity, } 171 @uri = "/Services/#{@solution[:service_sid]}/Lists/#{@solution[:list_sid]}/Permissions/#{@solution[:identity]}" 172 end
Public Instance Methods
Delete the SyncListPermissionInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 192 def delete 193 @version.delete('DELETE', @uri) 194 end
Fetch the SyncListPermissionInstance
@return [SyncListPermissionInstance] Fetched SyncListPermissionInstance
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 177 def fetch 178 payload = @version.fetch('GET', @uri) 179 180 SyncListPermissionInstance.new( 181 @version, 182 payload, 183 service_sid: @solution[:service_sid], 184 list_sid: @solution[:list_sid], 185 identity: @solution[:identity], 186 ) 187 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 228 def inspect 229 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 230 "#<Twilio.Sync.V1.SyncListPermissionContext #{context}>" 231 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 221 def to_s 222 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 223 "#<Twilio.Sync.V1.SyncListPermissionContext #{context}>" 224 end
Update the SyncListPermissionInstance
@param [Boolean] read Whether the identity can read the Sync
List and its Items.
Default value is `false`.
@param [Boolean] write Whether the identity can create, update, and delete Items
in the Sync List. Default value is `false`.
@param [Boolean] manage Whether the identity can delete the Sync
List. Default
value is `false`.
@return [SyncListPermissionInstance] Updated SyncListPermissionInstance
# File lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb 205 def update(read: nil, write: nil, manage: nil) 206 data = Twilio::Values.of({'Read' => read, 'Write' => write, 'Manage' => manage, }) 207 208 payload = @version.update('POST', @uri, data: data) 209 210 SyncListPermissionInstance.new( 211 @version, 212 payload, 213 service_sid: @solution[:service_sid], 214 list_sid: @solution[:list_sid], 215 identity: @solution[:identity], 216 ) 217 end