class Twilio::REST::Conversations::V1::RoleInstance
Public Class Methods
Initialize the RoleInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] sid The SID of the Role resource to fetch. @return [RoleInstance] RoleInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/conversations/v1/role.rb 236 def initialize(version, payload, sid: nil) 237 super(version) 238 239 # Marshaled Properties 240 @properties = { 241 'sid' => payload['sid'], 242 'account_sid' => payload['account_sid'], 243 'chat_service_sid' => payload['chat_service_sid'], 244 'friendly_name' => payload['friendly_name'], 245 'type' => payload['type'], 246 'permissions' => payload['permissions'], 247 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 248 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 249 'url' => payload['url'], 250 } 251 252 # Context 253 @instance_context = nil 254 @params = {'sid' => sid || @properties['sid'], } 255 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/conversations/v1/role.rb 276 def account_sid 277 @properties['account_sid'] 278 end
@return [String] The SID of the Conversation Service that the resource is associated with
# File lib/twilio-ruby/rest/conversations/v1/role.rb 282 def chat_service_sid 283 @properties['chat_service_sid'] 284 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [RoleContext] RoleContext
for this RoleInstance
# File lib/twilio-ruby/rest/conversations/v1/role.rb 261 def context 262 unless @instance_context 263 @instance_context = RoleContext.new(@version, @params['sid'], ) 264 end 265 @instance_context 266 end
@return [Time] The ISO 8601 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/conversations/v1/role.rb 306 def date_created 307 @properties['date_created'] 308 end
@return [Time] The ISO 8601 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/conversations/v1/role.rb 312 def date_updated 313 @properties['date_updated'] 314 end
Delete the RoleInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/conversations/v1/role.rb 338 def delete 339 context.delete 340 end
Fetch the RoleInstance
@return [RoleInstance] Fetched RoleInstance
# File lib/twilio-ruby/rest/conversations/v1/role.rb 345 def fetch 346 context.fetch 347 end
@return [String] The string that you assigned to describe the resource
# File lib/twilio-ruby/rest/conversations/v1/role.rb 288 def friendly_name 289 @properties['friendly_name'] 290 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/conversations/v1/role.rb 358 def inspect 359 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 360 "<Twilio.Conversations.V1.RoleInstance #{values}>" 361 end
@return [Array] An array of the permissions the role has been granted
# File lib/twilio-ruby/rest/conversations/v1/role.rb 300 def permissions 301 @properties['permissions'] 302 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/conversations/v1/role.rb 270 def sid 271 @properties['sid'] 272 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/conversations/v1/role.rb 351 def to_s 352 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 353 "<Twilio.Conversations.V1.RoleInstance #{values}>" 354 end
@return [role.RoleType] The type of role
# File lib/twilio-ruby/rest/conversations/v1/role.rb 294 def type 295 @properties['type'] 296 end
Update the RoleInstance
@param [Array] permission A permission that you grant to the role. Only
one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`.
@return [RoleInstance] Updated RoleInstance
# File lib/twilio-ruby/rest/conversations/v1/role.rb 331 def update(permission: nil) 332 context.update(permission: permission, ) 333 end
@return [String] An absolute URL for this user role.
# File lib/twilio-ruby/rest/conversations/v1/role.rb 318 def url 319 @properties['url'] 320 end