google-cloud-firestore-admin-v1 0.12.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +72 -101
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb +147 -12
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/operations.rb +28 -6
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/client.rb +142 -11
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/operations.rb +33 -8
- data/lib/google/cloud/firestore/admin/v1/firestore_admin/rest/service_stub.rb +73 -2
- data/lib/google/cloud/firestore/admin/v1/version.rb +1 -1
- data/lib/google/firestore/admin/v1/database_pb.rb +3 -2
- data/lib/google/firestore/admin/v1/firestore_admin_pb.rb +3 -1
- data/lib/google/firestore/admin/v1/firestore_admin_services_pb.rb +4 -1
- data/proto_docs/google/api/client.rb +1 -0
- data/proto_docs/google/firestore/admin/v1/database.rb +27 -2
- data/proto_docs/google/firestore/admin/v1/firestore_admin.rb +40 -3
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82b9e3bc129b384d9980d9c76be20b095638908338cde74514dcbfcb45312c19
|
4
|
+
data.tar.gz: 78ebaecf5aeaee77603a3fceb78e2e69bb9cf6422b86f419a0d5e2df739b4875
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85b53435eb6822b7d412c9ca611a97f8016a16c9b187a7b4079801be0519a5d63f8e83754b1e619e00210b27b17435aff73ce07c9145994beac048f1d1da217a
|
7
|
+
data.tar.gz: c7a839510a1d703912e6bc7243a1920ec59bddc98ff73088b5ce47650df8f1b9c4e81f2385857aeae74b3bbcb4b72b7e04760ab3f665949dcf6afa4243701c05
|
data/AUTHENTICATION.md
CHANGED
@@ -1,151 +1,122 @@
|
|
1
1
|
# Authentication
|
2
2
|
|
3
|
-
|
4
|
-
[
|
5
|
-
|
6
|
-
[Google Cloud Platform environments](#google-cloud-platform-environments) the
|
7
|
-
credentials will be discovered automatically. When running on other
|
8
|
-
environments, the Service Account credentials can be specified by providing the
|
9
|
-
path to the
|
10
|
-
[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys)
|
11
|
-
for the account (or the JSON itself) in
|
12
|
-
[environment variables](#environment-variables). Additionally, Cloud SDK
|
13
|
-
credentials can also be discovered automatically, but this is only recommended
|
14
|
-
during development.
|
3
|
+
The recommended way to authenticate to the google-cloud-firestore-admin-v1 library is to use
|
4
|
+
[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials).
|
5
|
+
To review all of your authentication options, see [Credentials lookup](#credential-lookup).
|
15
6
|
|
16
7
|
## Quickstart
|
17
8
|
|
18
|
-
|
19
|
-
|
9
|
+
The following example shows how to set up authentication for a local development
|
10
|
+
environment with your user credentials.
|
20
11
|
|
21
|
-
|
22
|
-
|
23
|
-
```
|
24
|
-
|
25
|
-
3. Initialize the client.
|
12
|
+
**NOTE:** This method is _not_ recommended for running in production. User credentials
|
13
|
+
should be used only during development.
|
26
14
|
|
27
|
-
|
28
|
-
|
15
|
+
1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk).
|
16
|
+
2. Set up a local ADC file with your user credentials:
|
29
17
|
|
30
|
-
|
18
|
+
```sh
|
19
|
+
gcloud auth application-default login
|
31
20
|
```
|
32
21
|
|
33
|
-
|
34
|
-
|
35
|
-
The google-cloud-firestore-admin-v1 library aims to make authentication
|
36
|
-
as simple as possible, and provides several mechanisms to configure your system
|
37
|
-
without requiring **Service Account Credentials** directly in code.
|
38
|
-
|
39
|
-
**Credentials** are discovered in the following order:
|
40
|
-
|
41
|
-
1. Specify credentials in method arguments
|
42
|
-
2. Specify credentials in configuration
|
43
|
-
3. Discover credentials path in environment variables
|
44
|
-
4. Discover credentials JSON in environment variables
|
45
|
-
5. Discover credentials file in the Cloud SDK's path
|
46
|
-
6. Discover GCP credentials
|
47
|
-
|
48
|
-
### Google Cloud Platform environments
|
22
|
+
3. Write code as if already authenticated.
|
49
23
|
|
50
|
-
|
51
|
-
|
52
|
-
Functions (GCF) and Cloud Run, **Credentials** are discovered automatically.
|
53
|
-
Code should be written as if already authenticated.
|
24
|
+
For more information about setting up authentication for a local development environment, see
|
25
|
+
[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev).
|
54
26
|
|
55
|
-
|
27
|
+
## Credential Lookup
|
56
28
|
|
57
|
-
The
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
**Credentials JSON** file can be stored in the environment variable, or the
|
62
|
-
**Credentials JSON** itself can be stored for environments such as Docker
|
63
|
-
containers where writing files is difficult or not encouraged.
|
29
|
+
The google-cloud-firestore-admin-v1 library provides several mechanisms to configure your system.
|
30
|
+
Generally, using Application Default Credentials to facilitate automatic
|
31
|
+
credentials discovery is the easist method. But if you need to explicitly specify
|
32
|
+
credentials, there are several methods available to you.
|
64
33
|
|
65
|
-
|
66
|
-
checks for credentials are configured on the service Credentials class (such as
|
67
|
-
{::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Credentials}):
|
34
|
+
Credentials are accepted in the following ways, in the following order or precedence:
|
68
35
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
36
|
+
1. Credentials specified in method arguments
|
37
|
+
2. Credentials specified in configuration
|
38
|
+
3. Credentials pointed to or included in environment variables
|
39
|
+
4. Credentials found in local ADC file
|
40
|
+
5. Credentials returned by the metadata server for the attached service account (GCP)
|
74
41
|
|
75
|
-
|
76
|
-
require "google/cloud/firestore/admin/v1"
|
77
|
-
|
78
|
-
ENV["FIRESTORE_CREDENTIALS"] = "path/to/keyfile.json"
|
42
|
+
### Configuration
|
79
43
|
|
80
|
-
client
|
81
|
-
|
44
|
+
You can configure a path to a JSON credentials file, either for an individual client object or
|
45
|
+
globally, for all client objects. The JSON file can contain credentials created for
|
46
|
+
[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
|
47
|
+
[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
|
48
|
+
[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
|
82
49
|
|
83
|
-
|
50
|
+
Note: Service account keys are a security risk if not managed correctly. You should
|
51
|
+
[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
|
52
|
+
whenever possible.
|
84
53
|
|
85
|
-
|
86
|
-
it in an environment variable. Either on an individual client initialization:
|
54
|
+
To configure a credentials file for an individual client initialization:
|
87
55
|
|
88
56
|
```ruby
|
89
57
|
require "google/cloud/firestore/admin/v1"
|
90
58
|
|
91
59
|
client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config|
|
92
|
-
config.credentials = "path/to/
|
60
|
+
config.credentials = "path/to/credentialfile.json"
|
93
61
|
end
|
94
62
|
```
|
95
63
|
|
96
|
-
|
64
|
+
To configure a credentials file globally for all clients:
|
97
65
|
|
98
66
|
```ruby
|
99
67
|
require "google/cloud/firestore/admin/v1"
|
100
68
|
|
101
69
|
::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.configure do |config|
|
102
|
-
config.credentials = "path/to/
|
70
|
+
config.credentials = "path/to/credentialfile.json"
|
103
71
|
end
|
104
72
|
|
105
73
|
client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
|
106
74
|
```
|
107
75
|
|
108
|
-
###
|
76
|
+
### Environment Variables
|
109
77
|
|
110
|
-
|
111
|
-
|
112
|
-
|
78
|
+
You can also use an environment variable to provide a JSON credentials file.
|
79
|
+
The environment variable can contain a path to the credentials file or, for
|
80
|
+
environments such as Docker containers where writing files is not encouraged,
|
81
|
+
you can include the credentials file itself.
|
113
82
|
|
114
|
-
|
83
|
+
The JSON file can contain credentials created for
|
84
|
+
[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
|
85
|
+
[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
|
86
|
+
[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
|
115
87
|
|
116
|
-
|
117
|
-
|
118
|
-
|
88
|
+
Note: Service account keys are a security risk if not managed correctly. You should
|
89
|
+
[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
|
90
|
+
whenever possible.
|
91
|
+
|
92
|
+
The environment variables that google-cloud-firestore-admin-v1
|
93
|
+
checks for credentials are:
|
119
94
|
|
120
|
-
|
121
|
-
*
|
95
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
96
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
122
97
|
|
123
|
-
|
98
|
+
```ruby
|
99
|
+
require "google/cloud/firestore/admin/v1"
|
124
100
|
|
125
|
-
|
126
|
-
connect to the APIs. You will use the **JSON key file** to
|
127
|
-
connect to most services with google-cloud-firestore-admin-v1.
|
101
|
+
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
|
128
102
|
|
129
|
-
|
130
|
-
|
131
|
-
need a Google Developers service account.
|
103
|
+
client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
|
104
|
+
```
|
132
105
|
|
133
|
-
|
134
|
-
2. Create a new project or click on an existing project.
|
135
|
-
3. Activate the menu in the upper left and select **APIs & Services**. From
|
136
|
-
here, you will enable the APIs that your application requires.
|
106
|
+
### Local ADC file
|
137
107
|
|
138
|
-
|
108
|
+
You can set up a local ADC file with your user credentials for authentication during
|
109
|
+
development. If credentials are not provided in code or in environment variables,
|
110
|
+
then the local ADC credentials are discovered.
|
139
111
|
|
140
|
-
|
112
|
+
Follow the steps in [Quickstart](#quickstart) to set up a local ADC file.
|
141
113
|
|
142
|
-
|
143
|
-
"Service account" to be guided through downloading a new JSON key file.
|
114
|
+
### Google Cloud Platform environments
|
144
115
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
116
|
+
When running on Google Cloud Platform (GCP), including Google Compute Engine
|
117
|
+
(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
|
118
|
+
Functions (GCF) and Cloud Run, credentials are retrieved from the attached
|
119
|
+
service account automatically. Code should be written as if already authenticated.
|
149
120
|
|
150
|
-
|
151
|
-
|
121
|
+
For more information, see
|
122
|
+
[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa).
|
@@ -59,6 +59,9 @@ module Google
|
|
59
59
|
# service `google.longrunning.Operations`.
|
60
60
|
#
|
61
61
|
class Client
|
62
|
+
# @private
|
63
|
+
DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$"
|
64
|
+
|
62
65
|
include Paths
|
63
66
|
|
64
67
|
# @private
|
@@ -152,6 +155,15 @@ module Google
|
|
152
155
|
@config
|
153
156
|
end
|
154
157
|
|
158
|
+
##
|
159
|
+
# The effective universe domain
|
160
|
+
#
|
161
|
+
# @return [String]
|
162
|
+
#
|
163
|
+
def universe_domain
|
164
|
+
@firestore_admin_stub.universe_domain
|
165
|
+
end
|
166
|
+
|
155
167
|
##
|
156
168
|
# Create a new FirestoreAdmin client object.
|
157
169
|
#
|
@@ -185,8 +197,9 @@ module Google
|
|
185
197
|
credentials = @config.credentials
|
186
198
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
187
199
|
# but only if the default endpoint does not have a region prefix.
|
188
|
-
enable_self_signed_jwt = @config.endpoint
|
189
|
-
|
200
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
201
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
202
|
+
!@config.endpoint.split(".").first.include?("-"))
|
190
203
|
credentials ||= Credentials.default scope: @config.scope,
|
191
204
|
enable_self_signed_jwt: enable_self_signed_jwt
|
192
205
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -199,18 +212,22 @@ module Google
|
|
199
212
|
config.credentials = credentials
|
200
213
|
config.quota_project = @quota_project_id
|
201
214
|
config.endpoint = @config.endpoint
|
215
|
+
config.universe_domain = @config.universe_domain
|
202
216
|
end
|
203
217
|
|
204
218
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
205
219
|
config.credentials = credentials
|
206
220
|
config.quota_project = @quota_project_id
|
207
221
|
config.endpoint = @config.endpoint
|
222
|
+
config.universe_domain = @config.universe_domain
|
208
223
|
end
|
209
224
|
|
210
225
|
@firestore_admin_stub = ::Gapic::ServiceStub.new(
|
211
226
|
::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Stub,
|
212
|
-
credentials:
|
213
|
-
endpoint:
|
227
|
+
credentials: credentials,
|
228
|
+
endpoint: @config.endpoint,
|
229
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
230
|
+
universe_domain: @config.universe_domain,
|
214
231
|
channel_args: @config.channel_args,
|
215
232
|
interceptors: @config.interceptors,
|
216
233
|
channel_pool_config: @config.channel_pool
|
@@ -809,7 +826,8 @@ module Google
|
|
809
826
|
# only supports listing fields that have been explicitly overridden. To issue
|
810
827
|
# this query, call
|
811
828
|
# {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}
|
812
|
-
# with the filter set to `indexConfig.usesAncestorConfig:false
|
829
|
+
# with the filter set to `indexConfig.usesAncestorConfig:false or
|
830
|
+
# `ttlConfig:*`.
|
813
831
|
#
|
814
832
|
# @overload list_fields(request, options = nil)
|
815
833
|
# Pass arguments to `list_fields` via a request object, either of type
|
@@ -955,7 +973,7 @@ module Google
|
|
955
973
|
# If the URI is a bucket (without a namespace path), a prefix will be
|
956
974
|
# generated based on the start time.
|
957
975
|
# @param namespace_ids [::Array<::String>]
|
958
|
-
#
|
976
|
+
# An empty list represents all namespaces. This is the preferred
|
959
977
|
# usage for databases that don't use namespaces.
|
960
978
|
#
|
961
979
|
# An empty string element represents the default namespace. This should be
|
@@ -1077,7 +1095,7 @@ module Google
|
|
1077
1095
|
# See:
|
1078
1096
|
# {::Google::Cloud::Firestore::Admin::V1::ExportDocumentsResponse#output_uri_prefix google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix}.
|
1079
1097
|
# @param namespace_ids [::Array<::String>]
|
1080
|
-
#
|
1098
|
+
# An empty list represents all namespaces. This is the preferred
|
1081
1099
|
# usage for databases that don't use namespaces.
|
1082
1100
|
#
|
1083
1101
|
# An empty string element represents the default namespace. This should be
|
@@ -1183,7 +1201,11 @@ module Google
|
|
1183
1201
|
# Required. The ID to use for the database, which will become the final
|
1184
1202
|
# component of the database's resource name.
|
1185
1203
|
#
|
1186
|
-
#
|
1204
|
+
# This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
|
1205
|
+
# with first character a letter and the last a letter or a number. Must not
|
1206
|
+
# be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/.
|
1207
|
+
#
|
1208
|
+
# "(default)" database id is also valid.
|
1187
1209
|
#
|
1188
1210
|
# @yield [response, operation] Access the result along with the RPC operation
|
1189
1211
|
# @yieldparam response [::Gapic::Operation]
|
@@ -1524,6 +1546,104 @@ module Google
|
|
1524
1546
|
raise ::Google::Cloud::Error.from_error(e)
|
1525
1547
|
end
|
1526
1548
|
|
1549
|
+
##
|
1550
|
+
# Deletes a database.
|
1551
|
+
#
|
1552
|
+
# @overload delete_database(request, options = nil)
|
1553
|
+
# Pass arguments to `delete_database` via a request object, either of type
|
1554
|
+
# {::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest} or an equivalent Hash.
|
1555
|
+
#
|
1556
|
+
# @param request [::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest, ::Hash]
|
1557
|
+
# A request object representing the call parameters. Required. To specify no
|
1558
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1559
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1560
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1561
|
+
#
|
1562
|
+
# @overload delete_database(name: nil, etag: nil)
|
1563
|
+
# Pass arguments to `delete_database` via keyword arguments. Note that at
|
1564
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1565
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1566
|
+
#
|
1567
|
+
# @param name [::String]
|
1568
|
+
# Required. A name of the form
|
1569
|
+
# `projects/{project_id}/databases/{database_id}`
|
1570
|
+
# @param etag [::String]
|
1571
|
+
# The current etag of the Database.
|
1572
|
+
# If an etag is provided and does not match the current etag of the database,
|
1573
|
+
# deletion will be blocked and a FAILED_PRECONDITION error will be returned.
|
1574
|
+
#
|
1575
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1576
|
+
# @yieldparam response [::Gapic::Operation]
|
1577
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1578
|
+
#
|
1579
|
+
# @return [::Gapic::Operation]
|
1580
|
+
#
|
1581
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1582
|
+
#
|
1583
|
+
# @example Basic example
|
1584
|
+
# require "google/cloud/firestore/admin/v1"
|
1585
|
+
#
|
1586
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1587
|
+
# client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
|
1588
|
+
#
|
1589
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1590
|
+
# request = Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new
|
1591
|
+
#
|
1592
|
+
# # Call the delete_database method.
|
1593
|
+
# result = client.delete_database request
|
1594
|
+
#
|
1595
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1596
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1597
|
+
# # Here is how to wait for a response.
|
1598
|
+
# result.wait_until_done! timeout: 60
|
1599
|
+
# if result.response?
|
1600
|
+
# p result.response
|
1601
|
+
# else
|
1602
|
+
# puts "No response received."
|
1603
|
+
# end
|
1604
|
+
#
|
1605
|
+
def delete_database request, options = nil
|
1606
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1607
|
+
|
1608
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest
|
1609
|
+
|
1610
|
+
# Converts hash and nil to an options object
|
1611
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1612
|
+
|
1613
|
+
# Customize the options with defaults
|
1614
|
+
metadata = @config.rpcs.delete_database.metadata.to_h
|
1615
|
+
|
1616
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1617
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1618
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1619
|
+
gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
|
1620
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1621
|
+
|
1622
|
+
header_params = {}
|
1623
|
+
if request.name
|
1624
|
+
header_params["name"] = request.name
|
1625
|
+
end
|
1626
|
+
|
1627
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1628
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1629
|
+
|
1630
|
+
options.apply_defaults timeout: @config.rpcs.delete_database.timeout,
|
1631
|
+
metadata: metadata,
|
1632
|
+
retry_policy: @config.rpcs.delete_database.retry_policy
|
1633
|
+
|
1634
|
+
options.apply_defaults timeout: @config.timeout,
|
1635
|
+
metadata: @config.metadata,
|
1636
|
+
retry_policy: @config.retry_policy
|
1637
|
+
|
1638
|
+
@firestore_admin_stub.call_rpc :delete_database, request, options: options do |response, operation|
|
1639
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1640
|
+
yield response, operation if block_given?
|
1641
|
+
return response
|
1642
|
+
end
|
1643
|
+
rescue ::GRPC::BadStatus => e
|
1644
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1645
|
+
end
|
1646
|
+
|
1527
1647
|
##
|
1528
1648
|
# Configuration class for the FirestoreAdmin API.
|
1529
1649
|
#
|
@@ -1554,9 +1674,9 @@ module Google
|
|
1554
1674
|
# end
|
1555
1675
|
#
|
1556
1676
|
# @!attribute [rw] endpoint
|
1557
|
-
#
|
1558
|
-
#
|
1559
|
-
# @return [::String]
|
1677
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1678
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1679
|
+
# @return [::String,nil]
|
1560
1680
|
# @!attribute [rw] credentials
|
1561
1681
|
# Credentials to send with calls. You may provide any of the following types:
|
1562
1682
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1602,13 +1722,20 @@ module Google
|
|
1602
1722
|
# @!attribute [rw] quota_project
|
1603
1723
|
# A separate project against which to charge quota.
|
1604
1724
|
# @return [::String]
|
1725
|
+
# @!attribute [rw] universe_domain
|
1726
|
+
# The universe domain within which to make requests. This determines the
|
1727
|
+
# default endpoint URL. The default value of nil uses the environment
|
1728
|
+
# universe (usually the default "googleapis.com" universe).
|
1729
|
+
# @return [::String,nil]
|
1605
1730
|
#
|
1606
1731
|
class Configuration
|
1607
1732
|
extend ::Gapic::Config
|
1608
1733
|
|
1734
|
+
# @private
|
1735
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1609
1736
|
DEFAULT_ENDPOINT = "firestore.googleapis.com"
|
1610
1737
|
|
1611
|
-
config_attr :endpoint,
|
1738
|
+
config_attr :endpoint, nil, ::String, nil
|
1612
1739
|
config_attr :credentials, nil do |value|
|
1613
1740
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1614
1741
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -1623,6 +1750,7 @@ module Google
|
|
1623
1750
|
config_attr :metadata, nil, ::Hash, nil
|
1624
1751
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1625
1752
|
config_attr :quota_project, nil, ::String, nil
|
1753
|
+
config_attr :universe_domain, nil, ::String, nil
|
1626
1754
|
|
1627
1755
|
# @private
|
1628
1756
|
def initialize parent_config = nil
|
@@ -1734,6 +1862,11 @@ module Google
|
|
1734
1862
|
# @return [::Gapic::Config::Method]
|
1735
1863
|
#
|
1736
1864
|
attr_reader :update_database
|
1865
|
+
##
|
1866
|
+
# RPC-specific configuration for `delete_database`
|
1867
|
+
# @return [::Gapic::Config::Method]
|
1868
|
+
#
|
1869
|
+
attr_reader :delete_database
|
1737
1870
|
|
1738
1871
|
# @private
|
1739
1872
|
def initialize parent_rpcs = nil
|
@@ -1763,6 +1896,8 @@ module Google
|
|
1763
1896
|
@list_databases = ::Gapic::Config::Method.new list_databases_config
|
1764
1897
|
update_database_config = parent_rpcs.update_database if parent_rpcs.respond_to? :update_database
|
1765
1898
|
@update_database = ::Gapic::Config::Method.new update_database_config
|
1899
|
+
delete_database_config = parent_rpcs.delete_database if parent_rpcs.respond_to? :delete_database
|
1900
|
+
@delete_database = ::Gapic::Config::Method.new delete_database_config
|
1766
1901
|
|
1767
1902
|
yield self if block_given?
|
1768
1903
|
end
|
@@ -27,6 +27,9 @@ module Google
|
|
27
27
|
module FirestoreAdmin
|
28
28
|
# Service that implements Longrunning Operations API.
|
29
29
|
class Operations
|
30
|
+
# @private
|
31
|
+
DEFAULT_ENDPOINT_TEMPLATE = "firestore.$UNIVERSE_DOMAIN$"
|
32
|
+
|
30
33
|
# @private
|
31
34
|
attr_reader :operations_stub
|
32
35
|
|
@@ -61,6 +64,15 @@ module Google
|
|
61
64
|
@config
|
62
65
|
end
|
63
66
|
|
67
|
+
##
|
68
|
+
# The effective universe domain
|
69
|
+
#
|
70
|
+
# @return [String]
|
71
|
+
#
|
72
|
+
def universe_domain
|
73
|
+
@operations_stub.universe_domain
|
74
|
+
end
|
75
|
+
|
64
76
|
##
|
65
77
|
# Create a new Operations client object.
|
66
78
|
#
|
@@ -91,8 +103,10 @@ module Google
|
|
91
103
|
|
92
104
|
@operations_stub = ::Gapic::ServiceStub.new(
|
93
105
|
::Google::Longrunning::Operations::Stub,
|
94
|
-
credentials:
|
95
|
-
endpoint:
|
106
|
+
credentials: credentials,
|
107
|
+
endpoint: @config.endpoint,
|
108
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
109
|
+
universe_domain: @config.universe_domain,
|
96
110
|
channel_args: @config.channel_args,
|
97
111
|
interceptors: @config.interceptors,
|
98
112
|
channel_pool_config: @config.channel_pool
|
@@ -614,9 +628,9 @@ module Google
|
|
614
628
|
# end
|
615
629
|
#
|
616
630
|
# @!attribute [rw] endpoint
|
617
|
-
#
|
618
|
-
#
|
619
|
-
# @return [::String]
|
631
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
632
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
633
|
+
# @return [::String,nil]
|
620
634
|
# @!attribute [rw] credentials
|
621
635
|
# Credentials to send with calls. You may provide any of the following types:
|
622
636
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -662,13 +676,20 @@ module Google
|
|
662
676
|
# @!attribute [rw] quota_project
|
663
677
|
# A separate project against which to charge quota.
|
664
678
|
# @return [::String]
|
679
|
+
# @!attribute [rw] universe_domain
|
680
|
+
# The universe domain within which to make requests. This determines the
|
681
|
+
# default endpoint URL. The default value of nil uses the environment
|
682
|
+
# universe (usually the default "googleapis.com" universe).
|
683
|
+
# @return [::String,nil]
|
665
684
|
#
|
666
685
|
class Configuration
|
667
686
|
extend ::Gapic::Config
|
668
687
|
|
688
|
+
# @private
|
689
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
669
690
|
DEFAULT_ENDPOINT = "firestore.googleapis.com"
|
670
691
|
|
671
|
-
config_attr :endpoint,
|
692
|
+
config_attr :endpoint, nil, ::String, nil
|
672
693
|
config_attr :credentials, nil do |value|
|
673
694
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
674
695
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -683,6 +704,7 @@ module Google
|
|
683
704
|
config_attr :metadata, nil, ::Hash, nil
|
684
705
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
685
706
|
config_attr :quota_project, nil, ::String, nil
|
707
|
+
config_attr :universe_domain, nil, ::String, nil
|
686
708
|
|
687
709
|
# @private
|
688
710
|
def initialize parent_config = nil
|