class Twilio::REST::Sync::V1::ServiceContext::DocumentContext::DocumentPermissionInstance
Public Class Methods
Initialize the DocumentPermissionInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] service_sid
The SID of the {Sync
Service}[https://www.twilio.com/docs/sync/api/service] the resource is associated with.
@param [String] document_sid
The SID of the Sync
Document to which the Document
Permission applies.
@param [String] identity The application-defined string that uniquely identifies
the User's Document Permission resource to fetch.
@return [DocumentPermissionInstance] DocumentPermissionInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 248 def initialize(version, payload, service_sid: nil, document_sid: nil, identity: nil) 249 super(version) 250 251 # Marshaled Properties 252 @properties = { 253 'account_sid' => payload['account_sid'], 254 'service_sid' => payload['service_sid'], 255 'document_sid' => payload['document_sid'], 256 'identity' => payload['identity'], 257 'read' => payload['read'], 258 'write' => payload['write'], 259 'manage' => payload['manage'], 260 'url' => payload['url'], 261 } 262 263 # Context 264 @instance_context = nil 265 @params = { 266 'service_sid' => service_sid, 267 'document_sid' => document_sid, 268 'identity' => identity || @properties['identity'], 269 } 270 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 290 def account_sid 291 @properties['account_sid'] 292 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [DocumentPermissionContext] DocumentPermissionContext
for this DocumentPermissionInstance
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 276 def context 277 unless @instance_context 278 @instance_context = DocumentPermissionContext.new( 279 @version, 280 @params['service_sid'], 281 @params['document_sid'], 282 @params['identity'], 283 ) 284 end 285 @instance_context 286 end
Delete the DocumentPermissionInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 346 def delete 347 context.delete 348 end
@return [String] The Sync
Document SID
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 302 def document_sid 303 @properties['document_sid'] 304 end
Fetch the DocumentPermissionInstance
@return [DocumentPermissionInstance] Fetched DocumentPermissionInstance
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 339 def fetch 340 context.fetch 341 end
@return [String] The identity of the user to whom the Sync
Document Permission applies
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 308 def identity 309 @properties['identity'] 310 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 372 def inspect 373 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 374 "<Twilio.Sync.V1.DocumentPermissionInstance #{values}>" 375 end
@return [Boolean] Manage access
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 326 def manage 327 @properties['manage'] 328 end
@return [Boolean] Read access
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 314 def read 315 @properties['read'] 316 end
@return [String] The SID of the Sync
Service that the resource is associated with
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 296 def service_sid 297 @properties['service_sid'] 298 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 365 def to_s 366 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 367 "<Twilio.Sync.V1.DocumentPermissionInstance #{values}>" 368 end
Update the DocumentPermissionInstance
@param [Boolean] read Whether the identity can read the Sync
Document. Default
value is `false`.
@param [Boolean] write Whether the identity can update the Sync
Document.
Default value is `false`.
@param [Boolean] manage Whether the identity can delete the Sync
Document.
Default value is `false`.
@return [DocumentPermissionInstance] Updated DocumentPermissionInstance
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 359 def update(read: nil, write: nil, manage: nil) 360 context.update(read: read, write: write, manage: manage, ) 361 end
@return [String] The absolute URL of the Sync
Document Permission resource
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 332 def url 333 @properties['url'] 334 end
@return [Boolean] Write access
# File lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb 320 def write 321 @properties['write'] 322 end