google-cloud-firestore-admin 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 +4 -4
- data/README.md +0 -26
- data/lib/google/cloud/firestore/admin/version.rb +1 -1
- data/lib/google/cloud/firestore/admin.rb +5 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8deb248db4ad133b41cbc5da07f4d750942cf19a889b5738694f8e35197769f5
|
4
|
+
data.tar.gz: f0e1fa5f64e7cc27a95b0191fc40a46dc5e7540ff2e029cf40e974133690c5a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc61086219018c35e67b4c004c6f54e6a870c595fcb77d50a47efa2fd4bd2b60ff0be5cb02a3105e1f7e6f90bf825ebc3caff3a1e7009c62c187fa766e6bc426
|
7
|
+
data.tar.gz: 196efb5367f8e6c7df4a21c709fa9d2d61501044fcee86a996d870d27cb196b66a9198081d453f5c74d60e5cefd237b814e3944a288ed11acca2184f03d98de9
|
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/firestore.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/current/stdlibs/logger/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+.
|
@@ -55,6 +55,8 @@ module Google
|
|
55
55
|
# `version` parameter. If the FirestoreAdmin service is
|
56
56
|
# supported by that API version, and the corresponding gem is available, the
|
57
57
|
# appropriate versioned client will be returned.
|
58
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
59
|
+
# the `transport` parameter.
|
58
60
|
#
|
59
61
|
# ## About FirestoreAdmin
|
60
62
|
#
|
@@ -89,9 +91,10 @@ module Google
|
|
89
91
|
#
|
90
92
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
91
93
|
# Defaults to `:v1`.
|
94
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
92
95
|
# @return [::Object] A client object for the specified version.
|
93
96
|
#
|
94
|
-
def self.firestore_admin version: :v1, &block
|
97
|
+
def self.firestore_admin version: :v1, transport: :grpc, &block
|
95
98
|
require "google/cloud/firestore/admin/#{version.to_s.downcase}"
|
96
99
|
|
97
100
|
package_name = Google::Cloud::Firestore::Admin
|
@@ -99,6 +102,7 @@ module Google
|
|
99
102
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
100
103
|
.first
|
101
104
|
service_module = Google::Cloud::Firestore::Admin.const_get(package_name).const_get(:FirestoreAdmin)
|
105
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
102
106
|
service_module.const_get(:Client).new(&block)
|
103
107
|
end
|
104
108
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-firestore-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 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: 2023-
|
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.
|
33
|
+
version: '0.8'
|
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.
|
43
|
+
version: '0.8'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 2.a
|