class Twilio::REST::Sync::V1::ServiceContext::SyncMapContext::SyncMapPermissionContext

Public Class Methods

new(version, service_sid, map_sid, identity) click to toggle source

Initialize the SyncMapPermissionContext @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 Map
Permission resource to fetch. Can be the Service's `sid` value or `default`.

@param [String] map_sid The SID of the Sync Map with the Sync Map Permission

resource to fetch. Can be the Sync Map resource's `sid` or its `unique_name`.

@param [String] identity The application-defined string that uniquely identifies

the User's Sync Map Permission resource to fetch.

@return [SyncMapPermissionContext] SyncMapPermissionContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
165 def initialize(version, service_sid, map_sid, identity)
166   super(version)
167 
168   # Path Solution
169   @solution = {service_sid: service_sid, map_sid: map_sid, identity: identity, }
170   @uri = "/Services/#{@solution[:service_sid]}/Maps/#{@solution[:map_sid]}/Permissions/#{@solution[:identity]}"
171 end

Public Instance Methods

delete() click to toggle source

Delete the SyncMapPermissionInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
191 def delete
192    @version.delete('DELETE', @uri)
193 end
fetch() click to toggle source

Fetch the SyncMapPermissionInstance @return [SyncMapPermissionInstance] Fetched SyncMapPermissionInstance

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
176 def fetch
177   payload = @version.fetch('GET', @uri)
178 
179   SyncMapPermissionInstance.new(
180       @version,
181       payload,
182       service_sid: @solution[:service_sid],
183       map_sid: @solution[:map_sid],
184       identity: @solution[:identity],
185   )
186 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
227 def inspect
228   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
229   "#<Twilio.Sync.V1.SyncMapPermissionContext #{context}>"
230 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
220 def to_s
221   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
222   "#<Twilio.Sync.V1.SyncMapPermissionContext #{context}>"
223 end
update(read: nil, write: nil, manage: nil) click to toggle source

Update the SyncMapPermissionInstance @param [Boolean] read Whether the identity can read the Sync Map and its Items.

Default value is `false`.

@param [Boolean] write Whether the identity can create, update, and delete Items

in the Sync Map. Default value is `false`.

@param [Boolean] manage Whether the identity can delete the Sync Map. Default

value is `false`.

@return [SyncMapPermissionInstance] Updated SyncMapPermissionInstance

    # File lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb
204 def update(read: nil, write: nil, manage: nil)
205   data = Twilio::Values.of({'Read' => read, 'Write' => write, 'Manage' => manage, })
206 
207   payload = @version.update('POST', @uri, data: data)
208 
209   SyncMapPermissionInstance.new(
210       @version,
211       payload,
212       service_sid: @solution[:service_sid],
213       map_sid: @solution[:map_sid],
214       identity: @solution[:identity],
215   )
216 end