Class: Twilio::REST::IpMessaging::V2::ServiceContext::RoleInstance
- Inherits:
-
Twilio::REST::InstanceResource
- Object
- Twilio::REST::InstanceResource
- Twilio::REST::IpMessaging::V2::ServiceContext::RoleInstance
- Defined in:
- lib/twilio-ruby/rest/ip_messaging/v2/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
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 244 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.
284 285 286 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 284 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
269 270 271 272 273 274 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 269 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.
314 315 316 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 314 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated in ISO 8601 format.
320 321 322 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 320 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the RoleInstance
340 341 342 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 340 def delete context.delete end |
#fetch ⇒ RoleInstance
Fetch a RoleInstance
333 334 335 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 333 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The human-readable name of this role.
296 297 298 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 296 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
362 363 364 365 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 362 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.IpMessaging.V2.RoleInstance #{values}>" end |
#permissions ⇒ String
Returns A JSON array of the permissions this role has.
308 309 310 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 308 def @properties['permissions'] end |
#service_sid ⇒ String
Returns The unique id of the Service this role belongs to.
290 291 292 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 290 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
278 279 280 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 278 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
355 356 357 358 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 355 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.IpMessaging.V2.RoleInstance #{values}>" end |
#type ⇒ role.RoleType
Returns What kind of role this is.
302 303 304 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 302 def type @properties['type'] end |
#update(permission: nil) ⇒ RoleInstance
Update the RoleInstance
349 350 351 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 349 def update(permission: nil) context.update(permission: , ) end |
#url ⇒ String
Returns An absolute URL for this role.
326 327 328 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb', line 326 def url @properties['url'] end |