google-cloud-service_directory 1.5.1 → 2.0.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: a12d34e7f86e40f24e16c588e8bc1bbe11dba6b76ccde295d450c81e1babd9cc
4
- data.tar.gz: b244a4e125c8aabce142c9b68a001b67554dfa31d2aa0b3895ae80d137cacb43
3
+ metadata.gz: 0a3e784b1960dd1916943645aa47d35bb79e686811e22aedc83deff43443563b
4
+ data.tar.gz: a99102eaa1d9a69d4ae7704e02c16bf24324423671729c27449351fb37fc0d8f
5
5
  SHA512:
6
- metadata.gz: aeab7130863e84f7bd181e137fa28d6572e8e6b4c26e473e9fc14cd4b44a6ae55ef2fcf16e53de6584073b5faf8483638debe6b70f18f356eccb4b0fc9f91cfd
7
- data.tar.gz: 88cfe01c23ca09ca9598394d90f199001962c59f9eb2d5bb09f4f35adeb14ae5f12efc2f668e8506460ff17c9d4ebc293662cc8ad09fd157e5bc5fb8a971e6b2
6
+ metadata.gz: 58119a02cf6c7f7a49a449162b47a4b6616c3e0a8d4b92511ee6081127bb74c17d633901d8ba270d566db7ea1fd2021676843ca145ddeeb3e35579883732b4ac
7
+ data.tar.gz: 56850ef0ec75e99d4dff2574b9661bfd4e67efc00c1e5b2ff81fc5b07dab7bfaff6f139de20fad578f15db548f8bb67a09c1b13e0c225341be5c3444b4da6a26
data/README.md CHANGED
@@ -16,8 +16,7 @@ for this library, google-cloud-service_directory, to see the convenience methods
16
16
  constructing client objects. Reference documentation for the client objects
17
17
  themselves can be found in the client library documentation for the versioned
18
18
  client gems:
19
- [google-cloud-service_directory-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-service_directory-v1/latest),
20
- [google-cloud-service_directory-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-service_directory-v1beta1/latest).
19
+ [google-cloud-service_directory-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-service_directory-v1/latest).
21
20
 
22
21
  See also the [Product Documentation](https://cloud.google.com/service-directory)
23
22
  for more usage information.
@@ -35,9 +34,39 @@ In order to use this library, you first need to go through the following steps:
35
34
  1. [Enable the API.](https://console.cloud.google.com/apis/library/servicedirectory.googleapis.com)
36
35
  1. {file:AUTHENTICATION.md Set up authentication.}
37
36
 
37
+ ## Debug Logging
38
+
39
+ This library comes with opt-in Debug Logging that can help you troubleshoot
40
+ your application's integration with the API. When logging is activated, key
41
+ events such as requests and responses, along with data payloads and metadata
42
+ such as headers and client configuration, are logged to the standard error
43
+ stream.
44
+
45
+ **WARNING:** Client Library Debug Logging includes your data payloads in
46
+ plaintext, which could include sensitive data such as PII for yourself or your
47
+ customers, private keys, or other security data that could be compromising if
48
+ leaked. Always practice good data hygiene with your application logs, and follow
49
+ the principle of least access. Google also recommends that Client Library Debug
50
+ Logging be enabled only temporarily during active debugging, and not used
51
+ permanently in production.
52
+
53
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
54
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
55
+ list of client library gem names. This will select the default logging behavior,
56
+ which writes logs to the standard error stream. On a local workstation, this may
57
+ result in logs appearing on the console. When running on a Google Cloud hosting
58
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
59
+ results in logs appearing alongside your application logs in the
60
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
61
+
62
+ Debug logging also requires that the versioned clients for this service be
63
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
64
+ working, try updating the versioned clients in your bundle or installed gems:
65
+ [google-cloud-service_directory-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-service_directory-v1/latest).
66
+
38
67
  ## Supported Ruby Versions
39
68
 
40
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
41
70
 
42
71
  Google provides official support for Ruby versions that are actively supported
43
72
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module ServiceDirectory
19
- VERSION = "1.5.1".freeze
19
+ VERSION = "2.0.0".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -58,6 +58,11 @@ module Google
58
58
  # You can also specify a different transport by passing `:rest` or `:grpc` in
59
59
  # the `transport` parameter.
60
60
  #
61
+ # Raises an exception if the currently installed versioned client gem for the
62
+ # given API version does not support the given transport of the LookupService service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::ServiceDirectory.lookup_service_available?}.
65
+ #
61
66
  # ## About LookupService
62
67
  #
63
68
  # Service Directory API for looking up service data at runtime.
@@ -79,6 +84,37 @@ module Google
79
84
  service_module.const_get(:Client).new(&block)
80
85
  end
81
86
 
87
+ ##
88
+ # Determines whether the LookupService service is supported by the current client.
89
+ # If true, you can retrieve a client object by calling {Google::Cloud::ServiceDirectory.lookup_service}.
90
+ # If false, that method will raise an exception. This could happen if the given
91
+ # API version does not exist or does not support the LookupService service,
92
+ # or if the versioned client gem needs an update to support the LookupService service.
93
+ #
94
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
95
+ # Defaults to `:v1`.
96
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
97
+ # @return [boolean] Whether the service is available.
98
+ #
99
+ def self.lookup_service_available? version: :v1, transport: :grpc
100
+ require "google/cloud/service_directory/#{version.to_s.downcase}"
101
+ package_name = Google::Cloud::ServiceDirectory
102
+ .constants
103
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
104
+ .first
105
+ return false unless package_name
106
+ service_module = Google::Cloud::ServiceDirectory.const_get package_name
107
+ return false unless service_module.const_defined? :LookupService
108
+ service_module = service_module.const_get :LookupService
109
+ if transport == :rest
110
+ return false unless service_module.const_defined? :Rest
111
+ service_module = service_module.const_get :Rest
112
+ end
113
+ service_module.const_defined? :Client
114
+ rescue ::LoadError
115
+ false
116
+ end
117
+
82
118
  ##
83
119
  # Create a new client object for RegistrationService.
84
120
  #
@@ -92,6 +128,11 @@ module Google
92
128
  # You can also specify a different transport by passing `:rest` or `:grpc` in
93
129
  # the `transport` parameter.
94
130
  #
131
+ # Raises an exception if the currently installed versioned client gem for the
132
+ # given API version does not support the given transport of the RegistrationService service.
133
+ # You can determine whether the method will succeed by calling
134
+ # {Google::Cloud::ServiceDirectory.registration_service_available?}.
135
+ #
95
136
  # ## About RegistrationService
96
137
  #
97
138
  # Service Directory API for registering services. It defines the following
@@ -127,6 +168,37 @@ module Google
127
168
  service_module.const_get(:Client).new(&block)
128
169
  end
129
170
 
171
+ ##
172
+ # Determines whether the RegistrationService service is supported by the current client.
173
+ # If true, you can retrieve a client object by calling {Google::Cloud::ServiceDirectory.registration_service}.
174
+ # If false, that method will raise an exception. This could happen if the given
175
+ # API version does not exist or does not support the RegistrationService service,
176
+ # or if the versioned client gem needs an update to support the RegistrationService service.
177
+ #
178
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
179
+ # Defaults to `:v1`.
180
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
181
+ # @return [boolean] Whether the service is available.
182
+ #
183
+ def self.registration_service_available? version: :v1, transport: :grpc
184
+ require "google/cloud/service_directory/#{version.to_s.downcase}"
185
+ package_name = Google::Cloud::ServiceDirectory
186
+ .constants
187
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
188
+ .first
189
+ return false unless package_name
190
+ service_module = Google::Cloud::ServiceDirectory.const_get package_name
191
+ return false unless service_module.const_defined? :RegistrationService
192
+ service_module = service_module.const_get :RegistrationService
193
+ if transport == :rest
194
+ return false unless service_module.const_defined? :Rest
195
+ service_module = service_module.const_get :Rest
196
+ end
197
+ service_module.const_defined? :Client
198
+ rescue ::LoadError
199
+ false
200
+ end
201
+
130
202
  ##
131
203
  # Configure the google-cloud-service_directory library.
132
204
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-service_directory
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-08 00:00:00.000000000 Z
10
+ date: 2025-02-13 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-core
@@ -28,42 +27,16 @@ dependencies:
28
27
  name: google-cloud-service_directory-v1
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0.10'
34
- - - "<"
35
- - !ruby/object:Gem::Version
36
- version: 2.a
37
- type: :runtime
38
- prerelease: false
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: '0.10'
44
- - - "<"
45
- - !ruby/object:Gem::Version
46
- version: 2.a
47
- - !ruby/object:Gem::Dependency
48
- name: google-cloud-service_directory-v1beta1
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: '0.14'
54
- - - "<"
30
+ - - "~>"
55
31
  - !ruby/object:Gem::Version
56
- version: 2.a
32
+ version: '1.2'
57
33
  type: :runtime
58
34
  prerelease: false
59
35
  version_requirements: !ruby/object:Gem::Requirement
60
36
  requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '0.14'
64
- - - "<"
37
+ - - "~>"
65
38
  - !ruby/object:Gem::Version
66
- version: 2.a
39
+ version: '1.2'
67
40
  description: Service Directory is the single place to register, browse, and resolve
68
41
  application services.
69
42
  email: googleapis-packages@google.com
@@ -82,7 +55,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
82
55
  licenses:
83
56
  - Apache-2.0
84
57
  metadata: {}
85
- post_install_message:
86
58
  rdoc_options: []
87
59
  require_paths:
88
60
  - lib
@@ -90,15 +62,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
62
  requirements:
91
63
  - - ">="
92
64
  - !ruby/object:Gem::Version
93
- version: '2.7'
65
+ version: '3.0'
94
66
  required_rubygems_version: !ruby/object:Gem::Requirement
95
67
  requirements:
96
68
  - - ">="
97
69
  - !ruby/object:Gem::Version
98
70
  version: '0'
99
71
  requirements: []
100
- rubygems_version: 3.5.6
101
- signing_key:
72
+ rubygems_version: 3.6.3
102
73
  specification_version: 4
103
74
  summary: API Client library for the Service Directory API
104
75
  test_files: []