Class: Twilio::REST::Sync::V1::ServiceContext::DocumentContext::DocumentPermissionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Sync::V1::ServiceContext::DocumentContext::DocumentPermissionInstance
- Defined in:
- lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Document Permission resource.
-
#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 SID of the Sync Document to which the Document Permission applies.
-
#fetch ⇒ DocumentPermissionInstance
Fetch the DocumentPermissionInstance.
-
#identity ⇒ String
The application-defined string that uniquely identifies the resource’s User within the Service to an FPA token.
-
#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
Whether the identity can delete the Sync Document.
-
#read ⇒ Boolean
Whether the identity can read the Sync Document.
-
#service_sid ⇒ String
The SID of the [Sync Service](www.twilio.com/docs/sync/api/service) the resource is associated with.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(read: nil, write: nil, manage: nil) ⇒ DocumentPermissionInstance
Update the DocumentPermissionInstance.
-
#url ⇒ String
The absolute URL of the Sync Document Permission resource.
-
#write ⇒ Boolean
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
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 251 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 SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Document Permission resource.
284 285 286 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 284 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
275 276 277 278 279 280 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 275 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
333 334 335 336 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 333 def delete context.delete end |
#document_sid ⇒ String
Returns The SID of the Sync Document to which the Document Permission applies.
296 297 298 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 296 def document_sid @properties['document_sid'] end |
#fetch ⇒ DocumentPermissionInstance
Fetch the DocumentPermissionInstance
341 342 343 344 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 341 def fetch context.fetch end |
#identity ⇒ String
Returns The application-defined string that uniquely identifies the resource’s User within the Service to an FPA token.
302 303 304 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 302 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
374 375 376 377 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 374 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Sync.V1.DocumentPermissionInstance #{values}>" end |
#manage ⇒ Boolean
Returns Whether the identity can delete the Sync Document.
320 321 322 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 320 def manage @properties['manage'] end |
#read ⇒ Boolean
Returns Whether the identity can read the Sync Document.
308 309 310 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 308 def read @properties['read'] end |
#service_sid ⇒ String
Returns The SID of the [Sync Service](www.twilio.com/docs/sync/api/service) the resource is associated with.
290 291 292 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 290 def service_sid @properties['service_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
367 368 369 370 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 367 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Sync.V1.DocumentPermissionInstance #{values}>" end |
#update(read: nil, write: nil, manage: nil) ⇒ DocumentPermissionInstance
Update the DocumentPermissionInstance
352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 352 def update( read: nil, write: nil, manage: nil ) context.update( read: read, write: write, manage: manage, ) end |
#url ⇒ String
Returns The absolute URL of the Sync Document Permission resource.
326 327 328 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 326 def url @properties['url'] end |
#write ⇒ Boolean
Returns Whether the identity can update the Sync Document.
314 315 316 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 314 def write @properties['write'] end |