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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73bb439a66d34332f9a1e4826dd3a7f496de2c33f062ff620d82e03979681f9d
4
- data.tar.gz: 9fc1183ce82f6d63dd52f05ed6d37ec5577705e6aaf68f289b3b2668342a779f
3
+ metadata.gz: 3c81b046b4ed9abb81b5815933f819f975bc06a02492a0f377400cc3265b4e45
4
+ data.tar.gz: d6e4054169a43b0670dce53f71ad642276e89c634960d294cdf8ef2c853ba9f9
5
5
  SHA512:
6
- metadata.gz: a3bc802ca041b68b71d2f32794d90c4a0e45aa475a483bf5cdda090b2d5823834875b8578b0aa4d30ad3f0385905d094996972fbed3652116d08891d6f6de0dd
7
- data.tar.gz: c48c44840a43e753d96050a0e123103265b295c2ed7eb296243fbe50a8f65bf43ec400dd6bd30d3117a407ee8a7074df7caf7a53ac251b46f0d4b8a2a92874f8
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_support_readiness
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Colyer