Class: Twilio::REST::PreviewIam::Versionless::OrganizationContext::UserInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::PreviewIam::Versionless::OrganizationContext::UserInstance
- Defined in:
- lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb
Instance Method Summary collapse
-
#active ⇒ Boolean
Indicates whether the user is active.
-
#code ⇒ String
Twilio-specific error code.
-
#context ⇒ UserContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#delete ⇒ Boolean
Delete the UserInstance.
-
#detail ⇒ String
A human-readable description of the error.
-
#display_name ⇒ String
User friendly display name.
-
#emails ⇒ Array<UserList.ScimEmailAddress>
Email address list of the user.
-
#external_id ⇒ String
External unique resource id defined by provisioning client.
-
#fetch ⇒ UserInstance
Fetch the UserInstance.
-
#id ⇒ String
Unique Twilio user sid.
-
#initialize(version, payload, organization_sid: nil, id: nil) ⇒ UserInstance
constructor
Initialize the UserInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#locale ⇒ String
User’s locale.
- #meta ⇒ UserList.ScimMeta
-
#more_info ⇒ String
Link to Error Code References.
- #name ⇒ UserList.ScimName
-
#schemas ⇒ Array<String>
An array of URIs that indicate the schemas supported for this user resource.
-
#scim_type ⇒ String
A scimType error code as defined in RFC7644.
-
#status ⇒ String
Http status code.
-
#timezone ⇒ String
User’s time zone.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(if_match: :unset, scim_user: nil) ⇒ UserInstance
Update the UserInstance.
-
#user_name ⇒ String
Unique username, MUST be same as primary email address.
Constructor Details
#initialize(version, payload, organization_sid: nil, id: nil) ⇒ UserInstance
Initialize the UserInstance
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 344 def initialize(version, payload , organization_sid: nil, id: nil) super(version) # Marshaled Properties @properties = { 'id' => payload['id'], 'external_id' => payload['external_id'], 'user_name' => payload['user_name'], 'display_name' => payload['display_name'], 'name' => payload['name'], 'emails' => payload['emails'], 'active' => payload['active'], 'locale' => payload['locale'], 'timezone' => payload['timezone'], 'schemas' => payload['schemas'], 'meta' => payload['meta'], 'detail' => payload['detail'], 'scim_type' => payload['scim_type'], 'status' => payload['status'], 'code' => payload['code'], 'more_info' => payload['more_info'], } # Context @instance_context = nil @params = { 'organization_sid' => organization_sid || @properties['organization_sid'] ,'id' => id || @properties['id'] , } end |
Instance Method Details
#active ⇒ Boolean
Returns Indicates whether the user is active.
421 422 423 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 421 def active @properties['active'] end |
#code ⇒ String
Returns Twilio-specific error code.
469 470 471 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 469 def code @properties['code'] end |
#context ⇒ UserContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
376 377 378 379 380 381 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 376 def context unless @instance_context @instance_context = UserContext.new(@version , @params['organization_sid'], @params['id']) end @instance_context end |
#delete ⇒ Boolean
Delete the UserInstance
482 483 484 485 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 482 def delete context.delete end |
#detail ⇒ String
Returns A human-readable description of the error.
451 452 453 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 451 def detail @properties['detail'] end |
#display_name ⇒ String
Returns User friendly display name.
403 404 405 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 403 def display_name @properties['display_name'] end |
#emails ⇒ Array<UserList.ScimEmailAddress>
Returns Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username.
415 416 417 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 415 def emails @properties['emails'] end |
#external_id ⇒ String
Returns External unique resource id defined by provisioning client.
391 392 393 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 391 def external_id @properties['external_id'] end |
#fetch ⇒ UserInstance
Fetch the UserInstance
490 491 492 493 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 490 def fetch context.fetch end |
#id ⇒ String
Returns Unique Twilio user sid.
385 386 387 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 385 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
518 519 520 521 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 518 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.PreviewIam.Versionless.UserInstance #{values}>" end |
#locale ⇒ String
Returns User’s locale.
427 428 429 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 427 def locale @properties['locale'] end |
#meta ⇒ UserList.ScimMeta
445 446 447 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 445 def @properties['meta'] end |
#more_info ⇒ String
Returns Link to Error Code References.
475 476 477 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 475 def more_info @properties['more_info'] end |
#name ⇒ UserList.ScimName
409 410 411 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 409 def name @properties['name'] end |
#schemas ⇒ Array<String>
Returns An array of URIs that indicate the schemas supported for this user resource.
439 440 441 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 439 def schemas @properties['schemas'] end |
#scim_type ⇒ String
Returns A scimType error code as defined in RFC7644.
457 458 459 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 457 def scim_type @properties['scim_type'] end |
#status ⇒ String
Returns Http status code.
463 464 465 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 463 def status @properties['status'] end |
#timezone ⇒ String
Returns User’s time zone.
433 434 435 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 433 def timezone @properties['timezone'] end |
#to_s ⇒ Object
Provide a user friendly representation
511 512 513 514 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 511 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.PreviewIam.Versionless.UserInstance #{values}>" end |
#update(if_match: :unset, scim_user: nil) ⇒ UserInstance
Update the UserInstance
500 501 502 503 504 505 506 507 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 500 def update( if_match: :unset,scim_user: nil ) context.update( if_match: if_match, ) end |
#user_name ⇒ String
Returns Unique username, MUST be same as primary email address.
397 398 399 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 397 def user_name @properties['user_name'] end |