google-cloud-firestore-admin 0.4.1 → 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: 703a49e7d0aef90b0a117c639d05206c8d7010349045676cecb31d5f5159d082
4
- data.tar.gz: e3a2294faff16b2cf4578137f8a3e9fb81dc0d621713cfdc605680a2c3c77520
3
+ metadata.gz: 146cd62f94b45ee8ac453191f1b1941da0309ec4c818131753ed020e8d9d32b9
4
+ data.tar.gz: 608dc87bf26ca78bb8dabd0581ff570b444f2c82e1598bd8ba48d766e571c6d7
5
5
  SHA512:
6
- metadata.gz: bf6c9d798248681bc0ea82c99941501d5fb32319afcff51070420726fdb97250085bcb7f42e05a343436f6a8da2cae4ff77f1e00ade378a58770b0a167ca9e29
7
- data.tar.gz: cdd845a88d6a5bae3c590ccac96623be94455c61f5ba356f51279793e80aaedaef65abce71a00983dc0e55ab60465c4a062e60db467b83c235a0bf611da03f4e
6
+ metadata.gz: 9572a8d584276bd61c136a00c5608702fb2ff7c54ff48fbd4f9e42219d0b20de8b2291508c0ca42db3bea4011bc402d897d59b070b67997af1d86e7d703cfb87
7
+ data.tar.gz: a9179966b3f9ca39b017067f3f375c0fcee34a6995aa336907067186a7d5a1e401eab7b90e18b18310d39fe963f34a606852870738a056a23ccdc6c948ee50ce
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/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.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 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.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-09 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 Cloud Firestore Admin API
84
81
  test_files: []