@@ -1010,7 +1010,7 @@ async def list_fields(
1010
1010
overridden. To issue this query, call
1011
1011
[FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
1012
1012
with the filter set to ``indexConfig.usesAncestorConfig:false``
1013
- or ``ttlConfig:*`` .
1013
+ .
1014
1014
1015
1015
.. code-block:: python
1016
1016
@@ -1448,16 +1448,12 @@ async def sample_create_database():
1448
1448
on the ``request`` instance; if ``request`` is provided, this
1449
1449
should not be set.
1450
1450
database_id (:class:`str`):
1451
- Required. The ID to use for the database, which will
1452
- become the final component of the database's resource
1451
+ Required. The ID to use for the
1452
+ database, which will become the final
1453
+ component of the database's resource
1453
1454
name.
1454
1455
1455
- This value should be 4-63 characters. Valid characters
1456
- are /[a-z][0-9]-/ with first character a letter and the
1457
- last a letter or a number. Must not be UUID-like
1458
- /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
1459
-
1460
- "(default)" database id is also valid.
1456
+ The value must be set to "(default)".
1461
1457
1462
1458
This corresponds to the ``database_id`` field
1463
1459
on the ``request`` instance; if ``request`` is provided, this
@@ -1472,9 +1468,10 @@ async def sample_create_database():
1472
1468
google.api_core.operation_async.AsyncOperation:
1473
1469
An object representing a long-running operation.
1474
1470
1475
- The result type for the operation will be
1476
- :class:`google.cloud.firestore_admin_v1.types.Database`
1477
- A Cloud Firestore Database.
1471
+ The result type for the operation will be :class:`google.cloud.firestore_admin_v1.types.Database` A Cloud Firestore Database.
1472
+ Currently only one database is allowed per cloud
1473
+ project; this database must have a database_id of
1474
+ '(default)'.
1478
1475
1479
1476
"""
1480
1477
# Create or coerce a protobuf request object.
@@ -1588,6 +1585,10 @@ async def sample_get_database():
1588
1585
Returns:
1589
1586
google.cloud.firestore_admin_v1.types.Database:
1590
1587
A Cloud Firestore Database.
1588
+ Currently only one database is allowed per cloud
1589
+ project; this database must have a database_id of
1590
+ '(default)'.
1591
+
1591
1592
"""
1592
1593
# Create or coerce a protobuf request object.
1593
1594
# Quick check: If we got a request object, we should *not* have
@@ -1797,9 +1798,10 @@ async def sample_update_database():
1797
1798
google.api_core.operation_async.AsyncOperation:
1798
1799
An object representing a long-running operation.
1799
1800
1800
- The result type for the operation will be
1801
- :class:`google.cloud.firestore_admin_v1.types.Database`
1802
- A Cloud Firestore Database.
1801
+ The result type for the operation will be :class:`google.cloud.firestore_admin_v1.types.Database` A Cloud Firestore Database.
1802
+ Currently only one database is allowed per cloud
1803
+ project; this database must have a database_id of
1804
+ '(default)'.
1803
1805
1804
1806
"""
1805
1807
# Create or coerce a protobuf request object.
@@ -1856,123 +1858,6 @@ async def sample_update_database():
1856
1858
# Done; return the response.
1857
1859
return response
1858
1860
1859
- async def delete_database (
1860
- self ,
1861
- request : Optional [Union [firestore_admin .DeleteDatabaseRequest , dict ]] = None ,
1862
- * ,
1863
- name : Optional [str ] = None ,
1864
- retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
1865
- timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
1866
- metadata : Sequence [Tuple [str , str ]] = (),
1867
- ) -> operation_async .AsyncOperation :
1868
- r"""Deletes a database.
1869
-
1870
- .. code-block:: python
1871
-
1872
- # This snippet has been automatically generated and should be regarded as a
1873
- # code template only.
1874
- # It will require modifications to work:
1875
- # - It may require correct/in-range values for request initialization.
1876
- # - It may require specifying regional endpoints when creating the service
1877
- # client as shown in:
1878
- # https://googleapis.dev/python/google-api-core/latest/client_options.html
1879
- from google.cloud import firestore_admin_v1
1880
-
1881
- async def sample_delete_database():
1882
- # Create a client
1883
- client = firestore_admin_v1.FirestoreAdminAsyncClient()
1884
-
1885
- # Initialize request argument(s)
1886
- request = firestore_admin_v1.DeleteDatabaseRequest(
1887
- name="name_value",
1888
- )
1889
-
1890
- # Make the request
1891
- operation = client.delete_database(request=request)
1892
-
1893
- print("Waiting for operation to complete...")
1894
-
1895
- response = (await operation).result()
1896
-
1897
- # Handle the response
1898
- print(response)
1899
-
1900
- Args:
1901
- request (Optional[Union[google.cloud.firestore_admin_v1.types.DeleteDatabaseRequest, dict]]):
1902
- The request object. The request for
1903
- [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase].
1904
- name (:class:`str`):
1905
- Required. A name of the form
1906
- ``projects/{project_id}/databases/{database_id}``
1907
-
1908
- This corresponds to the ``name`` field
1909
- on the ``request`` instance; if ``request`` is provided, this
1910
- should not be set.
1911
- retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1912
- should be retried.
1913
- timeout (float): The timeout for this request.
1914
- metadata (Sequence[Tuple[str, str]]): Strings which should be
1915
- sent along with the request as metadata.
1916
-
1917
- Returns:
1918
- google.api_core.operation_async.AsyncOperation:
1919
- An object representing a long-running operation.
1920
-
1921
- The result type for the operation will be
1922
- :class:`google.cloud.firestore_admin_v1.types.Database`
1923
- A Cloud Firestore Database.
1924
-
1925
- """
1926
- # Create or coerce a protobuf request object.
1927
- # Quick check: If we got a request object, we should *not* have
1928
- # gotten any keyword arguments that map to the request.
1929
- has_flattened_params = any ([name ])
1930
- if request is not None and has_flattened_params :
1931
- raise ValueError (
1932
- "If the `request` argument is set, then none of "
1933
- "the individual field arguments should be set."
1934
- )
1935
-
1936
- request = firestore_admin .DeleteDatabaseRequest (request )
1937
-
1938
- # If we have keyword arguments corresponding to fields on the
1939
- # request, apply these.
1940
- if name is not None :
1941
- request .name = name
1942
-
1943
- # Wrap the RPC method; this adds retry and timeout information,
1944
- # and friendly error handling.
1945
- rpc = gapic_v1 .method_async .wrap_method (
1946
- self ._client ._transport .delete_database ,
1947
- default_timeout = None ,
1948
- client_info = DEFAULT_CLIENT_INFO ,
1949
- )
1950
-
1951
- # Certain fields should be provided within the metadata header;
1952
- # add these here.
1953
- metadata = tuple (metadata ) + (
1954
- gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
1955
- )
1956
-
1957
- # Send the request.
1958
- response = await rpc (
1959
- request ,
1960
- retry = retry ,
1961
- timeout = timeout ,
1962
- metadata = metadata ,
1963
- )
1964
-
1965
- # Wrap the response in an operation future.
1966
- response = operation_async .from_gapic (
1967
- response ,
1968
- self ._client ._transport .operations_client ,
1969
- database .Database ,
1970
- metadata_type = firestore_admin .DeleteDatabaseMetadata ,
1971
- )
1972
-
1973
- # Done; return the response.
1974
- return response
1975
-
1976
1861
async def list_operations (
1977
1862
self ,
1978
1863
request : Optional [operations_pb2 .ListOperationsRequest ] = None ,
0 commit comments