Class: SDM::User
- Inherits:
-
Object
- Object
- SDM::User
- Defined in:
- lib/models/porcelain.rb
Overview
A User can connect to resources they are granted directly, or granted via roles.
Instance Attribute Summary collapse
-
#email ⇒ Object
The User's email address.
-
#external_id ⇒ Object
External ID is an alternative unique ID this user is represented by within an external service.
-
#first_name ⇒ Object
The User's first name.
-
#id ⇒ Object
Unique identifier of the User.
-
#last_name ⇒ Object
The User's last name.
-
#managed_by ⇒ Object
Managed By is a read only field for what service manages this user, e.g.
-
#password ⇒ Object
Password is a write-only field that can be used to set the user's password.
-
#permission_level ⇒ Object
PermissionLevel is the user's permission level e.g.
-
#suspended ⇒ Object
Suspended is a read only field for the User's suspended state.
-
#tags ⇒ Object
Tags is a map of key, value pairs.
Instance Method Summary collapse
-
#initialize(email: nil, external_id: nil, first_name: nil, id: nil, last_name: nil, managed_by: nil, password: nil, permission_level: nil, suspended: nil, tags: nil) ⇒ User
constructor
A new instance of User.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(email: nil, external_id: nil, first_name: nil, id: nil, last_name: nil, managed_by: nil, password: nil, permission_level: nil, suspended: nil, tags: nil) ⇒ User
Returns a new instance of User.
12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 |
# File 'lib/models/porcelain.rb', line 12419 def initialize( email: nil, external_id: nil, first_name: nil, id: nil, last_name: nil, managed_by: nil, password: nil, permission_level: nil, suspended: nil, tags: nil ) @email = email == nil ? "" : email @external_id = external_id == nil ? "" : external_id @first_name = first_name == nil ? "" : first_name @id = id == nil ? "" : id @last_name = last_name == nil ? "" : last_name @managed_by = managed_by == nil ? "" : managed_by @password = password == nil ? "" : password @permission_level = == nil ? "" : @suspended = suspended == nil ? false : suspended @tags = == nil ? SDM::() : end |
Instance Attribute Details
#email ⇒ Object
The User's email address. Must be unique.
12398 12399 12400 |
# File 'lib/models/porcelain.rb', line 12398 def email @email end |
#external_id ⇒ Object
External ID is an alternative unique ID this user is represented by within an external service.
12400 12401 12402 |
# File 'lib/models/porcelain.rb', line 12400 def external_id @external_id end |
#first_name ⇒ Object
The User's first name.
12402 12403 12404 |
# File 'lib/models/porcelain.rb', line 12402 def first_name @first_name end |
#id ⇒ Object
Unique identifier of the User.
12404 12405 12406 |
# File 'lib/models/porcelain.rb', line 12404 def id @id end |
#last_name ⇒ Object
The User's last name.
12406 12407 12408 |
# File 'lib/models/porcelain.rb', line 12406 def last_name @last_name end |
#managed_by ⇒ Object
Managed By is a read only field for what service manages this user, e.g. StrongDM, Okta, Azure.
12408 12409 12410 |
# File 'lib/models/porcelain.rb', line 12408 def managed_by @managed_by end |
#password ⇒ Object
Password is a write-only field that can be used to set the user's password. Currently only supported for update.
12411 12412 12413 |
# File 'lib/models/porcelain.rb', line 12411 def password @password end |
#permission_level ⇒ Object
PermissionLevel is the user's permission level e.g. admin, DBA, user.
12413 12414 12415 |
# File 'lib/models/porcelain.rb', line 12413 def @permission_level end |
#suspended ⇒ Object
Suspended is a read only field for the User's suspended state.
12415 12416 12417 |
# File 'lib/models/porcelain.rb', line 12415 def suspended @suspended end |
#tags ⇒ Object
Tags is a map of key, value pairs.
12417 12418 12419 |
# File 'lib/models/porcelain.rb', line 12417 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
12443 12444 12445 12446 12447 12448 12449 |
# File 'lib/models/porcelain.rb', line 12443 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |