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
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 255 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.
288 289 290 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 288 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
279 280 281 282 283 284 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 279 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
337 338 339 340 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 337 def delete context.delete end |
#document_sid ⇒ String
Returns The SID of the Sync Document to which the Document Permission applies.
300 301 302 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 300 def document_sid @properties['document_sid'] end |
#fetch ⇒ DocumentPermissionInstance
Fetch the DocumentPermissionInstance
345 346 347 348 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 345 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.
306 307 308 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 306 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
378 379 380 381 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 378 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.
324 325 326 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 324 def manage @properties['manage'] end |
#read ⇒ Boolean
Returns Whether the identity can read the Sync Document.
312 313 314 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 312 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.
294 295 296 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 294 def service_sid @properties['service_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
371 372 373 374 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 371 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
356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 356 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.
330 331 332 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 330 def url @properties['url'] end |
#write ⇒ Boolean
Returns Whether the identity can update the Sync Document.
318 319 320 |
# File 'lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb', line 318 def write @properties['write'] end |