Class: Twilio::REST::Chat::V1::ServiceContext::RoleInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Chat::V1::ServiceContext::RoleInstance
- Defined in:
- lib/twilio-ruby/rest/chat/v1/service/role.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique id of the Account responsible for this role.
-
#context ⇒ RoleContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this resource was created in ISO 8601 format.
-
#date_updated ⇒ Time
The date that this resource was last updated in ISO 8601 format.
-
#delete ⇒ Boolean
Deletes the RoleInstance.
-
#fetch ⇒ RoleInstance
Fetch a RoleInstance.
-
#friendly_name ⇒ String
The human-readable name of this role.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ RoleInstance
constructor
Initialize the RoleInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#permissions ⇒ String
A JSON array of the permissions this role has.
-
#service_sid ⇒ String
The unique id of the Service this role belongs to.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ role.RoleType
What kind of role this is.
-
#update(permission: nil) ⇒ RoleInstance
Update the RoleInstance.
-
#url ⇒ String
An absolute URL for this role.
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ RoleInstance
Initialize the RoleInstance
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 247 def initialize(version, payload, service_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'friendly_name' => payload['friendly_name'], 'type' => payload['type'], 'permissions' => payload['permissions'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], } # Context @instance_context = nil @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique id of the Account responsible for this role.
287 288 289 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 287 def account_sid @properties['account_sid'] end |
#context ⇒ RoleContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
272 273 274 275 276 277 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 272 def context unless @instance_context @instance_context = RoleContext.new(@version, @params['service_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date that this resource was created in ISO 8601 format.
317 318 319 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 317 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated in ISO 8601 format.
323 324 325 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 323 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the RoleInstance
343 344 345 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 343 def delete context.delete end |
#fetch ⇒ RoleInstance
Fetch a RoleInstance
336 337 338 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 336 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The human-readable name of this role.
299 300 301 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 299 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
365 366 367 368 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 365 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Chat.V1.RoleInstance #{values}>" end |
#permissions ⇒ String
Returns A JSON array of the permissions this role has.
311 312 313 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 311 def @properties['permissions'] end |
#service_sid ⇒ String
Returns The unique id of the Service this role belongs to.
293 294 295 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 293 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
281 282 283 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 281 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
358 359 360 361 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 358 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Chat.V1.RoleInstance #{values}>" end |
#type ⇒ role.RoleType
Returns What kind of role this is.
305 306 307 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 305 def type @properties['type'] end |
#update(permission: nil) ⇒ RoleInstance
Update the RoleInstance
352 353 354 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 352 def update(permission: nil) context.update(permission: , ) end |
#url ⇒ String
Returns An absolute URL for this role.
329 330 331 |
# File 'lib/twilio-ruby/rest/chat/v1/service/role.rb', line 329 def url @properties['url'] end |