Class: SupportOps::GitLab::UserEmails
- Defined in:
- lib/support_ops_gitlab/gitlab/user_emails.rb
Overview
Get details on an email address => docs.gitlab.com/api/user_email_addresses/#get-details-on-an-email-address
Defines the class UserEmails within the module SupportOps::GitLab.
Instance Attribute Summary collapse
-
#confirmed_at ⇒ String
Timestamp of when the email address was confirmed.
-
#email ⇒ String
The email address.
-
#id ⇒ Integer
ID of the email address.
-
#skip_confirmation ⇒ Boolean
Used in creations only, skips sending the confirmation email.
-
#user_id ⇒ Integer
Used in creations only, specifies the user ID.
Class Method Summary collapse
-
.list(key: value) ⇒ Array
Lists all email addresses for a user.
Instance Method Summary collapse
-
#delete! ⇒ Boolean
Deletes a user.
Methods inherited from Base
#activate!, #approve!, attributes, #badges, #ban!, #block!, client, #client=, #commits, configure, #contributors, #create_support_pin!, #deactivate!, define_attributes, #diffs, #disable_2fa!, #discussions, #emails, #encoded_path, #events, #find, #find!, #gpg_keys, #hard_delete!, #impersonations, #initialize, #issues, #jobs, #latest_pipeline, #members, #memberships, #merge_requests, #move!, #notes, #paid?, #pats, #pipeline_variables, #pipelines, #preferences, #projects, readonly_attributes, #reject!, #revoke!, #rotate!, #save!, #ssh_keys, #status, #store_original_attributes, #subscribe!, #support_pin, to_hash, #tokens, #unban!, #unblock!, #unsubscribe!, #webhooks
Constructor Details
This class inherits a constructor from SupportOps::GitLab::Base
Instance Attribute Details
#confirmed_at ⇒ String
Timestamp of when the email address was confirmed
18 19 20 |
# File 'lib/support_ops_gitlab/gitlab/user_emails.rb', line 18 def confirmed_at @confirmed_at end |
#email ⇒ String
The email address
18 19 20 |
# File 'lib/support_ops_gitlab/gitlab/user_emails.rb', line 18 def email @email end |
#id ⇒ Integer
ID of the email address
18 19 20 |
# File 'lib/support_ops_gitlab/gitlab/user_emails.rb', line 18 def id @id end |
#skip_confirmation ⇒ Boolean
Used in creations only, skips sending the confirmation email
18 19 20 |
# File 'lib/support_ops_gitlab/gitlab/user_emails.rb', line 18 def skip_confirmation @skip_confirmation end |
#user_id ⇒ Integer
Used in creations only, specifies the user ID
18 19 20 |
# File 'lib/support_ops_gitlab/gitlab/user_emails.rb', line 18 def user_id @user_id end |
Class Method Details
.list(key: value) ⇒ Array
Lists all email addresses for a user
97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/support_ops_gitlab/gitlab/user_emails.rb', line 97 def self.list(**args) args[:user_id] = nil unless args[:user_id] url = if args[:user_id].nil? 'user/emails' else "users/#{args[:user_id]}/emails" end response = client.connection.get(url) body = Oj.load(response.body) raise "Unable to get emails of user => #{body}" if response.status != 200 body.map { |e| UserEmails.new(e) } end |
Instance Method Details
#delete! ⇒ Boolean
This is inherited from Base#delete!
Deletes a user
21 |
# File 'lib/support_ops_gitlab/gitlab/user_emails.rb', line 21 def delete!; end |