gitlab_support_readiness 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/support_readiness/gitlab/users.rb +24 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3c81b046b4ed9abb81b5815933f819f975bc06a02492a0f377400cc3265b4e45
|
|
4
|
+
data.tar.gz: d6e4054169a43b0670dce53f71ad642276e89c634960d294cdf8ef2c853ba9f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c062e6b4fd08ee671c85f3fa95018d2ff30f578f19827b233ad18f56b5a3274efba3f31e1bd3a6b5c9944b0d9e1956534da8e9c657cde77ef76565d06a3aed0d
|
|
7
|
+
data.tar.gz: c81f1fa4ac72f8227edab1412260b81b7ba8e0d3a05477f3777dcf1b0ec37afbb7aca8b9fe6750af3a54477b680580a453a553adce8ddac92de4de1adc3f43f4
|
|
@@ -483,6 +483,30 @@ module Readiness
|
|
|
483
483
|
handle_request_error(1, 'GitLab', response.status, { action: 'Unblock a user', id: user.id }) unless response.status == 201
|
|
484
484
|
true
|
|
485
485
|
end
|
|
486
|
+
|
|
487
|
+
##
|
|
488
|
+
# Fetches the email addresses for a user
|
|
489
|
+
#
|
|
490
|
+
# @author Jason Colyer
|
|
491
|
+
# @since 1.0.3
|
|
492
|
+
# @param client [Object] An instance of {Readiness::GitLab::Client}
|
|
493
|
+
# @param user [Object] An instance of {Readiness::GitLab::Users}
|
|
494
|
+
# @return [Array]
|
|
495
|
+
# @see https://docs.gitlab.com/ee/api/user_email_addresses.html#list-email-addresses-for-a-user GitLab API > Users > User email addresses > List email addresses for a user
|
|
496
|
+
# @example
|
|
497
|
+
# require 'support_readiness'
|
|
498
|
+
# config = Readiness::GitLab::Configuration.new
|
|
499
|
+
# config.token = 'test123abc'
|
|
500
|
+
# client = Readiness::GitLab::Client.new(config)
|
|
501
|
+
# user = Readiness::GitLab::Users.find!(client, 2672834)
|
|
502
|
+
# emails = Readiness::GitLab::Users.emails(client, user)
|
|
503
|
+
# pp emaiks.first['email']
|
|
504
|
+
# # => 'alice+test@example.com'
|
|
505
|
+
def self.emails(client, user)
|
|
506
|
+
response = client.connection.get "users/#{user.id}/emails"
|
|
507
|
+
handle_request_error(0, 'GitLab', response.status) unless response.status == 200
|
|
508
|
+
Oj.load(response.body)
|
|
509
|
+
end
|
|
486
510
|
end
|
|
487
511
|
end
|
|
488
512
|
end
|