google-iam-client 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91fd5d6b297b117c92984c10e775641a8d1f06d1cd60d6c262997529b00c96f0
4
- data.tar.gz: dc9b650b67e8d88d9373ce4e2e23d31fac2cb1009270293cc163ac55627d771c
3
+ metadata.gz: 63137d82784607be97074152a35a2a0e1dd5096a76bec9dd59cd8255a9e0d0ad
4
+ data.tar.gz: ad441d920138c9ecaa4ebfa8fb85b270b062fc19d6e9d6460a0c0bcd518434db
5
5
  SHA512:
6
- metadata.gz: 2559f065cb77e8629bdfbbeaf4009f07c54d0572dd1c6227525d44aeabc85efd203d4fc8f6a51e10f76f89715d9a96acb93b8459e11a58a408446291f4db8191
7
- data.tar.gz: d4afc000ae365f04e3024add15a9a6c79fb7e1589bb81b1a61d6bff295f998f5995164bb62f3fb3ad6eca780bfcb09da5516fd7938be9021876aee3c803dd564
6
+ metadata.gz: 8d15ff8a844f17bf8a06a08b159623d42b30c8a3d671b2ce4bb604d09ab1bbef7157878abb06a99566c3304dfa599910500e29debdb40a31f5a473d0caf47f64
7
+ data.tar.gz: 7a115842152a71c4a74cdf86b03a7cb5c6a0693f2b4e2f7dff4b663f57489d0ede1f04d3fb9043deda2e620dbfbc6ad22e3b05f4a34fcb1c58bf8dc3ee3dcfa1
data/README.md CHANGED
@@ -34,32 +34,6 @@ In order to use this library, you first need to go through the following steps:
34
34
  1. [Enable the API.](https://console.cloud.google.com/apis/library/iam.googleapis.com)
35
35
  1. {file:AUTHENTICATION.md Set up authentication.}
36
36
 
37
- ## Enabling Logging
38
-
39
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
40
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
41
- or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
42
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
43
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
44
-
45
- Configuring a Ruby stdlib logger:
46
-
47
- ```ruby
48
- require "logger"
49
-
50
- module MyLogger
51
- LOGGER = Logger.new $stderr, level: Logger::WARN
52
- def logger
53
- LOGGER
54
- end
55
- end
56
-
57
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
58
- module GRPC
59
- extend MyLogger
60
- end
61
- ```
62
-
63
37
  ## Supported Ruby Versions
64
38
 
65
39
  This library is supported on Ruby 2.6+.
@@ -18,7 +18,7 @@
18
18
  module Google
19
19
  module Iam
20
20
  module Client
21
- VERSION = "0.1.0"
21
+ VERSION = "0.2.0"
22
22
  end
23
23
  end
24
24
  end
data/lib/google/iam.rb CHANGED
@@ -31,11 +31,13 @@ module Google
31
31
  #
32
32
  # By default, this returns an instance of
33
33
  # [Google::Iam::V2::Policies::Client](https://googleapis.dev/ruby/google-iam-v2/latest/Google/Iam/V2/Policies/Client.html)
34
- # for version V2 of the API.
35
- # However, you can specify specify a different API version by passing it in the
34
+ # for a gRPC client for version V2 of the API.
35
+ # However, you can specify a different API version by passing it in the
36
36
  # `version` parameter. If the Policies service is
37
37
  # supported by that API version, and the corresponding gem is available, the
38
38
  # appropriate versioned client will be returned.
39
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
40
+ # the `transport` parameter.
39
41
  #
40
42
  # ## About Policies
41
43
  #
@@ -43,17 +45,19 @@ module Google
43
45
  #
44
46
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
45
47
  # Defaults to `:v2`.
46
- # @return [Policies::Client] A client object for the specified version.
48
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
49
+ # @return [::Object] A client object for the specified version.
47
50
  #
48
- def self.policies version: :v2, &block
51
+ def self.policies version: :v2, transport: :grpc, &block
49
52
  require "google/iam/#{version.to_s.downcase}"
50
53
 
51
54
  package_name = Google::Iam
52
55
  .constants
53
56
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
54
57
  .first
55
- package_module = Google::Iam.const_get package_name
56
- package_module.const_get(:Policies).const_get(:Client).new(&block)
58
+ service_module = Google::Iam.const_get(package_name).const_get(:Policies)
59
+ service_module = service_module.const_get(:Rest) if transport == :rest
60
+ service_module.const_get(:Client).new(&block)
57
61
  end
58
62
  end
59
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-iam-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-14 00:00:00.000000000 Z
11
+ date: 2023-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0.0'
33
+ version: '0.2'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 2.a
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: '0.0'
43
+ version: '0.2'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 2.a
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
191
  requirements: []
192
- rubygems_version: 3.3.14
192
+ rubygems_version: 3.4.2
193
193
  signing_key:
194
194
  specification_version: 4
195
195
  summary: API Client library for the IAM API