google-cloud-firestore-admin 0.4.1 → 0.5.1

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: 703a49e7d0aef90b0a117c639d05206c8d7010349045676cecb31d5f5159d082
4
- data.tar.gz: e3a2294faff16b2cf4578137f8a3e9fb81dc0d621713cfdc605680a2c3c77520
3
+ metadata.gz: 668fa8ec0674ae5cbf70c176f5381b6cdfb0f2bff23a03192396542887980b4f
4
+ data.tar.gz: 62a32952805059fecf1713598df0b507631f8e69cf8de9e2ee89eb2f4df816fe
5
5
  SHA512:
6
- metadata.gz: bf6c9d798248681bc0ea82c99941501d5fb32319afcff51070420726fdb97250085bcb7f42e05a343436f6a8da2cae4ff77f1e00ade378a58770b0a167ca9e29
7
- data.tar.gz: cdd845a88d6a5bae3c590ccac96623be94455c61f5ba356f51279793e80aaedaef65abce71a00983dc0e55ab60465c4a062e60db467b83c235a0bf611da03f4e
6
+ metadata.gz: 33ede97c3bd18c55c2d1207f02b1e894654ccd53c99149e4928aced25274396180ee75b1abd4c622e4474b9ada15feda507e9b377db3adcfc286e3ab8c5af6e9
7
+ data.tar.gz: 9ec0c3ffea3b9e831a51c256d71732c059e1ddf2a0484b1f31824d46c145fe575cbb5f34800711bfba713175935dac3f2af5c4f7022de10b2033d5dbe38e0091
data/README.md CHANGED
@@ -7,7 +7,7 @@ Cloud Firestore is a NoSQL document database built for automatic scaling, high p
7
7
  Actual client classes for the various versions of this API are defined in
8
8
  _versioned_ client gems, with names of the form `google-cloud-firestore-admin-v*`.
9
9
  The gem `google-cloud-firestore-admin` is the main client library that brings the
10
- verisoned gems in as dependencies, and provides high-level methods for
10
+ versioned gems in as dependencies, and provides high-level methods for
11
11
  constructing clients. More information on versioned clients can be found below
12
12
  in the section titled *Which client should I use?*.
13
13
 
@@ -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/firestore.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-firestore-admin-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-firestore-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 Firestore
23
23
  module Admin
24
- VERSION = "0.4.1"
24
+ VERSION = "0.5.1"
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 FirestoreAdmin service.
64
+ # You can determine whether the method will succeed by calling
65
+ # {Google::Cloud::Firestore::Admin.firestore_admin_available?}.
66
+ #
62
67
  # ## About FirestoreAdmin
63
68
  #
64
69
  # The Cloud Firestore Admin API.
@@ -107,6 +112,37 @@ module Google
107
112
  service_module.const_get(:Client).new(&block)
108
113
  end
109
114
 
115
+ ##
116
+ # Determines whether the FirestoreAdmin service is supported by the current client.
117
+ # If true, you can retrieve a client object by calling {Google::Cloud::Firestore::Admin.firestore_admin}.
118
+ # If false, that method will raise an exception. This could happen if the given
119
+ # API version does not exist or does not support the FirestoreAdmin service,
120
+ # or if the versioned client gem needs an update to support the FirestoreAdmin service.
121
+ #
122
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
123
+ # Defaults to `:v1`.
124
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
125
+ # @return [boolean] Whether the service is available.
126
+ #
127
+ def self.firestore_admin_available? version: :v1, transport: :grpc
128
+ require "google/cloud/firestore/admin/#{version.to_s.downcase}"
129
+ package_name = Google::Cloud::Firestore::Admin
130
+ .constants
131
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
132
+ .first
133
+ return false unless package_name
134
+ service_module = Google::Cloud::Firestore::Admin.const_get package_name
135
+ return false unless service_module.const_defined? :FirestoreAdmin
136
+ service_module = service_module.const_get :FirestoreAdmin
137
+ if transport == :rest
138
+ return false unless service_module.const_defined? :Rest
139
+ service_module = service_module.const_get :Rest
140
+ end
141
+ service_module.const_defined? :Client
142
+ rescue ::LoadError
143
+ false
144
+ end
145
+
110
146
  ##
111
147
  # Configure the google-cloud-firestore-admin library.
112
148
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-firestore-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.1
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-09 00:00:00.000000000 Z
10
+ date: 1980-01-02 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.8
82
79
  specification_version: 4
83
80
  summary: API Client library for the Cloud Firestore Admin API
84
81
  test_files: []