Class: Twilio::REST::Preview::Sync::ServiceContext::DocumentContext::DocumentPermissionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::Sync::ServiceContext::DocumentContext::DocumentPermissionInstance
- Defined in:
- lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Twilio Account.
-
#context ⇒ DocumentPermissionContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#delete ⇒ Boolean
Delete the DocumentPermissionInstance.
-
#document_sid ⇒ String
The unique SID identifier of the Sync Document to which the Permission applies.
-
#fetch ⇒ DocumentPermissionInstance
Fetch the DocumentPermissionInstance.
-
#identity ⇒ String
Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer.
-
#initialize(version, payload, service_sid: nil, document_sid: nil, identity: nil) ⇒ DocumentPermissionInstance
constructor
Initialize the DocumentPermissionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#manage ⇒ Boolean
Boolean flag specifying whether the identity can delete the Sync Document.
-
#read ⇒ Boolean
Boolean flag specifying whether the identity can read the Sync Document.
-
#service_sid ⇒ String
The unique SID identifier of the Sync Service Instance.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(read: nil, write: nil, manage: nil) ⇒ DocumentPermissionInstance
Update the DocumentPermissionInstance.
-
#url ⇒ String
Contains an absolute URL for this Sync Document Permission.
-
#write ⇒ Boolean
Boolean flag specifying whether the identity can update the Sync Document.
Constructor Details
#initialize(version, payload, service_sid: nil, document_sid: nil, identity: nil) ⇒ DocumentPermissionInstance
Initialize the DocumentPermissionInstance
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 271 def initialize(version, payload , service_sid: nil, document_sid: nil, identity: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'document_sid' => payload['document_sid'], 'identity' => payload['identity'], 'read' => payload['read'], 'write' => payload['write'], 'manage' => payload['manage'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'service_sid' => service_sid || @properties['service_sid'] ,'document_sid' => document_sid || @properties['document_sid'] ,'identity' => identity || @properties['identity'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID identifier of the Twilio Account.
304 305 306 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 304 def account_sid @properties['account_sid'] end |
#context ⇒ DocumentPermissionContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
295 296 297 298 299 300 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 295 def context unless @instance_context @instance_context = DocumentPermissionContext.new(@version , @params['service_sid'], @params['document_sid'], @params['identity']) end @instance_context end |
#delete ⇒ Boolean
Delete the DocumentPermissionInstance
353 354 355 356 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 353 def delete context.delete end |
#document_sid ⇒ String
Returns The unique SID identifier of the Sync Document to which the Permission applies.
316 317 318 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 316 def document_sid @properties['document_sid'] end |
#fetch ⇒ DocumentPermissionInstance
Fetch the DocumentPermissionInstance
361 362 363 364 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 361 def fetch context.fetch end |
#identity ⇒ String
Returns Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer.
322 323 324 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 322 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
394 395 396 397 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 394 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Sync.DocumentPermissionInstance #{values}>" end |
#manage ⇒ Boolean
Returns Boolean flag specifying whether the identity can delete the Sync Document.
340 341 342 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 340 def manage @properties['manage'] end |
#read ⇒ Boolean
Returns Boolean flag specifying whether the identity can read the Sync Document.
328 329 330 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 328 def read @properties['read'] end |
#service_sid ⇒ String
Returns The unique SID identifier of the Sync Service Instance.
310 311 312 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 310 def service_sid @properties['service_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
387 388 389 390 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 387 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Sync.DocumentPermissionInstance #{values}>" end |
#update(read: nil, write: nil, manage: nil) ⇒ DocumentPermissionInstance
Update the DocumentPermissionInstance
372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 372 def update( read: nil, write: nil, manage: nil ) context.update( read: read, write: write, manage: manage, ) end |
#url ⇒ String
Returns Contains an absolute URL for this Sync Document Permission.
346 347 348 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 346 def url @properties['url'] end |
#write ⇒ Boolean
Returns Boolean flag specifying whether the identity can update the Sync Document.
334 335 336 |
# File 'lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb', line 334 def write @properties['write'] end |