@@ -268,6 +268,30 @@ async def create_index(
268268 metadata for the operation will be the type
269269 [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].
270270
271+
272+ .. code-block:: python
273+
274+ from google.cloud import firestore_admin_v1
275+
276+ def sample_create_index():
277+ # Create a client
278+ client = firestore_admin_v1.FirestoreAdminClient()
279+
280+ # Initialize request argument(s)
281+ request = firestore_admin_v1.CreateIndexRequest(
282+ parent="parent_value",
283+ )
284+
285+ # Make the request
286+ operation = client.create_index(request=request)
287+
288+ print("Waiting for operation to complete...")
289+
290+ response = operation.result()
291+
292+ # Handle the response
293+ print(response)
294+
271295 Args:
272296 request (Union[google.cloud.firestore_admin_v1.types.CreateIndexRequest, dict]):
273297 The request object. The request for
@@ -358,6 +382,26 @@ async def list_indexes(
358382 ) -> pagers .ListIndexesAsyncPager :
359383 r"""Lists composite indexes.
360384
385+ .. code-block:: python
386+
387+ from google.cloud import firestore_admin_v1
388+
389+ def sample_list_indexes():
390+ # Create a client
391+ client = firestore_admin_v1.FirestoreAdminClient()
392+
393+ # Initialize request argument(s)
394+ request = firestore_admin_v1.ListIndexesRequest(
395+ parent="parent_value",
396+ )
397+
398+ # Make the request
399+ page_result = client.list_indexes(request=request)
400+
401+ # Handle the response
402+ for response in page_result:
403+ print(response)
404+
361405 Args:
362406 request (Union[google.cloud.firestore_admin_v1.types.ListIndexesRequest, dict]):
363407 The request object. The request for
@@ -449,6 +493,25 @@ async def get_index(
449493 ) -> index .Index :
450494 r"""Gets a composite index.
451495
496+ .. code-block:: python
497+
498+ from google.cloud import firestore_admin_v1
499+
500+ def sample_get_index():
501+ # Create a client
502+ client = firestore_admin_v1.FirestoreAdminClient()
503+
504+ # Initialize request argument(s)
505+ request = firestore_admin_v1.GetIndexRequest(
506+ name="name_value",
507+ )
508+
509+ # Make the request
510+ response = client.get_index(request=request)
511+
512+ # Handle the response
513+ print(response)
514+
452515 Args:
453516 request (Union[google.cloud.firestore_admin_v1.types.GetIndexRequest, dict]):
454517 The request object. The request for
@@ -532,6 +595,22 @@ async def delete_index(
532595 ) -> None :
533596 r"""Deletes a composite index.
534597
598+ .. code-block:: python
599+
600+ from google.cloud import firestore_admin_v1
601+
602+ def sample_delete_index():
603+ # Create a client
604+ client = firestore_admin_v1.FirestoreAdminClient()
605+
606+ # Initialize request argument(s)
607+ request = firestore_admin_v1.DeleteIndexRequest(
608+ name="name_value",
609+ )
610+
611+ # Make the request
612+ client.delete_index(request=request)
613+
535614 Args:
536615 request (Union[google.cloud.firestore_admin_v1.types.DeleteIndexRequest, dict]):
537616 The request object. The request for
@@ -607,6 +686,25 @@ async def get_field(
607686 ) -> field .Field :
608687 r"""Gets the metadata and configuration for a Field.
609688
689+ .. code-block:: python
690+
691+ from google.cloud import firestore_admin_v1
692+
693+ def sample_get_field():
694+ # Create a client
695+ client = firestore_admin_v1.FirestoreAdminClient()
696+
697+ # Initialize request argument(s)
698+ request = firestore_admin_v1.GetFieldRequest(
699+ name="name_value",
700+ )
701+
702+ # Make the request
703+ response = client.get_field(request=request)
704+
705+ # Handle the response
706+ print(response)
707+
610708 Args:
611709 request (Union[google.cloud.firestore_admin_v1.types.GetFieldRequest, dict]):
612710 The request object. The request for
@@ -707,6 +805,33 @@ async def update_field(
707805 the special ``Field`` with resource name:
708806 ``projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*``.
709807
808+
809+ .. code-block:: python
810+
811+ from google.cloud import firestore_admin_v1
812+
813+ def sample_update_field():
814+ # Create a client
815+ client = firestore_admin_v1.FirestoreAdminClient()
816+
817+ # Initialize request argument(s)
818+ field = firestore_admin_v1.Field()
819+ field.name = "name_value"
820+
821+ request = firestore_admin_v1.UpdateFieldRequest(
822+ field=field,
823+ )
824+
825+ # Make the request
826+ operation = client.update_field(request=request)
827+
828+ print("Waiting for operation to complete...")
829+
830+ response = operation.result()
831+
832+ # Handle the response
833+ print(response)
834+
710835 Args:
711836 request (Union[google.cloud.firestore_admin_v1.types.UpdateFieldRequest, dict]):
712837 The request object. The request for
@@ -801,6 +926,27 @@ async def list_fields(
801926 with the filter set to ``indexConfig.usesAncestorConfig:false``
802927 .
803928
929+
930+ .. code-block:: python
931+
932+ from google.cloud import firestore_admin_v1
933+
934+ def sample_list_fields():
935+ # Create a client
936+ client = firestore_admin_v1.FirestoreAdminClient()
937+
938+ # Initialize request argument(s)
939+ request = firestore_admin_v1.ListFieldsRequest(
940+ parent="parent_value",
941+ )
942+
943+ # Make the request
944+ page_result = client.list_fields(request=request)
945+
946+ # Handle the response
947+ for response in page_result:
948+ print(response)
949+
804950 Args:
805951 request (Union[google.cloud.firestore_admin_v1.types.ListFieldsRequest, dict]):
806952 The request object. The request for
@@ -905,6 +1051,30 @@ async def export_documents(
9051051 refer to:
9061052 https://cloud.google.com/firestore/docs/manage-data/export-import
9071053
1054+
1055+ .. code-block:: python
1056+
1057+ from google.cloud import firestore_admin_v1
1058+
1059+ def sample_export_documents():
1060+ # Create a client
1061+ client = firestore_admin_v1.FirestoreAdminClient()
1062+
1063+ # Initialize request argument(s)
1064+ request = firestore_admin_v1.ExportDocumentsRequest(
1065+ name="name_value",
1066+ )
1067+
1068+ # Make the request
1069+ operation = client.export_documents(request=request)
1070+
1071+ print("Waiting for operation to complete...")
1072+
1073+ response = operation.result()
1074+
1075+ # Handle the response
1076+ print(response)
1077+
9081078 Args:
9091079 request (Union[google.cloud.firestore_admin_v1.types.ExportDocumentsRequest, dict]):
9101080 The request object. The request for
@@ -995,6 +1165,30 @@ async def import_documents(
9951165 cancelled, it is possible that a subset of the data has
9961166 already been imported to Cloud Firestore.
9971167
1168+
1169+ .. code-block:: python
1170+
1171+ from google.cloud import firestore_admin_v1
1172+
1173+ def sample_import_documents():
1174+ # Create a client
1175+ client = firestore_admin_v1.FirestoreAdminClient()
1176+
1177+ # Initialize request argument(s)
1178+ request = firestore_admin_v1.ImportDocumentsRequest(
1179+ name="name_value",
1180+ )
1181+
1182+ # Make the request
1183+ operation = client.import_documents(request=request)
1184+
1185+ print("Waiting for operation to complete...")
1186+
1187+ response = operation.result()
1188+
1189+ # Handle the response
1190+ print(response)
1191+
9981192 Args:
9991193 request (Union[google.cloud.firestore_admin_v1.types.ImportDocumentsRequest, dict]):
10001194 The request object. The request for
@@ -1087,6 +1281,25 @@ async def get_database(
10871281 ) -> database .Database :
10881282 r"""Gets information about a database.
10891283
1284+ .. code-block:: python
1285+
1286+ from google.cloud import firestore_admin_v1
1287+
1288+ def sample_get_database():
1289+ # Create a client
1290+ client = firestore_admin_v1.FirestoreAdminClient()
1291+
1292+ # Initialize request argument(s)
1293+ request = firestore_admin_v1.GetDatabaseRequest(
1294+ name="name_value",
1295+ )
1296+
1297+ # Make the request
1298+ response = client.get_database(request=request)
1299+
1300+ # Handle the response
1301+ print(response)
1302+
10901303 Args:
10911304 request (Union[google.cloud.firestore_admin_v1.types.GetDatabaseRequest, dict]):
10921305 The request object. The request for
@@ -1160,6 +1373,25 @@ async def list_databases(
11601373 ) -> firestore_admin .ListDatabasesResponse :
11611374 r"""List all the databases in the project.
11621375
1376+ .. code-block:: python
1377+
1378+ from google.cloud import firestore_admin_v1
1379+
1380+ def sample_list_databases():
1381+ # Create a client
1382+ client = firestore_admin_v1.FirestoreAdminClient()
1383+
1384+ # Initialize request argument(s)
1385+ request = firestore_admin_v1.ListDatabasesRequest(
1386+ parent="parent_value",
1387+ )
1388+
1389+ # Make the request
1390+ response = client.list_databases(request=request)
1391+
1392+ # Handle the response
1393+ print(response)
1394+
11631395 Args:
11641396 request (Union[google.cloud.firestore_admin_v1.types.ListDatabasesRequest, dict]):
11651397 The request object. A request to list the Firestore
@@ -1230,6 +1462,28 @@ async def update_database(
12301462 ) -> operation_async .AsyncOperation :
12311463 r"""Updates a database.
12321464
1465+ .. code-block:: python
1466+
1467+ from google.cloud import firestore_admin_v1
1468+
1469+ def sample_update_database():
1470+ # Create a client
1471+ client = firestore_admin_v1.FirestoreAdminClient()
1472+
1473+ # Initialize request argument(s)
1474+ request = firestore_admin_v1.UpdateDatabaseRequest(
1475+ )
1476+
1477+ # Make the request
1478+ operation = client.update_database(request=request)
1479+
1480+ print("Waiting for operation to complete...")
1481+
1482+ response = operation.result()
1483+
1484+ # Handle the response
1485+ print(response)
1486+
12331487 Args:
12341488 request (Union[google.cloud.firestore_admin_v1.types.UpdateDatabaseRequest, dict]):
12351489 The request object. The request for
0 commit comments