Class: Twilio::REST::FlexApi::V2::FlexUserInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::FlexApi::V2::FlexUserInstance
- Defined in:
- lib/twilio-ruby/rest/flex_api/v2/flex_user.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID of the account that created the resource.
-
#context ⇒ FlexUserContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#created_date ⇒ Time
The date that this user was created, given in ISO 8601 format.
-
#email ⇒ String
Email of the User.
-
#fetch ⇒ FlexUserInstance
Fetch the FlexUserInstance.
-
#flex_team_sid ⇒ String
The unique SID identifier of the Flex Team.
-
#flex_user_sid ⇒ String
The unique SID identifier of the Flex User.
-
#initialize(version, payload, instance_sid: nil, flex_user_sid: nil) ⇒ FlexUserInstance
constructor
Initialize the FlexUserInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#instance_sid ⇒ String
The unique ID created by Twilio to identify a Flex instance.
-
#locale ⇒ String
The locale preference of the user.
-
#roles ⇒ Array<String>
The roles of the user.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(email: :unset, user_sid: :unset, locale: :unset) ⇒ FlexUserInstance
Update the FlexUserInstance.
-
#updated_date ⇒ Time
The date that this user was updated, given in ISO 8601 format.
- #url ⇒ String
-
#user_sid ⇒ String
The unique SID identifier of the Twilio Unified User.
-
#username ⇒ String
Username of the User.
-
#version ⇒ String
The current version of the user.
-
#worker_sid ⇒ String
The unique SID identifier of the worker.
-
#workspace_sid ⇒ String
The unique SID identifier of the workspace.
Constructor Details
#initialize(version, payload, instance_sid: nil, flex_user_sid: nil) ⇒ FlexUserInstance
Initialize the FlexUserInstance
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 341 def initialize(version, payload , instance_sid: nil, flex_user_sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'instance_sid' => payload['instance_sid'], 'user_sid' => payload['user_sid'], 'flex_user_sid' => payload['flex_user_sid'], 'worker_sid' => payload['worker_sid'], 'workspace_sid' => payload['workspace_sid'], 'flex_team_sid' => payload['flex_team_sid'], 'username' => payload['username'], 'email' => payload['email'], 'locale' => payload['locale'], 'roles' => payload['roles'], 'created_date' => Twilio.deserialize_iso8601_datetime(payload['created_date']), 'updated_date' => Twilio.deserialize_iso8601_datetime(payload['updated_date']), 'version' => payload['version'] == nil ? payload['version'] : payload['version'].to_i, 'url' => payload['url'], } # Context @instance_context = nil @params = { 'instance_sid' => instance_sid || @properties['instance_sid'] ,'flex_user_sid' => flex_user_sid || @properties['flex_user_sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID of the account that created the resource.
382 383 384 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 382 def account_sid @properties['account_sid'] end |
#context ⇒ FlexUserContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
373 374 375 376 377 378 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 373 def context unless @instance_context @instance_context = FlexUserContext.new(@version , @params['instance_sid'], @params['flex_user_sid']) end @instance_context end |
#created_date ⇒ Time
Returns The date that this user was created, given in ISO 8601 format.
448 449 450 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 448 def created_date @properties['created_date'] end |
#email ⇒ String
Returns Email of the User.
430 431 432 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 430 def email @properties['email'] end |
#fetch ⇒ FlexUserInstance
Fetch the FlexUserInstance
473 474 475 476 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 473 def fetch context.fetch end |
#flex_team_sid ⇒ String
Returns The unique SID identifier of the Flex Team.
418 419 420 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 418 def flex_team_sid @properties['flex_team_sid'] end |
#flex_user_sid ⇒ String
Returns The unique SID identifier of the Flex User.
400 401 402 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 400 def flex_user_sid @properties['flex_user_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
506 507 508 509 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 506 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V2.FlexUserInstance #{values}>" end |
#instance_sid ⇒ String
Returns The unique ID created by Twilio to identify a Flex instance.
388 389 390 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 388 def instance_sid @properties['instance_sid'] end |
#locale ⇒ String
Returns The locale preference of the user.
436 437 438 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 436 def locale @properties['locale'] end |
#roles ⇒ Array<String>
Returns The roles of the user.
442 443 444 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 442 def roles @properties['roles'] end |
#to_s ⇒ Object
Provide a user friendly representation
499 500 501 502 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 499 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.FlexApi.V2.FlexUserInstance #{values}>" end |
#update(email: :unset, user_sid: :unset, locale: :unset) ⇒ FlexUserInstance
Update the FlexUserInstance
484 485 486 487 488 489 490 491 492 493 494 495 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 484 def update( email: :unset, user_sid: :unset, locale: :unset ) context.update( email: email, user_sid: user_sid, locale: locale, ) end |
#updated_date ⇒ Time
Returns The date that this user was updated, given in ISO 8601 format.
454 455 456 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 454 def updated_date @properties['updated_date'] end |
#url ⇒ String
466 467 468 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 466 def url @properties['url'] end |
#user_sid ⇒ String
Returns The unique SID identifier of the Twilio Unified User.
394 395 396 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 394 def user_sid @properties['user_sid'] end |
#username ⇒ String
Returns Username of the User.
424 425 426 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 424 def username @properties['username'] end |
#version ⇒ String
Returns The current version of the user.
460 461 462 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 460 def version @properties['version'] end |
#worker_sid ⇒ String
Returns The unique SID identifier of the worker.
406 407 408 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 406 def worker_sid @properties['worker_sid'] end |
#workspace_sid ⇒ String
Returns The unique SID identifier of the workspace.
412 413 414 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 412 def workspace_sid @properties['workspace_sid'] end |