Class: Twilio::REST::Chat::V2::ServiceContext::RoleInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Chat::V2::ServiceContext::RoleInstance
- Defined in:
- lib/twilio-ruby/rest/chat/v2/service/role.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The account_sid.
-
#context ⇒ RoleContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date_created.
-
#date_updated ⇒ Time
The date_updated.
-
#delete ⇒ Boolean
Deletes the RoleInstance.
-
#fetch ⇒ RoleInstance
Fetch a RoleInstance.
-
#friendly_name ⇒ String
The friendly_name.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ RoleInstance
constructor
Initialize the RoleInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#permissions ⇒ String
The permissions.
-
#service_sid ⇒ String
The service_sid.
-
#sid ⇒ String
The sid.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ role.RoleType
The type.
-
#update(permission: nil) ⇒ RoleInstance
Update the RoleInstance.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ RoleInstance
Initialize the RoleInstance
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 238 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 account_sid.
278 279 280 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 278 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
263 264 265 266 267 268 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 263 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_created.
308 309 310 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 308 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date_updated.
314 315 316 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 314 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the RoleInstance
334 335 336 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 334 def delete context.delete end |
#fetch ⇒ RoleInstance
Fetch a RoleInstance
327 328 329 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 327 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The friendly_name.
290 291 292 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 290 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
355 356 357 358 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 355 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Chat.V2.RoleInstance #{values}>" end |
#permissions ⇒ String
Returns The permissions.
302 303 304 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 302 def @properties['permissions'] end |
#service_sid ⇒ String
Returns The service_sid.
284 285 286 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 284 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The sid.
272 273 274 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 272 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
348 349 350 351 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 348 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Chat.V2.RoleInstance #{values}>" end |
#type ⇒ role.RoleType
Returns The type.
296 297 298 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 296 def type @properties['type'] end |
#update(permission: nil) ⇒ RoleInstance
Update the RoleInstance
342 343 344 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 342 def update(permission: nil) context.update(permission: , ) end |
#url ⇒ String
Returns The url.
320 321 322 |
# File 'lib/twilio-ruby/rest/chat/v2/service/role.rb', line 320 def url @properties['url'] end |