google-cloud-datastore-admin 0.4.0 → 0.5.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: 5d8f6a6dd31032cdd4a855526c8804cd125ceabcd9988431409f3b0291f9ea34
4
- data.tar.gz: bcef7e1ef263619c7bf6ad9ea87874eb9e8a9cc355336ce3ec2deceff1dd8b89
3
+ metadata.gz: 6d4d5baf92a9be21ac3f4a2782b6be85ead137561fcecd78adbb062357ef71b3
4
+ data.tar.gz: 89a8f4858d543c5783a1f3c88155c6da8e79a818a15c515367d1b312e8bd1d62
5
5
  SHA512:
6
- metadata.gz: 89633b0da288b545f8fb8c7761ebc68fadf4a3bd4be76cc4b2ca11ff1190fbefd35683f907d261a389aa61523325f3a60fa385fc5aa7cd9c1ac1acaa6899f95a
7
- data.tar.gz: fad1bd95cb693f84dfe7a98ae7846b426393a4d738da52af6513682d99f71e881e0451f4e3ceb8155cf54c0e3d3faa0ec40402e3219552e9b5e3cb555d2ea93f
6
+ metadata.gz: 768c35df4ebea41fe00779d17d3f7ff6cb83bb6c4369854a0ca9d51ef46b33a21f63d6d6733d7835a286b7b1c6743b9e29fd7b4e6b16b92e77e9d46d2530e087
7
+ data.tar.gz: 476d86e548bc94a3deb4007925ebf30e275190ada2375d589cff9908d8c7b2bcd14ca116e178e88c338097b5e2f4570198a56f88f8ad2d2c18a45b53a11fa16b
data/README.md CHANGED
@@ -34,9 +34,39 @@ 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/datastore.googleapis.com)
35
35
  1. {file:AUTHENTICATION.md Set up authentication.}
36
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-datastore-admin-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-datastore-admin-v1/latest).
66
+
37
67
  ## Supported Ruby Versions
38
68
 
39
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
40
70
 
41
71
  Google provides official support for Ruby versions that are actively supported
42
72
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Datastore
23
23
  module Admin
24
- VERSION = "0.4.0"
24
+ VERSION = "0.5.0"
25
25
  end
26
26
  end
27
27
  end
@@ -59,6 +59,11 @@ module Google
59
59
  # You can also specify a different transport by passing `:rest` or `:grpc` in
60
60
  # the `transport` parameter.
61
61
  #
62
+ # Raises an exception if the currently installed versioned client gem for the
63
+ # given API version does not support the given transport of the DatastoreAdmin service.
64
+ # You can determine whether the method will succeed by calling
65
+ # {Google::Cloud::Datastore::Admin.datastore_admin_available?}.
66
+ #
62
67
  # ## About DatastoreAdmin
63
68
  #
64
69
  # Google Cloud Datastore Admin API
@@ -126,6 +131,37 @@ module Google
126
131
  service_module.const_get(:Client).new(&block)
127
132
  end
128
133
 
134
+ ##
135
+ # Determines whether the DatastoreAdmin service is supported by the current client.
136
+ # If true, you can retrieve a client object by calling {Google::Cloud::Datastore::Admin.datastore_admin}.
137
+ # If false, that method will raise an exception. This could happen if the given
138
+ # API version does not exist or does not support the DatastoreAdmin service,
139
+ # or if the versioned client gem needs an update to support the DatastoreAdmin service.
140
+ #
141
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
142
+ # Defaults to `:v1`.
143
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
144
+ # @return [boolean] Whether the service is available.
145
+ #
146
+ def self.datastore_admin_available? version: :v1, transport: :grpc
147
+ require "google/cloud/datastore/admin/#{version.to_s.downcase}"
148
+ package_name = Google::Cloud::Datastore::Admin
149
+ .constants
150
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
151
+ .first
152
+ return false unless package_name
153
+ service_module = Google::Cloud::Datastore::Admin.const_get package_name
154
+ return false unless service_module.const_defined? :DatastoreAdmin
155
+ service_module = service_module.const_get :DatastoreAdmin
156
+ if transport == :rest
157
+ return false unless service_module.const_defined? :Rest
158
+ service_module = service_module.const_get :Rest
159
+ end
160
+ service_module.const_defined? :Client
161
+ rescue ::LoadError
162
+ false
163
+ end
164
+
129
165
  ##
130
166
  # Configure the google-cloud-datastore-admin library.
131
167
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-datastore-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.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-02-26 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-core
@@ -62,7 +61,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
62
61
  licenses:
63
62
  - Apache-2.0
64
63
  metadata: {}
65
- post_install_message:
66
64
  rdoc_options: []
67
65
  require_paths:
68
66
  - lib
@@ -70,15 +68,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
70
68
  requirements:
71
69
  - - ">="
72
70
  - !ruby/object:Gem::Version
73
- version: '2.7'
71
+ version: '3.0'
74
72
  required_rubygems_version: !ruby/object:Gem::Requirement
75
73
  requirements:
76
74
  - - ">="
77
75
  - !ruby/object:Gem::Version
78
76
  version: '0'
79
77
  requirements: []
80
- rubygems_version: 3.5.6
81
- signing_key:
78
+ rubygems_version: 3.6.2
82
79
  specification_version: 4
83
80
  summary: API Client library for the Firestore in Datastore mode Admin API
84
81
  test_files: []