From fd2077681d313f4087b2d8030203f9508c5ca023 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 25 Jan 2024 20:02:48 +0000 Subject: [PATCH 1/2] fix!: remove types QueryMode, QueryPlan, ResultSetStats fix!: remove QueryMode field from RunQueryRequest fix!: remove ResultSetStats field from RunQueryResponse fix!: remove QueryMode field from RunAggregationQueryRequest fix!: remove ResultSetStats field from RunAggregationQueryResponse PiperOrigin-RevId: 601486523 Source-Link: https://github.com/googleapis/googleapis/commit/a8b027a5c70951da414e3f6b3131cc0ed7886d48 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b9b571f58541c0ace1ff94bf22af3d063eebfb7c Copy-Tag: eyJwIjoiRmlyZXN0b3JlLy5Pd2xCb3QueWFtbCIsImgiOiJiOWI1NzFmNTg1NDFjMGFjZTFmZjk0YmYyMmFmM2QwNjNlZWJmYjdjIn0= --- .../Google/Firestore/Admin/V1/Database.php | Bin 0 -> 2647 bytes .../Google/Firestore/Admin/V1/Field.php | Bin 0 -> 1669 bytes .../Firestore/Admin/V1/FirestoreAdmin.php | 135 ++ .../Google/Firestore/Admin/V1/Index.php | Bin 0 -> 1837 bytes .../Google/Firestore/Admin/V1/Location.php | 28 + .../Google/Firestore/Admin/V1/Operation.php | Bin 0 -> 3457 bytes .../Admin/V1/CreateDatabaseMetadata.php | 33 + .../Admin/V1/CreateDatabaseRequest.php | 196 +++ .../Firestore/Admin/V1/CreateIndexRequest.php | 133 ++ .../Cloud/Firestore/Admin/V1/Database.php | 657 +++++++ .../V1/Database/AppEngineIntegrationMode.php | 69 + .../Admin/V1/Database/ConcurrencyMode.php | 77 + .../Admin/V1/Database/DatabaseType.php | 67 + .../V1/Database/DeleteProtectionState.php | 64 + .../PointInTimeRecoveryEnablement.php | 70 + .../Admin/V1/DeleteDatabaseMetadata.php | 33 + .../Admin/V1/DeleteDatabaseRequest.php | 129 ++ .../Firestore/Admin/V1/DeleteIndexRequest.php | 87 + .../Admin/V1/ExportDocumentsMetadata.php | 403 +++++ .../Admin/V1/ExportDocumentsRequest.php | 301 ++++ .../Admin/V1/ExportDocumentsResponse.php | 76 + .../Google/Cloud/Firestore/Admin/V1/Field.php | 261 +++ .../Firestore/Admin/V1/Field/IndexConfig.php | 208 +++ .../Firestore/Admin/V1/Field/TtlConfig.php | 74 + .../Admin/V1/Field/TtlConfig/State.php | 78 + .../Admin/V1/FieldOperationMetadata.php | 373 ++++ .../IndexConfigDelta.php | 114 ++ .../IndexConfigDelta/ChangeType.php | 64 + .../FieldOperationMetadata/TtlConfigDelta.php | 70 + .../TtlConfigDelta/ChangeType.php | 64 + .../Firestore/Admin/V1/GetDatabaseRequest.php | 87 + .../Firestore/Admin/V1/GetFieldRequest.php | 87 + .../Firestore/Admin/V1/GetIndexRequest.php | 87 + .../Admin/V1/ImportDocumentsMetadata.php | 351 ++++ .../Admin/V1/ImportDocumentsRequest.php | 225 +++ .../Google/Cloud/Firestore/Admin/V1/Index.php | 268 +++ .../Firestore/Admin/V1/Index/ApiScope.php | 59 + .../Firestore/Admin/V1/Index/IndexField.php | 158 ++ .../Admin/V1/Index/IndexField/ArrayConfig.php | 57 + .../Admin/V1/Index/IndexField/Order.php | 64 + .../Firestore/Admin/V1/Index/QueryScope.php | 77 + .../Cloud/Firestore/Admin/V1/Index/State.php | 86 + .../Admin/V1/IndexOperationMetadata.php | 287 +++ .../Admin/V1/ListDatabasesRequest.php | 86 + .../Admin/V1/ListDatabasesResponse.php | 129 ++ .../Firestore/Admin/V1/ListFieldsRequest.php | 217 +++ .../Firestore/Admin/V1/ListFieldsResponse.php | 106 ++ .../Firestore/Admin/V1/ListIndexesRequest.php | 197 +++ .../Admin/V1/ListIndexesResponse.php | 106 ++ .../Firestore/Admin/V1/LocationMetadata.php | 34 + .../Firestore/Admin/V1/OperationState.php | 98 ++ .../Cloud/Firestore/Admin/V1/Progress.php | 103 ++ .../Admin/V1/UpdateDatabaseMetadata.php | 33 + .../Admin/V1/UpdateDatabaseRequest.php | 137 ++ .../Firestore/Admin/V1/UpdateFieldRequest.php | 139 ++ .../FirestoreAdminClient/create_database.php | 96 + .../V1/FirestoreAdminClient/create_index.php | 94 + .../FirestoreAdminClient/delete_database.php | 84 + .../V1/FirestoreAdminClient/delete_index.php | 75 + .../FirestoreAdminClient/export_documents.php | 94 + .../V1/FirestoreAdminClient/get_database.php | 72 + .../V1/FirestoreAdminClient/get_field.php | 77 + .../V1/FirestoreAdminClient/get_index.php | 77 + .../FirestoreAdminClient/import_documents.php | 85 + .../FirestoreAdminClient/list_databases.php | 72 + .../V1/FirestoreAdminClient/list_fields.php | 89 + .../V1/FirestoreAdminClient/list_indexes.php | 81 + .../FirestoreAdminClient/update_database.php | 71 + .../V1/FirestoreAdminClient/update_field.php | 124 ++ .../src/V1/Client/FirestoreAdminClient.php | 789 +++++++++ .../v1/Admin/src/V1/FirestoreAdminClient.php | 34 + .../V1/Gapic/FirestoreAdminGapicClient.php | 1444 ++++++++++++++++ .../v1/Admin/src/V1/gapic_metadata.json | 88 + .../firestore_admin_client_config.json | 116 ++ .../firestore_admin_descriptor_config.php | 250 +++ .../firestore_admin_rest_client_config.php | 221 +++ .../V1/Client/FirestoreAdminClientTest.php | 1540 +++++++++++++++++ .../Unit/V1/FirestoreAdminClientTest.php | 1382 +++++++++++++++ .../Google/Firestore/V1/AggregationResult.php | 33 + .../Google/Firestore/V1/BloomFilter.php | 34 + .../Google/Firestore/V1/Common.php | Bin 0 -> 1296 bytes .../Google/Firestore/V1/Document.php | Bin 0 -> 1930 bytes .../Google/Firestore/V1/Firestore.php | Bin 0 -> 10892 bytes .../GPBMetadata/Google/Firestore/V1/Query.php | Bin 0 -> 3795 bytes .../GPBMetadata/Google/Firestore/V1/Write.php | Bin 0 -> 2679 bytes .../Cloud/Firestore/V1/AggregationResult.php | 86 + .../Google/Cloud/Firestore/V1/ArrayValue.php | 67 + .../Firestore/V1/BatchGetDocumentsRequest.php | 296 ++++ .../V1/BatchGetDocumentsResponse.php | 214 +++ .../Cloud/Firestore/V1/BatchWriteRequest.php | 152 ++ .../Cloud/Firestore/V1/BatchWriteResponse.php | 118 ++ .../Firestore/V1/BeginTransactionRequest.php | 134 ++ .../Firestore/V1/BeginTransactionResponse.php | 68 + .../Google/Cloud/Firestore/V1/BitSequence.php | 124 ++ .../Google/Cloud/Firestore/V1/BloomFilter.php | 119 ++ .../Cloud/Firestore/V1/CommitRequest.php | 161 ++ .../Cloud/Firestore/V1/CommitResponse.php | 123 ++ .../Firestore/V1/CreateDocumentRequest.php | 248 +++ .../src/Google/Cloud/Firestore/V1/Cursor.php | 113 ++ .../Firestore/V1/DeleteDocumentRequest.php | 134 ++ .../Google/Cloud/Firestore/V1/Document.php | 290 ++++ .../Cloud/Firestore/V1/DocumentChange.php | 154 ++ .../Cloud/Firestore/V1/DocumentDelete.php | 158 ++ .../Cloud/Firestore/V1/DocumentMask.php | 80 + .../Cloud/Firestore/V1/DocumentRemove.php | 160 ++ .../Cloud/Firestore/V1/DocumentTransform.php | 109 ++ .../V1/DocumentTransform/FieldTransform.php | 417 +++++ .../FieldTransform/ServerValue.php | 59 + .../Cloud/Firestore/V1/ExistenceFilter.php | 209 +++ .../Cloud/Firestore/V1/GetDocumentRequest.php | 208 +++ .../Firestore/V1/ListCollectionIdsRequest.php | 219 +++ .../V1/ListCollectionIdsResponse.php | 102 ++ .../Firestore/V1/ListDocumentsRequest.php | 462 +++++ .../Firestore/V1/ListDocumentsResponse.php | 106 ++ .../Cloud/Firestore/V1/ListenRequest.php | 180 ++ .../Cloud/Firestore/V1/ListenResponse.php | 219 +++ .../Google/Cloud/Firestore/V1/MapValue.php | 83 + .../Firestore/V1/PartitionQueryRequest.php | 364 ++++ .../Firestore/V1/PartitionQueryResponse.php | 162 ++ .../Cloud/Firestore/V1/Precondition.php | 114 ++ .../Cloud/Firestore/V1/RollbackRequest.php | 121 ++ .../V1/RunAggregationQueryRequest.php | 256 +++ .../V1/RunAggregationQueryResponse.php | 192 ++ .../Cloud/Firestore/V1/RunQueryRequest.php | 258 +++ .../Cloud/Firestore/V1/RunQueryResponse.php | 275 +++ .../V1/StructuredAggregationQuery.php | 122 ++ .../Aggregation.php | 290 ++++ .../Aggregation/Avg.php | 86 + .../Aggregation/Count.php | 169 ++ .../Aggregation/Sum.php | 95 + .../Cloud/Firestore/V1/StructuredQuery.php | 599 +++++++ .../V1/StructuredQuery/CollectionSelector.php | 116 ++ .../V1/StructuredQuery/CompositeFilter.php | 112 ++ .../CompositeFilter/Operator.php | 68 + .../V1/StructuredQuery/Direction.php | 64 + .../V1/StructuredQuery/FieldFilter.php | 158 ++ .../StructuredQuery/FieldFilter/Operator.php | 146 ++ .../V1/StructuredQuery/FieldReference.php | 86 + .../Firestore/V1/StructuredQuery/Filter.php | 144 ++ .../Firestore/V1/StructuredQuery/Order.php | 114 ++ .../V1/StructuredQuery/Projection.php | 78 + .../V1/StructuredQuery/UnaryFilter.php | 112 ++ .../StructuredQuery/UnaryFilter/Operator.php | 84 + .../src/Google/Cloud/Firestore/V1/Target.php | 407 +++++ .../Firestore/V1/Target/DocumentsTarget.php | 82 + .../Cloud/Firestore/V1/Target/QueryTarget.php | 132 ++ .../Cloud/Firestore/V1/TargetChange.php | 267 +++ .../V1/TargetChange/TargetChangeType.php | 86 + .../Cloud/Firestore/V1/TransactionOptions.php | 108 ++ .../V1/TransactionOptions/PBReadOnly.php | 90 + .../V1/TransactionOptions/ReadOnly.php | 9 + .../V1/TransactionOptions/ReadWrite.php | 72 + .../Firestore/V1/UpdateDocumentRequest.php | 268 +++ .../src/Google/Cloud/Firestore/V1/Value.php | 435 +++++ .../src/Google/Cloud/Firestore/V1/Write.php | 314 ++++ .../Cloud/Firestore/V1/WriteRequest.php | 277 +++ .../Cloud/Firestore/V1/WriteResponse.php | 203 +++ .../Google/Cloud/Firestore/V1/WriteResult.php | 131 ++ .../FirestoreClient/batch_get_documents.php | 86 + .../V1/FirestoreClient/batch_write.php | 66 + .../V1/FirestoreClient/begin_transaction.php | 71 + .../v1/samples/V1/FirestoreClient/commit.php | 74 + .../V1/FirestoreClient/create_document.php | 83 + .../V1/FirestoreClient/delete_document.php | 69 + .../V1/FirestoreClient/get_document.php | 71 + .../FirestoreClient/list_collection_ids.php | 77 + .../V1/FirestoreClient/list_documents.php | 89 + .../v1/samples/V1/FirestoreClient/listen.php | 78 + .../V1/FirestoreClient/partition_query.php | 64 + .../samples/V1/FirestoreClient/rollback.php | 72 + .../FirestoreClient/run_aggregation_query.php | 92 + .../samples/V1/FirestoreClient/run_query.php | 80 + .../V1/FirestoreClient/update_document.php | 62 + .../v1/samples/V1/FirestoreClient/write.php | 79 + .../v1/src/V1/Client/FirestoreClient.php | 619 +++++++ .../Firestore/v1/src/V1/FirestoreClient.php | 34 + .../v1/src/V1/Gapic/FirestoreGapicClient.php | 1357 +++++++++++++++ .../Firestore/v1/src/V1/gapic_metadata.json | 98 ++ .../V1/resources/firestore_client_config.json | 174 ++ .../resources/firestore_descriptor_config.php | 252 +++ .../firestore_rest_client_config.php | 272 +++ .../Unit/V1/Client/FirestoreClientTest.php | 1323 ++++++++++++++ .../v1/tests/Unit/V1/FirestoreClientTest.php | 1219 +++++++++++++ 183 files changed, 33463 insertions(+) create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Database.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Field.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/FirestoreAdmin.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Index.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Location.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Operation.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseMetadata.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateIndexRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/AppEngineIntegrationMode.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/ConcurrencyMode.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DatabaseType.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DeleteProtectionState.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/PointInTimeRecoveryEnablement.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseMetadata.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteIndexRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsMetadata.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsResponse.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/IndexConfig.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig/State.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta/ChangeType.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta/ChangeType.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetDatabaseRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetFieldRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetIndexRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsMetadata.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/ApiScope.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/ArrayConfig.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/Order.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/QueryScope.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/State.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/IndexOperationMetadata.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesResponse.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsResponse.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesResponse.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/LocationMetadata.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/OperationState.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Progress.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseMetadata.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateFieldRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_database.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_index.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_database.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_index.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/export_documents.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_database.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_field.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_index.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/import_documents.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_databases.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_fields.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_indexes.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_database.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_field.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/Client/FirestoreAdminClient.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/FirestoreAdminClient.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/Gapic/FirestoreAdminGapicClient.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_client_config.json create mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_descriptor_config.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_rest_client_config.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/Client/FirestoreAdminClientTest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/FirestoreAdminClientTest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/AggregationResult.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/BloomFilter.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Common.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Document.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Firestore.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Query.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Write.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/AggregationResult.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ArrayValue.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsResponse.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteResponse.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionResponse.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BitSequence.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BloomFilter.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitResponse.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CreateDocumentRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Cursor.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DeleteDocumentRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Document.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentChange.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentDelete.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentMask.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentRemove.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform/ServerValue.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExistenceFilter.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/GetDocumentRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsResponse.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsResponse.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenResponse.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/MapValue.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryResponse.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Precondition.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RollbackRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryResponse.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryResponse.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Avg.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Count.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Sum.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CollectionSelector.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter/Operator.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Direction.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter/Operator.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldReference.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Filter.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Order.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Projection.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter/Operator.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/DocumentsTarget.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/QueryTarget.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange/TargetChangeType.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/PBReadOnly.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/ReadOnly.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/ReadWrite.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/UpdateDocumentRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Value.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Write.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteRequest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResponse.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResult.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_get_documents.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_write.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/begin_transaction.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/commit.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/create_document.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/delete_document.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/get_document.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_collection_ids.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_documents.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/listen.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/partition_query.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/rollback.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_aggregation_query.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_query.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/update_document.php create mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/write.php create mode 100644 owl-bot-staging/Firestore/v1/src/V1/Client/FirestoreClient.php create mode 100644 owl-bot-staging/Firestore/v1/src/V1/FirestoreClient.php create mode 100644 owl-bot-staging/Firestore/v1/src/V1/Gapic/FirestoreGapicClient.php create mode 100644 owl-bot-staging/Firestore/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Firestore/v1/src/V1/resources/firestore_client_config.json create mode 100644 owl-bot-staging/Firestore/v1/src/V1/resources/firestore_descriptor_config.php create mode 100644 owl-bot-staging/Firestore/v1/src/V1/resources/firestore_rest_client_config.php create mode 100644 owl-bot-staging/Firestore/v1/tests/Unit/V1/Client/FirestoreClientTest.php create mode 100644 owl-bot-staging/Firestore/v1/tests/Unit/V1/FirestoreClientTest.php diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Database.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Database.php new file mode 100644 index 0000000000000000000000000000000000000000..6036be1305fda288922810c3e6ff355d96905536 GIT binary patch literal 2647 zcma)8U31$+6va*`bR80-Hq;3u*(9BbJ5U?9yi{odvLzeM)Rsn8(n&`%8d+XD0$I{X zav*dv{1D!F)Qa0{Ap+t9*=#0?2`J(2}u=HMFWfu!yD}kZwM4`95?n6vRx~R zu$c0ow+O>0m=0XW#!+m=@blP-OviI#$8w!tU>yf|WVsOm@b%cy)U#v9_b>%0o=vJx zaKcGr9|u0H`v7MZsZv|b&mb){@9t z?$a9cY3;1Bo=(-Rz^Q|YnXePiu5YIN%)#J=`Y>I5I=^*wKF(H{1nm4-LLX=T<(AMQ zJp+{jE>!PxWwbDLhLr{S(p>mgSm3@vB|9W=98F47`4DDG&(>>cch`GXEPu8YdH@7dEZB%Xb4 zPW&OMtT3+U^Ki9h*e*c1?@;B8gb{engu_8R>N+zZq2muLpR#4HWwg0CnL8704$&&H zLe~M;nHd$+mSgb$)z(GZfe(I!D~9a})M5KTbZ!#Q8n|QvMO9YW3WcncyVO!Cne5RW z)KVrXC*myhxfKLJJ$5_-DPuBDj#{GR1D5CIJb8p5kQj?RBVm$0Lg+_wZU!M4IX_n( z0%PjEH|WujxS%r3`7vSlq)G2DQu&PKeKAj7kx{5QL!S~*-@|P`uGlo)&TF)kxrdo% z1FeaIE;NO{Wa=lXWFGbUs??I(vLu#2;2xrKTh^q$u4t0k6Lk4lDi=5oEmKf3+EqlU zT-^Bytz2~wMqjj)Uh7EHq+aX9q=8rHml0A_UGB<#U2XyK3M#2mzn={hxoxyD3ou{H z`uC>P(`Eg{>}bl7+AlBc{8m64ckgTiJyjLCr<-!mgk+MbNiF4A(oTR&XuguVKzXIG z9kh8TM1*2@(bg?7qTHvvBFHj8m0RubB{KE|RfQ@#a!-Qlbg83(#!BxdtxD*lq+FVN z2`;u-l3&s4&3kX`pYKktk7K3vXW7u0I`S2%38AU+#_q2U??~M`GW>U_br+y|~zEwflb*w>qpRs{czB*g@qEt2^Nfn;j~jz~AVTav-^>48ze;+O SORdbUZ48S{nvDx|fzW^UXHTdA literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Field.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Field.php new file mode 100644 index 0000000000000000000000000000000000000000..f9245a9df94009f01eae011a49b15b422adf9533 GIT binary patch literal 1669 zcma)6%Wl&^6eUStnO0S50V)xXp)G2PicQK2mlipR69tJhN=z5XQsg+3bdYOX_Bf(c z`2aqG4NF%11RMT<9qWDtcgBemsSlb(;>_H0=H4^M=gnLH#7CRBMqCnDjP!8#46_r0 z{lH_M?K!v`_4_2iws-1NhXgXll_T6ZGO%8$8&3fmdQo5#6%Rab;1H!x0}?VXAd1yH zrLHn8!V+M;N>z10SRx%?DeR1o<#e=<3vrLCda20+%z}u_ zo{n)qSQNPXqHj(xN}kLs#L|2Uf`KX}a$*gs7pUrVswv5J&=wir+^tcUZwG|wkvOy`|1E{GNoP_8&2zWMimmRwyrGX+ zmINxdIgV?b*?5QM#XspDT5B7cp?5ws+D*M&uh#WS?vAvAmdY(%GwO|6E+rwfpp}jK zv7SpyIkeKy^-8h{`mKMdahQkwtu9b)I^BNWxZ8oC^2W^ zcAU2mxEJZom`7Dbm8vF8sw${d^|;tw0Iit!YCCz0cjG*piN9;3PgKSMH9{kV{sCLH B9gzS4 literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/FirestoreAdmin.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/FirestoreAdmin.php new file mode 100644 index 000000000000..785f61992d5d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/FirestoreAdmin.php @@ -0,0 +1,135 @@ +internalAddGeneratedFile( + ' +È- +/google/firestore/admin/v1/firestore_admin.protogoogle.firestore.admin.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto(google/firestore/admin/v1/database.proto%google/firestore/admin/v1/field.proto%google/firestore/admin/v1/index.proto)google/firestore/admin/v1/operation.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"Q +ListDatabasesRequest9 +parent ( B)àAúA#!firestore.googleapis.com/Database"¨ +CreateDatabaseRequest9 +parent ( B)àAúA#!firestore.googleapis.com/Database: +database ( 2#.google.firestore.admin.v1.DatabaseBàA + database_id ( BàA" +CreateDatabaseMetadata"d +ListDatabasesResponse6 + databases ( 2#.google.firestore.admin.v1.Database + unreachable ( "M +GetDatabaseRequest7 +name ( B)àAúA# +!firestore.googleapis.com/Database"„ +UpdateDatabaseRequest: +database ( 2#.google.firestore.admin.v1.DatabaseBàA/ + update_mask ( 2.google.protobuf.FieldMask" +UpdateDatabaseMetadata"^ +DeleteDatabaseRequest7 +name ( B)àAúA# +!firestore.googleapis.com/Database +etag ( " +DeleteDatabaseMetadata"Œ +CreateIndexRequest@ +parent ( B0àAúA* +(firestore.googleapis.com/CollectionGroup4 +index ( 2 .google.firestore.admin.v1.IndexBàA" +ListIndexesRequest@ +parent ( B0àAúA* +(firestore.googleapis.com/CollectionGroup +filter (  + page_size ( + +page_token ( "a +ListIndexesResponse1 +indexes ( 2 .google.firestore.admin.v1.Index +next_page_token ( "G +GetIndexRequest4 +name ( B&àAúA +firestore.googleapis.com/Index"J +DeleteIndexRequest4 +name ( B&àAúA +firestore.googleapis.com/Index"{ +UpdateFieldRequest4 +field ( 2 .google.firestore.admin.v1.FieldBàA/ + update_mask ( 2.google.protobuf.FieldMask"G +GetFieldRequest4 +name ( B&àAúA +firestore.googleapis.com/Field"Œ +ListFieldsRequest@ +parent ( B0àAúA* +(firestore.googleapis.com/CollectionGroup +filter (  + page_size ( + +page_token ( "_ +ListFieldsResponse0 +fields ( 2 .google.firestore.admin.v1.Field +next_page_token ( "Î +ExportDocumentsRequest7 +name ( B)àAúA# +!firestore.googleapis.com/Database +collection_ids (  +output_uri_prefix (  + namespace_ids ( 1 + snapshot_time ( 2.google.protobuf.Timestamp"š +ImportDocumentsRequest7 +name ( B)àAúA# +!firestore.googleapis.com/Database +collection_ids (  +input_uri_prefix (  + namespace_ids ( 2© +FirestoreAdminÛ + CreateIndex-.google.firestore.admin.v1.CreateIndexRequest.google.longrunning.Operation"~‚Óä“G">/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes:indexÚA parent,indexÊA +IndexIndexOperationMetadata½ + ListIndexes-.google.firestore.admin.v1.ListIndexesRequest..google.firestore.admin.v1.ListIndexesResponse"O‚Óä“@>/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexesÚAparent§ +GetIndex*.google.firestore.admin.v1.GetIndexRequest .google.firestore.admin.v1.Index"M‚Óä“@>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}ÚAname£ + DeleteIndex-.google.firestore.admin.v1.DeleteIndexRequest.google.protobuf.Empty"M‚Óä“@*>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}ÚAname¦ +GetField*.google.firestore.admin.v1.GetFieldRequest .google.firestore.admin.v1.Field"L‚Óä“?=/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}ÚAnameÙ + UpdateField-.google.firestore.admin.v1.UpdateFieldRequest.google.longrunning.Operation"|‚Óä“L2C/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}:fieldÚAfieldÊA +FieldFieldOperationMetadata¹ + +ListFields,.google.firestore.admin.v1.ListFieldsRequest-.google.firestore.admin.v1.ListFieldsResponse"N‚Óä“?=/v1/{parent=projects/*/databases/*/collectionGroups/*}/fieldsÚAparentÝ +ExportDocuments1.google.firestore.admin.v1.ExportDocumentsRequest.google.longrunning.Operation"x‚Óä“6"1/v1/{name=projects/*/databases/*}:exportDocuments:*ÚAnameÊA2 +ExportDocumentsResponseExportDocumentsMetadataÛ +ImportDocuments1.google.firestore.admin.v1.ImportDocumentsRequest.google.longrunning.Operation"v‚Óä“6"1/v1/{name=projects/*/databases/*}:importDocuments:*ÚAnameÊA0 +google.protobuf.EmptyImportDocumentsMetadataÙ +CreateDatabase0.google.firestore.admin.v1.CreateDatabaseRequest.google.longrunning.Operation"v‚Óä“-"!/v1/{parent=projects/*}/databases:databaseÚAparent,database,database_idÊA" +DatabaseCreateDatabaseMetadata“ + GetDatabase-.google.firestore.admin.v1.GetDatabaseRequest#.google.firestore.admin.v1.Database"0‚Óä“#!/v1/{name=projects/*/databases/*}ÚAname¦ + ListDatabases/.google.firestore.admin.v1.ListDatabasesRequest0.google.firestore.admin.v1.ListDatabasesResponse"2‚Óä“#!/v1/{parent=projects/*}/databasesÚAparentÛ +UpdateDatabase0.google.firestore.admin.v1.UpdateDatabaseRequest.google.longrunning.Operation"x‚Óä“62*/v1/{database.name=projects/*/databases/*}:databaseÚAdatabase,update_maskÊA" +DatabaseUpdateDatabaseMetadata¸ +DeleteDatabase0.google.firestore.admin.v1.DeleteDatabaseRequest.google.longrunning.Operation"U‚Óä“#*!/v1/{name=projects/*/databases/*}ÚAnameÊA" +DatabaseDeleteDatabaseMetadatavÊAfirestore.googleapis.comÒAXhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastoreB¥ +com.google.firestore.admin.v1BFirestoreAdminProtoPZ9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb¢GCFSªGoogle.Cloud.Firestore.Admin.V1ÊGoogle\\Cloud\\Firestore\\Admin\\V1ê#Google::Cloud::Firestore::Admin::V1êAL +!firestore.googleapis.com/Location\'projects/{project}/locations/{location}êAq +(firestore.googleapis.com/CollectionGroupEprojects/{project}/databases/{database}/collectionGroups/{collection}bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Index.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Index.php new file mode 100644 index 0000000000000000000000000000000000000000..933a1f2181b7e78b568eb1f7603b6a5bebb2df32 GIT binary patch literal 1837 zcmb7F-HzKt6y9VvZF4qM!732`hqTbF3XTFosNOE%*iLGxjZ-^WX)8;XV^6Y!yteVr z!nVrGaEW*YUVwWpc!fR%GvmaGwyd_~BC$`-_nq&YGyeSOhxjyxyJ(0*oVXeG(d+_c zrx?Xalto??pjkej;{JE> zu75_t?s>0ELLdJsaz=pAJ;Q12dKeAI{iir{eK&LMAqU%oHQ1IJ*gozZ0(gO&rbuTb z@DdRH#Q7{B9!fJeqd)gZ>X49R#0|&`+QAW;yFrR6^7Y(#9(oyxLc{<@=;6)*DmYp0 zy*Q#BAEC9JF&hFMfUSoaPC_@ZRh)VWiD`dhnkq>PoRyFKrsy;CVk^eNR^EW#2Ew4(KvFB|R&4 zAO5bx=Wnz{;r${_ESD|vWsB#%_8&K)#&;z&V2>@kRY8?bUHB39f6j4o;iO&^<5rah zZ-4zjypl-dB;qrMu^2>n1a&tiD}0UP53a@2ArC7L8A2ePlH&{RY6f8|2tI zi+tQB09*V25Z-$>)yxyeQjD>7iH2%Wj3-YtWuhA+s_70iH}}raG^XQbRcOJTt*EIf zQ`6FqwdQWS3%AOnvJW@q(TO9Eb=vE@AgJ<0wkC$DIZq8$zN7q8@B;FHa>R6G;(tfwNi-7ep_Fs1(a z6ZW#S`*L-)>@w?|xhbZx_2sflO*^1@)Z~Uql*jbHO=MYkF#{0hr_26775JDIx%#a1 zixbSPa9nx*&PV?qtTaDM(B&kk3=zg72!%E0=)`st9Hy{K@e((*-_ zS-yDO`)i$H+dReIdM&Kp3-rbCs(QEJktCiaNhOmcaVkkV?#*t{VP(-b_e-n$vhdw4 Qo4(Sbd1m3JOIQN@3!f%D+5i9m literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Location.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Location.php new file mode 100644 index 000000000000..3c93ac4fddbd --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Location.php @@ -0,0 +1,28 @@ +internalAddGeneratedFile( + ' +À +(google/firestore/admin/v1/location.protogoogle.firestore.admin.v1" +LocationMetadataBÜ +com.google.firestore.admin.v1B LocationProtoPZ9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb¢GCFSªGoogle.Cloud.Firestore.Admin.V1ÊGoogle\\Cloud\\Firestore\\Admin\\V1ê#Google::Cloud::Firestore::Admin::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Operation.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Operation.php new file mode 100644 index 0000000000000000000000000000000000000000..d93d92524fae1174838a9b129ba812521514aec7 GIT binary patch literal 3457 zcmeHK&2A$_5XN?XE5w*VoAqXe(m1=?1TAAZaDWNf#ql2_65EQMNJN%~@l4xkF`gdH zw3h^w3va=N1Kc=r;KmE^4xEvA3c7nd6KCy&1fo5y4{_S6`nu|?pRW4!xp(5hI;vq8 z`zFIS>YgEXf|2J_MlI@~?y%RxKCRo(!PW9 zJ>uhlQ6J|`dqCX$i$b1y0-I1*m8bx&IlzHuS{T)uyZe}#w#m#+O#*bP5kRLX06Is7 zZ2-$Lg8(%mAovat|9Hc$Lo5_9j&7kxBru3e7%?64E%#&x^-L$gTzgWsH*_sw5fTaw z*TNf{D8v-9k37mf-$9W{O+f}HqNBSE`>yG9$~drm;&DHlTvXHgn8g%|Up6*J*9th& zLmQ!unl@qN4r2ZgkKc}vkJ-?7x24?z;5`1XGlj6CM>+?16b9|Wp$q+KT9Y($?`(Xk z-54QerA>G^nK|&L>q<61ct%Ft6>U4Fs>)MpBX&->`UHNy2b(v}CFMaVs>W%j%Cu8o z6jmQ!jY5Q{VK%O=jl^Vb@*w9~go6$X!uB)-7Euo-12ZbBc z=Y<&8<_S-}N%ET9T-34yxp% z;tA^vU4t%Ra?b$9)E~nA(&xo`tzxvlY*viJdaGF}=~cZ_&b*<_L#kLVXA%m)+(Bi( zaa749SAR`F`m*!NSJV9b;u=e?$h6C_V_yDWqjSHd;C|)QqdqG~ec=@q=PtZOqvzZR z`JuYqi$G&!prnmxWJ|H<*4iW~jMN>@iKK%gRrbFfpnKAT<;rX~nPP3vM z7nOUk9M3*dV?k;ZU^#G2FF2v2mt;}8aLr4S`<@3*AG{76f6>AR=?(&yg$!|T5x3k& z6UD>lFps(co}L6^Kv>Laun<42Jcsz`LK?ay zVLxYq(PrZK6U(7PJ5u4=`92-rBRs;Fh;W;bf4%PZ==-PSOs!OH{gPa($>l*UNu+qT zRf}SUP>%|KL=v5j6zPnu8KXUeFB*R**FzjllTw-%BWaq1(zK&OcaG0OjDGke9$cS> XGyK@dFB%%Lri}YiGMvoM;T+%}ggoogle.firestore.admin.v1.CreateDatabaseMetadata + */ +class CreateDatabaseMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseRequest.php new file mode 100644 index 000000000000..2380588c92cd --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseRequest.php @@ -0,0 +1,196 @@ +google.firestore.admin.v1.CreateDatabaseRequest + */ +class CreateDatabaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A parent name of the form + * `projects/{project_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The Database to create. + * + * Generated from protobuf field .google.firestore.admin.v1.Database database = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $database = null; + /** + * Required. The ID to use for the database, which will become the final + * component of the database's resource name. + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * "(default)" database id is also valid. + * + * Generated from protobuf field string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $database_id = ''; + + /** + * @param string $parent Required. A parent name of the form + * `projects/{project_id}` + * Please see {@see FirestoreAdminClient::projectName()} for help formatting this field. + * @param \Google\Cloud\Firestore\Admin\V1\Database $database Required. The Database to create. + * @param string $databaseId Required. The ID to use for the database, which will become the final + * component of the database's resource name. + * + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * + * "(default)" database id is also valid. + * + * @return \Google\Cloud\Firestore\Admin\V1\CreateDatabaseRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Firestore\Admin\V1\Database $database, string $databaseId): self + { + return (new self()) + ->setParent($parent) + ->setDatabase($database) + ->setDatabaseId($databaseId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. A parent name of the form + * `projects/{project_id}` + * @type \Google\Cloud\Firestore\Admin\V1\Database $database + * Required. The Database to create. + * @type string $database_id + * Required. The ID to use for the database, which will become the final + * component of the database's resource name. + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * "(default)" database id is also valid. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. A parent name of the form + * `projects/{project_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. A parent name of the form + * `projects/{project_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The Database to create. + * + * Generated from protobuf field .google.firestore.admin.v1.Database database = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Firestore\Admin\V1\Database|null + */ + public function getDatabase() + { + return $this->database; + } + + public function hasDatabase() + { + return isset($this->database); + } + + public function clearDatabase() + { + unset($this->database); + } + + /** + * Required. The Database to create. + * + * Generated from protobuf field .google.firestore.admin.v1.Database database = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Firestore\Admin\V1\Database $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Database::class); + $this->database = $var; + + return $this; + } + + /** + * Required. The ID to use for the database, which will become the final + * component of the database's resource name. + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * "(default)" database id is also valid. + * + * Generated from protobuf field string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatabaseId() + { + return $this->database_id; + } + + /** + * Required. The ID to use for the database, which will become the final + * component of the database's resource name. + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * "(default)" database id is also valid. + * + * Generated from protobuf field string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatabaseId($var) + { + GPBUtil::checkString($var, True); + $this->database_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateIndexRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateIndexRequest.php new file mode 100644 index 000000000000..a09b8194ce62 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateIndexRequest.php @@ -0,0 +1,133 @@ +google.firestore.admin.v1.CreateIndexRequest + */ +class CreateIndexRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The composite index to create. + * + * Generated from protobuf field .google.firestore.admin.v1.Index index = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $index = null; + + /** + * @param string $parent Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * Please see {@see FirestoreAdminClient::collectionGroupName()} for help formatting this field. + * @param \Google\Cloud\Firestore\Admin\V1\Index $index Required. The composite index to create. + * + * @return \Google\Cloud\Firestore\Admin\V1\CreateIndexRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Firestore\Admin\V1\Index $index): self + { + return (new self()) + ->setParent($parent) + ->setIndex($index); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * @type \Google\Cloud\Firestore\Admin\V1\Index $index + * Required. The composite index to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The composite index to create. + * + * Generated from protobuf field .google.firestore.admin.v1.Index index = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Firestore\Admin\V1\Index|null + */ + public function getIndex() + { + return $this->index; + } + + public function hasIndex() + { + return isset($this->index); + } + + public function clearIndex() + { + unset($this->index); + } + + /** + * Required. The composite index to create. + * + * Generated from protobuf field .google.firestore.admin.v1.Index index = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Firestore\Admin\V1\Index $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Index::class); + $this->index = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database.php new file mode 100644 index 000000000000..07826f071ff8 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database.php @@ -0,0 +1,657 @@ +google.firestore.admin.v1.Database + */ +class Database extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the Database. + * Format: `projects/{project}/databases/{database}` + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Output only. The system-generated UUID4 for this Database. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. The timestamp at which this database was created. Databases + * created before 2016 do not populate create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp at which this database was most recently + * updated. Note this only includes updates to the database resource and not + * data contained by the database. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * The location of the database. Available locations are listed at + * https://cloud.google.com/firestore/docs/locations. + * + * Generated from protobuf field string location_id = 9; + */ + protected $location_id = ''; + /** + * The type of the database. + * See https://cloud.google.com/datastore/docs/firestore-or-datastore for + * information about how to choose. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.DatabaseType type = 10; + */ + protected $type = 0; + /** + * The concurrency control mode to use for this database. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; + */ + protected $concurrency_mode = 0; + /** + * Output only. The period during which past versions of data are retained in + * the database. + * Any [read][google.firestore.v1.GetDocumentRequest.read_time] + * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify + * a `read_time` within this window, and will read the state of the database + * at that time. + * If the PITR feature is enabled, the retention period is 7 days. Otherwise, + * the retention period is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $version_retention_period = null; + /** + * Output only. The earliest timestamp at which older versions of the data can + * be read from the database. See [version_retention_period] above; this field + * is populated with `now - version_retention_period`. + * This value is continuously updated, and becomes stale the moment it is + * queried. If you are using this value to recover data, make sure to account + * for the time from the moment when the value is queried to the moment when + * you initiate the recovery. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $earliest_version_time = null; + /** + * Whether to enable the PITR feature on this database. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; + */ + protected $point_in_time_recovery_enablement = 0; + /** + * The App Engine integration mode to use for this database. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.AppEngineIntegrationMode app_engine_integration_mode = 19; + */ + protected $app_engine_integration_mode = 0; + /** + * Output only. The key_prefix for this database. This key_prefix is used, in + * combination with the project id ("~") to construct + * the application id that is returned from the Cloud Datastore APIs in Google + * App Engine first generation runtimes. + * This value may be empty in which case the appid to use for URL-encoded keys + * is the project_id (eg: foo instead of v~foo). + * + * Generated from protobuf field string key_prefix = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $key_prefix = ''; + /** + * State of delete protection for the database. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; + */ + protected $delete_protection_state = 0; + /** + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 99; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the Database. + * Format: `projects/{project}/databases/{database}` + * @type string $uid + * Output only. The system-generated UUID4 for this Database. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp at which this database was created. Databases + * created before 2016 do not populate create_time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp at which this database was most recently + * updated. Note this only includes updates to the database resource and not + * data contained by the database. + * @type string $location_id + * The location of the database. Available locations are listed at + * https://cloud.google.com/firestore/docs/locations. + * @type int $type + * The type of the database. + * See https://cloud.google.com/datastore/docs/firestore-or-datastore for + * information about how to choose. + * @type int $concurrency_mode + * The concurrency control mode to use for this database. + * @type \Google\Protobuf\Duration $version_retention_period + * Output only. The period during which past versions of data are retained in + * the database. + * Any [read][google.firestore.v1.GetDocumentRequest.read_time] + * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify + * a `read_time` within this window, and will read the state of the database + * at that time. + * If the PITR feature is enabled, the retention period is 7 days. Otherwise, + * the retention period is 1 hour. + * @type \Google\Protobuf\Timestamp $earliest_version_time + * Output only. The earliest timestamp at which older versions of the data can + * be read from the database. See [version_retention_period] above; this field + * is populated with `now - version_retention_period`. + * This value is continuously updated, and becomes stale the moment it is + * queried. If you are using this value to recover data, make sure to account + * for the time from the moment when the value is queried to the moment when + * you initiate the recovery. + * @type int $point_in_time_recovery_enablement + * Whether to enable the PITR feature on this database. + * @type int $app_engine_integration_mode + * The App Engine integration mode to use for this database. + * @type string $key_prefix + * Output only. The key_prefix for this database. This key_prefix is used, in + * combination with the project id ("~") to construct + * the application id that is returned from the Cloud Datastore APIs in Google + * App Engine first generation runtimes. + * This value may be empty in which case the appid to use for URL-encoded keys + * is the project_id (eg: foo instead of v~foo). + * @type int $delete_protection_state + * State of delete protection for the database. + * @type string $etag + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Database::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the Database. + * Format: `projects/{project}/databases/{database}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the Database. + * Format: `projects/{project}/databases/{database}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The system-generated UUID4 for this Database. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. The system-generated UUID4 for this Database. + * + * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. The timestamp at which this database was created. Databases + * created before 2016 do not populate create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The timestamp at which this database was created. Databases + * created before 2016 do not populate create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The timestamp at which this database was most recently + * updated. Note this only includes updates to the database resource and not + * data contained by the database. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp at which this database was most recently + * updated. Note this only includes updates to the database resource and not + * data contained by the database. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * The location of the database. Available locations are listed at + * https://cloud.google.com/firestore/docs/locations. + * + * Generated from protobuf field string location_id = 9; + * @return string + */ + public function getLocationId() + { + return $this->location_id; + } + + /** + * The location of the database. Available locations are listed at + * https://cloud.google.com/firestore/docs/locations. + * + * Generated from protobuf field string location_id = 9; + * @param string $var + * @return $this + */ + public function setLocationId($var) + { + GPBUtil::checkString($var, True); + $this->location_id = $var; + + return $this; + } + + /** + * The type of the database. + * See https://cloud.google.com/datastore/docs/firestore-or-datastore for + * information about how to choose. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.DatabaseType type = 10; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * The type of the database. + * See https://cloud.google.com/datastore/docs/firestore-or-datastore for + * information about how to choose. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.DatabaseType type = 10; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Database\DatabaseType::class); + $this->type = $var; + + return $this; + } + + /** + * The concurrency control mode to use for this database. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; + * @return int + */ + public function getConcurrencyMode() + { + return $this->concurrency_mode; + } + + /** + * The concurrency control mode to use for this database. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; + * @param int $var + * @return $this + */ + public function setConcurrencyMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Database\ConcurrencyMode::class); + $this->concurrency_mode = $var; + + return $this; + } + + /** + * Output only. The period during which past versions of data are retained in + * the database. + * Any [read][google.firestore.v1.GetDocumentRequest.read_time] + * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify + * a `read_time` within this window, and will read the state of the database + * at that time. + * If the PITR feature is enabled, the retention period is 7 days. Otherwise, + * the retention period is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Duration|null + */ + public function getVersionRetentionPeriod() + { + return $this->version_retention_period; + } + + public function hasVersionRetentionPeriod() + { + return isset($this->version_retention_period); + } + + public function clearVersionRetentionPeriod() + { + unset($this->version_retention_period); + } + + /** + * Output only. The period during which past versions of data are retained in + * the database. + * Any [read][google.firestore.v1.GetDocumentRequest.read_time] + * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify + * a `read_time` within this window, and will read the state of the database + * at that time. + * If the PITR feature is enabled, the retention period is 7 days. Otherwise, + * the retention period is 1 hour. + * + * Generated from protobuf field .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setVersionRetentionPeriod($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->version_retention_period = $var; + + return $this; + } + + /** + * Output only. The earliest timestamp at which older versions of the data can + * be read from the database. See [version_retention_period] above; this field + * is populated with `now - version_retention_period`. + * This value is continuously updated, and becomes stale the moment it is + * queried. If you are using this value to recover data, make sure to account + * for the time from the moment when the value is queried to the moment when + * you initiate the recovery. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEarliestVersionTime() + { + return $this->earliest_version_time; + } + + public function hasEarliestVersionTime() + { + return isset($this->earliest_version_time); + } + + public function clearEarliestVersionTime() + { + unset($this->earliest_version_time); + } + + /** + * Output only. The earliest timestamp at which older versions of the data can + * be read from the database. See [version_retention_period] above; this field + * is populated with `now - version_retention_period`. + * This value is continuously updated, and becomes stale the moment it is + * queried. If you are using this value to recover data, make sure to account + * for the time from the moment when the value is queried to the moment when + * you initiate the recovery. + * + * Generated from protobuf field .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEarliestVersionTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->earliest_version_time = $var; + + return $this; + } + + /** + * Whether to enable the PITR feature on this database. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; + * @return int + */ + public function getPointInTimeRecoveryEnablement() + { + return $this->point_in_time_recovery_enablement; + } + + /** + * Whether to enable the PITR feature on this database. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; + * @param int $var + * @return $this + */ + public function setPointInTimeRecoveryEnablement($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Database\PointInTimeRecoveryEnablement::class); + $this->point_in_time_recovery_enablement = $var; + + return $this; + } + + /** + * The App Engine integration mode to use for this database. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.AppEngineIntegrationMode app_engine_integration_mode = 19; + * @return int + */ + public function getAppEngineIntegrationMode() + { + return $this->app_engine_integration_mode; + } + + /** + * The App Engine integration mode to use for this database. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.AppEngineIntegrationMode app_engine_integration_mode = 19; + * @param int $var + * @return $this + */ + public function setAppEngineIntegrationMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Database\AppEngineIntegrationMode::class); + $this->app_engine_integration_mode = $var; + + return $this; + } + + /** + * Output only. The key_prefix for this database. This key_prefix is used, in + * combination with the project id ("~") to construct + * the application id that is returned from the Cloud Datastore APIs in Google + * App Engine first generation runtimes. + * This value may be empty in which case the appid to use for URL-encoded keys + * is the project_id (eg: foo instead of v~foo). + * + * Generated from protobuf field string key_prefix = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getKeyPrefix() + { + return $this->key_prefix; + } + + /** + * Output only. The key_prefix for this database. This key_prefix is used, in + * combination with the project id ("~") to construct + * the application id that is returned from the Cloud Datastore APIs in Google + * App Engine first generation runtimes. + * This value may be empty in which case the appid to use for URL-encoded keys + * is the project_id (eg: foo instead of v~foo). + * + * Generated from protobuf field string key_prefix = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setKeyPrefix($var) + { + GPBUtil::checkString($var, True); + $this->key_prefix = $var; + + return $this; + } + + /** + * State of delete protection for the database. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; + * @return int + */ + public function getDeleteProtectionState() + { + return $this->delete_protection_state; + } + + /** + * State of delete protection for the database. + * + * Generated from protobuf field .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; + * @param int $var + * @return $this + */ + public function setDeleteProtectionState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Database\DeleteProtectionState::class); + $this->delete_protection_state = $var; + + return $this; + } + + /** + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 99; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 99; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/AppEngineIntegrationMode.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/AppEngineIntegrationMode.php new file mode 100644 index 000000000000..2a871f5971f6 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/AppEngineIntegrationMode.php @@ -0,0 +1,69 @@ +google.firestore.admin.v1.Database.AppEngineIntegrationMode + */ +class AppEngineIntegrationMode +{ + /** + * Not used. + * + * Generated from protobuf enum APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED = 0; + */ + const APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED = 0; + /** + * If an App Engine application exists in the same region as this database, + * App Engine configuration will impact this database. This includes + * disabling of the application & database, as well as disabling writes to + * the database. + * + * Generated from protobuf enum ENABLED = 1; + */ + const ENABLED = 1; + /** + * App Engine has no effect on the ability of this database to serve + * requests. + * This is the default setting for databases created with the Firestore API. + * + * Generated from protobuf enum DISABLED = 2; + */ + const DISABLED = 2; + + private static $valueToName = [ + self::APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED => 'APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED', + self::ENABLED => 'ENABLED', + self::DISABLED => 'DISABLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AppEngineIntegrationMode::class, \Google\Cloud\Firestore\Admin\V1\Database_AppEngineIntegrationMode::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/ConcurrencyMode.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/ConcurrencyMode.php new file mode 100644 index 000000000000..2e88fde688f8 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/ConcurrencyMode.php @@ -0,0 +1,77 @@ +google.firestore.admin.v1.Database.ConcurrencyMode + */ +class ConcurrencyMode +{ + /** + * Not used. + * + * Generated from protobuf enum CONCURRENCY_MODE_UNSPECIFIED = 0; + */ + const CONCURRENCY_MODE_UNSPECIFIED = 0; + /** + * Use optimistic concurrency control by default. This mode is available + * for Cloud Firestore databases. + * + * Generated from protobuf enum OPTIMISTIC = 1; + */ + const OPTIMISTIC = 1; + /** + * Use pessimistic concurrency control by default. This mode is available + * for Cloud Firestore databases. + * This is the default setting for Cloud Firestore. + * + * Generated from protobuf enum PESSIMISTIC = 2; + */ + const PESSIMISTIC = 2; + /** + * Use optimistic concurrency control with entity groups by default. + * This is the only available mode for Cloud Datastore. + * This mode is also available for Cloud Firestore with Datastore Mode but + * is not recommended. + * + * Generated from protobuf enum OPTIMISTIC_WITH_ENTITY_GROUPS = 3; + */ + const OPTIMISTIC_WITH_ENTITY_GROUPS = 3; + + private static $valueToName = [ + self::CONCURRENCY_MODE_UNSPECIFIED => 'CONCURRENCY_MODE_UNSPECIFIED', + self::OPTIMISTIC => 'OPTIMISTIC', + self::PESSIMISTIC => 'PESSIMISTIC', + self::OPTIMISTIC_WITH_ENTITY_GROUPS => 'OPTIMISTIC_WITH_ENTITY_GROUPS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConcurrencyMode::class, \Google\Cloud\Firestore\Admin\V1\Database_ConcurrencyMode::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DatabaseType.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DatabaseType.php new file mode 100644 index 000000000000..18bfd4d8e662 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DatabaseType.php @@ -0,0 +1,67 @@ +google.firestore.admin.v1.Database.DatabaseType + */ +class DatabaseType +{ + /** + * The default value. This value is used if the database type is omitted. + * + * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; + */ + const DATABASE_TYPE_UNSPECIFIED = 0; + /** + * Firestore Native Mode + * + * Generated from protobuf enum FIRESTORE_NATIVE = 1; + */ + const FIRESTORE_NATIVE = 1; + /** + * Firestore in Datastore Mode. + * + * Generated from protobuf enum DATASTORE_MODE = 2; + */ + const DATASTORE_MODE = 2; + + private static $valueToName = [ + self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', + self::FIRESTORE_NATIVE => 'FIRESTORE_NATIVE', + self::DATASTORE_MODE => 'DATASTORE_MODE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DatabaseType::class, \Google\Cloud\Firestore\Admin\V1\Database_DatabaseType::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DeleteProtectionState.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DeleteProtectionState.php new file mode 100644 index 000000000000..34ade3e23333 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DeleteProtectionState.php @@ -0,0 +1,64 @@ +google.firestore.admin.v1.Database.DeleteProtectionState + */ +class DeleteProtectionState +{ + /** + * The default value. Delete protection type is not specified + * + * Generated from protobuf enum DELETE_PROTECTION_STATE_UNSPECIFIED = 0; + */ + const DELETE_PROTECTION_STATE_UNSPECIFIED = 0; + /** + * Delete protection is disabled + * + * Generated from protobuf enum DELETE_PROTECTION_DISABLED = 1; + */ + const DELETE_PROTECTION_DISABLED = 1; + /** + * Delete protection is enabled + * + * Generated from protobuf enum DELETE_PROTECTION_ENABLED = 2; + */ + const DELETE_PROTECTION_ENABLED = 2; + + private static $valueToName = [ + self::DELETE_PROTECTION_STATE_UNSPECIFIED => 'DELETE_PROTECTION_STATE_UNSPECIFIED', + self::DELETE_PROTECTION_DISABLED => 'DELETE_PROTECTION_DISABLED', + self::DELETE_PROTECTION_ENABLED => 'DELETE_PROTECTION_ENABLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DeleteProtectionState::class, \Google\Cloud\Firestore\Admin\V1\Database_DeleteProtectionState::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/PointInTimeRecoveryEnablement.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/PointInTimeRecoveryEnablement.php new file mode 100644 index 000000000000..14a69b79b174 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/PointInTimeRecoveryEnablement.php @@ -0,0 +1,70 @@ +google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement + */ +class PointInTimeRecoveryEnablement +{ + /** + * Not used. + * + * Generated from protobuf enum POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED = 0; + */ + const POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED = 0; + /** + * Reads are supported on selected versions of the data from within the past + * 7 days: + * * Reads against any timestamp within the past hour + * * Reads against 1-minute snapshots beyond 1 hour and within 7 days + * `version_retention_period` and `earliest_version_time` can be + * used to determine the supported versions. + * + * Generated from protobuf enum POINT_IN_TIME_RECOVERY_ENABLED = 1; + */ + const POINT_IN_TIME_RECOVERY_ENABLED = 1; + /** + * Reads are supported on any version of the data from within the past 1 + * hour. + * + * Generated from protobuf enum POINT_IN_TIME_RECOVERY_DISABLED = 2; + */ + const POINT_IN_TIME_RECOVERY_DISABLED = 2; + + private static $valueToName = [ + self::POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED => 'POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED', + self::POINT_IN_TIME_RECOVERY_ENABLED => 'POINT_IN_TIME_RECOVERY_ENABLED', + self::POINT_IN_TIME_RECOVERY_DISABLED => 'POINT_IN_TIME_RECOVERY_DISABLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PointInTimeRecoveryEnablement::class, \Google\Cloud\Firestore\Admin\V1\Database_PointInTimeRecoveryEnablement::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseMetadata.php new file mode 100644 index 000000000000..c411410ff5b5 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseMetadata.php @@ -0,0 +1,33 @@ +google.firestore.admin.v1.DeleteDatabaseMetadata + */ +class DeleteDatabaseMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseRequest.php new file mode 100644 index 000000000000..5118ae7c1271 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseRequest.php @@ -0,0 +1,129 @@ +google.firestore.admin.v1.DeleteDatabaseRequest + */ +class DeleteDatabaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * The current etag of the Database. + * If an etag is provided and does not match the current etag of the database, + * deletion will be blocked and a FAILED_PRECONDITION error will be returned. + * + * Generated from protobuf field string etag = 3; + */ + protected $etag = ''; + + /** + * @param string $name Required. A name of the form + * `projects/{project_id}/databases/{database_id}` + * Please see {@see FirestoreAdminClient::databaseName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\DeleteDatabaseRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}` + * @type string $etag + * The current etag of the Database. + * If an etag is provided and does not match the current etag of the database, + * deletion will be blocked and a FAILED_PRECONDITION error will be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The current etag of the Database. + * If an etag is provided and does not match the current etag of the database, + * deletion will be blocked and a FAILED_PRECONDITION error will be returned. + * + * Generated from protobuf field string etag = 3; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * The current etag of the Database. + * If an etag is provided and does not match the current etag of the database, + * deletion will be blocked and a FAILED_PRECONDITION error will be returned. + * + * Generated from protobuf field string etag = 3; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteIndexRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteIndexRequest.php new file mode 100644 index 000000000000..0ff8c174cfd6 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteIndexRequest.php @@ -0,0 +1,87 @@ +google.firestore.admin.v1.DeleteIndexRequest + */ +class DeleteIndexRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * Please see {@see FirestoreAdminClient::indexName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\DeleteIndexRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsMetadata.php new file mode 100644 index 000000000000..480f1e8ffea5 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsMetadata.php @@ -0,0 +1,403 @@ +google.firestore.admin.v1.ExportDocumentsMetadata + */ +class ExportDocumentsMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * The state of the export operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; + */ + protected $operation_state = 0; + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; + */ + protected $progress_documents = null; + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + protected $progress_bytes = null; + /** + * Which collection ids are being exported. + * + * Generated from protobuf field repeated string collection_ids = 6; + */ + private $collection_ids; + /** + * Where the documents are being exported to. + * + * Generated from protobuf field string output_uri_prefix = 7; + */ + protected $output_uri_prefix = ''; + /** + * Which namespace ids are being exported. + * + * Generated from protobuf field repeated string namespace_ids = 8; + */ + private $namespace_ids; + /** + * The timestamp that corresponds to the version of the database that is being + * exported. If unspecified, there are no guarantees about the consistency of + * the documents being exported. + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 9; + */ + protected $snapshot_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * The time this operation started. + * @type \Google\Protobuf\Timestamp $end_time + * The time this operation completed. Will be unset if operation still in + * progress. + * @type int $operation_state + * The state of the export operation. + * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_documents + * The progress, in documents, of this operation. + * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_bytes + * The progress, in bytes, of this operation. + * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids + * Which collection ids are being exported. + * @type string $output_uri_prefix + * Where the documents are being exported to. + * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids + * Which namespace ids are being exported. + * @type \Google\Protobuf\Timestamp $snapshot_time + * The timestamp that corresponds to the version of the database that is being + * exported. If unspecified, there are no guarantees about the consistency of + * the documents being exported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); + parent::__construct($data); + } + + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * The state of the export operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; + * @return int + */ + public function getOperationState() + { + return $this->operation_state; + } + + /** + * The state of the export operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; + * @param int $var + * @return $this + */ + public function setOperationState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\OperationState::class); + $this->operation_state = $var; + + return $this; + } + + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; + * @return \Google\Cloud\Firestore\Admin\V1\Progress|null + */ + public function getProgressDocuments() + { + return $this->progress_documents; + } + + public function hasProgressDocuments() + { + return isset($this->progress_documents); + } + + public function clearProgressDocuments() + { + unset($this->progress_documents); + } + + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; + * @param \Google\Cloud\Firestore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressDocuments($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); + $this->progress_documents = $var; + + return $this; + } + + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; + * @return \Google\Cloud\Firestore\Admin\V1\Progress|null + */ + public function getProgressBytes() + { + return $this->progress_bytes; + } + + public function hasProgressBytes() + { + return isset($this->progress_bytes); + } + + public function clearProgressBytes() + { + unset($this->progress_bytes); + } + + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; + * @param \Google\Cloud\Firestore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressBytes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); + $this->progress_bytes = $var; + + return $this; + } + + /** + * Which collection ids are being exported. + * + * Generated from protobuf field repeated string collection_ids = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCollectionIds() + { + return $this->collection_ids; + } + + /** + * Which collection ids are being exported. + * + * Generated from protobuf field repeated string collection_ids = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCollectionIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->collection_ids = $arr; + + return $this; + } + + /** + * Where the documents are being exported to. + * + * Generated from protobuf field string output_uri_prefix = 7; + * @return string + */ + public function getOutputUriPrefix() + { + return $this->output_uri_prefix; + } + + /** + * Where the documents are being exported to. + * + * Generated from protobuf field string output_uri_prefix = 7; + * @param string $var + * @return $this + */ + public function setOutputUriPrefix($var) + { + GPBUtil::checkString($var, True); + $this->output_uri_prefix = $var; + + return $this; + } + + /** + * Which namespace ids are being exported. + * + * Generated from protobuf field repeated string namespace_ids = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamespaceIds() + { + return $this->namespace_ids; + } + + /** + * Which namespace ids are being exported. + * + * Generated from protobuf field repeated string namespace_ids = 8; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamespaceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->namespace_ids = $arr; + + return $this; + } + + /** + * The timestamp that corresponds to the version of the database that is being + * exported. If unspecified, there are no guarantees about the consistency of + * the documents being exported. + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 9; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSnapshotTime() + { + return $this->snapshot_time; + } + + public function hasSnapshotTime() + { + return isset($this->snapshot_time); + } + + public function clearSnapshotTime() + { + unset($this->snapshot_time); + } + + /** + * The timestamp that corresponds to the version of the database that is being + * exported. If unspecified, there are no guarantees about the consistency of + * the documents being exported. + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 9; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSnapshotTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->snapshot_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsRequest.php new file mode 100644 index 000000000000..e5024b86ac8d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsRequest.php @@ -0,0 +1,301 @@ +google.firestore.admin.v1.ExportDocumentsRequest + */ +class ExportDocumentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Database to export. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Which collection ids to export. Unspecified means all collections. + * + * Generated from protobuf field repeated string collection_ids = 2; + */ + private $collection_ids; + /** + * The output URI. Currently only supports Google Cloud Storage URIs of the + * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name + * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional + * Google Cloud Storage namespace path. When + * choosing a name, be sure to consider Google Cloud Storage naming + * guidelines: https://cloud.google.com/storage/docs/naming. + * If the URI is a bucket (without a namespace path), a prefix will be + * generated based on the start time. + * + * Generated from protobuf field string output_uri_prefix = 3; + */ + protected $output_uri_prefix = ''; + /** + * An empty list represents all namespaces. This is the preferred + * usage for databases that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to include them. Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 4; + */ + private $namespace_ids; + /** + * The timestamp that corresponds to the version of the database to be + * exported. The timestamp must be in the past, rounded to the minute and not + * older than + * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time]. + * If specified, then the exported documents will represent a consistent view + * of the database at the provided time. Otherwise, there are no guarantees + * about the consistency of the exported documents. + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 5; + */ + protected $snapshot_time = null; + + /** + * @param string $name Required. Database to export. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. Please see + * {@see FirestoreAdminClient::databaseName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\ExportDocumentsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Database to export. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids + * Which collection ids to export. Unspecified means all collections. + * @type string $output_uri_prefix + * The output URI. Currently only supports Google Cloud Storage URIs of the + * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name + * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional + * Google Cloud Storage namespace path. When + * choosing a name, be sure to consider Google Cloud Storage naming + * guidelines: https://cloud.google.com/storage/docs/naming. + * If the URI is a bucket (without a namespace path), a prefix will be + * generated based on the start time. + * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids + * An empty list represents all namespaces. This is the preferred + * usage for databases that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to include them. Each namespace in this list must be unique. + * @type \Google\Protobuf\Timestamp $snapshot_time + * The timestamp that corresponds to the version of the database to be + * exported. The timestamp must be in the past, rounded to the minute and not + * older than + * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time]. + * If specified, then the exported documents will represent a consistent view + * of the database at the provided time. Otherwise, there are no guarantees + * about the consistency of the exported documents. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Database to export. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Database to export. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Which collection ids to export. Unspecified means all collections. + * + * Generated from protobuf field repeated string collection_ids = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCollectionIds() + { + return $this->collection_ids; + } + + /** + * Which collection ids to export. Unspecified means all collections. + * + * Generated from protobuf field repeated string collection_ids = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCollectionIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->collection_ids = $arr; + + return $this; + } + + /** + * The output URI. Currently only supports Google Cloud Storage URIs of the + * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name + * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional + * Google Cloud Storage namespace path. When + * choosing a name, be sure to consider Google Cloud Storage naming + * guidelines: https://cloud.google.com/storage/docs/naming. + * If the URI is a bucket (without a namespace path), a prefix will be + * generated based on the start time. + * + * Generated from protobuf field string output_uri_prefix = 3; + * @return string + */ + public function getOutputUriPrefix() + { + return $this->output_uri_prefix; + } + + /** + * The output URI. Currently only supports Google Cloud Storage URIs of the + * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name + * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional + * Google Cloud Storage namespace path. When + * choosing a name, be sure to consider Google Cloud Storage naming + * guidelines: https://cloud.google.com/storage/docs/naming. + * If the URI is a bucket (without a namespace path), a prefix will be + * generated based on the start time. + * + * Generated from protobuf field string output_uri_prefix = 3; + * @param string $var + * @return $this + */ + public function setOutputUriPrefix($var) + { + GPBUtil::checkString($var, True); + $this->output_uri_prefix = $var; + + return $this; + } + + /** + * An empty list represents all namespaces. This is the preferred + * usage for databases that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to include them. Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamespaceIds() + { + return $this->namespace_ids; + } + + /** + * An empty list represents all namespaces. This is the preferred + * usage for databases that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to include them. Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamespaceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->namespace_ids = $arr; + + return $this; + } + + /** + * The timestamp that corresponds to the version of the database to be + * exported. The timestamp must be in the past, rounded to the minute and not + * older than + * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time]. + * If specified, then the exported documents will represent a consistent view + * of the database at the provided time. Otherwise, there are no guarantees + * about the consistency of the exported documents. + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getSnapshotTime() + { + return $this->snapshot_time; + } + + public function hasSnapshotTime() + { + return isset($this->snapshot_time); + } + + public function clearSnapshotTime() + { + unset($this->snapshot_time); + } + + /** + * The timestamp that corresponds to the version of the database to be + * exported. The timestamp must be in the past, rounded to the minute and not + * older than + * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time]. + * If specified, then the exported documents will represent a consistent view + * of the database at the provided time. Otherwise, there are no guarantees + * about the consistency of the exported documents. + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSnapshotTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->snapshot_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsResponse.php new file mode 100644 index 000000000000..98d2d38246b1 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsResponse.php @@ -0,0 +1,76 @@ +google.firestore.admin.v1.ExportDocumentsResponse + */ +class ExportDocumentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Location of the output files. This can be used to begin an import + * into Cloud Firestore (this project or another project) after the operation + * completes successfully. + * + * Generated from protobuf field string output_uri_prefix = 1; + */ + protected $output_uri_prefix = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $output_uri_prefix + * Location of the output files. This can be used to begin an import + * into Cloud Firestore (this project or another project) after the operation + * completes successfully. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); + parent::__construct($data); + } + + /** + * Location of the output files. This can be used to begin an import + * into Cloud Firestore (this project or another project) after the operation + * completes successfully. + * + * Generated from protobuf field string output_uri_prefix = 1; + * @return string + */ + public function getOutputUriPrefix() + { + return $this->output_uri_prefix; + } + + /** + * Location of the output files. This can be used to begin an import + * into Cloud Firestore (this project or another project) after the operation + * completes successfully. + * + * Generated from protobuf field string output_uri_prefix = 1; + * @param string $var + * @return $this + */ + public function setOutputUriPrefix($var) + { + GPBUtil::checkString($var, True); + $this->output_uri_prefix = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field.php new file mode 100644 index 000000000000..3443f452678d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field.php @@ -0,0 +1,261 @@ +google.firestore.admin.v1.Field + */ +class Field extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A field name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + * A field path may be a simple field name, e.g. `address` or a path to fields + * within map_value , e.g. `address.city`, + * or a special field path. The only valid special field is `*`, which + * represents any field. + * Field paths may be quoted using ` (backtick). The only character that needs + * to be escaped within a quoted field path is the backtick character itself, + * escaped using a backslash. Special characters in field paths that + * must be quoted include: `*`, `.`, + * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. + * Examples: + * (Note: Comments here are written in markdown syntax, so there is an + * additional layer of backticks to represent a code block) + * `\`address.city\`` represents a field named `address.city`, not the map key + * `city` in the field `address`. + * `\`*\`` represents a field named `*`, not any field. + * A special `Field` contains the default indexing settings for all fields. + * This field's resource name is: + * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` + * Indexes defined on this `Field` will be applied to all fields which do not + * have their own `Field` index configuration. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * The index configuration for this field. If unset, field indexing will + * revert to the configuration defined by the `ancestor_field`. To + * explicitly remove all indexes for this field, specify an index config + * with an empty list of indexes. + * + * Generated from protobuf field .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + */ + protected $index_config = null; + /** + * The TTL configuration for this `Field`. + * Setting or unsetting this will enable or disable the TTL for + * documents that have this `Field`. + * + * Generated from protobuf field .google.firestore.admin.v1.Field.TtlConfig ttl_config = 3; + */ + protected $ttl_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A field name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + * A field path may be a simple field name, e.g. `address` or a path to fields + * within map_value , e.g. `address.city`, + * or a special field path. The only valid special field is `*`, which + * represents any field. + * Field paths may be quoted using ` (backtick). The only character that needs + * to be escaped within a quoted field path is the backtick character itself, + * escaped using a backslash. Special characters in field paths that + * must be quoted include: `*`, `.`, + * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. + * Examples: + * (Note: Comments here are written in markdown syntax, so there is an + * additional layer of backticks to represent a code block) + * `\`address.city\`` represents a field named `address.city`, not the map key + * `city` in the field `address`. + * `\`*\`` represents a field named `*`, not any field. + * A special `Field` contains the default indexing settings for all fields. + * This field's resource name is: + * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` + * Indexes defined on this `Field` will be applied to all fields which do not + * have their own `Field` index configuration. + * @type \Google\Cloud\Firestore\Admin\V1\Field\IndexConfig $index_config + * The index configuration for this field. If unset, field indexing will + * revert to the configuration defined by the `ancestor_field`. To + * explicitly remove all indexes for this field, specify an index config + * with an empty list of indexes. + * @type \Google\Cloud\Firestore\Admin\V1\Field\TtlConfig $ttl_config + * The TTL configuration for this `Field`. + * Setting or unsetting this will enable or disable the TTL for + * documents that have this `Field`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Field::initOnce(); + parent::__construct($data); + } + + /** + * Required. A field name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + * A field path may be a simple field name, e.g. `address` or a path to fields + * within map_value , e.g. `address.city`, + * or a special field path. The only valid special field is `*`, which + * represents any field. + * Field paths may be quoted using ` (backtick). The only character that needs + * to be escaped within a quoted field path is the backtick character itself, + * escaped using a backslash. Special characters in field paths that + * must be quoted include: `*`, `.`, + * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. + * Examples: + * (Note: Comments here are written in markdown syntax, so there is an + * additional layer of backticks to represent a code block) + * `\`address.city\`` represents a field named `address.city`, not the map key + * `city` in the field `address`. + * `\`*\`` represents a field named `*`, not any field. + * A special `Field` contains the default indexing settings for all fields. + * This field's resource name is: + * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` + * Indexes defined on this `Field` will be applied to all fields which do not + * have their own `Field` index configuration. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A field name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + * A field path may be a simple field name, e.g. `address` or a path to fields + * within map_value , e.g. `address.city`, + * or a special field path. The only valid special field is `*`, which + * represents any field. + * Field paths may be quoted using ` (backtick). The only character that needs + * to be escaped within a quoted field path is the backtick character itself, + * escaped using a backslash. Special characters in field paths that + * must be quoted include: `*`, `.`, + * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. + * Examples: + * (Note: Comments here are written in markdown syntax, so there is an + * additional layer of backticks to represent a code block) + * `\`address.city\`` represents a field named `address.city`, not the map key + * `city` in the field `address`. + * `\`*\`` represents a field named `*`, not any field. + * A special `Field` contains the default indexing settings for all fields. + * This field's resource name is: + * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` + * Indexes defined on this `Field` will be applied to all fields which do not + * have their own `Field` index configuration. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The index configuration for this field. If unset, field indexing will + * revert to the configuration defined by the `ancestor_field`. To + * explicitly remove all indexes for this field, specify an index config + * with an empty list of indexes. + * + * Generated from protobuf field .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + * @return \Google\Cloud\Firestore\Admin\V1\Field\IndexConfig|null + */ + public function getIndexConfig() + { + return $this->index_config; + } + + public function hasIndexConfig() + { + return isset($this->index_config); + } + + public function clearIndexConfig() + { + unset($this->index_config); + } + + /** + * The index configuration for this field. If unset, field indexing will + * revert to the configuration defined by the `ancestor_field`. To + * explicitly remove all indexes for this field, specify an index config + * with an empty list of indexes. + * + * Generated from protobuf field .google.firestore.admin.v1.Field.IndexConfig index_config = 2; + * @param \Google\Cloud\Firestore\Admin\V1\Field\IndexConfig $var + * @return $this + */ + public function setIndexConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Field\IndexConfig::class); + $this->index_config = $var; + + return $this; + } + + /** + * The TTL configuration for this `Field`. + * Setting or unsetting this will enable or disable the TTL for + * documents that have this `Field`. + * + * Generated from protobuf field .google.firestore.admin.v1.Field.TtlConfig ttl_config = 3; + * @return \Google\Cloud\Firestore\Admin\V1\Field\TtlConfig|null + */ + public function getTtlConfig() + { + return $this->ttl_config; + } + + public function hasTtlConfig() + { + return isset($this->ttl_config); + } + + public function clearTtlConfig() + { + unset($this->ttl_config); + } + + /** + * The TTL configuration for this `Field`. + * Setting or unsetting this will enable or disable the TTL for + * documents that have this `Field`. + * + * Generated from protobuf field .google.firestore.admin.v1.Field.TtlConfig ttl_config = 3; + * @param \Google\Cloud\Firestore\Admin\V1\Field\TtlConfig $var + * @return $this + */ + public function setTtlConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Field\TtlConfig::class); + $this->ttl_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/IndexConfig.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/IndexConfig.php new file mode 100644 index 000000000000..08601827331f --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/IndexConfig.php @@ -0,0 +1,208 @@ +google.firestore.admin.v1.Field.IndexConfig + */ +class IndexConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The indexes supported for this field. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Index indexes = 1; + */ + private $indexes; + /** + * Output only. When true, the `Field`'s index configuration is set from the + * configuration specified by the `ancestor_field`. + * When false, the `Field`'s index configuration is defined explicitly. + * + * Generated from protobuf field bool uses_ancestor_config = 2; + */ + protected $uses_ancestor_config = false; + /** + * Output only. Specifies the resource name of the `Field` from which this field's + * index configuration is set (when `uses_ancestor_config` is true), + * or from which it *would* be set if this field had no index configuration + * (when `uses_ancestor_config` is false). + * + * Generated from protobuf field string ancestor_field = 3; + */ + protected $ancestor_field = ''; + /** + * Output only + * When true, the `Field`'s index configuration is in the process of being + * reverted. Once complete, the index config will transition to the same + * state as the field specified by `ancestor_field`, at which point + * `uses_ancestor_config` will be `true` and `reverting` will be `false`. + * + * Generated from protobuf field bool reverting = 4; + */ + protected $reverting = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Firestore\Admin\V1\Index>|\Google\Protobuf\Internal\RepeatedField $indexes + * The indexes supported for this field. + * @type bool $uses_ancestor_config + * Output only. When true, the `Field`'s index configuration is set from the + * configuration specified by the `ancestor_field`. + * When false, the `Field`'s index configuration is defined explicitly. + * @type string $ancestor_field + * Output only. Specifies the resource name of the `Field` from which this field's + * index configuration is set (when `uses_ancestor_config` is true), + * or from which it *would* be set if this field had no index configuration + * (when `uses_ancestor_config` is false). + * @type bool $reverting + * Output only + * When true, the `Field`'s index configuration is in the process of being + * reverted. Once complete, the index config will transition to the same + * state as the field specified by `ancestor_field`, at which point + * `uses_ancestor_config` will be `true` and `reverting` will be `false`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Field::initOnce(); + parent::__construct($data); + } + + /** + * The indexes supported for this field. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Index indexes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIndexes() + { + return $this->indexes; + } + + /** + * The indexes supported for this field. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Index indexes = 1; + * @param array<\Google\Cloud\Firestore\Admin\V1\Index>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIndexes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\Index::class); + $this->indexes = $arr; + + return $this; + } + + /** + * Output only. When true, the `Field`'s index configuration is set from the + * configuration specified by the `ancestor_field`. + * When false, the `Field`'s index configuration is defined explicitly. + * + * Generated from protobuf field bool uses_ancestor_config = 2; + * @return bool + */ + public function getUsesAncestorConfig() + { + return $this->uses_ancestor_config; + } + + /** + * Output only. When true, the `Field`'s index configuration is set from the + * configuration specified by the `ancestor_field`. + * When false, the `Field`'s index configuration is defined explicitly. + * + * Generated from protobuf field bool uses_ancestor_config = 2; + * @param bool $var + * @return $this + */ + public function setUsesAncestorConfig($var) + { + GPBUtil::checkBool($var); + $this->uses_ancestor_config = $var; + + return $this; + } + + /** + * Output only. Specifies the resource name of the `Field` from which this field's + * index configuration is set (when `uses_ancestor_config` is true), + * or from which it *would* be set if this field had no index configuration + * (when `uses_ancestor_config` is false). + * + * Generated from protobuf field string ancestor_field = 3; + * @return string + */ + public function getAncestorField() + { + return $this->ancestor_field; + } + + /** + * Output only. Specifies the resource name of the `Field` from which this field's + * index configuration is set (when `uses_ancestor_config` is true), + * or from which it *would* be set if this field had no index configuration + * (when `uses_ancestor_config` is false). + * + * Generated from protobuf field string ancestor_field = 3; + * @param string $var + * @return $this + */ + public function setAncestorField($var) + { + GPBUtil::checkString($var, True); + $this->ancestor_field = $var; + + return $this; + } + + /** + * Output only + * When true, the `Field`'s index configuration is in the process of being + * reverted. Once complete, the index config will transition to the same + * state as the field specified by `ancestor_field`, at which point + * `uses_ancestor_config` will be `true` and `reverting` will be `false`. + * + * Generated from protobuf field bool reverting = 4; + * @return bool + */ + public function getReverting() + { + return $this->reverting; + } + + /** + * Output only + * When true, the `Field`'s index configuration is in the process of being + * reverted. Once complete, the index config will transition to the same + * state as the field specified by `ancestor_field`, at which point + * `uses_ancestor_config` will be `true` and `reverting` will be `false`. + * + * Generated from protobuf field bool reverting = 4; + * @param bool $var + * @return $this + */ + public function setReverting($var) + { + GPBUtil::checkBool($var); + $this->reverting = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IndexConfig::class, \Google\Cloud\Firestore\Admin\V1\Field_IndexConfig::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig.php new file mode 100644 index 000000000000..ba50384a783f --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig.php @@ -0,0 +1,74 @@ +google.firestore.admin.v1.Field.TtlConfig + */ +class TtlConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The state of the TTL configuration. + * + * Generated from protobuf field .google.firestore.admin.v1.Field.TtlConfig.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Output only. The state of the TTL configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Field::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The state of the TTL configuration. + * + * Generated from protobuf field .google.firestore.admin.v1.Field.TtlConfig.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of the TTL configuration. + * + * Generated from protobuf field .google.firestore.admin.v1.Field.TtlConfig.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Field\TtlConfig\State::class); + $this->state = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TtlConfig::class, \Google\Cloud\Firestore\Admin\V1\Field_TtlConfig::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig/State.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig/State.php new file mode 100644 index 000000000000..7722ca6e7e0a --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig/State.php @@ -0,0 +1,78 @@ +google.firestore.admin.v1.Field.TtlConfig.State + */ +class State +{ + /** + * The state is unspecified or unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The TTL is being applied. There is an active long-running operation to + * track the change. Newly written documents will have TTLs applied as + * requested. Requested TTLs on existing documents are still being + * processed. When TTLs on all existing documents have been processed, the + * state will move to 'ACTIVE'. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The TTL is active for all documents. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The TTL configuration could not be enabled for all existing documents. + * Newly written documents will continue to have their TTL applied. + * The LRO returned when last attempting to enable TTL for this `Field` + * has failed, and may have more details. + * + * Generated from protobuf enum NEEDS_REPAIR = 3; + */ + const NEEDS_REPAIR = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::ACTIVE => 'ACTIVE', + self::NEEDS_REPAIR => 'NEEDS_REPAIR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Firestore\Admin\V1\Field_TtlConfig_State::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata.php new file mode 100644 index 000000000000..1d5d2218c70e --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata.php @@ -0,0 +1,373 @@ +google.firestore.admin.v1.FieldOperationMetadata + */ +class FieldOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * The field resource that this operation is acting on. For example: + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + * + * Generated from protobuf field string field = 3; + */ + protected $field = ''; + /** + * A list of + * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], + * which describe the intent of this operation. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + */ + private $index_config_deltas; + /** + * The state of the operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState state = 5; + */ + protected $state = 0; + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 6; + */ + protected $progress_documents = null; + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 7; + */ + protected $progress_bytes = null; + /** + * Describes the deltas of TTL configuration. + * + * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta ttl_config_delta = 8; + */ + protected $ttl_config_delta = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * The time this operation started. + * @type \Google\Protobuf\Timestamp $end_time + * The time this operation completed. Will be unset if operation still in + * progress. + * @type string $field + * The field resource that this operation is acting on. For example: + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + * @type array<\Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\IndexConfigDelta>|\Google\Protobuf\Internal\RepeatedField $index_config_deltas + * A list of + * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], + * which describe the intent of this operation. + * @type int $state + * The state of the operation. + * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_documents + * The progress, in documents, of this operation. + * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_bytes + * The progress, in bytes, of this operation. + * @type \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\TtlConfigDelta $ttl_config_delta + * Describes the deltas of TTL configuration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); + parent::__construct($data); + } + + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * The field resource that this operation is acting on. For example: + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + * + * Generated from protobuf field string field = 3; + * @return string + */ + public function getField() + { + return $this->field; + } + + /** + * The field resource that this operation is acting on. For example: + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` + * + * Generated from protobuf field string field = 3; + * @param string $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkString($var, True); + $this->field = $var; + + return $this; + } + + /** + * A list of + * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], + * which describe the intent of this operation. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIndexConfigDeltas() + { + return $this->index_config_deltas; + } + + /** + * A list of + * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], + * which describe the intent of this operation. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; + * @param array<\Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\IndexConfigDelta>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIndexConfigDeltas($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\IndexConfigDelta::class); + $this->index_config_deltas = $arr; + + return $this; + } + + /** + * The state of the operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState state = 5; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of the operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState state = 5; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\OperationState::class); + $this->state = $var; + + return $this; + } + + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 6; + * @return \Google\Cloud\Firestore\Admin\V1\Progress|null + */ + public function getProgressDocuments() + { + return $this->progress_documents; + } + + public function hasProgressDocuments() + { + return isset($this->progress_documents); + } + + public function clearProgressDocuments() + { + unset($this->progress_documents); + } + + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 6; + * @param \Google\Cloud\Firestore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressDocuments($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); + $this->progress_documents = $var; + + return $this; + } + + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 7; + * @return \Google\Cloud\Firestore\Admin\V1\Progress|null + */ + public function getProgressBytes() + { + return $this->progress_bytes; + } + + public function hasProgressBytes() + { + return isset($this->progress_bytes); + } + + public function clearProgressBytes() + { + unset($this->progress_bytes); + } + + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 7; + * @param \Google\Cloud\Firestore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressBytes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); + $this->progress_bytes = $var; + + return $this; + } + + /** + * Describes the deltas of TTL configuration. + * + * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta ttl_config_delta = 8; + * @return \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\TtlConfigDelta|null + */ + public function getTtlConfigDelta() + { + return $this->ttl_config_delta; + } + + public function hasTtlConfigDelta() + { + return isset($this->ttl_config_delta); + } + + public function clearTtlConfigDelta() + { + unset($this->ttl_config_delta); + } + + /** + * Describes the deltas of TTL configuration. + * + * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta ttl_config_delta = 8; + * @param \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\TtlConfigDelta $var + * @return $this + */ + public function setTtlConfigDelta($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\TtlConfigDelta::class); + $this->ttl_config_delta = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta.php new file mode 100644 index 000000000000..1ad9e51b4401 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta.php @@ -0,0 +1,114 @@ +google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + */ +class IndexConfigDelta extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies how the index is changing. + * + * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; + */ + protected $change_type = 0; + /** + * The index being changed. + * + * Generated from protobuf field .google.firestore.admin.v1.Index index = 2; + */ + protected $index = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $change_type + * Specifies how the index is changing. + * @type \Google\Cloud\Firestore\Admin\V1\Index $index + * The index being changed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); + parent::__construct($data); + } + + /** + * Specifies how the index is changing. + * + * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; + * @return int + */ + public function getChangeType() + { + return $this->change_type; + } + + /** + * Specifies how the index is changing. + * + * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; + * @param int $var + * @return $this + */ + public function setChangeType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\IndexConfigDelta\ChangeType::class); + $this->change_type = $var; + + return $this; + } + + /** + * The index being changed. + * + * Generated from protobuf field .google.firestore.admin.v1.Index index = 2; + * @return \Google\Cloud\Firestore\Admin\V1\Index|null + */ + public function getIndex() + { + return $this->index; + } + + public function hasIndex() + { + return isset($this->index); + } + + public function clearIndex() + { + unset($this->index); + } + + /** + * The index being changed. + * + * Generated from protobuf field .google.firestore.admin.v1.Index index = 2; + * @param \Google\Cloud\Firestore\Admin\V1\Index $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Index::class); + $this->index = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IndexConfigDelta::class, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata_IndexConfigDelta::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta/ChangeType.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta/ChangeType.php new file mode 100644 index 000000000000..df7d29035371 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta/ChangeType.php @@ -0,0 +1,64 @@ +google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType + */ +class ChangeType +{ + /** + * The type of change is not specified or known. + * + * Generated from protobuf enum CHANGE_TYPE_UNSPECIFIED = 0; + */ + const CHANGE_TYPE_UNSPECIFIED = 0; + /** + * The single field index is being added. + * + * Generated from protobuf enum ADD = 1; + */ + const ADD = 1; + /** + * The single field index is being removed. + * + * Generated from protobuf enum REMOVE = 2; + */ + const REMOVE = 2; + + private static $valueToName = [ + self::CHANGE_TYPE_UNSPECIFIED => 'CHANGE_TYPE_UNSPECIFIED', + self::ADD => 'ADD', + self::REMOVE => 'REMOVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ChangeType::class, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata_IndexConfigDelta_ChangeType::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta.php new file mode 100644 index 000000000000..a9d9a6a54440 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta.php @@ -0,0 +1,70 @@ +google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta + */ +class TtlConfigDelta extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies how the TTL configuration is changing. + * + * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType change_type = 1; + */ + protected $change_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $change_type + * Specifies how the TTL configuration is changing. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); + parent::__construct($data); + } + + /** + * Specifies how the TTL configuration is changing. + * + * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType change_type = 1; + * @return int + */ + public function getChangeType() + { + return $this->change_type; + } + + /** + * Specifies how the TTL configuration is changing. + * + * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType change_type = 1; + * @param int $var + * @return $this + */ + public function setChangeType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\TtlConfigDelta\ChangeType::class); + $this->change_type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TtlConfigDelta::class, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata_TtlConfigDelta::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta/ChangeType.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta/ChangeType.php new file mode 100644 index 000000000000..600dbab57322 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta/ChangeType.php @@ -0,0 +1,64 @@ +google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType + */ +class ChangeType +{ + /** + * The type of change is not specified or known. + * + * Generated from protobuf enum CHANGE_TYPE_UNSPECIFIED = 0; + */ + const CHANGE_TYPE_UNSPECIFIED = 0; + /** + * The TTL config is being added. + * + * Generated from protobuf enum ADD = 1; + */ + const ADD = 1; + /** + * The TTL config is being removed. + * + * Generated from protobuf enum REMOVE = 2; + */ + const REMOVE = 2; + + private static $valueToName = [ + self::CHANGE_TYPE_UNSPECIFIED => 'CHANGE_TYPE_UNSPECIFIED', + self::ADD => 'ADD', + self::REMOVE => 'REMOVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ChangeType::class, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata_TtlConfigDelta_ChangeType::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetDatabaseRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetDatabaseRequest.php new file mode 100644 index 000000000000..21451d1b0a94 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetDatabaseRequest.php @@ -0,0 +1,87 @@ +google.firestore.admin.v1.GetDatabaseRequest + */ +class GetDatabaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. A name of the form + * `projects/{project_id}/databases/{database_id}` + * Please see {@see FirestoreAdminClient::databaseName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\GetDatabaseRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetFieldRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetFieldRequest.php new file mode 100644 index 000000000000..3b25bbe324d8 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetFieldRequest.php @@ -0,0 +1,87 @@ +google.firestore.admin.v1.GetFieldRequest + */ +class GetFieldRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` + * Please see {@see FirestoreAdminClient::fieldName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\GetFieldRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetIndexRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetIndexRequest.php new file mode 100644 index 000000000000..5b700df02b53 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetIndexRequest.php @@ -0,0 +1,87 @@ +google.firestore.admin.v1.GetIndexRequest + */ +class GetIndexRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * Please see {@see FirestoreAdminClient::indexName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\GetIndexRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsMetadata.php new file mode 100644 index 000000000000..07d7a2c0d768 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsMetadata.php @@ -0,0 +1,351 @@ +google.firestore.admin.v1.ImportDocumentsMetadata + */ +class ImportDocumentsMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * The state of the import operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; + */ + protected $operation_state = 0; + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; + */ + protected $progress_documents = null; + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; + */ + protected $progress_bytes = null; + /** + * Which collection ids are being imported. + * + * Generated from protobuf field repeated string collection_ids = 6; + */ + private $collection_ids; + /** + * The location of the documents being imported. + * + * Generated from protobuf field string input_uri_prefix = 7; + */ + protected $input_uri_prefix = ''; + /** + * Which namespace ids are being imported. + * + * Generated from protobuf field repeated string namespace_ids = 8; + */ + private $namespace_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * The time this operation started. + * @type \Google\Protobuf\Timestamp $end_time + * The time this operation completed. Will be unset if operation still in + * progress. + * @type int $operation_state + * The state of the import operation. + * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_documents + * The progress, in documents, of this operation. + * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_bytes + * The progress, in bytes, of this operation. + * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids + * Which collection ids are being imported. + * @type string $input_uri_prefix + * The location of the documents being imported. + * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids + * Which namespace ids are being imported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); + parent::__construct($data); + } + + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * The state of the import operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; + * @return int + */ + public function getOperationState() + { + return $this->operation_state; + } + + /** + * The state of the import operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; + * @param int $var + * @return $this + */ + public function setOperationState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\OperationState::class); + $this->operation_state = $var; + + return $this; + } + + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; + * @return \Google\Cloud\Firestore\Admin\V1\Progress|null + */ + public function getProgressDocuments() + { + return $this->progress_documents; + } + + public function hasProgressDocuments() + { + return isset($this->progress_documents); + } + + public function clearProgressDocuments() + { + unset($this->progress_documents); + } + + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; + * @param \Google\Cloud\Firestore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressDocuments($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); + $this->progress_documents = $var; + + return $this; + } + + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; + * @return \Google\Cloud\Firestore\Admin\V1\Progress|null + */ + public function getProgressBytes() + { + return $this->progress_bytes; + } + + public function hasProgressBytes() + { + return isset($this->progress_bytes); + } + + public function clearProgressBytes() + { + unset($this->progress_bytes); + } + + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; + * @param \Google\Cloud\Firestore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressBytes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); + $this->progress_bytes = $var; + + return $this; + } + + /** + * Which collection ids are being imported. + * + * Generated from protobuf field repeated string collection_ids = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCollectionIds() + { + return $this->collection_ids; + } + + /** + * Which collection ids are being imported. + * + * Generated from protobuf field repeated string collection_ids = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCollectionIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->collection_ids = $arr; + + return $this; + } + + /** + * The location of the documents being imported. + * + * Generated from protobuf field string input_uri_prefix = 7; + * @return string + */ + public function getInputUriPrefix() + { + return $this->input_uri_prefix; + } + + /** + * The location of the documents being imported. + * + * Generated from protobuf field string input_uri_prefix = 7; + * @param string $var + * @return $this + */ + public function setInputUriPrefix($var) + { + GPBUtil::checkString($var, True); + $this->input_uri_prefix = $var; + + return $this; + } + + /** + * Which namespace ids are being imported. + * + * Generated from protobuf field repeated string namespace_ids = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamespaceIds() + { + return $this->namespace_ids; + } + + /** + * Which namespace ids are being imported. + * + * Generated from protobuf field repeated string namespace_ids = 8; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamespaceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->namespace_ids = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsRequest.php new file mode 100644 index 000000000000..3f05e1ac6ea7 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsRequest.php @@ -0,0 +1,225 @@ +google.firestore.admin.v1.ImportDocumentsRequest + */ +class ImportDocumentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Database to import into. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Which collection ids to import. Unspecified means all collections included + * in the import. + * + * Generated from protobuf field repeated string collection_ids = 2; + */ + private $collection_ids; + /** + * Location of the exported files. + * This must match the output_uri_prefix of an ExportDocumentsResponse from + * an export that has completed successfully. + * See: + * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]. + * + * Generated from protobuf field string input_uri_prefix = 3; + */ + protected $input_uri_prefix = ''; + /** + * An empty list represents all namespaces. This is the preferred + * usage for databases that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to include them. Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 4; + */ + private $namespace_ids; + + /** + * @param string $name Required. Database to import into. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. Please see + * {@see FirestoreAdminClient::databaseName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\ImportDocumentsRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Database to import into. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids + * Which collection ids to import. Unspecified means all collections included + * in the import. + * @type string $input_uri_prefix + * Location of the exported files. + * This must match the output_uri_prefix of an ExportDocumentsResponse from + * an export that has completed successfully. + * See: + * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]. + * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids + * An empty list represents all namespaces. This is the preferred + * usage for databases that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to include them. Each namespace in this list must be unique. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Database to import into. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Database to import into. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Which collection ids to import. Unspecified means all collections included + * in the import. + * + * Generated from protobuf field repeated string collection_ids = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCollectionIds() + { + return $this->collection_ids; + } + + /** + * Which collection ids to import. Unspecified means all collections included + * in the import. + * + * Generated from protobuf field repeated string collection_ids = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCollectionIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->collection_ids = $arr; + + return $this; + } + + /** + * Location of the exported files. + * This must match the output_uri_prefix of an ExportDocumentsResponse from + * an export that has completed successfully. + * See: + * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]. + * + * Generated from protobuf field string input_uri_prefix = 3; + * @return string + */ + public function getInputUriPrefix() + { + return $this->input_uri_prefix; + } + + /** + * Location of the exported files. + * This must match the output_uri_prefix of an ExportDocumentsResponse from + * an export that has completed successfully. + * See: + * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]. + * + * Generated from protobuf field string input_uri_prefix = 3; + * @param string $var + * @return $this + */ + public function setInputUriPrefix($var) + { + GPBUtil::checkString($var, True); + $this->input_uri_prefix = $var; + + return $this; + } + + /** + * An empty list represents all namespaces. This is the preferred + * usage for databases that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to include them. Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamespaceIds() + { + return $this->namespace_ids; + } + + /** + * An empty list represents all namespaces. This is the preferred + * usage for databases that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to include them. Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 4; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamespaceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->namespace_ids = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index.php new file mode 100644 index 000000000000..abd8d051aae4 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index.php @@ -0,0 +1,268 @@ +google.firestore.admin.v1.Index + */ +class Index extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. A server defined name for this index. + * The form of this name for composite indexes will be: + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` + * For single field indexes, this field will be empty. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Indexes with a collection query scope specified allow queries + * against a collection that is the child of a specific document, specified at + * query time, and that has the same collection id. + * Indexes with a collection group query scope specified allow queries against + * all collections descended from a specific document, specified at query + * time, and that have the same collection id as this index. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.QueryScope query_scope = 2; + */ + protected $query_scope = 0; + /** + * The API scope supported by this index. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.ApiScope api_scope = 5; + */ + protected $api_scope = 0; + /** + * The fields supported by this index. + * For composite indexes, this requires a minimum of 2 and a maximum of 100 + * fields. The last field entry is always for the field path `__name__`. If, + * on creation, `__name__` was not specified as the last field, it will be + * added automatically with the same direction as that of the last field + * defined. If the final field in a composite index is not directional, the + * `__name__` will be ordered ASCENDING (unless explicitly specified). + * For single field indexes, this will always be exactly one entry with a + * field path equal to the field path of the associated field. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + */ + private $fields; + /** + * Output only. The serving state of the index. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.State state = 4; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. A server defined name for this index. + * The form of this name for composite indexes will be: + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` + * For single field indexes, this field will be empty. + * @type int $query_scope + * Indexes with a collection query scope specified allow queries + * against a collection that is the child of a specific document, specified at + * query time, and that has the same collection id. + * Indexes with a collection group query scope specified allow queries against + * all collections descended from a specific document, specified at query + * time, and that have the same collection id as this index. + * @type int $api_scope + * The API scope supported by this index. + * @type array<\Google\Cloud\Firestore\Admin\V1\Index\IndexField>|\Google\Protobuf\Internal\RepeatedField $fields + * The fields supported by this index. + * For composite indexes, this requires a minimum of 2 and a maximum of 100 + * fields. The last field entry is always for the field path `__name__`. If, + * on creation, `__name__` was not specified as the last field, it will be + * added automatically with the same direction as that of the last field + * defined. If the final field in a composite index is not directional, the + * `__name__` will be ordered ASCENDING (unless explicitly specified). + * For single field indexes, this will always be exactly one entry with a + * field path equal to the field path of the associated field. + * @type int $state + * Output only. The serving state of the index. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Index::initOnce(); + parent::__construct($data); + } + + /** + * Output only. A server defined name for this index. + * The form of this name for composite indexes will be: + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` + * For single field indexes, this field will be empty. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. A server defined name for this index. + * The form of this name for composite indexes will be: + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` + * For single field indexes, this field will be empty. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Indexes with a collection query scope specified allow queries + * against a collection that is the child of a specific document, specified at + * query time, and that has the same collection id. + * Indexes with a collection group query scope specified allow queries against + * all collections descended from a specific document, specified at query + * time, and that have the same collection id as this index. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.QueryScope query_scope = 2; + * @return int + */ + public function getQueryScope() + { + return $this->query_scope; + } + + /** + * Indexes with a collection query scope specified allow queries + * against a collection that is the child of a specific document, specified at + * query time, and that has the same collection id. + * Indexes with a collection group query scope specified allow queries against + * all collections descended from a specific document, specified at query + * time, and that have the same collection id as this index. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.QueryScope query_scope = 2; + * @param int $var + * @return $this + */ + public function setQueryScope($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index\QueryScope::class); + $this->query_scope = $var; + + return $this; + } + + /** + * The API scope supported by this index. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.ApiScope api_scope = 5; + * @return int + */ + public function getApiScope() + { + return $this->api_scope; + } + + /** + * The API scope supported by this index. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.ApiScope api_scope = 5; + * @param int $var + * @return $this + */ + public function setApiScope($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index\ApiScope::class); + $this->api_scope = $var; + + return $this; + } + + /** + * The fields supported by this index. + * For composite indexes, this requires a minimum of 2 and a maximum of 100 + * fields. The last field entry is always for the field path `__name__`. If, + * on creation, `__name__` was not specified as the last field, it will be + * added automatically with the same direction as that of the last field + * defined. If the final field in a composite index is not directional, the + * `__name__` will be ordered ASCENDING (unless explicitly specified). + * For single field indexes, this will always be exactly one entry with a + * field path equal to the field path of the associated field. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * The fields supported by this index. + * For composite indexes, this requires a minimum of 2 and a maximum of 100 + * fields. The last field entry is always for the field path `__name__`. If, + * on creation, `__name__` was not specified as the last field, it will be + * added automatically with the same direction as that of the last field + * defined. If the final field in a composite index is not directional, the + * `__name__` will be ordered ASCENDING (unless explicitly specified). + * For single field indexes, this will always be exactly one entry with a + * field path equal to the field path of the associated field. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Index.IndexField fields = 3; + * @param array<\Google\Cloud\Firestore\Admin\V1\Index\IndexField>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\Index\IndexField::class); + $this->fields = $arr; + + return $this; + } + + /** + * Output only. The serving state of the index. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.State state = 4; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The serving state of the index. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.State state = 4; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index\State::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/ApiScope.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/ApiScope.php new file mode 100644 index 000000000000..d85fe6616eec --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/ApiScope.php @@ -0,0 +1,59 @@ +google.firestore.admin.v1.Index.ApiScope + */ +class ApiScope +{ + /** + * The index can only be used by the Firestore Native query API. + * This is the default. + * + * Generated from protobuf enum ANY_API = 0; + */ + const ANY_API = 0; + /** + * The index can only be used by the Firestore in Datastore Mode query API. + * + * Generated from protobuf enum DATASTORE_MODE_API = 1; + */ + const DATASTORE_MODE_API = 1; + + private static $valueToName = [ + self::ANY_API => 'ANY_API', + self::DATASTORE_MODE_API => 'DATASTORE_MODE_API', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ApiScope::class, \Google\Cloud\Firestore\Admin\V1\Index_ApiScope::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField.php new file mode 100644 index 000000000000..8c8cb50ff2cb --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField.php @@ -0,0 +1,158 @@ +google.firestore.admin.v1.Index.IndexField + */ +class IndexField extends \Google\Protobuf\Internal\Message +{ + /** + * Can be __name__. + * For single field indexes, this must match the name of the field or may + * be omitted. + * + * Generated from protobuf field string field_path = 1; + */ + protected $field_path = ''; + protected $value_mode; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $field_path + * Can be __name__. + * For single field indexes, this must match the name of the field or may + * be omitted. + * @type int $order + * Indicates that this field supports ordering by the specified order or + * comparing using =, !=, <, <=, >, >=. + * @type int $array_config + * Indicates that this field supports operations on `array_value`s. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Index::initOnce(); + parent::__construct($data); + } + + /** + * Can be __name__. + * For single field indexes, this must match the name of the field or may + * be omitted. + * + * Generated from protobuf field string field_path = 1; + * @return string + */ + public function getFieldPath() + { + return $this->field_path; + } + + /** + * Can be __name__. + * For single field indexes, this must match the name of the field or may + * be omitted. + * + * Generated from protobuf field string field_path = 1; + * @param string $var + * @return $this + */ + public function setFieldPath($var) + { + GPBUtil::checkString($var, True); + $this->field_path = $var; + + return $this; + } + + /** + * Indicates that this field supports ordering by the specified order or + * comparing using =, !=, <, <=, >, >=. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.Order order = 2; + * @return int + */ + public function getOrder() + { + return $this->readOneof(2); + } + + public function hasOrder() + { + return $this->hasOneof(2); + } + + /** + * Indicates that this field supports ordering by the specified order or + * comparing using =, !=, <, <=, >, >=. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.Order order = 2; + * @param int $var + * @return $this + */ + public function setOrder($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index\IndexField\Order::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Indicates that this field supports operations on `array_value`s. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3; + * @return int + */ + public function getArrayConfig() + { + return $this->readOneof(3); + } + + public function hasArrayConfig() + { + return $this->hasOneof(3); + } + + /** + * Indicates that this field supports operations on `array_value`s. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3; + * @param int $var + * @return $this + */ + public function setArrayConfig($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index\IndexField\ArrayConfig::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getValueMode() + { + return $this->whichOneof("value_mode"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IndexField::class, \Google\Cloud\Firestore\Admin\V1\Index_IndexField::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/ArrayConfig.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/ArrayConfig.php new file mode 100644 index 000000000000..e7ba6fe94de4 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/ArrayConfig.php @@ -0,0 +1,57 @@ +google.firestore.admin.v1.Index.IndexField.ArrayConfig + */ +class ArrayConfig +{ + /** + * The index does not support additional array queries. + * + * Generated from protobuf enum ARRAY_CONFIG_UNSPECIFIED = 0; + */ + const ARRAY_CONFIG_UNSPECIFIED = 0; + /** + * The index supports array containment queries. + * + * Generated from protobuf enum CONTAINS = 1; + */ + const CONTAINS = 1; + + private static $valueToName = [ + self::ARRAY_CONFIG_UNSPECIFIED => 'ARRAY_CONFIG_UNSPECIFIED', + self::CONTAINS => 'CONTAINS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ArrayConfig::class, \Google\Cloud\Firestore\Admin\V1\Index_IndexField_ArrayConfig::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/Order.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/Order.php new file mode 100644 index 000000000000..d523938322b4 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/Order.php @@ -0,0 +1,64 @@ +google.firestore.admin.v1.Index.IndexField.Order + */ +class Order +{ + /** + * The ordering is unspecified. Not a valid option. + * + * Generated from protobuf enum ORDER_UNSPECIFIED = 0; + */ + const ORDER_UNSPECIFIED = 0; + /** + * The field is ordered by ascending field value. + * + * Generated from protobuf enum ASCENDING = 1; + */ + const ASCENDING = 1; + /** + * The field is ordered by descending field value. + * + * Generated from protobuf enum DESCENDING = 2; + */ + const DESCENDING = 2; + + private static $valueToName = [ + self::ORDER_UNSPECIFIED => 'ORDER_UNSPECIFIED', + self::ASCENDING => 'ASCENDING', + self::DESCENDING => 'DESCENDING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Order::class, \Google\Cloud\Firestore\Admin\V1\Index_IndexField_Order::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/QueryScope.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/QueryScope.php new file mode 100644 index 000000000000..8de8f4c4803c --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/QueryScope.php @@ -0,0 +1,77 @@ +google.firestore.admin.v1.Index.QueryScope + */ +class QueryScope +{ + /** + * The query scope is unspecified. Not a valid option. + * + * Generated from protobuf enum QUERY_SCOPE_UNSPECIFIED = 0; + */ + const QUERY_SCOPE_UNSPECIFIED = 0; + /** + * Indexes with a collection query scope specified allow queries + * against a collection that is the child of a specific document, specified + * at query time, and that has the collection id specified by the index. + * + * Generated from protobuf enum COLLECTION = 1; + */ + const COLLECTION = 1; + /** + * Indexes with a collection group query scope specified allow queries + * against all collections that has the collection id specified by the + * index. + * + * Generated from protobuf enum COLLECTION_GROUP = 2; + */ + const COLLECTION_GROUP = 2; + /** + * Include all the collections's ancestor in the index. Only available for + * Datastore Mode databases. + * + * Generated from protobuf enum COLLECTION_RECURSIVE = 3; + */ + const COLLECTION_RECURSIVE = 3; + + private static $valueToName = [ + self::QUERY_SCOPE_UNSPECIFIED => 'QUERY_SCOPE_UNSPECIFIED', + self::COLLECTION => 'COLLECTION', + self::COLLECTION_GROUP => 'COLLECTION_GROUP', + self::COLLECTION_RECURSIVE => 'COLLECTION_RECURSIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QueryScope::class, \Google\Cloud\Firestore\Admin\V1\Index_QueryScope::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/State.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/State.php new file mode 100644 index 000000000000..d9f96475cd8e --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/State.php @@ -0,0 +1,86 @@ +google.firestore.admin.v1.Index.State + */ +class State +{ + /** + * The state is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The index is being created. + * There is an active long-running operation for the index. + * The index is updated when writing a document. + * Some index data may exist. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The index is ready to be used. + * The index is updated when writing a document. + * The index is fully populated from all stored documents it applies to. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The index was being created, but something went wrong. + * There is no active long-running operation for the index, + * and the most recently finished long-running operation failed. + * The index is not updated when writing a document. + * Some index data may exist. + * Use the google.longrunning.Operations API to determine why the operation + * that last attempted to create this index failed, then re-create the + * index. + * + * Generated from protobuf enum NEEDS_REPAIR = 3; + */ + const NEEDS_REPAIR = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + self::NEEDS_REPAIR => 'NEEDS_REPAIR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Firestore\Admin\V1\Index_State::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/IndexOperationMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/IndexOperationMetadata.php new file mode 100644 index 000000000000..4144b5459434 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/IndexOperationMetadata.php @@ -0,0 +1,287 @@ +google.firestore.admin.v1.IndexOperationMetadata + */ +class IndexOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * The index resource that this operation is acting on. For example: + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * + * Generated from protobuf field string index = 3; + */ + protected $index = ''; + /** + * The state of the operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState state = 4; + */ + protected $state = 0; + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 5; + */ + protected $progress_documents = null; + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 6; + */ + protected $progress_bytes = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * The time this operation started. + * @type \Google\Protobuf\Timestamp $end_time + * The time this operation completed. Will be unset if operation still in + * progress. + * @type string $index + * The index resource that this operation is acting on. For example: + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * @type int $state + * The state of the operation. + * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_documents + * The progress, in documents, of this operation. + * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_bytes + * The progress, in bytes, of this operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); + parent::__construct($data); + } + + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The time this operation started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The time this operation completed. Will be unset if operation still in + * progress. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * The index resource that this operation is acting on. For example: + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * + * Generated from protobuf field string index = 3; + * @return string + */ + public function getIndex() + { + return $this->index; + } + + /** + * The index resource that this operation is acting on. For example: + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * + * Generated from protobuf field string index = 3; + * @param string $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkString($var, True); + $this->index = $var; + + return $this; + } + + /** + * The state of the operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState state = 4; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The state of the operation. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState state = 4; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\OperationState::class); + $this->state = $var; + + return $this; + } + + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 5; + * @return \Google\Cloud\Firestore\Admin\V1\Progress|null + */ + public function getProgressDocuments() + { + return $this->progress_documents; + } + + public function hasProgressDocuments() + { + return isset($this->progress_documents); + } + + public function clearProgressDocuments() + { + unset($this->progress_documents); + } + + /** + * The progress, in documents, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 5; + * @param \Google\Cloud\Firestore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressDocuments($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); + $this->progress_documents = $var; + + return $this; + } + + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 6; + * @return \Google\Cloud\Firestore\Admin\V1\Progress|null + */ + public function getProgressBytes() + { + return $this->progress_bytes; + } + + public function hasProgressBytes() + { + return isset($this->progress_bytes); + } + + public function clearProgressBytes() + { + unset($this->progress_bytes); + } + + /** + * The progress, in bytes, of this operation. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 6; + * @param \Google\Cloud\Firestore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressBytes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); + $this->progress_bytes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesRequest.php new file mode 100644 index 000000000000..3afd3b83c9bb --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesRequest.php @@ -0,0 +1,86 @@ +google.firestore.admin.v1.ListDatabasesRequest + */ +class ListDatabasesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A parent name of the form + * `projects/{project_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. A parent name of the form + * `projects/{project_id}` + * Please see {@see FirestoreAdminClient::projectName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\ListDatabasesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. A parent name of the form + * `projects/{project_id}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. A parent name of the form + * `projects/{project_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. A parent name of the form + * `projects/{project_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesResponse.php new file mode 100644 index 000000000000..efe6b7b4ae83 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesResponse.php @@ -0,0 +1,129 @@ +google.firestore.admin.v1.ListDatabasesResponse + */ +class ListDatabasesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The databases in the project. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Database databases = 1; + */ + private $databases; + /** + * In the event that data about individual databases cannot be listed they + * will be recorded here. + * An example entry might be: projects/some_project/locations/some_location + * This can happen if the Cloud Region that the Database resides in is + * currently unavailable. In this case we can't fetch all the details about + * the database. You may be able to get a more detailed error message + * (or possibly fetch the resource) by sending a 'Get' request for the + * resource or a 'List' request for the specific location. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Firestore\Admin\V1\Database>|\Google\Protobuf\Internal\RepeatedField $databases + * The databases in the project. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * In the event that data about individual databases cannot be listed they + * will be recorded here. + * An example entry might be: projects/some_project/locations/some_location + * This can happen if the Cloud Region that the Database resides in is + * currently unavailable. In this case we can't fetch all the details about + * the database. You may be able to get a more detailed error message + * (or possibly fetch the resource) by sending a 'Get' request for the + * resource or a 'List' request for the specific location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The databases in the project. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Database databases = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDatabases() + { + return $this->databases; + } + + /** + * The databases in the project. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Database databases = 1; + * @param array<\Google\Cloud\Firestore\Admin\V1\Database>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDatabases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\Database::class); + $this->databases = $arr; + + return $this; + } + + /** + * In the event that data about individual databases cannot be listed they + * will be recorded here. + * An example entry might be: projects/some_project/locations/some_location + * This can happen if the Cloud Region that the Database resides in is + * currently unavailable. In this case we can't fetch all the details about + * the database. You may be able to get a more detailed error message + * (or possibly fetch the resource) by sending a 'Get' request for the + * resource or a 'List' request for the specific location. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * In the event that data about individual databases cannot be listed they + * will be recorded here. + * An example entry might be: projects/some_project/locations/some_location + * This can happen if the Cloud Region that the Database resides in is + * currently unavailable. In this case we can't fetch all the details about + * the database. You may be able to get a more detailed error message + * (or possibly fetch the resource) by sending a 'Get' request for the + * resource or a 'List' request for the specific location. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsRequest.php new file mode 100644 index 000000000000..d1144d213756 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsRequest.php @@ -0,0 +1,217 @@ +google.firestore.admin.v1.ListFieldsRequest + */ +class ListFieldsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The filter to apply to list results. Currently, + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * only supports listing fields that have been explicitly overridden. To issue + * this query, call + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * with a filter that includes `indexConfig.usesAncestorConfig:false` . + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * The number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A page token, returned from a previous call to + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], + * that may be used to get the next page of results. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * Please see {@see FirestoreAdminClient::collectionGroupName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\ListFieldsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * @type string $filter + * The filter to apply to list results. Currently, + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * only supports listing fields that have been explicitly overridden. To issue + * this query, call + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * with a filter that includes `indexConfig.usesAncestorConfig:false` . + * @type int $page_size + * The number of results to return. + * @type string $page_token + * A page token, returned from a previous call to + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], + * that may be used to get the next page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The filter to apply to list results. Currently, + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * only supports listing fields that have been explicitly overridden. To issue + * this query, call + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * with a filter that includes `indexConfig.usesAncestorConfig:false` . + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The filter to apply to list results. Currently, + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * only supports listing fields that have been explicitly overridden. To issue + * this query, call + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * with a filter that includes `indexConfig.usesAncestorConfig:false` . + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token, returned from a previous call to + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], + * that may be used to get the next page of results. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, returned from a previous call to + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], + * that may be used to get the next page of results. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsResponse.php new file mode 100644 index 000000000000..58d931b50c93 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsResponse.php @@ -0,0 +1,106 @@ +google.firestore.admin.v1.ListFieldsResponse + */ +class ListFieldsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The requested fields. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Field fields = 1; + */ + private $fields; + /** + * A page token that may be used to request another page of results. If blank, + * this is the last page. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Firestore\Admin\V1\Field>|\Google\Protobuf\Internal\RepeatedField $fields + * The requested fields. + * @type string $next_page_token + * A page token that may be used to request another page of results. If blank, + * this is the last page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The requested fields. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Field fields = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * The requested fields. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Field fields = 1; + * @param array<\Google\Cloud\Firestore\Admin\V1\Field>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\Field::class); + $this->fields = $arr; + + return $this; + } + + /** + * A page token that may be used to request another page of results. If blank, + * this is the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A page token that may be used to request another page of results. If blank, + * this is the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesRequest.php new file mode 100644 index 000000000000..a0d52b953646 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesRequest.php @@ -0,0 +1,197 @@ +google.firestore.admin.v1.ListIndexesRequest + */ +class ListIndexesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The filter to apply to list results. + * + * Generated from protobuf field string filter = 2; + */ + protected $filter = ''; + /** + * The number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + */ + protected $page_size = 0; + /** + * A page token, returned from a previous call to + * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], + * that may be used to get the next page of results. + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + + /** + * @param string $parent Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * Please see {@see FirestoreAdminClient::collectionGroupName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\ListIndexesRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * @type string $filter + * The filter to apply to list results. + * @type int $page_size + * The number of results to return. + * @type string $page_token + * A page token, returned from a previous call to + * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], + * that may be used to get the next page of results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The filter to apply to list results. + * + * Generated from protobuf field string filter = 2; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * The filter to apply to list results. + * + * Generated from protobuf field string filter = 2; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The number of results to return. + * + * Generated from protobuf field int32 page_size = 3; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token, returned from a previous call to + * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], + * that may be used to get the next page of results. + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, returned from a previous call to + * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], + * that may be used to get the next page of results. + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesResponse.php new file mode 100644 index 000000000000..6b6ba380cd71 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesResponse.php @@ -0,0 +1,106 @@ +google.firestore.admin.v1.ListIndexesResponse + */ +class ListIndexesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The requested indexes. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Index indexes = 1; + */ + private $indexes; + /** + * A page token that may be used to request another page of results. If blank, + * this is the last page. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Firestore\Admin\V1\Index>|\Google\Protobuf\Internal\RepeatedField $indexes + * The requested indexes. + * @type string $next_page_token + * A page token that may be used to request another page of results. If blank, + * this is the last page. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The requested indexes. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Index indexes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIndexes() + { + return $this->indexes; + } + + /** + * The requested indexes. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Index indexes = 1; + * @param array<\Google\Cloud\Firestore\Admin\V1\Index>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIndexes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\Index::class); + $this->indexes = $arr; + + return $this; + } + + /** + * A page token that may be used to request another page of results. If blank, + * this is the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A page token that may be used to request another page of results. If blank, + * this is the last page. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/LocationMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/LocationMetadata.php new file mode 100644 index 000000000000..36d656955673 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/LocationMetadata.php @@ -0,0 +1,34 @@ +google.firestore.admin.v1.LocationMetadata + */ +class LocationMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Location::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/OperationState.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/OperationState.php new file mode 100644 index 000000000000..73244df17d28 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/OperationState.php @@ -0,0 +1,98 @@ +google.firestore.admin.v1.OperationState + */ +class OperationState +{ + /** + * Unspecified. + * + * Generated from protobuf enum OPERATION_STATE_UNSPECIFIED = 0; + */ + const OPERATION_STATE_UNSPECIFIED = 0; + /** + * Request is being prepared for processing. + * + * Generated from protobuf enum INITIALIZING = 1; + */ + const INITIALIZING = 1; + /** + * Request is actively being processed. + * + * Generated from protobuf enum PROCESSING = 2; + */ + const PROCESSING = 2; + /** + * Request is in the process of being cancelled after user called + * google.longrunning.Operations.CancelOperation on the operation. + * + * Generated from protobuf enum CANCELLING = 3; + */ + const CANCELLING = 3; + /** + * Request has been processed and is in its finalization stage. + * + * Generated from protobuf enum FINALIZING = 4; + */ + const FINALIZING = 4; + /** + * Request has completed successfully. + * + * Generated from protobuf enum SUCCESSFUL = 5; + */ + const SUCCESSFUL = 5; + /** + * Request has finished being processed, but encountered an error. + * + * Generated from protobuf enum FAILED = 6; + */ + const FAILED = 6; + /** + * Request has finished being cancelled after user called + * google.longrunning.Operations.CancelOperation. + * + * Generated from protobuf enum CANCELLED = 7; + */ + const CANCELLED = 7; + + private static $valueToName = [ + self::OPERATION_STATE_UNSPECIFIED => 'OPERATION_STATE_UNSPECIFIED', + self::INITIALIZING => 'INITIALIZING', + self::PROCESSING => 'PROCESSING', + self::CANCELLING => 'CANCELLING', + self::FINALIZING => 'FINALIZING', + self::SUCCESSFUL => 'SUCCESSFUL', + self::FAILED => 'FAILED', + self::CANCELLED => 'CANCELLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Progress.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Progress.php new file mode 100644 index 000000000000..24ea17a96c10 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Progress.php @@ -0,0 +1,103 @@ +google.firestore.admin.v1.Progress + */ +class Progress extends \Google\Protobuf\Internal\Message +{ + /** + * The amount of work estimated. + * + * Generated from protobuf field int64 estimated_work = 1; + */ + protected $estimated_work = 0; + /** + * The amount of work completed. + * + * Generated from protobuf field int64 completed_work = 2; + */ + protected $completed_work = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $estimated_work + * The amount of work estimated. + * @type int|string $completed_work + * The amount of work completed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); + parent::__construct($data); + } + + /** + * The amount of work estimated. + * + * Generated from protobuf field int64 estimated_work = 1; + * @return int|string + */ + public function getEstimatedWork() + { + return $this->estimated_work; + } + + /** + * The amount of work estimated. + * + * Generated from protobuf field int64 estimated_work = 1; + * @param int|string $var + * @return $this + */ + public function setEstimatedWork($var) + { + GPBUtil::checkInt64($var); + $this->estimated_work = $var; + + return $this; + } + + /** + * The amount of work completed. + * + * Generated from protobuf field int64 completed_work = 2; + * @return int|string + */ + public function getCompletedWork() + { + return $this->completed_work; + } + + /** + * The amount of work completed. + * + * Generated from protobuf field int64 completed_work = 2; + * @param int|string $var + * @return $this + */ + public function setCompletedWork($var) + { + GPBUtil::checkInt64($var); + $this->completed_work = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseMetadata.php new file mode 100644 index 000000000000..bc68c8671ec8 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseMetadata.php @@ -0,0 +1,33 @@ +google.firestore.admin.v1.UpdateDatabaseMetadata + */ +class UpdateDatabaseMetadata extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseRequest.php new file mode 100644 index 000000000000..71f72a8e54b1 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseRequest.php @@ -0,0 +1,137 @@ +google.firestore.admin.v1.UpdateDatabaseRequest + */ +class UpdateDatabaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The database to update. + * + * Generated from protobuf field .google.firestore.admin.v1.Database database = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $database = null; + /** + * The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Firestore\Admin\V1\Database $database Required. The database to update. + * @param \Google\Protobuf\FieldMask $updateMask The list of fields to be updated. + * + * @return \Google\Cloud\Firestore\Admin\V1\UpdateDatabaseRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Firestore\Admin\V1\Database $database, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDatabase($database) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\Admin\V1\Database $database + * Required. The database to update. + * @type \Google\Protobuf\FieldMask $update_mask + * The list of fields to be updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The database to update. + * + * Generated from protobuf field .google.firestore.admin.v1.Database database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Firestore\Admin\V1\Database|null + */ + public function getDatabase() + { + return $this->database; + } + + public function hasDatabase() + { + return isset($this->database); + } + + public function clearDatabase() + { + unset($this->database); + } + + /** + * Required. The database to update. + * + * Generated from protobuf field .google.firestore.admin.v1.Database database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Firestore\Admin\V1\Database $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Database::class); + $this->database = $var; + + return $this; + } + + /** + * The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The list of fields to be updated. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateFieldRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateFieldRequest.php new file mode 100644 index 000000000000..a860a8be36a7 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateFieldRequest.php @@ -0,0 +1,139 @@ +google.firestore.admin.v1.UpdateFieldRequest + */ +class UpdateFieldRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The field to be updated. + * + * Generated from protobuf field .google.firestore.admin.v1.Field field = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $field = null; + /** + * A mask, relative to the field. If specified, only configuration specified + * by this field_mask will be updated in the field. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + + /** + * @param \Google\Cloud\Firestore\Admin\V1\Field $field Required. The field to be updated. + * + * @return \Google\Cloud\Firestore\Admin\V1\UpdateFieldRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Firestore\Admin\V1\Field $field): self + { + return (new self()) + ->setField($field); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\Admin\V1\Field $field + * Required. The field to be updated. + * @type \Google\Protobuf\FieldMask $update_mask + * A mask, relative to the field. If specified, only configuration specified + * by this field_mask will be updated in the field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The field to be updated. + * + * Generated from protobuf field .google.firestore.admin.v1.Field field = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Firestore\Admin\V1\Field|null + */ + public function getField() + { + return $this->field; + } + + public function hasField() + { + return isset($this->field); + } + + public function clearField() + { + unset($this->field); + } + + /** + * Required. The field to be updated. + * + * Generated from protobuf field .google.firestore.admin.v1.Field field = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Firestore\Admin\V1\Field $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Field::class); + $this->field = $var; + + return $this; + } + + /** + * A mask, relative to the field. If specified, only configuration specified + * by this field_mask will be updated in the field. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * A mask, relative to the field. If specified, only configuration specified + * by this field_mask will be updated in the field. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_database.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_database.php new file mode 100644 index 000000000000..23cf55551637 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_database.php @@ -0,0 +1,96 @@ +setParent($formattedParent) + ->setDatabase($database) + ->setDatabaseId($databaseId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firestoreAdminClient->createDatabase($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Database $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = FirestoreAdminClient::projectName('[PROJECT]'); + $databaseId = '[DATABASE_ID]'; + + create_database_sample($formattedParent, $databaseId); +} +// [END firestore_v1_generated_FirestoreAdmin_CreateDatabase_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_index.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_index.php new file mode 100644 index 000000000000..b3868089e22d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_index.php @@ -0,0 +1,94 @@ +setParent($formattedParent) + ->setIndex($index); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firestoreAdminClient->createIndex($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Index $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = FirestoreAdminClient::collectionGroupName( + '[PROJECT]', + '[DATABASE]', + '[COLLECTION]' + ); + + create_index_sample($formattedParent); +} +// [END firestore_v1_generated_FirestoreAdmin_CreateIndex_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_database.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_database.php new file mode 100644 index 000000000000..e9e63f6359ab --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_database.php @@ -0,0 +1,84 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firestoreAdminClient->deleteDatabase($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Database $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = FirestoreAdminClient::databaseName('[PROJECT]', '[DATABASE]'); + + delete_database_sample($formattedName); +} +// [END firestore_v1_generated_FirestoreAdmin_DeleteDatabase_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_index.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_index.php new file mode 100644 index 000000000000..1da8adead502 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_index.php @@ -0,0 +1,75 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $firestoreAdminClient->deleteIndex($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = FirestoreAdminClient::indexName( + '[PROJECT]', + '[DATABASE]', + '[COLLECTION]', + '[INDEX]' + ); + + delete_index_sample($formattedName); +} +// [END firestore_v1_generated_FirestoreAdmin_DeleteIndex_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/export_documents.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/export_documents.php new file mode 100644 index 000000000000..9fde0db173ba --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/export_documents.php @@ -0,0 +1,94 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firestoreAdminClient->exportDocuments($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ExportDocumentsResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = FirestoreAdminClient::databaseName('[PROJECT]', '[DATABASE]'); + + export_documents_sample($formattedName); +} +// [END firestore_v1_generated_FirestoreAdmin_ExportDocuments_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_database.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_database.php new file mode 100644 index 000000000000..8206f7a163fc --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_database.php @@ -0,0 +1,72 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Database $response */ + $response = $firestoreAdminClient->getDatabase($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = FirestoreAdminClient::databaseName('[PROJECT]', '[DATABASE]'); + + get_database_sample($formattedName); +} +// [END firestore_v1_generated_FirestoreAdmin_GetDatabase_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_field.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_field.php new file mode 100644 index 000000000000..e6fea83d16c5 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_field.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Field $response */ + $response = $firestoreAdminClient->getField($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = FirestoreAdminClient::fieldName( + '[PROJECT]', + '[DATABASE]', + '[COLLECTION]', + '[FIELD]' + ); + + get_field_sample($formattedName); +} +// [END firestore_v1_generated_FirestoreAdmin_GetField_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_index.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_index.php new file mode 100644 index 000000000000..1b4ad8918c85 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_index.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Index $response */ + $response = $firestoreAdminClient->getIndex($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = FirestoreAdminClient::indexName( + '[PROJECT]', + '[DATABASE]', + '[COLLECTION]', + '[INDEX]' + ); + + get_index_sample($formattedName); +} +// [END firestore_v1_generated_FirestoreAdmin_GetIndex_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/import_documents.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/import_documents.php new file mode 100644 index 000000000000..9a2a04e7a9f5 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/import_documents.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firestoreAdminClient->importDocuments($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = FirestoreAdminClient::databaseName('[PROJECT]', '[DATABASE]'); + + import_documents_sample($formattedName); +} +// [END firestore_v1_generated_FirestoreAdmin_ImportDocuments_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_databases.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_databases.php new file mode 100644 index 000000000000..695b54581c8c --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_databases.php @@ -0,0 +1,72 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var ListDatabasesResponse $response */ + $response = $firestoreAdminClient->listDatabases($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = FirestoreAdminClient::projectName('[PROJECT]'); + + list_databases_sample($formattedParent); +} +// [END firestore_v1_generated_FirestoreAdmin_ListDatabases_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_fields.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_fields.php new file mode 100644 index 000000000000..6a38c4d901ae --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_fields.php @@ -0,0 +1,89 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $firestoreAdminClient->listFields($request); + + /** @var Field $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = FirestoreAdminClient::collectionGroupName( + '[PROJECT]', + '[DATABASE]', + '[COLLECTION]' + ); + + list_fields_sample($formattedParent); +} +// [END firestore_v1_generated_FirestoreAdmin_ListFields_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_indexes.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_indexes.php new file mode 100644 index 000000000000..4b1b4a26a49e --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_indexes.php @@ -0,0 +1,81 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $firestoreAdminClient->listIndexes($request); + + /** @var Index $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = FirestoreAdminClient::collectionGroupName( + '[PROJECT]', + '[DATABASE]', + '[COLLECTION]' + ); + + list_indexes_sample($formattedParent); +} +// [END firestore_v1_generated_FirestoreAdmin_ListIndexes_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_database.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_database.php new file mode 100644 index 000000000000..c98f5c894ff9 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_database.php @@ -0,0 +1,71 @@ +setDatabase($database); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firestoreAdminClient->updateDatabase($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Database $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END firestore_v1_generated_FirestoreAdmin_UpdateDatabase_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_field.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_field.php new file mode 100644 index 000000000000..8482c64a4df9 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_field.php @@ -0,0 +1,124 @@ +setName($fieldName); + $request = (new UpdateFieldRequest()) + ->setField($field); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firestoreAdminClient->updateField($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Field $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $fieldName = '[NAME]'; + + update_field_sample($fieldName); +} +// [END firestore_v1_generated_FirestoreAdmin_UpdateField_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/src/V1/Client/FirestoreAdminClient.php b/owl-bot-staging/Firestore/v1/Admin/src/V1/Client/FirestoreAdminClient.php new file mode 100644 index 000000000000..fdaa886fee35 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/src/V1/Client/FirestoreAdminClient.php @@ -0,0 +1,789 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/firestore_admin_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/firestore_admin_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/firestore_admin_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/firestore_admin_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * collection_group resource. + * + * @param string $project + * @param string $database + * @param string $collection + * + * @return string The formatted collection_group resource. + */ + public static function collectionGroupName(string $project, string $database, string $collection): string + { + return self::getPathTemplate('collectionGroup')->render([ + 'project' => $project, + 'database' => $database, + 'collection' => $collection, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a database + * resource. + * + * @param string $project + * @param string $database + * + * @return string The formatted database resource. + */ + public static function databaseName(string $project, string $database): string + { + return self::getPathTemplate('database')->render([ + 'project' => $project, + 'database' => $database, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a field + * resource. + * + * @param string $project + * @param string $database + * @param string $collection + * @param string $field + * + * @return string The formatted field resource. + */ + public static function fieldName(string $project, string $database, string $collection, string $field): string + { + return self::getPathTemplate('field')->render([ + 'project' => $project, + 'database' => $database, + 'collection' => $collection, + 'field' => $field, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a index + * resource. + * + * @param string $project + * @param string $database + * @param string $collection + * @param string $index + * + * @return string The formatted index resource. + */ + public static function indexName(string $project, string $database, string $collection, string $index): string + { + return self::getPathTemplate('index')->render([ + 'project' => $project, + 'database' => $database, + 'collection' => $collection, + 'index' => $index, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName(string $project): string + { + return self::getPathTemplate('project')->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - collectionGroup: projects/{project}/databases/{database}/collectionGroups/{collection} + * - database: projects/{project}/databases/{database} + * - field: projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field} + * - index: projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index} + * - project: projects/{project} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'firestore.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Create a database. + * + * The async variant is {@see FirestoreAdminClient::createDatabaseAsync()} . + * + * @example samples/V1/FirestoreAdminClient/create_database.php + * + * @param CreateDatabaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createDatabase(CreateDatabaseRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateDatabase', $request, $callOptions)->wait(); + } + + /** + * Creates a composite index. This returns a + * [google.longrunning.Operation][google.longrunning.Operation] which may be + * used to track the status of the creation. The metadata for the operation + * will be the type + * [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata]. + * + * The async variant is {@see FirestoreAdminClient::createIndexAsync()} . + * + * @example samples/V1/FirestoreAdminClient/create_index.php + * + * @param CreateIndexRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createIndex(CreateIndexRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateIndex', $request, $callOptions)->wait(); + } + + /** + * Deletes a database. + * + * The async variant is {@see FirestoreAdminClient::deleteDatabaseAsync()} . + * + * @example samples/V1/FirestoreAdminClient/delete_database.php + * + * @param DeleteDatabaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteDatabase(DeleteDatabaseRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteDatabase', $request, $callOptions)->wait(); + } + + /** + * Deletes a composite index. + * + * The async variant is {@see FirestoreAdminClient::deleteIndexAsync()} . + * + * @example samples/V1/FirestoreAdminClient/delete_index.php + * + * @param DeleteIndexRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteIndex(DeleteIndexRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteIndex', $request, $callOptions)->wait(); + } + + /** + * Exports a copy of all or a subset of documents from Google Cloud Firestore + * to another storage system, such as Google Cloud Storage. Recent updates to + * documents may not be reflected in the export. The export occurs in the + * background and its progress can be monitored and managed via the + * Operation resource that is created. The output of an export may only be + * used once the associated operation is done. If an export operation is + * cancelled before completion it may leave partial data behind in Google + * Cloud Storage. + * + * For more details on export behavior and output format, refer to: + * https://cloud.google.com/firestore/docs/manage-data/export-import + * + * The async variant is {@see FirestoreAdminClient::exportDocumentsAsync()} . + * + * @example samples/V1/FirestoreAdminClient/export_documents.php + * + * @param ExportDocumentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportDocuments(ExportDocumentsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportDocuments', $request, $callOptions)->wait(); + } + + /** + * Gets information about a database. + * + * The async variant is {@see FirestoreAdminClient::getDatabaseAsync()} . + * + * @example samples/V1/FirestoreAdminClient/get_database.php + * + * @param GetDatabaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Database + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDatabase(GetDatabaseRequest $request, array $callOptions = []): Database + { + return $this->startApiCall('GetDatabase', $request, $callOptions)->wait(); + } + + /** + * Gets the metadata and configuration for a Field. + * + * The async variant is {@see FirestoreAdminClient::getFieldAsync()} . + * + * @example samples/V1/FirestoreAdminClient/get_field.php + * + * @param GetFieldRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Field + * + * @throws ApiException Thrown if the API call fails. + */ + public function getField(GetFieldRequest $request, array $callOptions = []): Field + { + return $this->startApiCall('GetField', $request, $callOptions)->wait(); + } + + /** + * Gets a composite index. + * + * The async variant is {@see FirestoreAdminClient::getIndexAsync()} . + * + * @example samples/V1/FirestoreAdminClient/get_index.php + * + * @param GetIndexRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Index + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIndex(GetIndexRequest $request, array $callOptions = []): Index + { + return $this->startApiCall('GetIndex', $request, $callOptions)->wait(); + } + + /** + * Imports documents into Google Cloud Firestore. Existing documents with the + * same name are overwritten. The import occurs in the background and its + * progress can be monitored and managed via the Operation resource that is + * created. If an ImportDocuments operation is cancelled, it is possible + * that a subset of the data has already been imported to Cloud Firestore. + * + * The async variant is {@see FirestoreAdminClient::importDocumentsAsync()} . + * + * @example samples/V1/FirestoreAdminClient/import_documents.php + * + * @param ImportDocumentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importDocuments(ImportDocumentsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportDocuments', $request, $callOptions)->wait(); + } + + /** + * List all the databases in the project. + * + * The async variant is {@see FirestoreAdminClient::listDatabasesAsync()} . + * + * @example samples/V1/FirestoreAdminClient/list_databases.php + * + * @param ListDatabasesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ListDatabasesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDatabases(ListDatabasesRequest $request, array $callOptions = []): ListDatabasesResponse + { + return $this->startApiCall('ListDatabases', $request, $callOptions)->wait(); + } + + /** + * Lists the field configuration and metadata for this database. + * + * Currently, + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * only supports listing fields that have been explicitly overridden. To issue + * this query, call + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * with the filter set to `indexConfig.usesAncestorConfig:false` or + * `ttlConfig:*`. + * + * The async variant is {@see FirestoreAdminClient::listFieldsAsync()} . + * + * @example samples/V1/FirestoreAdminClient/list_fields.php + * + * @param ListFieldsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listFields(ListFieldsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListFields', $request, $callOptions); + } + + /** + * Lists composite indexes. + * + * The async variant is {@see FirestoreAdminClient::listIndexesAsync()} . + * + * @example samples/V1/FirestoreAdminClient/list_indexes.php + * + * @param ListIndexesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listIndexes(ListIndexesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListIndexes', $request, $callOptions); + } + + /** + * Updates a database. + * + * The async variant is {@see FirestoreAdminClient::updateDatabaseAsync()} . + * + * @example samples/V1/FirestoreAdminClient/update_database.php + * + * @param UpdateDatabaseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDatabase(UpdateDatabaseRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateDatabase', $request, $callOptions)->wait(); + } + + /** + * Updates a field configuration. Currently, field updates apply only to + * single field index configuration. However, calls to + * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] + * should provide a field mask to avoid changing any configuration that the + * caller isn't aware of. The field mask should be specified as: `{ paths: + * "index_config" }`. + * + * This call returns a + * [google.longrunning.Operation][google.longrunning.Operation] which may be + * used to track the status of the field update. The metadata for the + * operation will be the type + * [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata]. + * + * To configure the default field settings for the database, use + * the special `Field` with resource name: + * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. + * + * The async variant is {@see FirestoreAdminClient::updateFieldAsync()} . + * + * @example samples/V1/FirestoreAdminClient/update_field.php + * + * @param UpdateFieldRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateField(UpdateFieldRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateField', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Firestore/v1/Admin/src/V1/FirestoreAdminClient.php b/owl-bot-staging/Firestore/v1/Admin/src/V1/FirestoreAdminClient.php new file mode 100644 index 000000000000..c16524637b1e --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/src/V1/FirestoreAdminClient.php @@ -0,0 +1,34 @@ +projectName('[PROJECT]'); + * $database = new Database(); + * $databaseId = 'database_id'; + * $operationResponse = $firestoreAdminClient->createDatabase($formattedParent, $database, $databaseId); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $firestoreAdminClient->createDatabase($formattedParent, $database, $databaseId); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'createDatabase'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + * + * @deprecated Please use the new service client {@see \Google\Cloud\Firestore\Admin\V1\Client\FirestoreAdminClient}. + */ +class FirestoreAdminGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.firestore.admin.v1.FirestoreAdmin'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'firestore.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'firestore.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/datastore', + ]; + + private static $collectionGroupNameTemplate; + + private static $databaseNameTemplate; + + private static $fieldNameTemplate; + + private static $indexNameTemplate; + + private static $projectNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/firestore_admin_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/firestore_admin_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/firestore_admin_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/firestore_admin_rest_client_config.php', + ], + ], + ]; + } + + private static function getCollectionGroupNameTemplate() + { + if (self::$collectionGroupNameTemplate == null) { + self::$collectionGroupNameTemplate = new PathTemplate('projects/{project}/databases/{database}/collectionGroups/{collection}'); + } + + return self::$collectionGroupNameTemplate; + } + + private static function getDatabaseNameTemplate() + { + if (self::$databaseNameTemplate == null) { + self::$databaseNameTemplate = new PathTemplate('projects/{project}/databases/{database}'); + } + + return self::$databaseNameTemplate; + } + + private static function getFieldNameTemplate() + { + if (self::$fieldNameTemplate == null) { + self::$fieldNameTemplate = new PathTemplate('projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}'); + } + + return self::$fieldNameTemplate; + } + + private static function getIndexNameTemplate() + { + if (self::$indexNameTemplate == null) { + self::$indexNameTemplate = new PathTemplate('projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}'); + } + + return self::$indexNameTemplate; + } + + private static function getProjectNameTemplate() + { + if (self::$projectNameTemplate == null) { + self::$projectNameTemplate = new PathTemplate('projects/{project}'); + } + + return self::$projectNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'collectionGroup' => self::getCollectionGroupNameTemplate(), + 'database' => self::getDatabaseNameTemplate(), + 'field' => self::getFieldNameTemplate(), + 'index' => self::getIndexNameTemplate(), + 'project' => self::getProjectNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a + * collection_group resource. + * + * @param string $project + * @param string $database + * @param string $collection + * + * @return string The formatted collection_group resource. + */ + public static function collectionGroupName($project, $database, $collection) + { + return self::getCollectionGroupNameTemplate()->render([ + 'project' => $project, + 'database' => $database, + 'collection' => $collection, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a database + * resource. + * + * @param string $project + * @param string $database + * + * @return string The formatted database resource. + */ + public static function databaseName($project, $database) + { + return self::getDatabaseNameTemplate()->render([ + 'project' => $project, + 'database' => $database, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a field + * resource. + * + * @param string $project + * @param string $database + * @param string $collection + * @param string $field + * + * @return string The formatted field resource. + */ + public static function fieldName($project, $database, $collection, $field) + { + return self::getFieldNameTemplate()->render([ + 'project' => $project, + 'database' => $database, + 'collection' => $collection, + 'field' => $field, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a index + * resource. + * + * @param string $project + * @param string $database + * @param string $collection + * @param string $index + * + * @return string The formatted index resource. + */ + public static function indexName($project, $database, $collection, $index) + { + return self::getIndexNameTemplate()->render([ + 'project' => $project, + 'database' => $database, + 'collection' => $collection, + 'index' => $index, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a project + * resource. + * + * @param string $project + * + * @return string The formatted project resource. + */ + public static function projectName($project) + { + return self::getProjectNameTemplate()->render([ + 'project' => $project, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - collectionGroup: projects/{project}/databases/{database}/collectionGroups/{collection} + * - database: projects/{project}/databases/{database} + * - field: projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field} + * - index: projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index} + * - project: projects/{project} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'firestore.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Create a database. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedParent = $firestoreAdminClient->projectName('[PROJECT]'); + * $database = new Database(); + * $databaseId = 'database_id'; + * $operationResponse = $firestoreAdminClient->createDatabase($formattedParent, $database, $databaseId); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $firestoreAdminClient->createDatabase($formattedParent, $database, $databaseId); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'createDatabase'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. A parent name of the form + * `projects/{project_id}` + * @param Database $database Required. The Database to create. + * @param string $databaseId Required. The ID to use for the database, which will become the final + * component of the database's resource name. + * + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * + * "(default)" database id is also valid. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createDatabase($parent, $database, $databaseId, array $optionalArgs = []) + { + $request = new CreateDatabaseRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setDatabase($database); + $request->setDatabaseId($databaseId); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a composite index. This returns a + * [google.longrunning.Operation][google.longrunning.Operation] which may be + * used to track the status of the creation. The metadata for the operation + * will be the type + * [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata]. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedParent = $firestoreAdminClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + * $index = new Index(); + * $operationResponse = $firestoreAdminClient->createIndex($formattedParent, $index); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $firestoreAdminClient->createIndex($formattedParent, $index); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'createIndex'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * @param Index $index Required. The composite index to create. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createIndex($parent, $index, array $optionalArgs = []) + { + $request = new CreateIndexRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setIndex($index); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateIndex', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a database. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedName = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); + * $operationResponse = $firestoreAdminClient->deleteDatabase($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $firestoreAdminClient->deleteDatabase($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'deleteDatabase'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the form + * `projects/{project_id}/databases/{database_id}` + * @param array $optionalArgs { + * Optional. + * + * @type string $etag + * The current etag of the Database. + * If an etag is provided and does not match the current etag of the database, + * deletion will be blocked and a FAILED_PRECONDITION error will be returned. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteDatabase($name, array $optionalArgs = []) + { + $request = new DeleteDatabaseRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes a composite index. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedName = $firestoreAdminClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); + * $firestoreAdminClient->deleteIndex($formattedName); + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteIndex($name, array $optionalArgs = []) + { + $request = new DeleteIndexRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteIndex', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Exports a copy of all or a subset of documents from Google Cloud Firestore + * to another storage system, such as Google Cloud Storage. Recent updates to + * documents may not be reflected in the export. The export occurs in the + * background and its progress can be monitored and managed via the + * Operation resource that is created. The output of an export may only be + * used once the associated operation is done. If an export operation is + * cancelled before completion it may leave partial data behind in Google + * Cloud Storage. + * + * For more details on export behavior and output format, refer to: + * https://cloud.google.com/firestore/docs/manage-data/export-import + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedName = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); + * $operationResponse = $firestoreAdminClient->exportDocuments($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $firestoreAdminClient->exportDocuments($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'exportDocuments'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $name Required. Database to export. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * @param array $optionalArgs { + * Optional. + * + * @type string[] $collectionIds + * Which collection ids to export. Unspecified means all collections. + * @type string $outputUriPrefix + * The output URI. Currently only supports Google Cloud Storage URIs of the + * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name + * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional + * Google Cloud Storage namespace path. When + * choosing a name, be sure to consider Google Cloud Storage naming + * guidelines: https://cloud.google.com/storage/docs/naming. + * If the URI is a bucket (without a namespace path), a prefix will be + * generated based on the start time. + * @type string[] $namespaceIds + * An empty list represents all namespaces. This is the preferred + * usage for databases that don't use namespaces. + * + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to include them. Each namespace in this list must be unique. + * @type Timestamp $snapshotTime + * The timestamp that corresponds to the version of the database to be + * exported. The timestamp must be in the past, rounded to the minute and not + * older than + * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time]. + * If specified, then the exported documents will represent a consistent view + * of the database at the provided time. Otherwise, there are no guarantees + * about the consistency of the exported documents. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function exportDocuments($name, array $optionalArgs = []) + { + $request = new ExportDocumentsRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['collectionIds'])) { + $request->setCollectionIds($optionalArgs['collectionIds']); + } + + if (isset($optionalArgs['outputUriPrefix'])) { + $request->setOutputUriPrefix($optionalArgs['outputUriPrefix']); + } + + if (isset($optionalArgs['namespaceIds'])) { + $request->setNamespaceIds($optionalArgs['namespaceIds']); + } + + if (isset($optionalArgs['snapshotTime'])) { + $request->setSnapshotTime($optionalArgs['snapshotTime']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ExportDocuments', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets information about a database. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedName = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); + * $response = $firestoreAdminClient->getDatabase($formattedName); + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the form + * `projects/{project_id}/databases/{database_id}` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Firestore\Admin\V1\Database + * + * @throws ApiException if the remote call fails + */ + public function getDatabase($name, array $optionalArgs = []) + { + $request = new GetDatabaseRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetDatabase', Database::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the metadata and configuration for a Field. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedName = $firestoreAdminClient->fieldName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[FIELD]'); + * $response = $firestoreAdminClient->getField($formattedName); + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Firestore\Admin\V1\Field + * + * @throws ApiException if the remote call fails + */ + public function getField($name, array $optionalArgs = []) + { + $request = new GetFieldRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetField', Field::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a composite index. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedName = $firestoreAdminClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); + * $response = $firestoreAdminClient->getIndex($formattedName); + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $name Required. A name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Firestore\Admin\V1\Index + * + * @throws ApiException if the remote call fails + */ + public function getIndex($name, array $optionalArgs = []) + { + $request = new GetIndexRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIndex', Index::class, $optionalArgs, $request)->wait(); + } + + /** + * Imports documents into Google Cloud Firestore. Existing documents with the + * same name are overwritten. The import occurs in the background and its + * progress can be monitored and managed via the Operation resource that is + * created. If an ImportDocuments operation is cancelled, it is possible + * that a subset of the data has already been imported to Cloud Firestore. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedName = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); + * $operationResponse = $firestoreAdminClient->importDocuments($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $firestoreAdminClient->importDocuments($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'importDocuments'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $name Required. Database to import into. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * @param array $optionalArgs { + * Optional. + * + * @type string[] $collectionIds + * Which collection ids to import. Unspecified means all collections included + * in the import. + * @type string $inputUriPrefix + * Location of the exported files. + * This must match the output_uri_prefix of an ExportDocumentsResponse from + * an export that has completed successfully. + * See: + * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]. + * @type string[] $namespaceIds + * An empty list represents all namespaces. This is the preferred + * usage for databases that don't use namespaces. + * + * An empty string element represents the default namespace. This should be + * used if the database has data in non-default namespaces, but doesn't want + * to include them. Each namespace in this list must be unique. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function importDocuments($name, array $optionalArgs = []) + { + $request = new ImportDocumentsRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['collectionIds'])) { + $request->setCollectionIds($optionalArgs['collectionIds']); + } + + if (isset($optionalArgs['inputUriPrefix'])) { + $request->setInputUriPrefix($optionalArgs['inputUriPrefix']); + } + + if (isset($optionalArgs['namespaceIds'])) { + $request->setNamespaceIds($optionalArgs['namespaceIds']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ImportDocuments', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * List all the databases in the project. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedParent = $firestoreAdminClient->projectName('[PROJECT]'); + * $response = $firestoreAdminClient->listDatabases($formattedParent); + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. A parent name of the form + * `projects/{project_id}` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Firestore\Admin\V1\ListDatabasesResponse + * + * @throws ApiException if the remote call fails + */ + public function listDatabases($parent, array $optionalArgs = []) + { + $request = new ListDatabasesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ListDatabases', ListDatabasesResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists the field configuration and metadata for this database. + * + * Currently, + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * only supports listing fields that have been explicitly overridden. To issue + * this query, call + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * with the filter set to `indexConfig.usesAncestorConfig:false` or + * `ttlConfig:*`. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedParent = $firestoreAdminClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + * // Iterate over pages of elements + * $pagedResponse = $firestoreAdminClient->listFields($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $firestoreAdminClient->listFields($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * The filter to apply to list results. Currently, + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * only supports listing fields that have been explicitly overridden. To issue + * this query, call + * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] + * with a filter that includes `indexConfig.usesAncestorConfig:false` . + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listFields($parent, array $optionalArgs = []) + { + $request = new ListFieldsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListFields', $optionalArgs, ListFieldsResponse::class, $request); + } + + /** + * Lists composite indexes. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedParent = $firestoreAdminClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + * // Iterate over pages of elements + * $pagedResponse = $firestoreAdminClient->listIndexes($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $firestoreAdminClient->listIndexes($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. A parent name of the form + * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` + * @param array $optionalArgs { + * Optional. + * + * @type string $filter + * The filter to apply to list results. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listIndexes($parent, array $optionalArgs = []) + { + $request = new ListIndexesRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListIndexes', $optionalArgs, ListIndexesResponse::class, $request); + } + + /** + * Updates a database. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $database = new Database(); + * $operationResponse = $firestoreAdminClient->updateDatabase($database); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $firestoreAdminClient->updateDatabase($database); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'updateDatabase'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param Database $database Required. The database to update. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * The list of fields to be updated. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateDatabase($database, array $optionalArgs = []) + { + $request = new UpdateDatabaseRequest(); + $requestParamHeaders = []; + $request->setDatabase($database); + $requestParamHeaders['database.name'] = $database->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates a field configuration. Currently, field updates apply only to + * single field index configuration. However, calls to + * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] + * should provide a field mask to avoid changing any configuration that the + * caller isn't aware of. The field mask should be specified as: `{ paths: + * "index_config" }`. + * + * This call returns a + * [google.longrunning.Operation][google.longrunning.Operation] which may be + * used to track the status of the field update. The metadata for the + * operation will be the type + * [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata]. + * + * To configure the default field settings for the database, use + * the special `Field` with resource name: + * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $field = new Field(); + * $operationResponse = $firestoreAdminClient->updateField($field); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $firestoreAdminClient->updateField($field); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'updateField'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param Field $field Required. The field to be updated. + * @param array $optionalArgs { + * Optional. + * + * @type FieldMask $updateMask + * A mask, relative to the field. If specified, only configuration specified + * by this field_mask will be updated in the field. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateField($field, array $optionalArgs = []) + { + $request = new UpdateFieldRequest(); + $requestParamHeaders = []; + $request->setField($field); + $requestParamHeaders['field.name'] = $field->getName(); + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateField', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } +} diff --git a/owl-bot-staging/Firestore/v1/Admin/src/V1/gapic_metadata.json b/owl-bot-staging/Firestore/v1/Admin/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..251b3002719f --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/src/V1/gapic_metadata.json @@ -0,0 +1,88 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.firestore.admin.v1", + "libraryPackage": "Google\\Cloud\\Firestore\\Admin\\V1", + "services": { + "FirestoreAdmin": { + "clients": { + "grpc": { + "libraryClient": "FirestoreAdminGapicClient", + "rpcs": { + "CreateDatabase": { + "methods": [ + "createDatabase" + ] + }, + "CreateIndex": { + "methods": [ + "createIndex" + ] + }, + "DeleteDatabase": { + "methods": [ + "deleteDatabase" + ] + }, + "DeleteIndex": { + "methods": [ + "deleteIndex" + ] + }, + "ExportDocuments": { + "methods": [ + "exportDocuments" + ] + }, + "GetDatabase": { + "methods": [ + "getDatabase" + ] + }, + "GetField": { + "methods": [ + "getField" + ] + }, + "GetIndex": { + "methods": [ + "getIndex" + ] + }, + "ImportDocuments": { + "methods": [ + "importDocuments" + ] + }, + "ListDatabases": { + "methods": [ + "listDatabases" + ] + }, + "ListFields": { + "methods": [ + "listFields" + ] + }, + "ListIndexes": { + "methods": [ + "listIndexes" + ] + }, + "UpdateDatabase": { + "methods": [ + "updateDatabase" + ] + }, + "UpdateField": { + "methods": [ + "updateField" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_client_config.json b/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_client_config.json new file mode 100644 index 000000000000..46411a511d21 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_client_config.json @@ -0,0 +1,116 @@ +{ + "interfaces": { + "google.firestore.admin.v1.FirestoreAdmin": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "INTERNAL", + "DEADLINE_EXCEEDED" + ], + "no_retry_1_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateDatabase": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateIndex": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteDatabase": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteIndex": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ExportDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetDatabase": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetField": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIndex": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListDatabases": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListFields": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListIndexes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "UpdateDatabase": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateField": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_descriptor_config.php b/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_descriptor_config.php new file mode 100644 index 000000000000..b668c10926a7 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_descriptor_config.php @@ -0,0 +1,250 @@ + [ + 'google.firestore.admin.v1.FirestoreAdmin' => [ + 'CreateDatabase' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\Database', + 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\CreateDatabaseMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateIndex' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\Index', + 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\IndexOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDatabase' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\Database', + 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\DeleteDatabaseMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ExportDocuments' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\ExportDocumentsResponse', + 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\ExportDocumentsMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ImportDocuments' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\ImportDocumentsMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateDatabase' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\Database', + 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\UpdateDatabaseMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'database.name', + 'fieldAccessors' => [ + 'getDatabase', + 'getName', + ], + ], + ], + ], + 'UpdateField' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\Field', + 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'field.name', + 'fieldAccessors' => [ + 'getField', + 'getName', + ], + ], + ], + ], + 'DeleteIndex' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDatabase' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\Admin\V1\Database', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetField' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\Admin\V1\Field', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetIndex' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\Admin\V1\Index', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListDatabases' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\Admin\V1\ListDatabasesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListFields' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getFields', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Firestore\Admin\V1\ListFieldsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListIndexes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getIndexes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Firestore\Admin\V1\ListIndexesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'collectionGroup' => 'projects/{project}/databases/{database}/collectionGroups/{collection}', + 'database' => 'projects/{project}/databases/{database}', + 'field' => 'projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}', + 'index' => 'projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}', + 'project' => 'projects/{project}', + ], + ], + ], +]; diff --git a/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_rest_client_config.php b/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_rest_client_config.php new file mode 100644 index 000000000000..a1558d611821 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_rest_client_config.php @@ -0,0 +1,221 @@ + [ + 'google.firestore.admin.v1.FirestoreAdmin' => [ + 'CreateDatabase' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}/databases', + 'body' => 'database', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'database_id', + ], + ], + 'CreateIndex' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes', + 'body' => 'index', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteDatabase' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/databases/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteIndex' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExportDocuments' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/databases/*}:exportDocuments', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDatabase' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/databases/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetField' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetIndex' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ImportDocuments' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/databases/*}:importDocuments', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListDatabases' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*}/databases', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListFields' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/collectionGroups/*}/fields', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListIndexes' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateDatabase' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{database.name=projects/*/databases/*}', + 'body' => 'database', + 'placeholders' => [ + 'database.name' => [ + 'getters' => [ + 'getDatabase', + 'getName', + ], + ], + ], + ], + 'UpdateField' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}', + 'body' => 'field', + 'placeholders' => [ + 'field.name' => [ + 'getters' => [ + 'getField', + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/databases/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/databases/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/databases/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/databases/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/Client/FirestoreAdminClientTest.php b/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/Client/FirestoreAdminClientTest.php new file mode 100644 index 000000000000..71ace8051bb4 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/Client/FirestoreAdminClientTest.php @@ -0,0 +1,1540 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return FirestoreAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new FirestoreAdminClient($options); + } + + /** @test */ + public function createDatabaseTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDatabaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $locationId = 'locationId552319461'; + $keyPrefix = 'keyPrefix438630514'; + $etag = 'etag3123477'; + $expectedResponse = new Database(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setKeyPrefix($keyPrefix); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDatabaseTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $database = new Database(); + $databaseId = 'databaseId816491103'; + $request = (new CreateDatabaseRequest()) + ->setParent($formattedParent) + ->setDatabase($database) + ->setDatabaseId($databaseId); + $response = $gapicClient->createDatabase($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/CreateDatabase', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $actualValue = $actualApiRequestObject->getDatabaseId(); + $this->assertProtobufEquals($databaseId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDatabaseTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createDatabaseExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDatabaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $database = new Database(); + $databaseId = 'databaseId816491103'; + $request = (new CreateDatabaseRequest()) + ->setParent($formattedParent) + ->setDatabase($database) + ->setDatabaseId($databaseId); + $response = $gapicClient->createDatabase($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDatabaseTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createIndexTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new Index(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createIndexTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + $index = new Index(); + $request = (new CreateIndexRequest()) + ->setParent($formattedParent) + ->setIndex($index); + $response = $gapicClient->createIndex($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/CreateIndex', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getIndex(); + $this->assertProtobufEquals($index, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createIndexTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createIndexExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + $index = new Index(); + $request = (new CreateIndexRequest()) + ->setParent($formattedParent) + ->setIndex($index); + $response = $gapicClient->createIndex($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createIndexTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteDatabaseTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteDatabaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $locationId = 'locationId552319461'; + $keyPrefix = 'keyPrefix438630514'; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Database(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setKeyPrefix($keyPrefix); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteDatabaseTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new DeleteDatabaseRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteDatabase($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteDatabase', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDatabaseTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteDatabaseExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteDatabaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new DeleteDatabaseRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteDatabase($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDatabaseTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteIndexTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); + $request = (new DeleteIndexRequest()) + ->setName($formattedName); + $gapicClient->deleteIndex($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteIndex', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteIndexExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); + $request = (new DeleteIndexRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteIndex($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function exportDocumentsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $outputUriPrefix2 = 'outputUriPrefix2-377757258'; + $expectedResponse = new ExportDocumentsResponse(); + $expectedResponse->setOutputUriPrefix($outputUriPrefix2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new ExportDocumentsRequest()) + ->setName($formattedName); + $response = $gapicClient->exportDocuments($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ExportDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDocumentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportDocumentsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new ExportDocumentsRequest()) + ->setName($formattedName); + $response = $gapicClient->exportDocuments($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDocumentsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getDatabaseTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $locationId = 'locationId552319461'; + $keyPrefix = 'keyPrefix438630514'; + $etag = 'etag3123477'; + $expectedResponse = new Database(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setKeyPrefix($keyPrefix); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new GetDatabaseRequest()) + ->setName($formattedName); + $response = $gapicClient->getDatabase($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/GetDatabase', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDatabaseExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new GetDatabaseRequest()) + ->setName($formattedName); + try { + $gapicClient->getDatabase($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFieldTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Field(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->fieldName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[FIELD]'); + $request = (new GetFieldRequest()) + ->setName($formattedName); + $response = $gapicClient->getField($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/GetField', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFieldExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->fieldName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[FIELD]'); + $request = (new GetFieldRequest()) + ->setName($formattedName); + try { + $gapicClient->getField($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIndexTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Index(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); + $request = (new GetIndexRequest()) + ->setName($formattedName); + $response = $gapicClient->getIndex($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/GetIndex', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIndexExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); + $request = (new GetIndexRequest()) + ->setName($formattedName); + try { + $gapicClient->getIndex($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function importDocumentsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new ImportDocumentsRequest()) + ->setName($formattedName); + $response = $gapicClient->importDocuments($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ImportDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDocumentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function importDocumentsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new ImportDocumentsRequest()) + ->setName($formattedName); + $response = $gapicClient->importDocuments($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDocumentsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function listDatabasesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListDatabasesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListDatabasesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listDatabases($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ListDatabases', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDatabasesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $request = (new ListDatabasesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listDatabases($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFieldsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $fieldsElement = new Field(); + $fields = [ + $fieldsElement, + ]; + $expectedResponse = new ListFieldsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setFields($fields); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + $request = (new ListFieldsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listFields($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getFields()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ListFields', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFieldsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + $request = (new ListFieldsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listFields($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listIndexesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $indexesElement = new Index(); + $indexes = [ + $indexesElement, + ]; + $expectedResponse = new ListIndexesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setIndexes($indexes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + $request = (new ListIndexesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listIndexes($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getIndexes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ListIndexes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listIndexesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + $request = (new ListIndexesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listIndexes($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDatabaseTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDatabaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $locationId = 'locationId552319461'; + $keyPrefix = 'keyPrefix438630514'; + $etag = 'etag3123477'; + $expectedResponse = new Database(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setKeyPrefix($keyPrefix); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateDatabaseTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $database = new Database(); + $request = (new UpdateDatabaseRequest()) + ->setDatabase($database); + $response = $gapicClient->updateDatabase($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/UpdateDatabase', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDatabaseTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateDatabaseExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDatabaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $database = new Database(); + $request = (new UpdateDatabaseRequest()) + ->setDatabase($database); + $response = $gapicClient->updateDatabase($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDatabaseTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateFieldTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateFieldTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new Field(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateFieldTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $field = new Field(); + $fieldName = 'fieldName1265009317'; + $field->setName($fieldName); + $request = (new UpdateFieldRequest()) + ->setField($field); + $response = $gapicClient->updateField($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/UpdateField', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getField(); + $this->assertProtobufEquals($field, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateFieldTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateFieldExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateFieldTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $field = new Field(); + $fieldName = 'fieldName1265009317'; + $field->setName($fieldName); + $request = (new UpdateFieldRequest()) + ->setField($field); + $response = $gapicClient->updateField($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateFieldTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createDatabaseAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDatabaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $locationId = 'locationId552319461'; + $keyPrefix = 'keyPrefix438630514'; + $etag = 'etag3123477'; + $expectedResponse = new Database(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setKeyPrefix($keyPrefix); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDatabaseTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $database = new Database(); + $databaseId = 'databaseId816491103'; + $request = (new CreateDatabaseRequest()) + ->setParent($formattedParent) + ->setDatabase($database) + ->setDatabaseId($databaseId); + $response = $gapicClient->createDatabaseAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/CreateDatabase', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $actualValue = $actualApiRequestObject->getDatabaseId(); + $this->assertProtobufEquals($databaseId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDatabaseTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/FirestoreAdminClientTest.php b/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/FirestoreAdminClientTest.php new file mode 100644 index 000000000000..76c08a0fc07c --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/FirestoreAdminClientTest.php @@ -0,0 +1,1382 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return FirestoreAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new FirestoreAdminClient($options); + } + + /** @test */ + public function createDatabaseTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDatabaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $locationId = 'locationId552319461'; + $keyPrefix = 'keyPrefix438630514'; + $etag = 'etag3123477'; + $expectedResponse = new Database(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setKeyPrefix($keyPrefix); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createDatabaseTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $database = new Database(); + $databaseId = 'databaseId816491103'; + $response = $gapicClient->createDatabase($formattedParent, $database, $databaseId); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/CreateDatabase', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $actualValue = $actualApiRequestObject->getDatabaseId(); + $this->assertProtobufEquals($databaseId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDatabaseTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createDatabaseExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createDatabaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $database = new Database(); + $databaseId = 'databaseId816491103'; + $response = $gapicClient->createDatabase($formattedParent, $database, $databaseId); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createDatabaseTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createIndexTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new Index(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createIndexTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + $index = new Index(); + $response = $gapicClient->createIndex($formattedParent, $index); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/CreateIndex', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getIndex(); + $this->assertProtobufEquals($index, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createIndexTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createIndexExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + $index = new Index(); + $response = $gapicClient->createIndex($formattedParent, $index); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createIndexTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteDatabaseTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteDatabaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $locationId = 'locationId552319461'; + $keyPrefix = 'keyPrefix438630514'; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Database(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setKeyPrefix($keyPrefix); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteDatabaseTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $response = $gapicClient->deleteDatabase($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteDatabase', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDatabaseTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteDatabaseExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteDatabaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $response = $gapicClient->deleteDatabase($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteDatabaseTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteIndexTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); + $gapicClient->deleteIndex($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteIndex', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteIndexExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); + try { + $gapicClient->deleteIndex($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function exportDocumentsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $outputUriPrefix2 = 'outputUriPrefix2-377757258'; + $expectedResponse = new ExportDocumentsResponse(); + $expectedResponse->setOutputUriPrefix($outputUriPrefix2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $response = $gapicClient->exportDocuments($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ExportDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDocumentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportDocumentsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $response = $gapicClient->exportDocuments($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportDocumentsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getDatabaseTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $locationId = 'locationId552319461'; + $keyPrefix = 'keyPrefix438630514'; + $etag = 'etag3123477'; + $expectedResponse = new Database(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setKeyPrefix($keyPrefix); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $response = $gapicClient->getDatabase($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/GetDatabase', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDatabaseExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + try { + $gapicClient->getDatabase($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFieldTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Field(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->fieldName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[FIELD]'); + $response = $gapicClient->getField($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/GetField', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFieldExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->fieldName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[FIELD]'); + try { + $gapicClient->getField($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIndexTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Index(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); + $response = $gapicClient->getIndex($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/GetIndex', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIndexExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); + try { + $gapicClient->getIndex($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function importDocumentsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $response = $gapicClient->importDocuments($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ImportDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDocumentsTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function importDocumentsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $response = $gapicClient->importDocuments($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importDocumentsTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function listDatabasesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListDatabasesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $response = $gapicClient->listDatabases($formattedParent); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ListDatabases', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDatabasesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + try { + $gapicClient->listDatabases($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFieldsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $fieldsElement = new Field(); + $fields = [ + $fieldsElement, + ]; + $expectedResponse = new ListFieldsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setFields($fields); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + $response = $gapicClient->listFields($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getFields()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ListFields', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listFieldsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + try { + $gapicClient->listFields($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listIndexesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $indexesElement = new Index(); + $indexes = [ + $indexesElement, + ]; + $expectedResponse = new ListIndexesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setIndexes($indexes); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + $response = $gapicClient->listIndexes($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getIndexes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ListIndexes', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listIndexesExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); + try { + $gapicClient->listIndexes($formattedParent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDatabaseTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDatabaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $locationId = 'locationId552319461'; + $keyPrefix = 'keyPrefix438630514'; + $etag = 'etag3123477'; + $expectedResponse = new Database(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setKeyPrefix($keyPrefix); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateDatabaseTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $database = new Database(); + $response = $gapicClient->updateDatabase($database); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/UpdateDatabase', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDatabaseTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateDatabaseExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDatabaseTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $database = new Database(); + $response = $gapicClient->updateDatabase($database); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDatabaseTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateFieldTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateFieldTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new Field(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateFieldTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $field = new Field(); + $fieldName = 'fieldName1265009317'; + $field->setName($fieldName); + $response = $gapicClient->updateField($field); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/UpdateField', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getField(); + $this->assertProtobufEquals($field, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateFieldTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateFieldExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateFieldTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $field = new Field(); + $fieldName = 'fieldName1265009317'; + $field->setName($fieldName); + $response = $gapicClient->updateField($field); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateFieldTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/AggregationResult.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/AggregationResult.php new file mode 100644 index 000000000000..5f249ebfc8d4 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/AggregationResult.php @@ -0,0 +1,33 @@ +internalAddGeneratedFile( + ' +Ý +,google/firestore/v1/aggregation_result.protogoogle.firestore.v1"¾ +AggregationResultU +aggregate_fields ( 2;.google.firestore.v1.AggregationResult.AggregateFieldsEntryR +AggregateFieldsEntry +key ( ) +value ( 2.google.firestore.v1.Value:8BÎ +com.google.firestore.v1BAggregationResultProtoPZ;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb¢GCFSªGoogle.Cloud.Firestore.V1ÊGoogle\\Cloud\\Firestore\\V1êGoogle::Cloud::Firestore::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/BloomFilter.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/BloomFilter.php new file mode 100644 index 000000000000..84249064625d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/BloomFilter.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + ' +“ +&google/firestore/v1/bloom_filter.protogoogle.firestore.v1". + BitSequence +bitmap (  +padding ("Q + BloomFilter. +bits ( 2 .google.firestore.v1.BitSequence + +hash_count (BÈ +com.google.firestore.v1BBloomFilterProtoPZ;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb¢GCFSªGoogle.Cloud.Firestore.V1ÊGoogle\\Cloud\\Firestore\\V1êGoogle::Cloud::Firestore::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Common.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Common.php new file mode 100644 index 0000000000000000000000000000000000000000..57fc24775305fca474d9b6362acebc92c29cb815 GIT binary patch literal 1296 zcmb7E-A)rh7^MXXOo_q8C=f43AX*aLx_Y-2jit13fo-J0#B9<`cfTzYw=O`QsLJ!-0{ z$w>JArL9XA>+10fI`Qx-iVDds)5vO(Bun`aeZPVJ+CgV6@3C9-*gf~Qw$VzHhv^8I zJ|^nDvxX`$g(T_=qR-TN3C~xTw*aklC4`(sremBrt7s8EQl+!=Qg!KY&hbzs6=ooy zuZ^+wviV$jy6H|b+6gi}aSPXnbB$GWvtaD&v4E|wW#sfEVT#y(cSM#ZOCU9od{}ny(pv@)MuW*lo#6jt&?x%jeODFeaqFFuDg5c z{hXc!fjtaneg@`m@T+_;hx)!f_Wc6v`={Pu(GJJ6hs8uc%9m_rC;zyQHZotD3v_|d EZyxKVYXATM literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Document.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Document.php new file mode 100644 index 0000000000000000000000000000000000000000..0d2328d9b6142573315b7ae8e0cacf99427360f2 GIT binary patch literal 1930 zcmb_d-EPxJ6y79l)tt0c1OcT2F=UZQSBpcs+7-AIM1K-00j)&U3uGypI48zh$F|1f zO4(H<9)V}zk_+B~8y1W+%!?u~z|Pngn8-+A z=cL;iMQ%F5P+B@2K*%SU#N0*JKiqzal8?CLPG2*fUe0umyPE)Rz>|dSnhfwSF#5#l zFz{WLNG|E?uAdD2(3d_B{C`OM78~;*K_Xwoj?>VUeiSlAI0#*Aud^(t!rqM|s&$Ly zS`JnDRJyYtN)#avoLx*@;m1_jAwg~1Ls>LUt+dz8wkn-JX6;O)ZC?<%#iU5FygOq8 zWh%l=ty?8HEq*yOI#sB9O_^M2+h;YMrT8xK$ftvld=meE?$IG^hz7F#zJV=prpWCr)Np^}pr=x{_%S3^I0u*q3Igenk+CfBsAJIxG*#?Z`tzQmtFe0_x;F z6eggw)F^NbmPQd>TQuvcHx*j{6IO~-Ga;bRciWbwOQi5a&u}gir%vlvp)s6FOw4kV zmX~Px2CN9A2Mp=Po6x*rSg_(@G>9Y8Z9m`p3XL|`ipUFT;Xgvft%h>!47IZA3(^obvY<5n9 z&eVEefyF#+$=?}qw!d?D+223WecPWaaGj>ftPX51=a);raEFyQn{E)LqZ~`Lju(|i z43B-9GDY3-aI^ILLv^md(|i4~dZVugjJ2b4_3|-e9e2OvF~`wCr!<6U3Vp5K%&4}l m!?sXd7C)O_x%f&9-*_wAHq0NV6@fELmgwC7G=~ zGdnYGnyqpH?EwjCk#-U69#{z>4l5+CAdt8qA@&G@LoaaPfH;D^eSPizroOU#XY({{^_`YiBL#iiakd*Izh!yE4;+u=pI&MIl4J4^vdt#(U9(2? zTkEBJBrxk{V3u#Ot>sm@wfykP0z$Qh>HB*45Isja{Bv8?hE>!3zzpEOvzA}6Y%8$L zhV>q3zo>7S4WGd7?zLMjyB1iEtH4^mJYKNYL`^1*SI@ zupjQi)}!)@lx9e(daTwura)l1D%Ctbp{tH$))Bf2HXL z0~{M}-LxRz0<-D9#IcV&({+hA0Jt{XTKNG$vX!uh<=CY+Es;^hdOb{_RUnu1A>?TS zoI^i;3!UkMRq!#sD7Pi~Blq-5c1G+pT`ON>fae^P{Ziz`7DaWXDqt-ZTvVNDwy|3Q zf&=i1)k@w2wgiNV6^2S)UBIwIsn7(P3%r#l6fzyV!^$Im%HqC@( zr7&q%&KeiltY zIiy>Ga4S}w*}+WH@H858&23Wgp$0KM)6`@Q&mhE}2hI~>&kjppXkgl?(4NTy&UO)!Rk1m5^eRd5aCO z&d_ee3V6ZfSrsbOT`?*| zb4g-O{y{@iZSSZ7$D9cYvD;772Q^vyK8F-va=hM|NX@GqMs3gEDdl z7C4j+@a*k=vGB2mPAUB-U~x@SqoC-oD7_N#g-H7j{^D?o(Q;3881JXhiFMNpSUv9@ z)>qGEfFm^C{JcsH3RA!uwIPhV8)>LTk*1r*Gab*@|6h!%Xu8u4B071hmrz(z@+oD6 zmRg?gc*(8qKQuHhXd99MZcqv34y=aUA!akYg5Y+w8R}VWXphggx9=q5coB^>%qnU4 zaG#>}>XOogsCv1(Z2gKIczfAPC=>Y=XVB0Svd8aEcmk!LnvE9W*QG-0x@P=DLld$> z@hd~jD0XFJmyxKV9Kc;wkXt-(73|rP82HUV-vVJ85=o)T{W{YlAp}rE_NfjMA=UF%nVkud}O!xTPJupWiw<&gTwi^{m(V z8!R@kAGmkRYQXeYj2YA|$;vZ6Ss*aNg0)aA!LQKHGHA0#!1&7$8sWad*HJoJW5qjwh0-d|NZlJ5xb*M2Br8jaIFy9vMxCla(-iuE}e)+QZT+bH)2Ohw8< zoO{R7umdx7-Z9{-Xp%g0VORp41t)SkO~}lLnGrUgFkZhp|BzBd_AELgF(7oN2T2I= zW_m2!M45Xq>y3qZY3rESB?}VgO)V zI5|ImK(zSwTvXO396&3dkZ0Ao2h#X7O4rO5TxdB6uoMf!xf~zAQu>r?wj&+y4tv%| zV+~Dp=`(@G*6vr9ZWq^XtxO%lhtW`Rd3j0$HAgm9?%jX5GL?b?aCqtMjg6JH&8Zd5|Hj_1*iw;)jcv2?8)s1j0EqZ zlL`d|6;7kc*aVOl{ITSk4t@SncK41}&ZNTLuHwD#jHR$n@cO3)R@c$5P%Dgg5su0e zF6pYreBRf)9vf(ckCCCC(2hfa;rSOQ(b%dS>EjPHl!**@Z~}8imWaZgJ$U+PT>ti; z{{CTV9$%&-_vdtKy$Iy=4se&BpUcbP5&KybDEjl<+&=z~=n+EF!WU#J#xD94QsEk@ z)m%SIxtopeX-voW;VQ$Fgq{;-a($|qe;z~a{^J{XaS$o{odWQ0H8dHYXJWNA@kP?| z9`UF$TUX}4!IYHjpBo@Bh49k+qIg^ixEL9k;vawo@!@2G1@T4Ff@vAMu!^z2&lxv3 zl;#G8(u*Sda|!;HWQ+)meXMTB6;nNSbI7W@M#XZ0t|g}RqH&!&Tue(7(6yhJ4)qIF zF?20xbC)&zdzfl;j??f(>8V&kbS{&AO)xZJMrStayh+FyKWooD<`pX=sFx z->{+7U(V*Zzt!ESTqB(Pfa$tmTpLtZKD=WZ9+6~pahLw#&&NO2(5Rf%VRd&ZUrQG! zLHF^?g1{5ALZ;#IP{YVf82^>3DW-u*YQ~3!*)J>oE`@A}?%MbcC&qo@);@W0zu<}E zK>eM7fFApFF2iRMUH)+yW+c=@x~w~>=z*P zks%lL!s=k&6kh0(gFn(xnst9zePfPxhFLY)h$X_tn=DTY#@CpIGTr(hYepGh+IbD4 z@*`k4e$h{0IQ~*bLCtV-jnJ(4vJBT?_h+fvM=5laN{(F;5=vm#I;pU_1S*yb-9P2X z`9L#n42B%4drVUbo;$|!AW{T)RH9xK#pRY#J!&`LSUm=AFOZH%=#rxgg$q_#_-+`5 zL4n1(00vU99sdIIJ^m;AgnW-LlKS@O4L6vQcSXgAbnCATp6lvi+bv@D>F34Sc6Y+R zN`a4t{2Wx?KNi2W69leb$me%=cLg`gmwB@l?7+80POE;&ZJ5E9<25h#T23>TeI8kY zE_w!zP!WDZ!Hwq>p~&iTqr!eQXOF(@YQqSms=P4r;U*> WA?ZEOswuvLWGngCiu-6Eq5lC#>dCYE%*@1FCW$G!L7ee1-6w}d7! zh^@F}ER4cYsIOo%P0=BcIW#1;ji-VxfJfzYV825%zNF+E!)6=7~oQE0T{|DaV$k8LbF@_gt*FBag||{!G`-GYRNo_YR6QkS{LPxqZa146bGF)OCiax9pN3}HzW9p)5r7|UMBo}?Nbt71o(rFW6 z%lENTdCJK>!L>aSUtJJv;(E5R%lxJUkE3711u{vNhEfrITqP&UnP%FR$}FlG$s%Z6 z;bGlWy;EYi%flmGKD8CgBDS*_%H+KLkrs$2jmMEz`&d6)QFJuc>+nqh-ngJ}_?LVG zF{&)_Y`a)mgc=7?`4v}uJ+NW*hbb*T3S9TUmww)WjXq{X#SD-!D>nWlR}EQ zace0aR2XZPzXuu99ur$0oflS^8#kANcPNOz4H+z8+m#i!u*w#Hbs@Uu*$z5-3(~|G zQ{&9V#_NzaCliObg)|y-{7v9=?NoCM+>_WaVz-63LfqJqw zM%@!zS^g?)D7r3>v31cq#c&-aWTyCc0@8s@UC7g^W;&WnAYtW9WhhHTWA+|D~ov9Yd>GkJz$pNC9-6)eYeM1dhw^)lrA*kt$IBE{blurcR2 z--4uRvC!9d_Lg#XjzR3;Ku~Z%V(G2=t2sdf{GY-ty$hL$sQ@o`x{aPR==9{HcE8)G zwf0+$dj1l>3Mr{w&nNgaBs;x)viN-paxwY%DsU_fK{oF!6%r%p5!~wtZV}kVR1=!O z^_>rwC-7yT>2U+NGg`et8y6QcvHC9ko>(gS%aA>6^!xJQKx(4~uK*uC$|zOi!I5;B zPx5(KYxWw_pwaU!Q~Wi!5`Qx@Ug5LA`8bY8dfeOtnl#VDy434Q59L~?J&;=Metwn8 z-fHJFbm=F*$x{1aKFb57DFxa<@!KTiV)YovN=NImvc}LeS?ghj{SJGU3?E!7eZG|7 z7*4A%w^8jRpMzEU`{?j6pW@d6=mUmIKd$f_kPDxw0asmzHIp_5jz`ve-z9+aXY7lp zPzkbQJT$RwBPdjHVR_BZt$K(mZo>Lp*<&TYkp7^u0_y8cbzttekEW!qV7VS$7 z$VOh!!mPJ?joP5qY0tGfR-@FfHQM!7yNSh)iq{*_bF%ak2gO-*(sXK*DIO0^!{5t4 zhP)GP?=m}!1|wl}8KH2XAH$k5W2Jit-PCt4K+iiO#$HrYe@KbqUpTR1FZmvDs_7Zw zp+kC(1;iR9Lf_kvay)ttp?lE%=V9!7r#_!@HVp>ZbMZ-MQ{>};!^6AcutP@H*X0A? znEQMgIM0$@GsstT0*N0C-n+{Nr;ltw3f+7WqrZq$=;4c?ssf(Gf~~Q-2Ea;?&4N-L z(!l}hCZyRG;b5$^y8dI2zy?T<$OJD}EUlU9FA2DcXP8CFtpaNT>|EFECO+F$b<-P% zhKMOo&DdQ{u{6A{MJH@)v>W^VLvp2A+wcFFyw+rwHL=FHq6>w1y!~tVZ8&5fhp`JC x-st{JzUD(K752GOiNKZ0@%AXq@_OfbbUS$4zbVBoR{wgbVwV2Z=P^76_y=cOweSD{ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Write.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Write.php new file mode 100644 index 0000000000000000000000000000000000000000..abcc4fb4abf939ee66ecb337b6ce2bac0cd6cdcf GIT binary patch literal 2679 zcmbtW-EJF26vj@R;t8bAR;VT_>eN)!mB?ByDiRw4#IYSBk;WvBk&vZjvO9K0?CvZx zv!MayWw_)qxa1YMMnZ^(;LNOd?Gj^`lAG9`^PQjXd}ro-{Aqjy-fX|cBhzjiSFlGT2HpcB^{Oq`oJMF{%1At1N2#-2=%=tK=jS&-6DlTZ_ zvf21vFhyP=X4Z9g^IB4!58J*S$9$cJC~<@+1#3|Sx`D~l8Sb#HqWm= zDSTp+#WperB_va?JCj`05GW-m^1@-Vt>XIOEM}mhg(dQsK zJvYle)OOMO3`^EMR6XsS3_2(7VDF2wj(hg(wAa}`>>hU76+LEeoOHfC>zwx8{^3!l zQfO7sMy?ZAUB$GPpmj6ECsZbZ0@AZl(&Ijv=bV`AF0k{P&U%VAryk*r1Sb-vTF+1p zo4uWE!$s{ow2`TM|AItg3Xxxw_Offl0#zy^;MsDSFQJ7i^^&!PtdwAwhw0gxKC6Y( zkZp7M06#B=EHA=a+o&uk0mqt{bg1(RZxS;b?!@%`rNe3VO8+%ngl>19GpQ(S0_o#v zZNi5})tPeEzApda&O;{kiz|fmx{RedDW}tyT7* z`D=DI9Gb)7%+dv0*Pq3EDb#VyvE$@m#~C!w*G%g^c$7cB@2A_$%<}WEi;uBP_mXRL GjnLneB4OkJ literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/AggregationResult.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/AggregationResult.php new file mode 100644 index 000000000000..d98419955554 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/AggregationResult.php @@ -0,0 +1,86 @@ +google.firestore.v1.AggregationResult + */ +class AggregationResult extends \Google\Protobuf\Internal\Message +{ + /** + * The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. + * The key is the + * [alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + * + * Generated from protobuf field map aggregate_fields = 2; + */ + private $aggregate_fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $aggregate_fields + * The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. + * The key is the + * [alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\AggregationResult::initOnce(); + parent::__construct($data); + } + + /** + * The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. + * The key is the + * [alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + * + * Generated from protobuf field map aggregate_fields = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAggregateFields() + { + return $this->aggregate_fields; + } + + /** + * The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. + * The key is the + * [alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias] + * assigned to the aggregation function on input and the size of this map + * equals the number of aggregation functions in the query. + * + * Generated from protobuf field map aggregate_fields = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAggregateFields($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class); + $this->aggregate_fields = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ArrayValue.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ArrayValue.php new file mode 100644 index 000000000000..a5e67239f7a8 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ArrayValue.php @@ -0,0 +1,67 @@ +google.firestore.v1.ArrayValue + */ +class ArrayValue extends \Google\Protobuf\Internal\Message +{ + /** + * Values in the array. + * + * Generated from protobuf field repeated .google.firestore.v1.Value values = 1; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Firestore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $values + * Values in the array. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * Values in the array. + * + * Generated from protobuf field repeated .google.firestore.v1.Value values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Values in the array. + * + * Generated from protobuf field repeated .google.firestore.v1.Value values = 1; + * @param array<\Google\Cloud\Firestore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class); + $this->values = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsRequest.php new file mode 100644 index 000000000000..d6e70f8173e6 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsRequest.php @@ -0,0 +1,296 @@ +google.firestore.v1.BatchGetDocumentsRequest + */ +class BatchGetDocumentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $database = ''; + /** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of the + * given `database`. Duplicate names will be elided. + * + * Generated from protobuf field repeated string documents = 2; + */ + private $documents; + /** + * The fields to return. If not set, returns all fields. + * If a document has a field that is not present in this mask, that field will + * not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 3; + */ + protected $mask = null; + protected $consistency_selector; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $database + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $documents + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of the + * given `database`. Duplicate names will be elided. + * @type \Google\Cloud\Firestore\V1\DocumentMask $mask + * The fields to return. If not set, returns all fields. + * If a document has a field that is not present in this mask, that field will + * not be returned in the response. + * @type string $transaction + * Reads documents in a transaction. + * @type \Google\Cloud\Firestore\V1\TransactionOptions $new_transaction + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + * @type \Google\Protobuf\Timestamp $read_time + * Reads documents as they were at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of the + * given `database`. Duplicate names will be elided. + * + * Generated from protobuf field repeated string documents = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDocuments() + { + return $this->documents; + } + + /** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of the + * given `database`. Duplicate names will be elided. + * + * Generated from protobuf field repeated string documents = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDocuments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->documents = $arr; + + return $this; + } + + /** + * The fields to return. If not set, returns all fields. + * If a document has a field that is not present in this mask, that field will + * not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 3; + * @return \Google\Cloud\Firestore\V1\DocumentMask|null + */ + public function getMask() + { + return $this->mask; + } + + public function hasMask() + { + return isset($this->mask); + } + + public function clearMask() + { + unset($this->mask); + } + + /** + * The fields to return. If not set, returns all fields. + * If a document has a field that is not present in this mask, that field will + * not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 3; + * @param \Google\Cloud\Firestore\V1\DocumentMask $var + * @return $this + */ + public function setMask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); + $this->mask = $var; + + return $this; + } + + /** + * Reads documents in a transaction. + * + * Generated from protobuf field bytes transaction = 4; + * @return string + */ + public function getTransaction() + { + return $this->readOneof(4); + } + + public function hasTransaction() + { + return $this->hasOneof(4); + } + + /** + * Reads documents in a transaction. + * + * Generated from protobuf field bytes transaction = 4; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + * + * Generated from protobuf field .google.firestore.v1.TransactionOptions new_transaction = 5; + * @return \Google\Cloud\Firestore\V1\TransactionOptions|null + */ + public function getNewTransaction() + { + return $this->readOneof(5); + } + + public function hasNewTransaction() + { + return $this->hasOneof(5); + } + + /** + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + * + * Generated from protobuf field .google.firestore.v1.TransactionOptions new_transaction = 5; + * @param \Google\Cloud\Firestore\V1\TransactionOptions $var + * @return $this + */ + public function setNewTransaction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TransactionOptions::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Reads documents as they were at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->readOneof(7); + } + + public function hasReadTime() + { + return $this->hasOneof(7); + } + + /** + * Reads documents as they were at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getConsistencySelector() + { + return $this->whichOneof("consistency_selector"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsResponse.php new file mode 100644 index 000000000000..97801733b24f --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsResponse.php @@ -0,0 +1,214 @@ +google.firestore.v1.BatchGetDocumentsResponse + */ +class BatchGetDocumentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The transaction that was started as part of this request. + * Will only be set in the first response, and only if + * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] + * was set in the request. + * + * Generated from protobuf field bytes transaction = 3; + */ + protected $transaction = ''; + /** + * The time at which the document was read. + * This may be monotically increasing, in this case the previous documents in + * the result stream are guaranteed not to have changed between their + * read_time and this one. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; + */ + protected $read_time = null; + protected $result; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\Document $found + * A document that was requested. + * @type string $missing + * A document name that was requested but does not exist. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * @type string $transaction + * The transaction that was started as part of this request. + * Will only be set in the first response, and only if + * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] + * was set in the request. + * @type \Google\Protobuf\Timestamp $read_time + * The time at which the document was read. + * This may be monotically increasing, in this case the previous documents in + * the result stream are guaranteed not to have changed between their + * read_time and this one. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * A document that was requested. + * + * Generated from protobuf field .google.firestore.v1.Document found = 1; + * @return \Google\Cloud\Firestore\V1\Document|null + */ + public function getFound() + { + return $this->readOneof(1); + } + + public function hasFound() + { + return $this->hasOneof(1); + } + + /** + * A document that was requested. + * + * Generated from protobuf field .google.firestore.v1.Document found = 1; + * @param \Google\Cloud\Firestore\V1\Document $var + * @return $this + */ + public function setFound($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Document::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A document name that was requested but does not exist. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string missing = 2; + * @return string + */ + public function getMissing() + { + return $this->readOneof(2); + } + + public function hasMissing() + { + return $this->hasOneof(2); + } + + /** + * A document name that was requested but does not exist. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string missing = 2; + * @param string $var + * @return $this + */ + public function setMissing($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The transaction that was started as part of this request. + * Will only be set in the first response, and only if + * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] + * was set in the request. + * + * Generated from protobuf field bytes transaction = 3; + * @return string + */ + public function getTransaction() + { + return $this->transaction; + } + + /** + * The transaction that was started as part of this request. + * Will only be set in the first response, and only if + * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] + * was set in the request. + * + * Generated from protobuf field bytes transaction = 3; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->transaction = $var; + + return $this; + } + + /** + * The time at which the document was read. + * This may be monotically increasing, in this case the previous documents in + * the result stream are guaranteed not to have changed between their + * read_time and this one. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * The time at which the document was read. + * This may be monotically increasing, in this case the previous documents in + * the result stream are guaranteed not to have changed between their + * read_time and this one. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getResult() + { + return $this->whichOneof("result"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteRequest.php new file mode 100644 index 000000000000..bc22dba85194 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteRequest.php @@ -0,0 +1,152 @@ +google.firestore.v1.BatchWriteRequest + */ +class BatchWriteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $database = ''; + /** + * The writes to apply. + * Method does not apply writes atomically and does not guarantee ordering. + * Each write succeeds or fails independently. You cannot write to the same + * document more than once per request. + * + * Generated from protobuf field repeated .google.firestore.v1.Write writes = 2; + */ + private $writes; + /** + * Labels associated with this batch write. + * + * Generated from protobuf field map labels = 3; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $database + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @type array<\Google\Cloud\Firestore\V1\Write>|\Google\Protobuf\Internal\RepeatedField $writes + * The writes to apply. + * Method does not apply writes atomically and does not guarantee ordering. + * Each write succeeds or fails independently. You cannot write to the same + * document more than once per request. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels associated with this batch write. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * The writes to apply. + * Method does not apply writes atomically and does not guarantee ordering. + * Each write succeeds or fails independently. You cannot write to the same + * document more than once per request. + * + * Generated from protobuf field repeated .google.firestore.v1.Write writes = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWrites() + { + return $this->writes; + } + + /** + * The writes to apply. + * Method does not apply writes atomically and does not guarantee ordering. + * Each write succeeds or fails independently. You cannot write to the same + * document more than once per request. + * + * Generated from protobuf field repeated .google.firestore.v1.Write writes = 2; + * @param array<\Google\Cloud\Firestore\V1\Write>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWrites($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Write::class); + $this->writes = $arr; + + return $this; + } + + /** + * Labels associated with this batch write. + * + * Generated from protobuf field map labels = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels associated with this batch write. + * + * Generated from protobuf field map labels = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteResponse.php new file mode 100644 index 000000000000..da43ca0a535b --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteResponse.php @@ -0,0 +1,118 @@ +google.firestore.v1.BatchWriteResponse + */ +class BatchWriteResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The result of applying the writes. + * This i-th write result corresponds to the i-th write in the + * request. + * + * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 1; + */ + private $write_results; + /** + * The status of applying the writes. + * This i-th write status corresponds to the i-th write in the + * request. + * + * Generated from protobuf field repeated .google.rpc.Status status = 2; + */ + private $status; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $write_results + * The result of applying the writes. + * This i-th write result corresponds to the i-th write in the + * request. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $status + * The status of applying the writes. + * This i-th write status corresponds to the i-th write in the + * request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * The result of applying the writes. + * This i-th write result corresponds to the i-th write in the + * request. + * + * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWriteResults() + { + return $this->write_results; + } + + /** + * The result of applying the writes. + * This i-th write result corresponds to the i-th write in the + * request. + * + * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 1; + * @param array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWriteResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\WriteResult::class); + $this->write_results = $arr; + + return $this; + } + + /** + * The status of applying the writes. + * This i-th write status corresponds to the i-th write in the + * request. + * + * Generated from protobuf field repeated .google.rpc.Status status = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStatus() + { + return $this->status; + } + + /** + * The status of applying the writes. + * This i-th write status corresponds to the i-th write in the + * request. + * + * Generated from protobuf field repeated .google.rpc.Status status = 2; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStatus($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->status = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionRequest.php new file mode 100644 index 000000000000..08de515ed1e5 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionRequest.php @@ -0,0 +1,134 @@ +google.firestore.v1.BeginTransactionRequest + */ +class BeginTransactionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $database = ''; + /** + * The options for the transaction. + * Defaults to a read-write transaction. + * + * Generated from protobuf field .google.firestore.v1.TransactionOptions options = 2; + */ + protected $options = null; + + /** + * @param string $database Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * @return \Google\Cloud\Firestore\V1\BeginTransactionRequest + * + * @experimental + */ + public static function build(string $database): self + { + return (new self()) + ->setDatabase($database); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $database + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @type \Google\Cloud\Firestore\V1\TransactionOptions $options + * The options for the transaction. + * Defaults to a read-write transaction. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * The options for the transaction. + * Defaults to a read-write transaction. + * + * Generated from protobuf field .google.firestore.v1.TransactionOptions options = 2; + * @return \Google\Cloud\Firestore\V1\TransactionOptions|null + */ + public function getOptions() + { + return $this->options; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * The options for the transaction. + * Defaults to a read-write transaction. + * + * Generated from protobuf field .google.firestore.v1.TransactionOptions options = 2; + * @param \Google\Cloud\Firestore\V1\TransactionOptions $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TransactionOptions::class); + $this->options = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionResponse.php new file mode 100644 index 000000000000..2dcf768331c3 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionResponse.php @@ -0,0 +1,68 @@ +google.firestore.v1.BeginTransactionResponse + */ +class BeginTransactionResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The transaction that was started. + * + * Generated from protobuf field bytes transaction = 1; + */ + protected $transaction = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $transaction + * The transaction that was started. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * The transaction that was started. + * + * Generated from protobuf field bytes transaction = 1; + * @return string + */ + public function getTransaction() + { + return $this->transaction; + } + + /** + * The transaction that was started. + * + * Generated from protobuf field bytes transaction = 1; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->transaction = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BitSequence.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BitSequence.php new file mode 100644 index 000000000000..7ce2da3b9590 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BitSequence.php @@ -0,0 +1,124 @@ +google.firestore.v1.BitSequence + */ +class BitSequence extends \Google\Protobuf\Internal\Message +{ + /** + * The bytes that encode the bit sequence. + * May have a length of zero. + * + * Generated from protobuf field bytes bitmap = 1; + */ + protected $bitmap = ''; + /** + * The number of bits of the last byte in `bitmap` to ignore as "padding". + * If the length of `bitmap` is zero, then this value must be `0`. + * Otherwise, this value must be between 0 and 7, inclusive. + * + * Generated from protobuf field int32 padding = 2; + */ + protected $padding = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bitmap + * The bytes that encode the bit sequence. + * May have a length of zero. + * @type int $padding + * The number of bits of the last byte in `bitmap` to ignore as "padding". + * If the length of `bitmap` is zero, then this value must be `0`. + * Otherwise, this value must be between 0 and 7, inclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\BloomFilter::initOnce(); + parent::__construct($data); + } + + /** + * The bytes that encode the bit sequence. + * May have a length of zero. + * + * Generated from protobuf field bytes bitmap = 1; + * @return string + */ + public function getBitmap() + { + return $this->bitmap; + } + + /** + * The bytes that encode the bit sequence. + * May have a length of zero. + * + * Generated from protobuf field bytes bitmap = 1; + * @param string $var + * @return $this + */ + public function setBitmap($var) + { + GPBUtil::checkString($var, False); + $this->bitmap = $var; + + return $this; + } + + /** + * The number of bits of the last byte in `bitmap` to ignore as "padding". + * If the length of `bitmap` is zero, then this value must be `0`. + * Otherwise, this value must be between 0 and 7, inclusive. + * + * Generated from protobuf field int32 padding = 2; + * @return int + */ + public function getPadding() + { + return $this->padding; + } + + /** + * The number of bits of the last byte in `bitmap` to ignore as "padding". + * If the length of `bitmap` is zero, then this value must be `0`. + * Otherwise, this value must be between 0 and 7, inclusive. + * + * Generated from protobuf field int32 padding = 2; + * @param int $var + * @return $this + */ + public function setPadding($var) + { + GPBUtil::checkInt32($var); + $this->padding = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BloomFilter.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BloomFilter.php new file mode 100644 index 000000000000..3a4b0b5d26af --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BloomFilter.php @@ -0,0 +1,119 @@ +google.firestore.v1.BloomFilter + */ +class BloomFilter extends \Google\Protobuf\Internal\Message +{ + /** + * The bloom filter data. + * + * Generated from protobuf field .google.firestore.v1.BitSequence bits = 1; + */ + protected $bits = null; + /** + * The number of hashes used by the algorithm. + * + * Generated from protobuf field int32 hash_count = 2; + */ + protected $hash_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\BitSequence $bits + * The bloom filter data. + * @type int $hash_count + * The number of hashes used by the algorithm. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\BloomFilter::initOnce(); + parent::__construct($data); + } + + /** + * The bloom filter data. + * + * Generated from protobuf field .google.firestore.v1.BitSequence bits = 1; + * @return \Google\Cloud\Firestore\V1\BitSequence|null + */ + public function getBits() + { + return $this->bits; + } + + public function hasBits() + { + return isset($this->bits); + } + + public function clearBits() + { + unset($this->bits); + } + + /** + * The bloom filter data. + * + * Generated from protobuf field .google.firestore.v1.BitSequence bits = 1; + * @param \Google\Cloud\Firestore\V1\BitSequence $var + * @return $this + */ + public function setBits($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\BitSequence::class); + $this->bits = $var; + + return $this; + } + + /** + * The number of hashes used by the algorithm. + * + * Generated from protobuf field int32 hash_count = 2; + * @return int + */ + public function getHashCount() + { + return $this->hash_count; + } + + /** + * The number of hashes used by the algorithm. + * + * Generated from protobuf field int32 hash_count = 2; + * @param int $var + * @return $this + */ + public function setHashCount($var) + { + GPBUtil::checkInt32($var); + $this->hash_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitRequest.php new file mode 100644 index 000000000000..01455af2f717 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitRequest.php @@ -0,0 +1,161 @@ +google.firestore.v1.CommitRequest + */ +class CommitRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $database = ''; + /** + * The writes to apply. + * Always executed atomically and in order. + * + * Generated from protobuf field repeated .google.firestore.v1.Write writes = 2; + */ + private $writes; + /** + * If set, applies all writes in this transaction, and commits it. + * + * Generated from protobuf field bytes transaction = 3; + */ + protected $transaction = ''; + + /** + * @param string $database Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @param \Google\Cloud\Firestore\V1\Write[] $writes The writes to apply. + * + * Always executed atomically and in order. + * + * @return \Google\Cloud\Firestore\V1\CommitRequest + * + * @experimental + */ + public static function build(string $database, array $writes): self + { + return (new self()) + ->setDatabase($database) + ->setWrites($writes); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $database + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @type array<\Google\Cloud\Firestore\V1\Write>|\Google\Protobuf\Internal\RepeatedField $writes + * The writes to apply. + * Always executed atomically and in order. + * @type string $transaction + * If set, applies all writes in this transaction, and commits it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * The writes to apply. + * Always executed atomically and in order. + * + * Generated from protobuf field repeated .google.firestore.v1.Write writes = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWrites() + { + return $this->writes; + } + + /** + * The writes to apply. + * Always executed atomically and in order. + * + * Generated from protobuf field repeated .google.firestore.v1.Write writes = 2; + * @param array<\Google\Cloud\Firestore\V1\Write>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWrites($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Write::class); + $this->writes = $arr; + + return $this; + } + + /** + * If set, applies all writes in this transaction, and commits it. + * + * Generated from protobuf field bytes transaction = 3; + * @return string + */ + public function getTransaction() + { + return $this->transaction; + } + + /** + * If set, applies all writes in this transaction, and commits it. + * + * Generated from protobuf field bytes transaction = 3; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->transaction = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitResponse.php new file mode 100644 index 000000000000..aa52dc11399d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitResponse.php @@ -0,0 +1,123 @@ +google.firestore.v1.CommitResponse + */ +class CommitResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The result of applying the writes. + * This i-th write result corresponds to the i-th write in the + * request. + * + * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 1; + */ + private $write_results; + /** + * The time at which the commit occurred. Any read with an equal or greater + * `read_time` is guaranteed to see the effects of the commit. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 2; + */ + protected $commit_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $write_results + * The result of applying the writes. + * This i-th write result corresponds to the i-th write in the + * request. + * @type \Google\Protobuf\Timestamp $commit_time + * The time at which the commit occurred. Any read with an equal or greater + * `read_time` is guaranteed to see the effects of the commit. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * The result of applying the writes. + * This i-th write result corresponds to the i-th write in the + * request. + * + * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWriteResults() + { + return $this->write_results; + } + + /** + * The result of applying the writes. + * This i-th write result corresponds to the i-th write in the + * request. + * + * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 1; + * @param array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWriteResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\WriteResult::class); + $this->write_results = $arr; + + return $this; + } + + /** + * The time at which the commit occurred. Any read with an equal or greater + * `read_time` is guaranteed to see the effects of the commit. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCommitTime() + { + return $this->commit_time; + } + + public function hasCommitTime() + { + return isset($this->commit_time); + } + + public function clearCommitTime() + { + unset($this->commit_time); + } + + /** + * The time at which the commit occurred. Any read with an equal or greater + * `read_time` is guaranteed to see the effects of the commit. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCommitTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->commit_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CreateDocumentRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CreateDocumentRequest.php new file mode 100644 index 000000000000..8e2171cf630c --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CreateDocumentRequest.php @@ -0,0 +1,248 @@ +google.firestore.v1.CreateDocumentRequest + */ +class CreateDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource. For example: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. The collection ID, relative to `parent`, to list. For example: + * `chatrooms`. + * + * Generated from protobuf field string collection_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $collection_id = ''; + /** + * The client-assigned document ID to use for this document. + * Optional. If not specified, an ID will be assigned by the service. + * + * Generated from protobuf field string document_id = 3; + */ + protected $document_id = ''; + /** + * Required. The document to create. `name` must not be set. + * + * Generated from protobuf field .google.firestore.v1.Document document = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $document = null; + /** + * The fields to return. If not set, returns all fields. + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 5; + */ + protected $mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource. For example: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + * @type string $collection_id + * Required. The collection ID, relative to `parent`, to list. For example: + * `chatrooms`. + * @type string $document_id + * The client-assigned document ID to use for this document. + * Optional. If not specified, an ID will be assigned by the service. + * @type \Google\Cloud\Firestore\V1\Document $document + * Required. The document to create. `name` must not be set. + * @type \Google\Cloud\Firestore\V1\DocumentMask $mask + * The fields to return. If not set, returns all fields. + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource. For example: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource. For example: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The collection ID, relative to `parent`, to list. For example: + * `chatrooms`. + * + * Generated from protobuf field string collection_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCollectionId() + { + return $this->collection_id; + } + + /** + * Required. The collection ID, relative to `parent`, to list. For example: + * `chatrooms`. + * + * Generated from protobuf field string collection_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCollectionId($var) + { + GPBUtil::checkString($var, True); + $this->collection_id = $var; + + return $this; + } + + /** + * The client-assigned document ID to use for this document. + * Optional. If not specified, an ID will be assigned by the service. + * + * Generated from protobuf field string document_id = 3; + * @return string + */ + public function getDocumentId() + { + return $this->document_id; + } + + /** + * The client-assigned document ID to use for this document. + * Optional. If not specified, an ID will be assigned by the service. + * + * Generated from protobuf field string document_id = 3; + * @param string $var + * @return $this + */ + public function setDocumentId($var) + { + GPBUtil::checkString($var, True); + $this->document_id = $var; + + return $this; + } + + /** + * Required. The document to create. `name` must not be set. + * + * Generated from protobuf field .google.firestore.v1.Document document = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Firestore\V1\Document|null + */ + public function getDocument() + { + return $this->document; + } + + public function hasDocument() + { + return isset($this->document); + } + + public function clearDocument() + { + unset($this->document); + } + + /** + * Required. The document to create. `name` must not be set. + * + * Generated from protobuf field .google.firestore.v1.Document document = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Firestore\V1\Document $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Document::class); + $this->document = $var; + + return $this; + } + + /** + * The fields to return. If not set, returns all fields. + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 5; + * @return \Google\Cloud\Firestore\V1\DocumentMask|null + */ + public function getMask() + { + return $this->mask; + } + + public function hasMask() + { + return isset($this->mask); + } + + public function clearMask() + { + unset($this->mask); + } + + /** + * The fields to return. If not set, returns all fields. + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 5; + * @param \Google\Cloud\Firestore\V1\DocumentMask $var + * @return $this + */ + public function setMask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); + $this->mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Cursor.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Cursor.php new file mode 100644 index 000000000000..9fdaf73c3abe --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Cursor.php @@ -0,0 +1,113 @@ +google.firestore.v1.Cursor + */ +class Cursor extends \Google\Protobuf\Internal\Message +{ + /** + * The values that represent a position, in the order they appear in + * the order by clause of a query. + * Can contain fewer values than specified in the order by clause. + * + * Generated from protobuf field repeated .google.firestore.v1.Value values = 1; + */ + private $values; + /** + * If the position is just before or just after the given values, relative + * to the sort order defined by the query. + * + * Generated from protobuf field bool before = 2; + */ + protected $before = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Firestore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $values + * The values that represent a position, in the order they appear in + * the order by clause of a query. + * Can contain fewer values than specified in the order by clause. + * @type bool $before + * If the position is just before or just after the given values, relative + * to the sort order defined by the query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The values that represent a position, in the order they appear in + * the order by clause of a query. + * Can contain fewer values than specified in the order by clause. + * + * Generated from protobuf field repeated .google.firestore.v1.Value values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * The values that represent a position, in the order they appear in + * the order by clause of a query. + * Can contain fewer values than specified in the order by clause. + * + * Generated from protobuf field repeated .google.firestore.v1.Value values = 1; + * @param array<\Google\Cloud\Firestore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class); + $this->values = $arr; + + return $this; + } + + /** + * If the position is just before or just after the given values, relative + * to the sort order defined by the query. + * + * Generated from protobuf field bool before = 2; + * @return bool + */ + public function getBefore() + { + return $this->before; + } + + /** + * If the position is just before or just after the given values, relative + * to the sort order defined by the query. + * + * Generated from protobuf field bool before = 2; + * @param bool $var + * @return $this + */ + public function setBefore($var) + { + GPBUtil::checkBool($var); + $this->before = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DeleteDocumentRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DeleteDocumentRequest.php new file mode 100644 index 000000000000..86172865d22c --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DeleteDocumentRequest.php @@ -0,0 +1,134 @@ +google.firestore.v1.DeleteDocumentRequest + */ +class DeleteDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Document to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * An optional precondition on the document. + * The request will fail if this is set and not met by the target document. + * + * Generated from protobuf field .google.firestore.v1.Precondition current_document = 2; + */ + protected $current_document = null; + + /** + * @param string $name Required. The resource name of the Document to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * @return \Google\Cloud\Firestore\V1\DeleteDocumentRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Document to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * @type \Google\Cloud\Firestore\V1\Precondition $current_document + * An optional precondition on the document. + * The request will fail if this is set and not met by the target document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Document to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Document to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * An optional precondition on the document. + * The request will fail if this is set and not met by the target document. + * + * Generated from protobuf field .google.firestore.v1.Precondition current_document = 2; + * @return \Google\Cloud\Firestore\V1\Precondition|null + */ + public function getCurrentDocument() + { + return $this->current_document; + } + + public function hasCurrentDocument() + { + return isset($this->current_document); + } + + public function clearCurrentDocument() + { + unset($this->current_document); + } + + /** + * An optional precondition on the document. + * The request will fail if this is set and not met by the target document. + * + * Generated from protobuf field .google.firestore.v1.Precondition current_document = 2; + * @param \Google\Cloud\Firestore\V1\Precondition $var + * @return $this + */ + public function setCurrentDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Precondition::class); + $this->current_document = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Document.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Document.php new file mode 100644 index 000000000000..594b70eed952 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Document.php @@ -0,0 +1,290 @@ +google.firestore.v1.Document + */ +class Document extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the document, for example + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The document's fields. + * The map keys represent field names. + * Field names matching the regular expression `__.*__` are reserved. Reserved + * field names are forbidden except in certain documented contexts. The field + * names, represented as UTF-8, must not exceed 1,500 bytes and cannot be + * empty. + * Field paths may be used in other contexts to refer to structured fields + * defined here. For `map_value`, the field path is represented by a + * dot-delimited (`.`) string of segments. Each segment is either a simple + * field name (defined below) or a quoted field name. For example, the + * structured field `"foo" : { map_value: { "x&y" : { string_value: "hello" + * }}}` would be represented by the field path `` foo.`x&y` ``. + * A simple field name contains only characters `a` to `z`, `A` to `Z`, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, + * `foo_bar_17`. + * A quoted field name starts and ends with `` ` `` and + * may contain any character. Some characters, including `` ` ``, must be + * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and + * `` `bak\`tik` `` represents `` bak`tik ``. + * + * Generated from protobuf field map fields = 2; + */ + private $fields; + /** + * Output only. The time at which the document was created. + * This value increases monotonically when a document is deleted then + * recreated. It can also be compared to values from other documents and + * the `read_time` of a query. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + */ + protected $create_time = null; + /** + * Output only. The time at which the document was last changed. + * This value is initially set to the `create_time` then increases + * monotonically with each change to the document. It can also be + * compared to values from other documents and the `read_time` of a query. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The resource name of the document, for example + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * @type array|\Google\Protobuf\Internal\MapField $fields + * The document's fields. + * The map keys represent field names. + * Field names matching the regular expression `__.*__` are reserved. Reserved + * field names are forbidden except in certain documented contexts. The field + * names, represented as UTF-8, must not exceed 1,500 bytes and cannot be + * empty. + * Field paths may be used in other contexts to refer to structured fields + * defined here. For `map_value`, the field path is represented by a + * dot-delimited (`.`) string of segments. Each segment is either a simple + * field name (defined below) or a quoted field name. For example, the + * structured field `"foo" : { map_value: { "x&y" : { string_value: "hello" + * }}}` would be represented by the field path `` foo.`x&y` ``. + * A simple field name contains only characters `a` to `z`, `A` to `Z`, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, + * `foo_bar_17`. + * A quoted field name starts and ends with `` ` `` and + * may contain any character. Some characters, including `` ` ``, must be + * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and + * `` `bak\`tik` `` represents `` bak`tik ``. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time at which the document was created. + * This value increases monotonically when a document is deleted then + * recreated. It can also be compared to values from other documents and + * the `read_time` of a query. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The time at which the document was last changed. + * This value is initially set to the `create_time` then increases + * monotonically with each change to the document. It can also be + * compared to values from other documents and the `read_time` of a query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the document, for example + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the document, for example + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The document's fields. + * The map keys represent field names. + * Field names matching the regular expression `__.*__` are reserved. Reserved + * field names are forbidden except in certain documented contexts. The field + * names, represented as UTF-8, must not exceed 1,500 bytes and cannot be + * empty. + * Field paths may be used in other contexts to refer to structured fields + * defined here. For `map_value`, the field path is represented by a + * dot-delimited (`.`) string of segments. Each segment is either a simple + * field name (defined below) or a quoted field name. For example, the + * structured field `"foo" : { map_value: { "x&y" : { string_value: "hello" + * }}}` would be represented by the field path `` foo.`x&y` ``. + * A simple field name contains only characters `a` to `z`, `A` to `Z`, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, + * `foo_bar_17`. + * A quoted field name starts and ends with `` ` `` and + * may contain any character. Some characters, including `` ` ``, must be + * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and + * `` `bak\`tik` `` represents `` bak`tik ``. + * + * Generated from protobuf field map fields = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getFields() + { + return $this->fields; + } + + /** + * The document's fields. + * The map keys represent field names. + * Field names matching the regular expression `__.*__` are reserved. Reserved + * field names are forbidden except in certain documented contexts. The field + * names, represented as UTF-8, must not exceed 1,500 bytes and cannot be + * empty. + * Field paths may be used in other contexts to refer to structured fields + * defined here. For `map_value`, the field path is represented by a + * dot-delimited (`.`) string of segments. Each segment is either a simple + * field name (defined below) or a quoted field name. For example, the + * structured field `"foo" : { map_value: { "x&y" : { string_value: "hello" + * }}}` would be represented by the field path `` foo.`x&y` ``. + * A simple field name contains only characters `a` to `z`, `A` to `Z`, + * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, + * `foo_bar_17`. + * A quoted field name starts and ends with `` ` `` and + * may contain any character. Some characters, including `` ` ``, must be + * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and + * `` `bak\`tik` `` represents `` bak`tik ``. + * + * Generated from protobuf field map fields = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class); + $this->fields = $arr; + + return $this; + } + + /** + * Output only. The time at which the document was created. + * This value increases monotonically when a document is deleted then + * recreated. It can also be compared to values from other documents and + * the `read_time` of a query. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time at which the document was created. + * This value increases monotonically when a document is deleted then + * recreated. It can also be compared to values from other documents and + * the `read_time` of a query. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time at which the document was last changed. + * This value is initially set to the `create_time` then increases + * monotonically with each change to the document. It can also be + * compared to values from other documents and the `read_time` of a query. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The time at which the document was last changed. + * This value is initially set to the `create_time` then increases + * monotonically with each change to the document. It can also be + * compared to values from other documents and the `read_time` of a query. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentChange.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentChange.php new file mode 100644 index 000000000000..f4e1a5181731 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentChange.php @@ -0,0 +1,154 @@ +google.firestore.v1.DocumentChange + */ +class DocumentChange extends \Google\Protobuf\Internal\Message +{ + /** + * The new state of the [Document][google.firestore.v1.Document]. + * If `mask` is set, contains only fields that were updated or added. + * + * Generated from protobuf field .google.firestore.v1.Document document = 1; + */ + protected $document = null; + /** + * A set of target IDs of targets that match this document. + * + * Generated from protobuf field repeated int32 target_ids = 5; + */ + private $target_ids; + /** + * A set of target IDs for targets that no longer match this document. + * + * Generated from protobuf field repeated int32 removed_target_ids = 6; + */ + private $removed_target_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\Document $document + * The new state of the [Document][google.firestore.v1.Document]. + * If `mask` is set, contains only fields that were updated or added. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_ids + * A set of target IDs of targets that match this document. + * @type array|\Google\Protobuf\Internal\RepeatedField $removed_target_ids + * A set of target IDs for targets that no longer match this document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Write::initOnce(); + parent::__construct($data); + } + + /** + * The new state of the [Document][google.firestore.v1.Document]. + * If `mask` is set, contains only fields that were updated or added. + * + * Generated from protobuf field .google.firestore.v1.Document document = 1; + * @return \Google\Cloud\Firestore\V1\Document|null + */ + public function getDocument() + { + return $this->document; + } + + public function hasDocument() + { + return isset($this->document); + } + + public function clearDocument() + { + unset($this->document); + } + + /** + * The new state of the [Document][google.firestore.v1.Document]. + * If `mask` is set, contains only fields that were updated or added. + * + * Generated from protobuf field .google.firestore.v1.Document document = 1; + * @param \Google\Cloud\Firestore\V1\Document $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Document::class); + $this->document = $var; + + return $this; + } + + /** + * A set of target IDs of targets that match this document. + * + * Generated from protobuf field repeated int32 target_ids = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetIds() + { + return $this->target_ids; + } + + /** + * A set of target IDs of targets that match this document. + * + * Generated from protobuf field repeated int32 target_ids = 5; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->target_ids = $arr; + + return $this; + } + + /** + * A set of target IDs for targets that no longer match this document. + * + * Generated from protobuf field repeated int32 removed_target_ids = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRemovedTargetIds() + { + return $this->removed_target_ids; + } + + /** + * A set of target IDs for targets that no longer match this document. + * + * Generated from protobuf field repeated int32 removed_target_ids = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRemovedTargetIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->removed_target_ids = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentDelete.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentDelete.php new file mode 100644 index 000000000000..94b0fb72fcd8 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentDelete.php @@ -0,0 +1,158 @@ +google.firestore.v1.DocumentDelete + */ +class DocumentDelete extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the [Document][google.firestore.v1.Document] that was + * deleted. + * + * Generated from protobuf field string document = 1; + */ + protected $document = ''; + /** + * A set of target IDs for targets that previously matched this entity. + * + * Generated from protobuf field repeated int32 removed_target_ids = 6; + */ + private $removed_target_ids; + /** + * The read timestamp at which the delete was observed. + * Greater or equal to the `commit_time` of the delete. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; + */ + protected $read_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $document + * The resource name of the [Document][google.firestore.v1.Document] that was + * deleted. + * @type array|\Google\Protobuf\Internal\RepeatedField $removed_target_ids + * A set of target IDs for targets that previously matched this entity. + * @type \Google\Protobuf\Timestamp $read_time + * The read timestamp at which the delete was observed. + * Greater or equal to the `commit_time` of the delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Write::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the [Document][google.firestore.v1.Document] that was + * deleted. + * + * Generated from protobuf field string document = 1; + * @return string + */ + public function getDocument() + { + return $this->document; + } + + /** + * The resource name of the [Document][google.firestore.v1.Document] that was + * deleted. + * + * Generated from protobuf field string document = 1; + * @param string $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkString($var, True); + $this->document = $var; + + return $this; + } + + /** + * A set of target IDs for targets that previously matched this entity. + * + * Generated from protobuf field repeated int32 removed_target_ids = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRemovedTargetIds() + { + return $this->removed_target_ids; + } + + /** + * A set of target IDs for targets that previously matched this entity. + * + * Generated from protobuf field repeated int32 removed_target_ids = 6; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRemovedTargetIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->removed_target_ids = $arr; + + return $this; + } + + /** + * The read timestamp at which the delete was observed. + * Greater or equal to the `commit_time` of the delete. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * The read timestamp at which the delete was observed. + * Greater or equal to the `commit_time` of the delete. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentMask.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentMask.php new file mode 100644 index 000000000000..10644f490192 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentMask.php @@ -0,0 +1,80 @@ +google.firestore.v1.DocumentMask + */ +class DocumentMask extends \Google\Protobuf\Internal\Message +{ + /** + * The list of field paths in the mask. See + * [Document.fields][google.firestore.v1.Document.fields] for a field path + * syntax reference. + * + * Generated from protobuf field repeated string field_paths = 1; + */ + private $field_paths; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $field_paths + * The list of field paths in the mask. See + * [Document.fields][google.firestore.v1.Document.fields] for a field path + * syntax reference. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * The list of field paths in the mask. See + * [Document.fields][google.firestore.v1.Document.fields] for a field path + * syntax reference. + * + * Generated from protobuf field repeated string field_paths = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFieldPaths() + { + return $this->field_paths; + } + + /** + * The list of field paths in the mask. See + * [Document.fields][google.firestore.v1.Document.fields] for a field path + * syntax reference. + * + * Generated from protobuf field repeated string field_paths = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFieldPaths($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->field_paths = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentRemove.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentRemove.php new file mode 100644 index 000000000000..7a435ef42700 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentRemove.php @@ -0,0 +1,160 @@ +google.firestore.v1.DocumentRemove + */ +class DocumentRemove extends \Google\Protobuf\Internal\Message +{ + /** + * The resource name of the [Document][google.firestore.v1.Document] that has + * gone out of view. + * + * Generated from protobuf field string document = 1; + */ + protected $document = ''; + /** + * A set of target IDs for targets that previously matched this document. + * + * Generated from protobuf field repeated int32 removed_target_ids = 2; + */ + private $removed_target_ids; + /** + * The read timestamp at which the remove was observed. + * Greater or equal to the `commit_time` of the change/delete/remove. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; + */ + protected $read_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $document + * The resource name of the [Document][google.firestore.v1.Document] that has + * gone out of view. + * @type array|\Google\Protobuf\Internal\RepeatedField $removed_target_ids + * A set of target IDs for targets that previously matched this document. + * @type \Google\Protobuf\Timestamp $read_time + * The read timestamp at which the remove was observed. + * Greater or equal to the `commit_time` of the change/delete/remove. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Write::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the [Document][google.firestore.v1.Document] that has + * gone out of view. + * + * Generated from protobuf field string document = 1; + * @return string + */ + public function getDocument() + { + return $this->document; + } + + /** + * The resource name of the [Document][google.firestore.v1.Document] that has + * gone out of view. + * + * Generated from protobuf field string document = 1; + * @param string $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkString($var, True); + $this->document = $var; + + return $this; + } + + /** + * A set of target IDs for targets that previously matched this document. + * + * Generated from protobuf field repeated int32 removed_target_ids = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRemovedTargetIds() + { + return $this->removed_target_ids; + } + + /** + * A set of target IDs for targets that previously matched this document. + * + * Generated from protobuf field repeated int32 removed_target_ids = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRemovedTargetIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->removed_target_ids = $arr; + + return $this; + } + + /** + * The read timestamp at which the remove was observed. + * Greater or equal to the `commit_time` of the change/delete/remove. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * The read timestamp at which the remove was observed. + * Greater or equal to the `commit_time` of the change/delete/remove. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform.php new file mode 100644 index 000000000000..05828bedba2f --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform.php @@ -0,0 +1,109 @@ +google.firestore.v1.DocumentTransform + */ +class DocumentTransform extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the document to transform. + * + * Generated from protobuf field string document = 1; + */ + protected $document = ''; + /** + * The list of transformations to apply to the fields of the document, in + * order. + * This must not be empty. + * + * Generated from protobuf field repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + */ + private $field_transforms; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $document + * The name of the document to transform. + * @type array<\Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform>|\Google\Protobuf\Internal\RepeatedField $field_transforms + * The list of transformations to apply to the fields of the document, in + * order. + * This must not be empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Write::initOnce(); + parent::__construct($data); + } + + /** + * The name of the document to transform. + * + * Generated from protobuf field string document = 1; + * @return string + */ + public function getDocument() + { + return $this->document; + } + + /** + * The name of the document to transform. + * + * Generated from protobuf field string document = 1; + * @param string $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkString($var, True); + $this->document = $var; + + return $this; + } + + /** + * The list of transformations to apply to the fields of the document, in + * order. + * This must not be empty. + * + * Generated from protobuf field repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFieldTransforms() + { + return $this->field_transforms; + } + + /** + * The list of transformations to apply to the fields of the document, in + * order. + * This must not be empty. + * + * Generated from protobuf field repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; + * @param array<\Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFieldTransforms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform::class); + $this->field_transforms = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform.php new file mode 100644 index 000000000000..1372f46bd038 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform.php @@ -0,0 +1,417 @@ +google.firestore.v1.DocumentTransform.FieldTransform + */ +class FieldTransform extends \Google\Protobuf\Internal\Message +{ + /** + * The path of the field. See + * [Document.fields][google.firestore.v1.Document.fields] for the field path + * syntax reference. + * + * Generated from protobuf field string field_path = 1; + */ + protected $field_path = ''; + protected $transform_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $field_path + * The path of the field. See + * [Document.fields][google.firestore.v1.Document.fields] for the field path + * syntax reference. + * @type int $set_to_server_value + * Sets the field to the given server value. + * @type \Google\Cloud\Firestore\V1\Value $increment + * Adds the given value to the field's current value. + * This must be an integer or a double value. + * If the field is not an integer or double, or if the field does not yet + * exist, the transformation will set the field to the given value. + * If either of the given value or the current field value are doubles, + * both values will be interpreted as doubles. Double arithmetic and + * representation of double values follow IEEE 754 semantics. + * If there is positive/negative integer overflow, the field is resolved + * to the largest magnitude positive/negative integer. + * @type \Google\Cloud\Firestore\V1\Value $maximum + * Sets the field to the maximum of its current value and the given value. + * This must be an integer or a double value. + * If the field is not an integer or double, or if the field does not yet + * exist, the transformation will set the field to the given value. + * If a maximum operation is applied where the field and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the field takes on the type of the larger operand. If the operands are + * equivalent (e.g. 3 and 3.0), the field does not change. + * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and + * zero input value is always the stored value. + * The maximum of any numeric value x and NaN is NaN. + * @type \Google\Cloud\Firestore\V1\Value $minimum + * Sets the field to the minimum of its current value and the given value. + * This must be an integer or a double value. + * If the field is not an integer or double, or if the field does not yet + * exist, the transformation will set the field to the input value. + * If a minimum operation is applied where the field and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the field takes on the type of the smaller operand. If the operands are + * equivalent (e.g. 3 and 3.0), the field does not change. + * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and + * zero input value is always the stored value. + * The minimum of any numeric value x and NaN is NaN. + * @type \Google\Cloud\Firestore\V1\ArrayValue $append_missing_elements + * Append the given elements in order if they are not already present in + * the current field value. + * If the field is not an array, or if the field does not yet exist, it is + * first set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when checking if a value is missing. + * NaN is equal to NaN, and Null is equal to Null. + * If the input contains multiple equivalent values, only the first will + * be considered. + * The corresponding transform_result will be the null value. + * @type \Google\Cloud\Firestore\V1\ArrayValue $remove_all_from_array + * Remove all of the given elements from the array in the field. + * If the field is not an array, or if the field does not yet exist, it is + * set to the empty array. + * Equivalent numbers of the different types (e.g. 3L and 3.0) are + * considered equal when deciding whether an element should be removed. + * NaN is equal to NaN, and Null is equal to Null. + * This will remove all equivalent values if there are duplicates. + * The corresponding transform_result will be the null value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Write::initOnce(); + parent::__construct($data); + } + + /** + * The path of the field. See + * [Document.fields][google.firestore.v1.Document.fields] for the field path + * syntax reference. + * + * Generated from protobuf field string field_path = 1; + * @return string + */ + public function getFieldPath() + { + return $this->field_path; + } + + /** + * The path of the field. See + * [Document.fields][google.firestore.v1.Document.fields] for the field path + * syntax reference. + * + * Generated from protobuf field string field_path = 1; + * @param string $var + * @return $this + */ + public function setFieldPath($var) + { + GPBUtil::checkString($var, True); + $this->field_path = $var; + + return $this; + } + + /** + * Sets the field to the given server value. + * + * Generated from protobuf field .google.firestore.v1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2; + * @return int + */ + public function getSetToServerValue() + { + return $this->readOneof(2); + } + + public function hasSetToServerValue() + { + return $this->hasOneof(2); + } + + /** + * Sets the field to the given server value. + * + * Generated from protobuf field .google.firestore.v1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2; + * @param int $var + * @return $this + */ + public function setSetToServerValue($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform\ServerValue::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Adds the given value to the field's current value. + * This must be an integer or a double value. + * If the field is not an integer or double, or if the field does not yet + * exist, the transformation will set the field to the given value. + * If either of the given value or the current field value are doubles, + * both values will be interpreted as doubles. Double arithmetic and + * representation of double values follow IEEE 754 semantics. + * If there is positive/negative integer overflow, the field is resolved + * to the largest magnitude positive/negative integer. + * + * Generated from protobuf field .google.firestore.v1.Value increment = 3; + * @return \Google\Cloud\Firestore\V1\Value|null + */ + public function getIncrement() + { + return $this->readOneof(3); + } + + public function hasIncrement() + { + return $this->hasOneof(3); + } + + /** + * Adds the given value to the field's current value. + * This must be an integer or a double value. + * If the field is not an integer or double, or if the field does not yet + * exist, the transformation will set the field to the given value. + * If either of the given value or the current field value are doubles, + * both values will be interpreted as doubles. Double arithmetic and + * representation of double values follow IEEE 754 semantics. + * If there is positive/negative integer overflow, the field is resolved + * to the largest magnitude positive/negative integer. + * + * Generated from protobuf field .google.firestore.v1.Value increment = 3; + * @param \Google\Cloud\Firestore\V1\Value $var + * @return $this + */ + public function setIncrement($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Value::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Sets the field to the maximum of its current value and the given value. + * This must be an integer or a double value. + * If the field is not an integer or double, or if the field does not yet + * exist, the transformation will set the field to the given value. + * If a maximum operation is applied where the field and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the field takes on the type of the larger operand. If the operands are + * equivalent (e.g. 3 and 3.0), the field does not change. + * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and + * zero input value is always the stored value. + * The maximum of any numeric value x and NaN is NaN. + * + * Generated from protobuf field .google.firestore.v1.Value maximum = 4; + * @return \Google\Cloud\Firestore\V1\Value|null + */ + public function getMaximum() + { + return $this->readOneof(4); + } + + public function hasMaximum() + { + return $this->hasOneof(4); + } + + /** + * Sets the field to the maximum of its current value and the given value. + * This must be an integer or a double value. + * If the field is not an integer or double, or if the field does not yet + * exist, the transformation will set the field to the given value. + * If a maximum operation is applied where the field and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the field takes on the type of the larger operand. If the operands are + * equivalent (e.g. 3 and 3.0), the field does not change. + * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and + * zero input value is always the stored value. + * The maximum of any numeric value x and NaN is NaN. + * + * Generated from protobuf field .google.firestore.v1.Value maximum = 4; + * @param \Google\Cloud\Firestore\V1\Value $var + * @return $this + */ + public function setMaximum($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Value::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Sets the field to the minimum of its current value and the given value. + * This must be an integer or a double value. + * If the field is not an integer or double, or if the field does not yet + * exist, the transformation will set the field to the input value. + * If a minimum operation is applied where the field and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the field takes on the type of the smaller operand. If the operands are + * equivalent (e.g. 3 and 3.0), the field does not change. + * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and + * zero input value is always the stored value. + * The minimum of any numeric value x and NaN is NaN. + * + * Generated from protobuf field .google.firestore.v1.Value minimum = 5; + * @return \Google\Cloud\Firestore\V1\Value|null + */ + public function getMinimum() + { + return $this->readOneof(5); + } + + public function hasMinimum() + { + return $this->hasOneof(5); + } + + /** + * Sets the field to the minimum of its current value and the given value. + * This must be an integer or a double value. + * If the field is not an integer or double, or if the field does not yet + * exist, the transformation will set the field to the input value. + * If a minimum operation is applied where the field and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the field takes on the type of the smaller operand. If the operands are + * equivalent (e.g. 3 and 3.0), the field does not change. + * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and + * zero input value is always the stored value. + * The minimum of any numeric value x and NaN is NaN. + * + * Generated from protobuf field .google.firestore.v1.Value minimum = 5; + * @param \Google\Cloud\Firestore\V1\Value $var + * @return $this + */ + public function setMinimum($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Value::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Append the given elements in order if they are not already present in + * the current field value. + * If the field is not an array, or if the field does not yet exist, it is + * first set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when checking if a value is missing. + * NaN is equal to NaN, and Null is equal to Null. + * If the input contains multiple equivalent values, only the first will + * be considered. + * The corresponding transform_result will be the null value. + * + * Generated from protobuf field .google.firestore.v1.ArrayValue append_missing_elements = 6; + * @return \Google\Cloud\Firestore\V1\ArrayValue|null + */ + public function getAppendMissingElements() + { + return $this->readOneof(6); + } + + public function hasAppendMissingElements() + { + return $this->hasOneof(6); + } + + /** + * Append the given elements in order if they are not already present in + * the current field value. + * If the field is not an array, or if the field does not yet exist, it is + * first set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when checking if a value is missing. + * NaN is equal to NaN, and Null is equal to Null. + * If the input contains multiple equivalent values, only the first will + * be considered. + * The corresponding transform_result will be the null value. + * + * Generated from protobuf field .google.firestore.v1.ArrayValue append_missing_elements = 6; + * @param \Google\Cloud\Firestore\V1\ArrayValue $var + * @return $this + */ + public function setAppendMissingElements($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ArrayValue::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Remove all of the given elements from the array in the field. + * If the field is not an array, or if the field does not yet exist, it is + * set to the empty array. + * Equivalent numbers of the different types (e.g. 3L and 3.0) are + * considered equal when deciding whether an element should be removed. + * NaN is equal to NaN, and Null is equal to Null. + * This will remove all equivalent values if there are duplicates. + * The corresponding transform_result will be the null value. + * + * Generated from protobuf field .google.firestore.v1.ArrayValue remove_all_from_array = 7; + * @return \Google\Cloud\Firestore\V1\ArrayValue|null + */ + public function getRemoveAllFromArray() + { + return $this->readOneof(7); + } + + public function hasRemoveAllFromArray() + { + return $this->hasOneof(7); + } + + /** + * Remove all of the given elements from the array in the field. + * If the field is not an array, or if the field does not yet exist, it is + * set to the empty array. + * Equivalent numbers of the different types (e.g. 3L and 3.0) are + * considered equal when deciding whether an element should be removed. + * NaN is equal to NaN, and Null is equal to Null. + * This will remove all equivalent values if there are duplicates. + * The corresponding transform_result will be the null value. + * + * Generated from protobuf field .google.firestore.v1.ArrayValue remove_all_from_array = 7; + * @param \Google\Cloud\Firestore\V1\ArrayValue $var + * @return $this + */ + public function setRemoveAllFromArray($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ArrayValue::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getTransformType() + { + return $this->whichOneof("transform_type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FieldTransform::class, \Google\Cloud\Firestore\V1\DocumentTransform_FieldTransform::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform/ServerValue.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform/ServerValue.php new file mode 100644 index 000000000000..47d3356c025d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform/ServerValue.php @@ -0,0 +1,59 @@ +google.firestore.v1.DocumentTransform.FieldTransform.ServerValue + */ +class ServerValue +{ + /** + * Unspecified. This value must not be used. + * + * Generated from protobuf enum SERVER_VALUE_UNSPECIFIED = 0; + */ + const SERVER_VALUE_UNSPECIFIED = 0; + /** + * The time at which the server processed the request, with millisecond + * precision. If used on multiple fields (same or different documents) in + * a transaction, all the fields will get the same server timestamp. + * + * Generated from protobuf enum REQUEST_TIME = 1; + */ + const REQUEST_TIME = 1; + + private static $valueToName = [ + self::SERVER_VALUE_UNSPECIFIED => 'SERVER_VALUE_UNSPECIFIED', + self::REQUEST_TIME => 'REQUEST_TIME', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ServerValue::class, \Google\Cloud\Firestore\V1\DocumentTransform_FieldTransform_ServerValue::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExistenceFilter.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExistenceFilter.php new file mode 100644 index 000000000000..d6817e30b2fa --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExistenceFilter.php @@ -0,0 +1,209 @@ +google.firestore.v1.ExistenceFilter + */ +class ExistenceFilter extends \Google\Protobuf\Internal\Message +{ + /** + * The target ID to which this filter applies. + * + * Generated from protobuf field int32 target_id = 1; + */ + protected $target_id = 0; + /** + * The total count of documents that match + * [target_id][google.firestore.v1.ExistenceFilter.target_id]. + * If different from the count of documents in the client that match, the + * client must manually determine which documents no longer match the target. + * The client can use the `unchanged_names` bloom filter to assist with + * this determination by testing ALL the document names against the filter; + * if the document name is NOT in the filter, it means the document no + * longer matches the target. + * + * Generated from protobuf field int32 count = 2; + */ + protected $count = 0; + /** + * A bloom filter that, despite its name, contains the UTF-8 byte encodings of + * the resource names of ALL the documents that match + * [target_id][google.firestore.v1.ExistenceFilter.target_id], in the form + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * This bloom filter may be omitted at the server's discretion, such as if it + * is deemed that the client will not make use of it or if it is too + * computationally expensive to calculate or transmit. Clients must gracefully + * handle this field being absent by falling back to the logic used before + * this field existed; that is, re-add the target without a resume token to + * figure out which documents in the client's cache are out of sync. + * + * Generated from protobuf field .google.firestore.v1.BloomFilter unchanged_names = 3; + */ + protected $unchanged_names = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $target_id + * The target ID to which this filter applies. + * @type int $count + * The total count of documents that match + * [target_id][google.firestore.v1.ExistenceFilter.target_id]. + * If different from the count of documents in the client that match, the + * client must manually determine which documents no longer match the target. + * The client can use the `unchanged_names` bloom filter to assist with + * this determination by testing ALL the document names against the filter; + * if the document name is NOT in the filter, it means the document no + * longer matches the target. + * @type \Google\Cloud\Firestore\V1\BloomFilter $unchanged_names + * A bloom filter that, despite its name, contains the UTF-8 byte encodings of + * the resource names of ALL the documents that match + * [target_id][google.firestore.v1.ExistenceFilter.target_id], in the form + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * This bloom filter may be omitted at the server's discretion, such as if it + * is deemed that the client will not make use of it or if it is too + * computationally expensive to calculate or transmit. Clients must gracefully + * handle this field being absent by falling back to the logic used before + * this field existed; that is, re-add the target without a resume token to + * figure out which documents in the client's cache are out of sync. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Write::initOnce(); + parent::__construct($data); + } + + /** + * The target ID to which this filter applies. + * + * Generated from protobuf field int32 target_id = 1; + * @return int + */ + public function getTargetId() + { + return $this->target_id; + } + + /** + * The target ID to which this filter applies. + * + * Generated from protobuf field int32 target_id = 1; + * @param int $var + * @return $this + */ + public function setTargetId($var) + { + GPBUtil::checkInt32($var); + $this->target_id = $var; + + return $this; + } + + /** + * The total count of documents that match + * [target_id][google.firestore.v1.ExistenceFilter.target_id]. + * If different from the count of documents in the client that match, the + * client must manually determine which documents no longer match the target. + * The client can use the `unchanged_names` bloom filter to assist with + * this determination by testing ALL the document names against the filter; + * if the document name is NOT in the filter, it means the document no + * longer matches the target. + * + * Generated from protobuf field int32 count = 2; + * @return int + */ + public function getCount() + { + return $this->count; + } + + /** + * The total count of documents that match + * [target_id][google.firestore.v1.ExistenceFilter.target_id]. + * If different from the count of documents in the client that match, the + * client must manually determine which documents no longer match the target. + * The client can use the `unchanged_names` bloom filter to assist with + * this determination by testing ALL the document names against the filter; + * if the document name is NOT in the filter, it means the document no + * longer matches the target. + * + * Generated from protobuf field int32 count = 2; + * @param int $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt32($var); + $this->count = $var; + + return $this; + } + + /** + * A bloom filter that, despite its name, contains the UTF-8 byte encodings of + * the resource names of ALL the documents that match + * [target_id][google.firestore.v1.ExistenceFilter.target_id], in the form + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * This bloom filter may be omitted at the server's discretion, such as if it + * is deemed that the client will not make use of it or if it is too + * computationally expensive to calculate or transmit. Clients must gracefully + * handle this field being absent by falling back to the logic used before + * this field existed; that is, re-add the target without a resume token to + * figure out which documents in the client's cache are out of sync. + * + * Generated from protobuf field .google.firestore.v1.BloomFilter unchanged_names = 3; + * @return \Google\Cloud\Firestore\V1\BloomFilter|null + */ + public function getUnchangedNames() + { + return $this->unchanged_names; + } + + public function hasUnchangedNames() + { + return isset($this->unchanged_names); + } + + public function clearUnchangedNames() + { + unset($this->unchanged_names); + } + + /** + * A bloom filter that, despite its name, contains the UTF-8 byte encodings of + * the resource names of ALL the documents that match + * [target_id][google.firestore.v1.ExistenceFilter.target_id], in the form + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * This bloom filter may be omitted at the server's discretion, such as if it + * is deemed that the client will not make use of it or if it is too + * computationally expensive to calculate or transmit. Clients must gracefully + * handle this field being absent by falling back to the logic used before + * this field existed; that is, re-add the target without a resume token to + * figure out which documents in the client's cache are out of sync. + * + * Generated from protobuf field .google.firestore.v1.BloomFilter unchanged_names = 3; + * @param \Google\Cloud\Firestore\V1\BloomFilter $var + * @return $this + */ + public function setUnchangedNames($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\BloomFilter::class); + $this->unchanged_names = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/GetDocumentRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/GetDocumentRequest.php new file mode 100644 index 000000000000..7342dfd8c590 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/GetDocumentRequest.php @@ -0,0 +1,208 @@ +google.firestore.v1.GetDocumentRequest + */ +class GetDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the Document to get. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * The fields to return. If not set, returns all fields. + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 2; + */ + protected $mask = null; + protected $consistency_selector; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the Document to get. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * @type \Google\Cloud\Firestore\V1\DocumentMask $mask + * The fields to return. If not set, returns all fields. + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * @type string $transaction + * Reads the document in a transaction. + * @type \Google\Protobuf\Timestamp $read_time + * Reads the version of the document at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the Document to get. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the Document to get. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The fields to return. If not set, returns all fields. + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 2; + * @return \Google\Cloud\Firestore\V1\DocumentMask|null + */ + public function getMask() + { + return $this->mask; + } + + public function hasMask() + { + return isset($this->mask); + } + + public function clearMask() + { + unset($this->mask); + } + + /** + * The fields to return. If not set, returns all fields. + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 2; + * @param \Google\Cloud\Firestore\V1\DocumentMask $var + * @return $this + */ + public function setMask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); + $this->mask = $var; + + return $this; + } + + /** + * Reads the document in a transaction. + * + * Generated from protobuf field bytes transaction = 3; + * @return string + */ + public function getTransaction() + { + return $this->readOneof(3); + } + + public function hasTransaction() + { + return $this->hasOneof(3); + } + + /** + * Reads the document in a transaction. + * + * Generated from protobuf field bytes transaction = 3; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Reads the version of the document at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->readOneof(5); + } + + public function hasReadTime() + { + return $this->hasOneof(5); + } + + /** + * Reads the version of the document at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getConsistencySelector() + { + return $this->whichOneof("consistency_selector"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsRequest.php new file mode 100644 index 000000000000..7603b7a00593 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsRequest.php @@ -0,0 +1,219 @@ +google.firestore.v1.ListCollectionIdsRequest + */ +class ListCollectionIdsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent document. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * The maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * A page token. Must be a value from + * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse]. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + protected $consistency_selector; + + /** + * @param string $parent Required. The parent document. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * @return \Google\Cloud\Firestore\V1\ListCollectionIdsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent document. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * @type int $page_size + * The maximum number of results to return. + * @type string $page_token + * A page token. Must be a value from + * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse]. + * @type \Google\Protobuf\Timestamp $read_time + * Reads documents as they were at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent document. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent document. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of results to return. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token. Must be a value from + * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse]. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token. Must be a value from + * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse]. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Reads documents as they were at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->readOneof(4); + } + + public function hasReadTime() + { + return $this->hasOneof(4); + } + + /** + * Reads documents as they were at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getConsistencySelector() + { + return $this->whichOneof("consistency_selector"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsResponse.php new file mode 100644 index 000000000000..b31178cf5166 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsResponse.php @@ -0,0 +1,102 @@ +google.firestore.v1.ListCollectionIdsResponse + */ +class ListCollectionIdsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The collection ids. + * + * Generated from protobuf field repeated string collection_ids = 1; + */ + private $collection_ids; + /** + * A page token that may be used to continue the list. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids + * The collection ids. + * @type string $next_page_token + * A page token that may be used to continue the list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * The collection ids. + * + * Generated from protobuf field repeated string collection_ids = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCollectionIds() + { + return $this->collection_ids; + } + + /** + * The collection ids. + * + * Generated from protobuf field repeated string collection_ids = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCollectionIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->collection_ids = $arr; + + return $this; + } + + /** + * A page token that may be used to continue the list. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A page token that may be used to continue the list. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsRequest.php new file mode 100644 index 000000000000..51ea08cec401 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsRequest.php @@ -0,0 +1,462 @@ +google.firestore.v1.ListDocumentsRequest + */ +class ListDocumentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Optional. The collection ID, relative to `parent`, to list. + * For example: `chatrooms` or `messages`. + * This is optional, and when not provided, Firestore will list documents + * from all collections under the provided `parent`. + * + * Generated from protobuf field string collection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $collection_id = ''; + /** + * Optional. The maximum number of documents to return in a single response. + * Firestore may return fewer than this value. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListDocuments` response. + * Provide this to retrieve the subsequent page. When paginating, all other + * parameters (with the exception of `page_size`) must match the values set + * in the request that generated the page token. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The optional ordering of the documents to return. + * For example: `priority desc, __name__ desc`. + * This mirrors the [`ORDER BY`][google.firestore.v1.StructuredQuery.order_by] + * used in Firestore queries but in a string representation. When absent, + * documents are ordered based on `__name__ ASC`. + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + /** + * Optional. The fields to return. If not set, returns all fields. + * If a document has a field that is not present in this mask, that field + * will not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $mask = null; + /** + * If the list should show missing documents. + * A document is missing if it does not exist, but there are sub-documents + * nested underneath it. When true, such missing documents will be returned + * with a key but will not have fields, + * [`create_time`][google.firestore.v1.Document.create_time], or + * [`update_time`][google.firestore.v1.Document.update_time] set. + * Requests with `show_missing` may not specify `where` or `order_by`. + * + * Generated from protobuf field bool show_missing = 12; + */ + protected $show_missing = false; + protected $consistency_selector; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * @type string $collection_id + * Optional. The collection ID, relative to `parent`, to list. + * For example: `chatrooms` or `messages`. + * This is optional, and when not provided, Firestore will list documents + * from all collections under the provided `parent`. + * @type int $page_size + * Optional. The maximum number of documents to return in a single response. + * Firestore may return fewer than this value. + * @type string $page_token + * Optional. A page token, received from a previous `ListDocuments` response. + * Provide this to retrieve the subsequent page. When paginating, all other + * parameters (with the exception of `page_size`) must match the values set + * in the request that generated the page token. + * @type string $order_by + * Optional. The optional ordering of the documents to return. + * For example: `priority desc, __name__ desc`. + * This mirrors the [`ORDER BY`][google.firestore.v1.StructuredQuery.order_by] + * used in Firestore queries but in a string representation. When absent, + * documents are ordered based on `__name__ ASC`. + * @type \Google\Cloud\Firestore\V1\DocumentMask $mask + * Optional. The fields to return. If not set, returns all fields. + * If a document has a field that is not present in this mask, that field + * will not be returned in the response. + * @type string $transaction + * Perform the read as part of an already active transaction. + * @type \Google\Protobuf\Timestamp $read_time + * Perform the read at the provided time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * @type bool $show_missing + * If the list should show missing documents. + * A document is missing if it does not exist, but there are sub-documents + * nested underneath it. When true, such missing documents will be returned + * with a key but will not have fields, + * [`create_time`][google.firestore.v1.Document.create_time], or + * [`update_time`][google.firestore.v1.Document.update_time] set. + * Requests with `show_missing` may not specify `where` or `order_by`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The collection ID, relative to `parent`, to list. + * For example: `chatrooms` or `messages`. + * This is optional, and when not provided, Firestore will list documents + * from all collections under the provided `parent`. + * + * Generated from protobuf field string collection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCollectionId() + { + return $this->collection_id; + } + + /** + * Optional. The collection ID, relative to `parent`, to list. + * For example: `chatrooms` or `messages`. + * This is optional, and when not provided, Firestore will list documents + * from all collections under the provided `parent`. + * + * Generated from protobuf field string collection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCollectionId($var) + { + GPBUtil::checkString($var, True); + $this->collection_id = $var; + + return $this; + } + + /** + * Optional. The maximum number of documents to return in a single response. + * Firestore may return fewer than this value. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of documents to return in a single response. + * Firestore may return fewer than this value. + * + * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListDocuments` response. + * Provide this to retrieve the subsequent page. When paginating, all other + * parameters (with the exception of `page_size`) must match the values set + * in the request that generated the page token. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListDocuments` response. + * Provide this to retrieve the subsequent page. When paginating, all other + * parameters (with the exception of `page_size`) must match the values set + * in the request that generated the page token. + * + * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The optional ordering of the documents to return. + * For example: `priority desc, __name__ desc`. + * This mirrors the [`ORDER BY`][google.firestore.v1.StructuredQuery.order_by] + * used in Firestore queries but in a string representation. When absent, + * documents are ordered based on `__name__ ASC`. + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The optional ordering of the documents to return. + * For example: `priority desc, __name__ desc`. + * This mirrors the [`ORDER BY`][google.firestore.v1.StructuredQuery.order_by] + * used in Firestore queries but in a string representation. When absent, + * documents are ordered based on `__name__ ASC`. + * + * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + + /** + * Optional. The fields to return. If not set, returns all fields. + * If a document has a field that is not present in this mask, that field + * will not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Firestore\V1\DocumentMask|null + */ + public function getMask() + { + return $this->mask; + } + + public function hasMask() + { + return isset($this->mask); + } + + public function clearMask() + { + unset($this->mask); + } + + /** + * Optional. The fields to return. If not set, returns all fields. + * If a document has a field that is not present in this mask, that field + * will not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Firestore\V1\DocumentMask $var + * @return $this + */ + public function setMask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); + $this->mask = $var; + + return $this; + } + + /** + * Perform the read as part of an already active transaction. + * + * Generated from protobuf field bytes transaction = 8; + * @return string + */ + public function getTransaction() + { + return $this->readOneof(8); + } + + public function hasTransaction() + { + return $this->hasOneof(8); + } + + /** + * Perform the read as part of an already active transaction. + * + * Generated from protobuf field bytes transaction = 8; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Perform the read at the provided time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 10; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->readOneof(10); + } + + public function hasReadTime() + { + return $this->hasOneof(10); + } + + /** + * Perform the read at the provided time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 10; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * If the list should show missing documents. + * A document is missing if it does not exist, but there are sub-documents + * nested underneath it. When true, such missing documents will be returned + * with a key but will not have fields, + * [`create_time`][google.firestore.v1.Document.create_time], or + * [`update_time`][google.firestore.v1.Document.update_time] set. + * Requests with `show_missing` may not specify `where` or `order_by`. + * + * Generated from protobuf field bool show_missing = 12; + * @return bool + */ + public function getShowMissing() + { + return $this->show_missing; + } + + /** + * If the list should show missing documents. + * A document is missing if it does not exist, but there are sub-documents + * nested underneath it. When true, such missing documents will be returned + * with a key but will not have fields, + * [`create_time`][google.firestore.v1.Document.create_time], or + * [`update_time`][google.firestore.v1.Document.update_time] set. + * Requests with `show_missing` may not specify `where` or `order_by`. + * + * Generated from protobuf field bool show_missing = 12; + * @param bool $var + * @return $this + */ + public function setShowMissing($var) + { + GPBUtil::checkBool($var); + $this->show_missing = $var; + + return $this; + } + + /** + * @return string + */ + public function getConsistencySelector() + { + return $this->whichOneof("consistency_selector"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsResponse.php new file mode 100644 index 000000000000..3608a134151d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsResponse.php @@ -0,0 +1,106 @@ +google.firestore.v1.ListDocumentsResponse + */ +class ListDocumentsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The Documents found. + * + * Generated from protobuf field repeated .google.firestore.v1.Document documents = 1; + */ + private $documents; + /** + * A token to retrieve the next page of documents. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Firestore\V1\Document>|\Google\Protobuf\Internal\RepeatedField $documents + * The Documents found. + * @type string $next_page_token + * A token to retrieve the next page of documents. + * If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * The Documents found. + * + * Generated from protobuf field repeated .google.firestore.v1.Document documents = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDocuments() + { + return $this->documents; + } + + /** + * The Documents found. + * + * Generated from protobuf field repeated .google.firestore.v1.Document documents = 1; + * @param array<\Google\Cloud\Firestore\V1\Document>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDocuments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Document::class); + $this->documents = $arr; + + return $this; + } + + /** + * A token to retrieve the next page of documents. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token to retrieve the next page of documents. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenRequest.php new file mode 100644 index 000000000000..8fb415f4ed4b --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenRequest.php @@ -0,0 +1,180 @@ +google.firestore.v1.ListenRequest + */ +class ListenRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $database = ''; + /** + * Labels associated with this target change. + * + * Generated from protobuf field map labels = 4; + */ + private $labels; + protected $target_change; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $database + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @type \Google\Cloud\Firestore\V1\Target $add_target + * A target to add to this stream. + * @type int $remove_target + * The ID of a target to remove from this stream. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels associated with this target change. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * A target to add to this stream. + * + * Generated from protobuf field .google.firestore.v1.Target add_target = 2; + * @return \Google\Cloud\Firestore\V1\Target|null + */ + public function getAddTarget() + { + return $this->readOneof(2); + } + + public function hasAddTarget() + { + return $this->hasOneof(2); + } + + /** + * A target to add to this stream. + * + * Generated from protobuf field .google.firestore.v1.Target add_target = 2; + * @param \Google\Cloud\Firestore\V1\Target $var + * @return $this + */ + public function setAddTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Target::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The ID of a target to remove from this stream. + * + * Generated from protobuf field int32 remove_target = 3; + * @return int + */ + public function getRemoveTarget() + { + return $this->readOneof(3); + } + + public function hasRemoveTarget() + { + return $this->hasOneof(3); + } + + /** + * The ID of a target to remove from this stream. + * + * Generated from protobuf field int32 remove_target = 3; + * @param int $var + * @return $this + */ + public function setRemoveTarget($var) + { + GPBUtil::checkInt32($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Labels associated with this target change. + * + * Generated from protobuf field map labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels associated with this target change. + * + * Generated from protobuf field map labels = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * @return string + */ + public function getTargetChange() + { + return $this->whichOneof("target_change"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenResponse.php new file mode 100644 index 000000000000..64234422f378 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenResponse.php @@ -0,0 +1,219 @@ +google.firestore.v1.ListenResponse + */ +class ListenResponse extends \Google\Protobuf\Internal\Message +{ + protected $response_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\TargetChange $target_change + * Targets have changed. + * @type \Google\Cloud\Firestore\V1\DocumentChange $document_change + * A [Document][google.firestore.v1.Document] has changed. + * @type \Google\Cloud\Firestore\V1\DocumentDelete $document_delete + * A [Document][google.firestore.v1.Document] has been deleted. + * @type \Google\Cloud\Firestore\V1\DocumentRemove $document_remove + * A [Document][google.firestore.v1.Document] has been removed from a target + * (because it is no longer relevant to that target). + * @type \Google\Cloud\Firestore\V1\ExistenceFilter $filter + * A filter to apply to the set of documents previously returned for the + * given target. + * Returned when documents may have been removed from the given target, but + * the exact documents are unknown. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Targets have changed. + * + * Generated from protobuf field .google.firestore.v1.TargetChange target_change = 2; + * @return \Google\Cloud\Firestore\V1\TargetChange|null + */ + public function getTargetChange() + { + return $this->readOneof(2); + } + + public function hasTargetChange() + { + return $this->hasOneof(2); + } + + /** + * Targets have changed. + * + * Generated from protobuf field .google.firestore.v1.TargetChange target_change = 2; + * @param \Google\Cloud\Firestore\V1\TargetChange $var + * @return $this + */ + public function setTargetChange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TargetChange::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A [Document][google.firestore.v1.Document] has changed. + * + * Generated from protobuf field .google.firestore.v1.DocumentChange document_change = 3; + * @return \Google\Cloud\Firestore\V1\DocumentChange|null + */ + public function getDocumentChange() + { + return $this->readOneof(3); + } + + public function hasDocumentChange() + { + return $this->hasOneof(3); + } + + /** + * A [Document][google.firestore.v1.Document] has changed. + * + * Generated from protobuf field .google.firestore.v1.DocumentChange document_change = 3; + * @param \Google\Cloud\Firestore\V1\DocumentChange $var + * @return $this + */ + public function setDocumentChange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentChange::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A [Document][google.firestore.v1.Document] has been deleted. + * + * Generated from protobuf field .google.firestore.v1.DocumentDelete document_delete = 4; + * @return \Google\Cloud\Firestore\V1\DocumentDelete|null + */ + public function getDocumentDelete() + { + return $this->readOneof(4); + } + + public function hasDocumentDelete() + { + return $this->hasOneof(4); + } + + /** + * A [Document][google.firestore.v1.Document] has been deleted. + * + * Generated from protobuf field .google.firestore.v1.DocumentDelete document_delete = 4; + * @param \Google\Cloud\Firestore\V1\DocumentDelete $var + * @return $this + */ + public function setDocumentDelete($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentDelete::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * A [Document][google.firestore.v1.Document] has been removed from a target + * (because it is no longer relevant to that target). + * + * Generated from protobuf field .google.firestore.v1.DocumentRemove document_remove = 6; + * @return \Google\Cloud\Firestore\V1\DocumentRemove|null + */ + public function getDocumentRemove() + { + return $this->readOneof(6); + } + + public function hasDocumentRemove() + { + return $this->hasOneof(6); + } + + /** + * A [Document][google.firestore.v1.Document] has been removed from a target + * (because it is no longer relevant to that target). + * + * Generated from protobuf field .google.firestore.v1.DocumentRemove document_remove = 6; + * @param \Google\Cloud\Firestore\V1\DocumentRemove $var + * @return $this + */ + public function setDocumentRemove($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentRemove::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * A filter to apply to the set of documents previously returned for the + * given target. + * Returned when documents may have been removed from the given target, but + * the exact documents are unknown. + * + * Generated from protobuf field .google.firestore.v1.ExistenceFilter filter = 5; + * @return \Google\Cloud\Firestore\V1\ExistenceFilter|null + */ + public function getFilter() + { + return $this->readOneof(5); + } + + public function hasFilter() + { + return $this->hasOneof(5); + } + + /** + * A filter to apply to the set of documents previously returned for the + * given target. + * Returned when documents may have been removed from the given target, but + * the exact documents are unknown. + * + * Generated from protobuf field .google.firestore.v1.ExistenceFilter filter = 5; + * @param \Google\Cloud\Firestore\V1\ExistenceFilter $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ExistenceFilter::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * @return string + */ + public function getResponseType() + { + return $this->whichOneof("response_type"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/MapValue.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/MapValue.php new file mode 100644 index 000000000000..fa811000207c --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/MapValue.php @@ -0,0 +1,83 @@ +google.firestore.v1.MapValue + */ +class MapValue extends \Google\Protobuf\Internal\Message +{ + /** + * The map's fields. + * The map keys represent field names. Field names matching the regular + * expression `__.*__` are reserved. Reserved field names are forbidden except + * in certain documented contexts. The map keys, represented as UTF-8, must + * not exceed 1,500 bytes and cannot be empty. + * + * Generated from protobuf field map fields = 1; + */ + private $fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $fields + * The map's fields. + * The map keys represent field names. Field names matching the regular + * expression `__.*__` are reserved. Reserved field names are forbidden except + * in certain documented contexts. The map keys, represented as UTF-8, must + * not exceed 1,500 bytes and cannot be empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * The map's fields. + * The map keys represent field names. Field names matching the regular + * expression `__.*__` are reserved. Reserved field names are forbidden except + * in certain documented contexts. The map keys, represented as UTF-8, must + * not exceed 1,500 bytes and cannot be empty. + * + * Generated from protobuf field map fields = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getFields() + { + return $this->fields; + } + + /** + * The map's fields. + * The map keys represent field names. Field names matching the regular + * expression `__.*__` are reserved. Reserved field names are forbidden except + * in certain documented contexts. The map keys, represented as UTF-8, must + * not exceed 1,500 bytes and cannot be empty. + * + * Generated from protobuf field map fields = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class); + $this->fields = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryRequest.php new file mode 100644 index 000000000000..9b09a390000e --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryRequest.php @@ -0,0 +1,364 @@ +google.firestore.v1.PartitionQueryRequest + */ +class PartitionQueryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents`. + * Document resource names are not supported; only database resource names + * can be specified. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * The desired maximum number of partition points. + * The partitions may be returned across multiple pages of results. + * The number must be positive. The actual number of partitions + * returned may be fewer. + * For example, this may be set to one fewer than the number of parallel + * queries to be run, or in running a data pipeline job, one fewer than the + * number of workers or compute instances available. + * + * Generated from protobuf field int64 partition_count = 3; + */ + protected $partition_count = 0; + /** + * The `next_page_token` value returned from a previous call to + * PartitionQuery that may be used to get an additional set of results. + * There are no ordering guarantees between sets of results. Thus, using + * multiple sets of results will require merging the different result sets. + * For example, two subsequent calls using a page_token may return: + * * cursor B, cursor M, cursor Q + * * cursor A, cursor U, cursor W + * To obtain a complete result set ordered with respect to the results of the + * query supplied to PartitionQuery, the results sets should be merged: + * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W + * + * Generated from protobuf field string page_token = 4; + */ + protected $page_token = ''; + /** + * The maximum number of partitions to return in this call, subject to + * `partition_count`. + * For example, if `partition_count` = 10 and `page_size` = 8, the first call + * to PartitionQuery will return up to 8 partitions and a `next_page_token` + * if more results exist. A second call to PartitionQuery will return up to + * 2 partitions, to complete the total of 10 specified in `partition_count`. + * + * Generated from protobuf field int32 page_size = 5; + */ + protected $page_size = 0; + protected $query_type; + protected $consistency_selector; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents`. + * Document resource names are not supported; only database resource names + * can be specified. + * @type \Google\Cloud\Firestore\V1\StructuredQuery $structured_query + * A structured query. + * Query must specify collection with all descendants and be ordered by name + * ascending. Other filters, order bys, limits, offsets, and start/end + * cursors are not supported. + * @type int|string $partition_count + * The desired maximum number of partition points. + * The partitions may be returned across multiple pages of results. + * The number must be positive. The actual number of partitions + * returned may be fewer. + * For example, this may be set to one fewer than the number of parallel + * queries to be run, or in running a data pipeline job, one fewer than the + * number of workers or compute instances available. + * @type string $page_token + * The `next_page_token` value returned from a previous call to + * PartitionQuery that may be used to get an additional set of results. + * There are no ordering guarantees between sets of results. Thus, using + * multiple sets of results will require merging the different result sets. + * For example, two subsequent calls using a page_token may return: + * * cursor B, cursor M, cursor Q + * * cursor A, cursor U, cursor W + * To obtain a complete result set ordered with respect to the results of the + * query supplied to PartitionQuery, the results sets should be merged: + * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W + * @type int $page_size + * The maximum number of partitions to return in this call, subject to + * `partition_count`. + * For example, if `partition_count` = 10 and `page_size` = 8, the first call + * to PartitionQuery will return up to 8 partitions and a `next_page_token` + * if more results exist. A second call to PartitionQuery will return up to + * 2 partitions, to complete the total of 10 specified in `partition_count`. + * @type \Google\Protobuf\Timestamp $read_time + * Reads documents as they were at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents`. + * Document resource names are not supported; only database resource names + * can be specified. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents`. + * Document resource names are not supported; only database resource names + * can be specified. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * A structured query. + * Query must specify collection with all descendants and be ordered by name + * ascending. Other filters, order bys, limits, offsets, and start/end + * cursors are not supported. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 2; + * @return \Google\Cloud\Firestore\V1\StructuredQuery|null + */ + public function getStructuredQuery() + { + return $this->readOneof(2); + } + + public function hasStructuredQuery() + { + return $this->hasOneof(2); + } + + /** + * A structured query. + * Query must specify collection with all descendants and be ordered by name + * ascending. Other filters, order bys, limits, offsets, and start/end + * cursors are not supported. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 2; + * @param \Google\Cloud\Firestore\V1\StructuredQuery $var + * @return $this + */ + public function setStructuredQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The desired maximum number of partition points. + * The partitions may be returned across multiple pages of results. + * The number must be positive. The actual number of partitions + * returned may be fewer. + * For example, this may be set to one fewer than the number of parallel + * queries to be run, or in running a data pipeline job, one fewer than the + * number of workers or compute instances available. + * + * Generated from protobuf field int64 partition_count = 3; + * @return int|string + */ + public function getPartitionCount() + { + return $this->partition_count; + } + + /** + * The desired maximum number of partition points. + * The partitions may be returned across multiple pages of results. + * The number must be positive. The actual number of partitions + * returned may be fewer. + * For example, this may be set to one fewer than the number of parallel + * queries to be run, or in running a data pipeline job, one fewer than the + * number of workers or compute instances available. + * + * Generated from protobuf field int64 partition_count = 3; + * @param int|string $var + * @return $this + */ + public function setPartitionCount($var) + { + GPBUtil::checkInt64($var); + $this->partition_count = $var; + + return $this; + } + + /** + * The `next_page_token` value returned from a previous call to + * PartitionQuery that may be used to get an additional set of results. + * There are no ordering guarantees between sets of results. Thus, using + * multiple sets of results will require merging the different result sets. + * For example, two subsequent calls using a page_token may return: + * * cursor B, cursor M, cursor Q + * * cursor A, cursor U, cursor W + * To obtain a complete result set ordered with respect to the results of the + * query supplied to PartitionQuery, the results sets should be merged: + * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W + * + * Generated from protobuf field string page_token = 4; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The `next_page_token` value returned from a previous call to + * PartitionQuery that may be used to get an additional set of results. + * There are no ordering guarantees between sets of results. Thus, using + * multiple sets of results will require merging the different result sets. + * For example, two subsequent calls using a page_token may return: + * * cursor B, cursor M, cursor Q + * * cursor A, cursor U, cursor W + * To obtain a complete result set ordered with respect to the results of the + * query supplied to PartitionQuery, the results sets should be merged: + * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W + * + * Generated from protobuf field string page_token = 4; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * The maximum number of partitions to return in this call, subject to + * `partition_count`. + * For example, if `partition_count` = 10 and `page_size` = 8, the first call + * to PartitionQuery will return up to 8 partitions and a `next_page_token` + * if more results exist. A second call to PartitionQuery will return up to + * 2 partitions, to complete the total of 10 specified in `partition_count`. + * + * Generated from protobuf field int32 page_size = 5; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of partitions to return in this call, subject to + * `partition_count`. + * For example, if `partition_count` = 10 and `page_size` = 8, the first call + * to PartitionQuery will return up to 8 partitions and a `next_page_token` + * if more results exist. A second call to PartitionQuery will return up to + * 2 partitions, to complete the total of 10 specified in `partition_count`. + * + * Generated from protobuf field int32 page_size = 5; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Reads documents as they were at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->readOneof(6); + } + + public function hasReadTime() + { + return $this->hasOneof(6); + } + + /** + * Reads documents as they were at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getQueryType() + { + return $this->whichOneof("query_type"); + } + + /** + * @return string + */ + public function getConsistencySelector() + { + return $this->whichOneof("consistency_selector"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryResponse.php new file mode 100644 index 000000000000..d6281a637903 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryResponse.php @@ -0,0 +1,162 @@ +google.firestore.v1.PartitionQueryResponse + */ +class PartitionQueryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Partition results. + * Each partition is a split point that can be used by RunQuery as a starting + * or end point for the query results. The RunQuery requests must be made with + * the same query supplied to this PartitionQuery request. The partition + * cursors will be ordered according to same ordering as the results of the + * query supplied to PartitionQuery. + * For example, if a PartitionQuery request returns partition cursors A and B, + * running the following three queries will return the entire result set of + * the original query: + * * query, end_at A + * * query, start_at A, end_at B + * * query, start_at B + * An empty result may indicate that the query has too few results to be + * partitioned, or that the query is not yet supported for partitioning. + * + * Generated from protobuf field repeated .google.firestore.v1.Cursor partitions = 1; + */ + private $partitions; + /** + * A page token that may be used to request an additional set of results, up + * to the number specified by `partition_count` in the PartitionQuery request. + * If blank, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Firestore\V1\Cursor>|\Google\Protobuf\Internal\RepeatedField $partitions + * Partition results. + * Each partition is a split point that can be used by RunQuery as a starting + * or end point for the query results. The RunQuery requests must be made with + * the same query supplied to this PartitionQuery request. The partition + * cursors will be ordered according to same ordering as the results of the + * query supplied to PartitionQuery. + * For example, if a PartitionQuery request returns partition cursors A and B, + * running the following three queries will return the entire result set of + * the original query: + * * query, end_at A + * * query, start_at A, end_at B + * * query, start_at B + * An empty result may indicate that the query has too few results to be + * partitioned, or that the query is not yet supported for partitioning. + * @type string $next_page_token + * A page token that may be used to request an additional set of results, up + * to the number specified by `partition_count` in the PartitionQuery request. + * If blank, there are no more results. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Partition results. + * Each partition is a split point that can be used by RunQuery as a starting + * or end point for the query results. The RunQuery requests must be made with + * the same query supplied to this PartitionQuery request. The partition + * cursors will be ordered according to same ordering as the results of the + * query supplied to PartitionQuery. + * For example, if a PartitionQuery request returns partition cursors A and B, + * running the following three queries will return the entire result set of + * the original query: + * * query, end_at A + * * query, start_at A, end_at B + * * query, start_at B + * An empty result may indicate that the query has too few results to be + * partitioned, or that the query is not yet supported for partitioning. + * + * Generated from protobuf field repeated .google.firestore.v1.Cursor partitions = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPartitions() + { + return $this->partitions; + } + + /** + * Partition results. + * Each partition is a split point that can be used by RunQuery as a starting + * or end point for the query results. The RunQuery requests must be made with + * the same query supplied to this PartitionQuery request. The partition + * cursors will be ordered according to same ordering as the results of the + * query supplied to PartitionQuery. + * For example, if a PartitionQuery request returns partition cursors A and B, + * running the following three queries will return the entire result set of + * the original query: + * * query, end_at A + * * query, start_at A, end_at B + * * query, start_at B + * An empty result may indicate that the query has too few results to be + * partitioned, or that the query is not yet supported for partitioning. + * + * Generated from protobuf field repeated .google.firestore.v1.Cursor partitions = 1; + * @param array<\Google\Cloud\Firestore\V1\Cursor>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPartitions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Cursor::class); + $this->partitions = $arr; + + return $this; + } + + /** + * A page token that may be used to request an additional set of results, up + * to the number specified by `partition_count` in the PartitionQuery request. + * If blank, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A page token that may be used to request an additional set of results, up + * to the number specified by `partition_count` in the PartitionQuery request. + * If blank, there are no more results. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Precondition.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Precondition.php new file mode 100644 index 000000000000..7f7b92595750 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Precondition.php @@ -0,0 +1,114 @@ +google.firestore.v1.Precondition + */ +class Precondition extends \Google\Protobuf\Internal\Message +{ + protected $condition_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $exists + * When set to `true`, the target document must exist. + * When set to `false`, the target document must not exist. + * @type \Google\Protobuf\Timestamp $update_time + * When set, the target document must exist and have been last updated at + * that time. Timestamp must be microsecond aligned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * When set to `true`, the target document must exist. + * When set to `false`, the target document must not exist. + * + * Generated from protobuf field bool exists = 1; + * @return bool + */ + public function getExists() + { + return $this->readOneof(1); + } + + public function hasExists() + { + return $this->hasOneof(1); + } + + /** + * When set to `true`, the target document must exist. + * When set to `false`, the target document must not exist. + * + * Generated from protobuf field bool exists = 1; + * @param bool $var + * @return $this + */ + public function setExists($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * When set, the target document must exist and have been last updated at + * that time. Timestamp must be microsecond aligned. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->readOneof(2); + } + + public function hasUpdateTime() + { + return $this->hasOneof(2); + } + + /** + * When set, the target document must exist and have been last updated at + * that time. Timestamp must be microsecond aligned. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getConditionType() + { + return $this->whichOneof("condition_type"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RollbackRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RollbackRequest.php new file mode 100644 index 000000000000..8a1dca5d7d53 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RollbackRequest.php @@ -0,0 +1,121 @@ +google.firestore.v1.RollbackRequest + */ +class RollbackRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $database = ''; + /** + * Required. The transaction to roll back. + * + * Generated from protobuf field bytes transaction = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $transaction = ''; + + /** + * @param string $database Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @param string $transaction Required. The transaction to roll back. + * + * @return \Google\Cloud\Firestore\V1\RollbackRequest + * + * @experimental + */ + public static function build(string $database, string $transaction): self + { + return (new self()) + ->setDatabase($database) + ->setTransaction($transaction); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $database + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @type string $transaction + * Required. The transaction to roll back. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * Required. The transaction to roll back. + * + * Generated from protobuf field bytes transaction = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTransaction() + { + return $this->transaction; + } + + /** + * Required. The transaction to roll back. + * + * Generated from protobuf field bytes transaction = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->transaction = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryRequest.php new file mode 100644 index 000000000000..3111353cce86 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryRequest.php @@ -0,0 +1,256 @@ +google.firestore.v1.RunAggregationQueryRequest + */ +class RunAggregationQueryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + protected $query_type; + protected $consistency_selector; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * @type \Google\Cloud\Firestore\V1\StructuredAggregationQuery $structured_aggregation_query + * An aggregation query. + * @type string $transaction + * Run the aggregation within an already active transaction. + * The value here is the opaque transaction ID to execute the query in. + * @type \Google\Cloud\Firestore\V1\TransactionOptions $new_transaction + * Starts a new transaction as part of the query, defaulting to read-only. + * The new transaction ID will be returned as the first response in the + * stream. + * @type \Google\Protobuf\Timestamp $read_time + * Executes the query at the given timestamp. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * An aggregation query. + * + * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery structured_aggregation_query = 2; + * @return \Google\Cloud\Firestore\V1\StructuredAggregationQuery|null + */ + public function getStructuredAggregationQuery() + { + return $this->readOneof(2); + } + + public function hasStructuredAggregationQuery() + { + return $this->hasOneof(2); + } + + /** + * An aggregation query. + * + * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery structured_aggregation_query = 2; + * @param \Google\Cloud\Firestore\V1\StructuredAggregationQuery $var + * @return $this + */ + public function setStructuredAggregationQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredAggregationQuery::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Run the aggregation within an already active transaction. + * The value here is the opaque transaction ID to execute the query in. + * + * Generated from protobuf field bytes transaction = 4; + * @return string + */ + public function getTransaction() + { + return $this->readOneof(4); + } + + public function hasTransaction() + { + return $this->hasOneof(4); + } + + /** + * Run the aggregation within an already active transaction. + * The value here is the opaque transaction ID to execute the query in. + * + * Generated from protobuf field bytes transaction = 4; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Starts a new transaction as part of the query, defaulting to read-only. + * The new transaction ID will be returned as the first response in the + * stream. + * + * Generated from protobuf field .google.firestore.v1.TransactionOptions new_transaction = 5; + * @return \Google\Cloud\Firestore\V1\TransactionOptions|null + */ + public function getNewTransaction() + { + return $this->readOneof(5); + } + + public function hasNewTransaction() + { + return $this->hasOneof(5); + } + + /** + * Starts a new transaction as part of the query, defaulting to read-only. + * The new transaction ID will be returned as the first response in the + * stream. + * + * Generated from protobuf field .google.firestore.v1.TransactionOptions new_transaction = 5; + * @param \Google\Cloud\Firestore\V1\TransactionOptions $var + * @return $this + */ + public function setNewTransaction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TransactionOptions::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Executes the query at the given timestamp. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->readOneof(6); + } + + public function hasReadTime() + { + return $this->hasOneof(6); + } + + /** + * Executes the query at the given timestamp. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getQueryType() + { + return $this->whichOneof("query_type"); + } + + /** + * @return string + */ + public function getConsistencySelector() + { + return $this->whichOneof("consistency_selector"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryResponse.php new file mode 100644 index 000000000000..4e61e23a404d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryResponse.php @@ -0,0 +1,192 @@ +google.firestore.v1.RunAggregationQueryResponse + */ +class RunAggregationQueryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A single aggregation result. + * Not present when reporting partial progress. + * + * Generated from protobuf field .google.firestore.v1.AggregationResult result = 1; + */ + protected $result = null; + /** + * The transaction that was started as part of this request. + * Only present on the first response when the request requested to start + * a new transaction. + * + * Generated from protobuf field bytes transaction = 2; + */ + protected $transaction = ''; + /** + * The time at which the aggregate result was computed. This is always + * monotonically increasing; in this case, the previous AggregationResult in + * the result stream are guaranteed not to have changed between their + * `read_time` and this one. + * If the query returns no results, a response with `read_time` and no + * `result` will be sent, and this represents the time at which the query + * was run. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; + */ + protected $read_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\AggregationResult $result + * A single aggregation result. + * Not present when reporting partial progress. + * @type string $transaction + * The transaction that was started as part of this request. + * Only present on the first response when the request requested to start + * a new transaction. + * @type \Google\Protobuf\Timestamp $read_time + * The time at which the aggregate result was computed. This is always + * monotonically increasing; in this case, the previous AggregationResult in + * the result stream are guaranteed not to have changed between their + * `read_time` and this one. + * If the query returns no results, a response with `read_time` and no + * `result` will be sent, and this represents the time at which the query + * was run. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * A single aggregation result. + * Not present when reporting partial progress. + * + * Generated from protobuf field .google.firestore.v1.AggregationResult result = 1; + * @return \Google\Cloud\Firestore\V1\AggregationResult|null + */ + public function getResult() + { + return $this->result; + } + + public function hasResult() + { + return isset($this->result); + } + + public function clearResult() + { + unset($this->result); + } + + /** + * A single aggregation result. + * Not present when reporting partial progress. + * + * Generated from protobuf field .google.firestore.v1.AggregationResult result = 1; + * @param \Google\Cloud\Firestore\V1\AggregationResult $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\AggregationResult::class); + $this->result = $var; + + return $this; + } + + /** + * The transaction that was started as part of this request. + * Only present on the first response when the request requested to start + * a new transaction. + * + * Generated from protobuf field bytes transaction = 2; + * @return string + */ + public function getTransaction() + { + return $this->transaction; + } + + /** + * The transaction that was started as part of this request. + * Only present on the first response when the request requested to start + * a new transaction. + * + * Generated from protobuf field bytes transaction = 2; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->transaction = $var; + + return $this; + } + + /** + * The time at which the aggregate result was computed. This is always + * monotonically increasing; in this case, the previous AggregationResult in + * the result stream are guaranteed not to have changed between their + * `read_time` and this one. + * If the query returns no results, a response with `read_time` and no + * `result` will be sent, and this represents the time at which the query + * was run. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * The time at which the aggregate result was computed. This is always + * monotonically increasing; in this case, the previous AggregationResult in + * the result stream are guaranteed not to have changed between their + * `read_time` and this one. + * If the query returns no results, a response with `read_time` and no + * `result` will be sent, and this represents the time at which the query + * was run. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryRequest.php new file mode 100644 index 000000000000..554db6f12df2 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryRequest.php @@ -0,0 +1,258 @@ +google.firestore.v1.RunQueryRequest + */ +class RunQueryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + protected $query_type; + protected $consistency_selector; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * @type \Google\Cloud\Firestore\V1\StructuredQuery $structured_query + * A structured query. + * @type string $transaction + * Run the query within an already active transaction. + * The value here is the opaque transaction ID to execute the query in. + * @type \Google\Cloud\Firestore\V1\TransactionOptions $new_transaction + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + * @type \Google\Protobuf\Timestamp $read_time + * Reads documents as they were at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * A structured query. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 2; + * @return \Google\Cloud\Firestore\V1\StructuredQuery|null + */ + public function getStructuredQuery() + { + return $this->readOneof(2); + } + + public function hasStructuredQuery() + { + return $this->hasOneof(2); + } + + /** + * A structured query. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 2; + * @param \Google\Cloud\Firestore\V1\StructuredQuery $var + * @return $this + */ + public function setStructuredQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Run the query within an already active transaction. + * The value here is the opaque transaction ID to execute the query in. + * + * Generated from protobuf field bytes transaction = 5; + * @return string + */ + public function getTransaction() + { + return $this->readOneof(5); + } + + public function hasTransaction() + { + return $this->hasOneof(5); + } + + /** + * Run the query within an already active transaction. + * The value here is the opaque transaction ID to execute the query in. + * + * Generated from protobuf field bytes transaction = 5; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + * + * Generated from protobuf field .google.firestore.v1.TransactionOptions new_transaction = 6; + * @return \Google\Cloud\Firestore\V1\TransactionOptions|null + */ + public function getNewTransaction() + { + return $this->readOneof(6); + } + + public function hasNewTransaction() + { + return $this->hasOneof(6); + } + + /** + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + * + * Generated from protobuf field .google.firestore.v1.TransactionOptions new_transaction = 6; + * @param \Google\Cloud\Firestore\V1\TransactionOptions $var + * @return $this + */ + public function setNewTransaction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TransactionOptions::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Reads documents as they were at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->readOneof(7); + } + + public function hasReadTime() + { + return $this->hasOneof(7); + } + + /** + * Reads documents as they were at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getQueryType() + { + return $this->whichOneof("query_type"); + } + + /** + * @return string + */ + public function getConsistencySelector() + { + return $this->whichOneof("consistency_selector"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryResponse.php new file mode 100644 index 000000000000..ef6bbca5c468 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryResponse.php @@ -0,0 +1,275 @@ +google.firestore.v1.RunQueryResponse + */ +class RunQueryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The transaction that was started as part of this request. + * Can only be set in the first response, and only if + * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] + * was set in the request. If set, no other fields will be set in this + * response. + * + * Generated from protobuf field bytes transaction = 2; + */ + protected $transaction = ''; + /** + * A query result, not set when reporting partial progress. + * + * Generated from protobuf field .google.firestore.v1.Document document = 1; + */ + protected $document = null; + /** + * The time at which the document was read. This may be monotonically + * increasing; in this case, the previous documents in the result stream are + * guaranteed not to have changed between their `read_time` and this one. + * If the query returns no results, a response with `read_time` and no + * `document` will be sent, and this represents the time at which the query + * was run. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; + */ + protected $read_time = null; + /** + * The number of results that have been skipped due to an offset between + * the last response and the current response. + * + * Generated from protobuf field int32 skipped_results = 4; + */ + protected $skipped_results = 0; + protected $continuation_selector; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $transaction + * The transaction that was started as part of this request. + * Can only be set in the first response, and only if + * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] + * was set in the request. If set, no other fields will be set in this + * response. + * @type \Google\Cloud\Firestore\V1\Document $document + * A query result, not set when reporting partial progress. + * @type \Google\Protobuf\Timestamp $read_time + * The time at which the document was read. This may be monotonically + * increasing; in this case, the previous documents in the result stream are + * guaranteed not to have changed between their `read_time` and this one. + * If the query returns no results, a response with `read_time` and no + * `document` will be sent, and this represents the time at which the query + * was run. + * @type int $skipped_results + * The number of results that have been skipped due to an offset between + * the last response and the current response. + * @type bool $done + * If present, Firestore has completely finished the request and no more + * documents will be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * The transaction that was started as part of this request. + * Can only be set in the first response, and only if + * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] + * was set in the request. If set, no other fields will be set in this + * response. + * + * Generated from protobuf field bytes transaction = 2; + * @return string + */ + public function getTransaction() + { + return $this->transaction; + } + + /** + * The transaction that was started as part of this request. + * Can only be set in the first response, and only if + * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] + * was set in the request. If set, no other fields will be set in this + * response. + * + * Generated from protobuf field bytes transaction = 2; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->transaction = $var; + + return $this; + } + + /** + * A query result, not set when reporting partial progress. + * + * Generated from protobuf field .google.firestore.v1.Document document = 1; + * @return \Google\Cloud\Firestore\V1\Document|null + */ + public function getDocument() + { + return $this->document; + } + + public function hasDocument() + { + return isset($this->document); + } + + public function clearDocument() + { + unset($this->document); + } + + /** + * A query result, not set when reporting partial progress. + * + * Generated from protobuf field .google.firestore.v1.Document document = 1; + * @param \Google\Cloud\Firestore\V1\Document $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Document::class); + $this->document = $var; + + return $this; + } + + /** + * The time at which the document was read. This may be monotonically + * increasing; in this case, the previous documents in the result stream are + * guaranteed not to have changed between their `read_time` and this one. + * If the query returns no results, a response with `read_time` and no + * `document` will be sent, and this represents the time at which the query + * was run. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * The time at which the document was read. This may be monotonically + * increasing; in this case, the previous documents in the result stream are + * guaranteed not to have changed between their `read_time` and this one. + * If the query returns no results, a response with `read_time` and no + * `document` will be sent, and this represents the time at which the query + * was run. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + + /** + * The number of results that have been skipped due to an offset between + * the last response and the current response. + * + * Generated from protobuf field int32 skipped_results = 4; + * @return int + */ + public function getSkippedResults() + { + return $this->skipped_results; + } + + /** + * The number of results that have been skipped due to an offset between + * the last response and the current response. + * + * Generated from protobuf field int32 skipped_results = 4; + * @param int $var + * @return $this + */ + public function setSkippedResults($var) + { + GPBUtil::checkInt32($var); + $this->skipped_results = $var; + + return $this; + } + + /** + * If present, Firestore has completely finished the request and no more + * documents will be returned. + * + * Generated from protobuf field bool done = 6; + * @return bool + */ + public function getDone() + { + return $this->readOneof(6); + } + + public function hasDone() + { + return $this->hasOneof(6); + } + + /** + * If present, Firestore has completely finished the request and no more + * documents will be returned. + * + * Generated from protobuf field bool done = 6; + * @param bool $var + * @return $this + */ + public function setDone($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getContinuationSelector() + { + return $this->whichOneof("continuation_selector"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery.php new file mode 100644 index 000000000000..513a7aeb0f84 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery.php @@ -0,0 +1,122 @@ +google.firestore.v1.StructuredAggregationQuery + */ +class StructuredAggregationQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Series of aggregations to apply over the results of the + * `structured_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredAggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $aggregations; + protected $query_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\StructuredQuery $structured_query + * Nested structured query. + * @type array<\Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation>|\Google\Protobuf\Internal\RepeatedField $aggregations + * Optional. Series of aggregations to apply over the results of the + * `structured_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * Nested structured query. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 1; + * @return \Google\Cloud\Firestore\V1\StructuredQuery|null + */ + public function getStructuredQuery() + { + return $this->readOneof(1); + } + + public function hasStructuredQuery() + { + return $this->hasOneof(1); + } + + /** + * Nested structured query. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 1; + * @param \Google\Cloud\Firestore\V1\StructuredQuery $var + * @return $this + */ + public function setStructuredQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. Series of aggregations to apply over the results of the + * `structured_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredAggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAggregations() + { + return $this->aggregations; + } + + /** + * Optional. Series of aggregations to apply over the results of the + * `structured_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredAggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAggregations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation::class); + $this->aggregations = $arr; + + return $this; + } + + /** + * @return string + */ + public function getQueryType() + { + return $this->whichOneof("query_type"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation.php new file mode 100644 index 000000000000..2e21334696cb --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation.php @@ -0,0 +1,290 @@ +google.firestore.v1.StructuredAggregationQuery.Aggregation + */ +class Aggregation extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Optional name of the field to store the result of the + * aggregation into. + * If not provided, Firestore will pick a default name following the format + * `field_`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS field_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) AS field_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [document field name][google.firestore.v1.Document.fields] + * limitations. + * + * Generated from protobuf field string alias = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $alias = ''; + protected $operator; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Count $count + * Count aggregator. + * @type \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Sum $sum + * Sum aggregator. + * @type \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Avg $avg + * Average aggregator. + * @type string $alias + * Optional. Optional name of the field to store the result of the + * aggregation into. + * If not provided, Firestore will pick a default name following the format + * `field_`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS field_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) AS field_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [document field name][google.firestore.v1.Document.fields] + * limitations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * Count aggregator. + * + * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery.Aggregation.Count count = 1; + * @return \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Count|null + */ + public function getCount() + { + return $this->readOneof(1); + } + + public function hasCount() + { + return $this->hasOneof(1); + } + + /** + * Count aggregator. + * + * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery.Aggregation.Count count = 1; + * @param \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Count $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Count::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Sum aggregator. + * + * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum sum = 2; + * @return \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Sum|null + */ + public function getSum() + { + return $this->readOneof(2); + } + + public function hasSum() + { + return $this->hasOneof(2); + } + + /** + * Sum aggregator. + * + * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum sum = 2; + * @param \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Sum $var + * @return $this + */ + public function setSum($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Sum::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Average aggregator. + * + * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg avg = 3; + * @return \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Avg|null + */ + public function getAvg() + { + return $this->readOneof(3); + } + + public function hasAvg() + { + return $this->hasOneof(3); + } + + /** + * Average aggregator. + * + * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg avg = 3; + * @param \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Avg $var + * @return $this + */ + public function setAvg($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Avg::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Optional name of the field to store the result of the + * aggregation into. + * If not provided, Firestore will pick a default name following the format + * `field_`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS field_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) AS field_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [document field name][google.firestore.v1.Document.fields] + * limitations. + * + * Generated from protobuf field string alias = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAlias() + { + return $this->alias; + } + + /** + * Optional. Optional name of the field to store the result of the + * aggregation into. + * If not provided, Firestore will pick a default name following the format + * `field_`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS field_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) AS field_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [document field name][google.firestore.v1.Document.fields] + * limitations. + * + * Generated from protobuf field string alias = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAlias($var) + { + GPBUtil::checkString($var, True); + $this->alias = $var; + + return $this; + } + + /** + * @return string + */ + public function getOperator() + { + return $this->whichOneof("operator"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Aggregation::class, \Google\Cloud\Firestore\V1\StructuredAggregationQuery_Aggregation::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Avg.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Avg.php new file mode 100644 index 000000000000..4af9d9ee411c --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Avg.php @@ -0,0 +1,86 @@ +google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg + */ +class Avg extends \Google\Protobuf\Internal\Message +{ + /** + * The field to aggregate on. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + protected $field = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $field + * The field to aggregate on. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The field to aggregate on. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; + * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference|null + */ + public function getField() + { + return $this->field; + } + + public function hasField() + { + return isset($this->field); + } + + public function clearField() + { + unset($this->field); + } + + /** + * The field to aggregate on. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; + * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); + $this->field = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Avg::class, \Google\Cloud\Firestore\V1\StructuredAggregationQuery_Aggregation_Avg::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Count.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Count.php new file mode 100644 index 000000000000..0bfb56baf641 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Count.php @@ -0,0 +1,169 @@ +google.firestore.v1.StructuredAggregationQuery.Aggregation.Count + */ +class Count extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Optional constraint on the maximum number of documents to + * count. + * This provides a way to set an upper bound on the number of documents + * to scan, limiting latency, and cost. + * Unspecified is interpreted as no bound. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be greater than zero when present. + * + * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $up_to = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Int64Value $up_to + * Optional. Optional constraint on the maximum number of documents to + * count. + * This provides a way to set an upper bound on the number of documents + * to scan, limiting latency, and cost. + * Unspecified is interpreted as no bound. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be greater than zero when present. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Optional constraint on the maximum number of documents to + * count. + * This provides a way to set an upper bound on the number of documents + * to scan, limiting latency, and cost. + * Unspecified is interpreted as no bound. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be greater than zero when present. + * + * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getUpTo() + { + return $this->up_to; + } + + public function hasUpTo() + { + return isset($this->up_to); + } + + public function clearUpTo() + { + unset($this->up_to); + } + + /** + * Returns the unboxed value from getUpTo() + + * Optional. Optional constraint on the maximum number of documents to + * count. + * This provides a way to set an upper bound on the number of documents + * to scan, limiting latency, and cost. + * Unspecified is interpreted as no bound. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be greater than zero when present. + * + * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getUpToUnwrapped() + { + return $this->readWrapperValue("up_to"); + } + + /** + * Optional. Optional constraint on the maximum number of documents to + * count. + * This provides a way to set an upper bound on the number of documents + * to scan, limiting latency, and cost. + * Unspecified is interpreted as no bound. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be greater than zero when present. + * + * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setUpTo($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->up_to = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. Optional constraint on the maximum number of documents to + * count. + * This provides a way to set an upper bound on the number of documents + * to scan, limiting latency, and cost. + * Unspecified is interpreted as no bound. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be greater than zero when present. + * + * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setUpToUnwrapped($var) + { + $this->writeWrapperValue("up_to", $var); + return $this;} + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Count::class, \Google\Cloud\Firestore\V1\StructuredAggregationQuery_Aggregation_Count::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Sum.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Sum.php new file mode 100644 index 000000000000..215315c68ef8 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Sum.php @@ -0,0 +1,95 @@ +google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum + */ +class Sum extends \Google\Protobuf\Internal\Message +{ + /** + * The field to aggregate on. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + protected $field = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $field + * The field to aggregate on. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The field to aggregate on. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; + * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference|null + */ + public function getField() + { + return $this->field; + } + + public function hasField() + { + return isset($this->field); + } + + public function clearField() + { + unset($this->field); + } + + /** + * The field to aggregate on. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; + * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); + $this->field = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Sum::class, \Google\Cloud\Firestore\V1\StructuredAggregationQuery_Aggregation_Sum::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery.php new file mode 100644 index 000000000000..dc6fcc123ed3 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery.php @@ -0,0 +1,599 @@ +google.firestore.v1.StructuredQuery + */ +class StructuredQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Optional sub-set of the fields to return. + * This acts as a [DocumentMask][google.firestore.v1.DocumentMask] over the + * documents returned from a query. When not set, assumes that the caller + * wants all fields returned. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.Projection select = 1; + */ + protected $select = null; + /** + * The collections to query. + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + */ + private $from; + /** + * The filter to apply. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.Filter where = 3; + */ + protected $where = null; + /** + * The order to apply to the query results. + * Firestore allows callers to provide a full ordering, a partial ordering, or + * no ordering at all. In all cases, Firestore guarantees a stable ordering + * through the following rules: + * * The `order_by` is required to reference all fields used with an + * inequality filter. + * * All fields that are required to be in the `order_by` but are not already + * present are appended in lexicographical ordering of the field name. + * * If an order on `__name__` is not specified, it is appended by default. + * Fields are appended with the same sort direction as the last order + * specified, or 'ASCENDING' if no order was specified. For example: + * * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` + * * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` + * * `WHERE a > 1` becomes `WHERE a > 1 ORDER BY a ASC, __name__ ASC` + * * `WHERE __name__ > ... AND a > 1` becomes + * `WHERE __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC` + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + */ + private $order_by; + /** + * A potential prefix of a position in the result set to start the query at. + * The ordering of the result set is based on the `ORDER BY` clause of the + * original query. + * ``` + * SELECT * FROM k WHERE a = 1 AND b > 2 ORDER BY b ASC, __name__ ASC; + * ``` + * This query's results are ordered by `(b ASC, __name__ ASC)`. + * Cursors can reference either the full ordering or a prefix of the location, + * though it cannot reference more fields than what are in the provided + * `ORDER BY`. + * Continuing off the example above, attaching the following start cursors + * will have varying impact: + * - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND + * b > 2 AND __name__ > /k/123`. + * - `START AFTER (10)`: start the query right after `a = 1 AND b > 10`. + * Unlike `OFFSET` which requires scanning over the first N results to skip, + * a start cursor allows the query to begin at a logical position. This + * position is not required to match an actual result, it will scan forward + * from this position to find the next document. + * Requires: + * * The number of values cannot be greater than the number of fields + * specified in the `ORDER BY` clause. + * + * Generated from protobuf field .google.firestore.v1.Cursor start_at = 7; + */ + protected $start_at = null; + /** + * A potential prefix of a position in the result set to end the query at. + * This is similar to `START_AT` but with it controlling the end position + * rather than the start position. + * Requires: + * * The number of values cannot be greater than the number of fields + * specified in the `ORDER BY` clause. + * + * Generated from protobuf field .google.firestore.v1.Cursor end_at = 8; + */ + protected $end_at = null; + /** + * The number of documents to skip before returning the first result. + * This applies after the constraints specified by the `WHERE`, `START AT`, & + * `END AT` but before the `LIMIT` clause. + * Requires: + * * The value must be greater than or equal to zero if specified. + * + * Generated from protobuf field int32 offset = 6; + */ + protected $offset = 0; + /** + * The maximum number of results to return. + * Applies after all other constraints. + * Requires: + * * The value must be greater than or equal to zero if specified. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 5; + */ + protected $limit = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\StructuredQuery\Projection $select + * Optional sub-set of the fields to return. + * This acts as a [DocumentMask][google.firestore.v1.DocumentMask] over the + * documents returned from a query. When not set, assumes that the caller + * wants all fields returned. + * @type array<\Google\Cloud\Firestore\V1\StructuredQuery\CollectionSelector>|\Google\Protobuf\Internal\RepeatedField $from + * The collections to query. + * @type \Google\Cloud\Firestore\V1\StructuredQuery\Filter $where + * The filter to apply. + * @type array<\Google\Cloud\Firestore\V1\StructuredQuery\Order>|\Google\Protobuf\Internal\RepeatedField $order_by + * The order to apply to the query results. + * Firestore allows callers to provide a full ordering, a partial ordering, or + * no ordering at all. In all cases, Firestore guarantees a stable ordering + * through the following rules: + * * The `order_by` is required to reference all fields used with an + * inequality filter. + * * All fields that are required to be in the `order_by` but are not already + * present are appended in lexicographical ordering of the field name. + * * If an order on `__name__` is not specified, it is appended by default. + * Fields are appended with the same sort direction as the last order + * specified, or 'ASCENDING' if no order was specified. For example: + * * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` + * * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` + * * `WHERE a > 1` becomes `WHERE a > 1 ORDER BY a ASC, __name__ ASC` + * * `WHERE __name__ > ... AND a > 1` becomes + * `WHERE __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC` + * @type \Google\Cloud\Firestore\V1\Cursor $start_at + * A potential prefix of a position in the result set to start the query at. + * The ordering of the result set is based on the `ORDER BY` clause of the + * original query. + * ``` + * SELECT * FROM k WHERE a = 1 AND b > 2 ORDER BY b ASC, __name__ ASC; + * ``` + * This query's results are ordered by `(b ASC, __name__ ASC)`. + * Cursors can reference either the full ordering or a prefix of the location, + * though it cannot reference more fields than what are in the provided + * `ORDER BY`. + * Continuing off the example above, attaching the following start cursors + * will have varying impact: + * - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND + * b > 2 AND __name__ > /k/123`. + * - `START AFTER (10)`: start the query right after `a = 1 AND b > 10`. + * Unlike `OFFSET` which requires scanning over the first N results to skip, + * a start cursor allows the query to begin at a logical position. This + * position is not required to match an actual result, it will scan forward + * from this position to find the next document. + * Requires: + * * The number of values cannot be greater than the number of fields + * specified in the `ORDER BY` clause. + * @type \Google\Cloud\Firestore\V1\Cursor $end_at + * A potential prefix of a position in the result set to end the query at. + * This is similar to `START_AT` but with it controlling the end position + * rather than the start position. + * Requires: + * * The number of values cannot be greater than the number of fields + * specified in the `ORDER BY` clause. + * @type int $offset + * The number of documents to skip before returning the first result. + * This applies after the constraints specified by the `WHERE`, `START AT`, & + * `END AT` but before the `LIMIT` clause. + * Requires: + * * The value must be greater than or equal to zero if specified. + * @type \Google\Protobuf\Int32Value $limit + * The maximum number of results to return. + * Applies after all other constraints. + * Requires: + * * The value must be greater than or equal to zero if specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * Optional sub-set of the fields to return. + * This acts as a [DocumentMask][google.firestore.v1.DocumentMask] over the + * documents returned from a query. When not set, assumes that the caller + * wants all fields returned. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.Projection select = 1; + * @return \Google\Cloud\Firestore\V1\StructuredQuery\Projection|null + */ + public function getSelect() + { + return $this->select; + } + + public function hasSelect() + { + return isset($this->select); + } + + public function clearSelect() + { + unset($this->select); + } + + /** + * Optional sub-set of the fields to return. + * This acts as a [DocumentMask][google.firestore.v1.DocumentMask] over the + * documents returned from a query. When not set, assumes that the caller + * wants all fields returned. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.Projection select = 1; + * @param \Google\Cloud\Firestore\V1\StructuredQuery\Projection $var + * @return $this + */ + public function setSelect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\Projection::class); + $this->select = $var; + + return $this; + } + + /** + * The collections to query. + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFrom() + { + return $this->from; + } + + /** + * The collections to query. + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; + * @param array<\Google\Cloud\Firestore\V1\StructuredQuery\CollectionSelector>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFrom($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\StructuredQuery\CollectionSelector::class); + $this->from = $arr; + + return $this; + } + + /** + * The filter to apply. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.Filter where = 3; + * @return \Google\Cloud\Firestore\V1\StructuredQuery\Filter|null + */ + public function getWhere() + { + return $this->where; + } + + public function hasWhere() + { + return isset($this->where); + } + + public function clearWhere() + { + unset($this->where); + } + + /** + * The filter to apply. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.Filter where = 3; + * @param \Google\Cloud\Firestore\V1\StructuredQuery\Filter $var + * @return $this + */ + public function setWhere($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\Filter::class); + $this->where = $var; + + return $this; + } + + /** + * The order to apply to the query results. + * Firestore allows callers to provide a full ordering, a partial ordering, or + * no ordering at all. In all cases, Firestore guarantees a stable ordering + * through the following rules: + * * The `order_by` is required to reference all fields used with an + * inequality filter. + * * All fields that are required to be in the `order_by` but are not already + * present are appended in lexicographical ordering of the field name. + * * If an order on `__name__` is not specified, it is appended by default. + * Fields are appended with the same sort direction as the last order + * specified, or 'ASCENDING' if no order was specified. For example: + * * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` + * * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` + * * `WHERE a > 1` becomes `WHERE a > 1 ORDER BY a ASC, __name__ ASC` + * * `WHERE __name__ > ... AND a > 1` becomes + * `WHERE __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC` + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * The order to apply to the query results. + * Firestore allows callers to provide a full ordering, a partial ordering, or + * no ordering at all. In all cases, Firestore guarantees a stable ordering + * through the following rules: + * * The `order_by` is required to reference all fields used with an + * inequality filter. + * * All fields that are required to be in the `order_by` but are not already + * present are appended in lexicographical ordering of the field name. + * * If an order on `__name__` is not specified, it is appended by default. + * Fields are appended with the same sort direction as the last order + * specified, or 'ASCENDING' if no order was specified. For example: + * * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` + * * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` + * * `WHERE a > 1` becomes `WHERE a > 1 ORDER BY a ASC, __name__ ASC` + * * `WHERE __name__ > ... AND a > 1` becomes + * `WHERE __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC` + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; + * @param array<\Google\Cloud\Firestore\V1\StructuredQuery\Order>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOrderBy($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\StructuredQuery\Order::class); + $this->order_by = $arr; + + return $this; + } + + /** + * A potential prefix of a position in the result set to start the query at. + * The ordering of the result set is based on the `ORDER BY` clause of the + * original query. + * ``` + * SELECT * FROM k WHERE a = 1 AND b > 2 ORDER BY b ASC, __name__ ASC; + * ``` + * This query's results are ordered by `(b ASC, __name__ ASC)`. + * Cursors can reference either the full ordering or a prefix of the location, + * though it cannot reference more fields than what are in the provided + * `ORDER BY`. + * Continuing off the example above, attaching the following start cursors + * will have varying impact: + * - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND + * b > 2 AND __name__ > /k/123`. + * - `START AFTER (10)`: start the query right after `a = 1 AND b > 10`. + * Unlike `OFFSET` which requires scanning over the first N results to skip, + * a start cursor allows the query to begin at a logical position. This + * position is not required to match an actual result, it will scan forward + * from this position to find the next document. + * Requires: + * * The number of values cannot be greater than the number of fields + * specified in the `ORDER BY` clause. + * + * Generated from protobuf field .google.firestore.v1.Cursor start_at = 7; + * @return \Google\Cloud\Firestore\V1\Cursor|null + */ + public function getStartAt() + { + return $this->start_at; + } + + public function hasStartAt() + { + return isset($this->start_at); + } + + public function clearStartAt() + { + unset($this->start_at); + } + + /** + * A potential prefix of a position in the result set to start the query at. + * The ordering of the result set is based on the `ORDER BY` clause of the + * original query. + * ``` + * SELECT * FROM k WHERE a = 1 AND b > 2 ORDER BY b ASC, __name__ ASC; + * ``` + * This query's results are ordered by `(b ASC, __name__ ASC)`. + * Cursors can reference either the full ordering or a prefix of the location, + * though it cannot reference more fields than what are in the provided + * `ORDER BY`. + * Continuing off the example above, attaching the following start cursors + * will have varying impact: + * - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND + * b > 2 AND __name__ > /k/123`. + * - `START AFTER (10)`: start the query right after `a = 1 AND b > 10`. + * Unlike `OFFSET` which requires scanning over the first N results to skip, + * a start cursor allows the query to begin at a logical position. This + * position is not required to match an actual result, it will scan forward + * from this position to find the next document. + * Requires: + * * The number of values cannot be greater than the number of fields + * specified in the `ORDER BY` clause. + * + * Generated from protobuf field .google.firestore.v1.Cursor start_at = 7; + * @param \Google\Cloud\Firestore\V1\Cursor $var + * @return $this + */ + public function setStartAt($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Cursor::class); + $this->start_at = $var; + + return $this; + } + + /** + * A potential prefix of a position in the result set to end the query at. + * This is similar to `START_AT` but with it controlling the end position + * rather than the start position. + * Requires: + * * The number of values cannot be greater than the number of fields + * specified in the `ORDER BY` clause. + * + * Generated from protobuf field .google.firestore.v1.Cursor end_at = 8; + * @return \Google\Cloud\Firestore\V1\Cursor|null + */ + public function getEndAt() + { + return $this->end_at; + } + + public function hasEndAt() + { + return isset($this->end_at); + } + + public function clearEndAt() + { + unset($this->end_at); + } + + /** + * A potential prefix of a position in the result set to end the query at. + * This is similar to `START_AT` but with it controlling the end position + * rather than the start position. + * Requires: + * * The number of values cannot be greater than the number of fields + * specified in the `ORDER BY` clause. + * + * Generated from protobuf field .google.firestore.v1.Cursor end_at = 8; + * @param \Google\Cloud\Firestore\V1\Cursor $var + * @return $this + */ + public function setEndAt($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Cursor::class); + $this->end_at = $var; + + return $this; + } + + /** + * The number of documents to skip before returning the first result. + * This applies after the constraints specified by the `WHERE`, `START AT`, & + * `END AT` but before the `LIMIT` clause. + * Requires: + * * The value must be greater than or equal to zero if specified. + * + * Generated from protobuf field int32 offset = 6; + * @return int + */ + public function getOffset() + { + return $this->offset; + } + + /** + * The number of documents to skip before returning the first result. + * This applies after the constraints specified by the `WHERE`, `START AT`, & + * `END AT` but before the `LIMIT` clause. + * Requires: + * * The value must be greater than or equal to zero if specified. + * + * Generated from protobuf field int32 offset = 6; + * @param int $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkInt32($var); + $this->offset = $var; + + return $this; + } + + /** + * The maximum number of results to return. + * Applies after all other constraints. + * Requires: + * * The value must be greater than or equal to zero if specified. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 5; + * @return \Google\Protobuf\Int32Value|null + */ + public function getLimit() + { + return $this->limit; + } + + public function hasLimit() + { + return isset($this->limit); + } + + public function clearLimit() + { + unset($this->limit); + } + + /** + * Returns the unboxed value from getLimit() + + * The maximum number of results to return. + * Applies after all other constraints. + * Requires: + * * The value must be greater than or equal to zero if specified. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 5; + * @return int|null + */ + public function getLimitUnwrapped() + { + return $this->readWrapperValue("limit"); + } + + /** + * The maximum number of results to return. + * Applies after all other constraints. + * Requires: + * * The value must be greater than or equal to zero if specified. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 5; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setLimit($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->limit = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * The maximum number of results to return. + * Applies after all other constraints. + * Requires: + * * The value must be greater than or equal to zero if specified. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 5; + * @param int|null $var + * @return $this + */ + public function setLimitUnwrapped($var) + { + $this->writeWrapperValue("limit", $var); + return $this;} + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CollectionSelector.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CollectionSelector.php new file mode 100644 index 000000000000..b06253d9d6ad --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CollectionSelector.php @@ -0,0 +1,116 @@ +google.firestore.v1.StructuredQuery.CollectionSelector + */ +class CollectionSelector extends \Google\Protobuf\Internal\Message +{ + /** + * The collection ID. + * When set, selects only collections with this ID. + * + * Generated from protobuf field string collection_id = 2; + */ + protected $collection_id = ''; + /** + * When false, selects only collections that are immediate children of + * the `parent` specified in the containing `RunQueryRequest`. + * When true, selects all descendant collections. + * + * Generated from protobuf field bool all_descendants = 3; + */ + protected $all_descendants = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $collection_id + * The collection ID. + * When set, selects only collections with this ID. + * @type bool $all_descendants + * When false, selects only collections that are immediate children of + * the `parent` specified in the containing `RunQueryRequest`. + * When true, selects all descendant collections. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The collection ID. + * When set, selects only collections with this ID. + * + * Generated from protobuf field string collection_id = 2; + * @return string + */ + public function getCollectionId() + { + return $this->collection_id; + } + + /** + * The collection ID. + * When set, selects only collections with this ID. + * + * Generated from protobuf field string collection_id = 2; + * @param string $var + * @return $this + */ + public function setCollectionId($var) + { + GPBUtil::checkString($var, True); + $this->collection_id = $var; + + return $this; + } + + /** + * When false, selects only collections that are immediate children of + * the `parent` specified in the containing `RunQueryRequest`. + * When true, selects all descendant collections. + * + * Generated from protobuf field bool all_descendants = 3; + * @return bool + */ + public function getAllDescendants() + { + return $this->all_descendants; + } + + /** + * When false, selects only collections that are immediate children of + * the `parent` specified in the containing `RunQueryRequest`. + * When true, selects all descendant collections. + * + * Generated from protobuf field bool all_descendants = 3; + * @param bool $var + * @return $this + */ + public function setAllDescendants($var) + { + GPBUtil::checkBool($var); + $this->all_descendants = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CollectionSelector::class, \Google\Cloud\Firestore\V1\StructuredQuery_CollectionSelector::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter.php new file mode 100644 index 000000000000..f63c324d982d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter.php @@ -0,0 +1,112 @@ +google.firestore.v1.StructuredQuery.CompositeFilter + */ +class CompositeFilter extends \Google\Protobuf\Internal\Message +{ + /** + * The operator for combining multiple filters. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; + */ + protected $op = 0; + /** + * The list of filters to combine. + * Requires: + * * At least one filter is present. + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + */ + private $filters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $op + * The operator for combining multiple filters. + * @type array<\Google\Cloud\Firestore\V1\StructuredQuery\Filter>|\Google\Protobuf\Internal\RepeatedField $filters + * The list of filters to combine. + * Requires: + * * At least one filter is present. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The operator for combining multiple filters. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; + * @return int + */ + public function getOp() + { + return $this->op; + } + + /** + * The operator for combining multiple filters. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; + * @param int $var + * @return $this + */ + public function setOp($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\StructuredQuery\CompositeFilter\Operator::class); + $this->op = $var; + + return $this; + } + + /** + * The list of filters to combine. + * Requires: + * * At least one filter is present. + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilters() + { + return $this->filters; + } + + /** + * The list of filters to combine. + * Requires: + * * At least one filter is present. + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; + * @param array<\Google\Cloud\Firestore\V1\StructuredQuery\Filter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\StructuredQuery\Filter::class); + $this->filters = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CompositeFilter::class, \Google\Cloud\Firestore\V1\StructuredQuery_CompositeFilter::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter/Operator.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter/Operator.php new file mode 100644 index 000000000000..b603b83dc965 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter/Operator.php @@ -0,0 +1,68 @@ +google.firestore.v1.StructuredQuery.CompositeFilter.Operator + */ +class Operator +{ + /** + * Unspecified. This value must not be used. + * + * Generated from protobuf enum OPERATOR_UNSPECIFIED = 0; + */ + const OPERATOR_UNSPECIFIED = 0; + /** + * Documents are required to satisfy all of the combined filters. + * + * Generated from protobuf enum AND = 1; + */ + const PBAND = 1; + /** + * Documents are required to satisfy at least one of the combined filters. + * + * Generated from protobuf enum OR = 2; + */ + const PBOR = 2; + + private static $valueToName = [ + self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED', + self::PBAND => 'AND', + self::PBOR => 'OR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Operator::class, \Google\Cloud\Firestore\V1\StructuredQuery_CompositeFilter_Operator::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Direction.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Direction.php new file mode 100644 index 000000000000..70989c758cf2 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Direction.php @@ -0,0 +1,64 @@ +google.firestore.v1.StructuredQuery.Direction + */ +class Direction +{ + /** + * Unspecified. + * + * Generated from protobuf enum DIRECTION_UNSPECIFIED = 0; + */ + const DIRECTION_UNSPECIFIED = 0; + /** + * Ascending. + * + * Generated from protobuf enum ASCENDING = 1; + */ + const ASCENDING = 1; + /** + * Descending. + * + * Generated from protobuf enum DESCENDING = 2; + */ + const DESCENDING = 2; + + private static $valueToName = [ + self::DIRECTION_UNSPECIFIED => 'DIRECTION_UNSPECIFIED', + self::ASCENDING => 'ASCENDING', + self::DESCENDING => 'DESCENDING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Direction::class, \Google\Cloud\Firestore\V1\StructuredQuery_Direction::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter.php new file mode 100644 index 000000000000..d027d09f1050 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter.php @@ -0,0 +1,158 @@ +google.firestore.v1.StructuredQuery.FieldFilter + */ +class FieldFilter extends \Google\Protobuf\Internal\Message +{ + /** + * The field to filter by. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + protected $field = null; + /** + * The operator to filter by. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; + */ + protected $op = 0; + /** + * The value to compare to. + * + * Generated from protobuf field .google.firestore.v1.Value value = 3; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $field + * The field to filter by. + * @type int $op + * The operator to filter by. + * @type \Google\Cloud\Firestore\V1\Value $value + * The value to compare to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The field to filter by. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; + * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference|null + */ + public function getField() + { + return $this->field; + } + + public function hasField() + { + return isset($this->field); + } + + public function clearField() + { + unset($this->field); + } + + /** + * The field to filter by. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; + * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); + $this->field = $var; + + return $this; + } + + /** + * The operator to filter by. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; + * @return int + */ + public function getOp() + { + return $this->op; + } + + /** + * The operator to filter by. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; + * @param int $var + * @return $this + */ + public function setOp($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldFilter\Operator::class); + $this->op = $var; + + return $this; + } + + /** + * The value to compare to. + * + * Generated from protobuf field .google.firestore.v1.Value value = 3; + * @return \Google\Cloud\Firestore\V1\Value|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * The value to compare to. + * + * Generated from protobuf field .google.firestore.v1.Value value = 3; + * @param \Google\Cloud\Firestore\V1\Value $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Value::class); + $this->value = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FieldFilter::class, \Google\Cloud\Firestore\V1\StructuredQuery_FieldFilter::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter/Operator.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter/Operator.php new file mode 100644 index 000000000000..9721e2039d04 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter/Operator.php @@ -0,0 +1,146 @@ +google.firestore.v1.StructuredQuery.FieldFilter.Operator + */ +class Operator +{ + /** + * Unspecified. This value must not be used. + * + * Generated from protobuf enum OPERATOR_UNSPECIFIED = 0; + */ + const OPERATOR_UNSPECIFIED = 0; + /** + * The given `field` is less than the given `value`. + * Requires: + * * That `field` come first in `order_by`. + * + * Generated from protobuf enum LESS_THAN = 1; + */ + const LESS_THAN = 1; + /** + * The given `field` is less than or equal to the given `value`. + * Requires: + * * That `field` come first in `order_by`. + * + * Generated from protobuf enum LESS_THAN_OR_EQUAL = 2; + */ + const LESS_THAN_OR_EQUAL = 2; + /** + * The given `field` is greater than the given `value`. + * Requires: + * * That `field` come first in `order_by`. + * + * Generated from protobuf enum GREATER_THAN = 3; + */ + const GREATER_THAN = 3; + /** + * The given `field` is greater than or equal to the given `value`. + * Requires: + * * That `field` come first in `order_by`. + * + * Generated from protobuf enum GREATER_THAN_OR_EQUAL = 4; + */ + const GREATER_THAN_OR_EQUAL = 4; + /** + * The given `field` is equal to the given `value`. + * + * Generated from protobuf enum EQUAL = 5; + */ + const EQUAL = 5; + /** + * The given `field` is not equal to the given `value`. + * Requires: + * * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. + * * That `field` comes first in the `order_by`. + * + * Generated from protobuf enum NOT_EQUAL = 6; + */ + const NOT_EQUAL = 6; + /** + * The given `field` is an array that contains the given `value`. + * + * Generated from protobuf enum ARRAY_CONTAINS = 7; + */ + const ARRAY_CONTAINS = 7; + /** + * The given `field` is equal to at least one value in the given array. + * Requires: + * * That `value` is a non-empty `ArrayValue`, subject to disjunction + * limits. + * * No `NOT_IN` filters in the same query. + * + * Generated from protobuf enum IN = 8; + */ + const IN = 8; + /** + * The given `field` is an array that contains any of the values in the + * given array. + * Requires: + * * That `value` is a non-empty `ArrayValue`, subject to disjunction + * limits. + * * No other `ARRAY_CONTAINS_ANY` filters within the same disjunction. + * * No `NOT_IN` filters in the same query. + * + * Generated from protobuf enum ARRAY_CONTAINS_ANY = 9; + */ + const ARRAY_CONTAINS_ANY = 9; + /** + * The value of the `field` is not in the given array. + * Requires: + * * That `value` is a non-empty `ArrayValue` with at most 10 values. + * * No other `OR`, `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`, + * `IS_NOT_NULL`, or `IS_NOT_NAN`. + * * That `field` comes first in the `order_by`. + * + * Generated from protobuf enum NOT_IN = 10; + */ + const NOT_IN = 10; + + private static $valueToName = [ + self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED', + self::LESS_THAN => 'LESS_THAN', + self::LESS_THAN_OR_EQUAL => 'LESS_THAN_OR_EQUAL', + self::GREATER_THAN => 'GREATER_THAN', + self::GREATER_THAN_OR_EQUAL => 'GREATER_THAN_OR_EQUAL', + self::EQUAL => 'EQUAL', + self::NOT_EQUAL => 'NOT_EQUAL', + self::ARRAY_CONTAINS => 'ARRAY_CONTAINS', + self::IN => 'IN', + self::ARRAY_CONTAINS_ANY => 'ARRAY_CONTAINS_ANY', + self::NOT_IN => 'NOT_IN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Operator::class, \Google\Cloud\Firestore\V1\StructuredQuery_FieldFilter_Operator::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldReference.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldReference.php new file mode 100644 index 000000000000..be709a472fb1 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldReference.php @@ -0,0 +1,86 @@ +google.firestore.v1.StructuredQuery.FieldReference + */ +class FieldReference extends \Google\Protobuf\Internal\Message +{ + /** + * A reference to a field in a document. + * Requires: + * * MUST be a dot-delimited (`.`) string of segments, where each segment + * conforms to [document field name][google.firestore.v1.Document.fields] + * limitations. + * + * Generated from protobuf field string field_path = 2; + */ + protected $field_path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $field_path + * A reference to a field in a document. + * Requires: + * * MUST be a dot-delimited (`.`) string of segments, where each segment + * conforms to [document field name][google.firestore.v1.Document.fields] + * limitations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * A reference to a field in a document. + * Requires: + * * MUST be a dot-delimited (`.`) string of segments, where each segment + * conforms to [document field name][google.firestore.v1.Document.fields] + * limitations. + * + * Generated from protobuf field string field_path = 2; + * @return string + */ + public function getFieldPath() + { + return $this->field_path; + } + + /** + * A reference to a field in a document. + * Requires: + * * MUST be a dot-delimited (`.`) string of segments, where each segment + * conforms to [document field name][google.firestore.v1.Document.fields] + * limitations. + * + * Generated from protobuf field string field_path = 2; + * @param string $var + * @return $this + */ + public function setFieldPath($var) + { + GPBUtil::checkString($var, True); + $this->field_path = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FieldReference::class, \Google\Cloud\Firestore\V1\StructuredQuery_FieldReference::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Filter.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Filter.php new file mode 100644 index 000000000000..dc43c16b7859 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Filter.php @@ -0,0 +1,144 @@ +google.firestore.v1.StructuredQuery.Filter + */ +class Filter extends \Google\Protobuf\Internal\Message +{ + protected $filter_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\StructuredQuery\CompositeFilter $composite_filter + * A composite filter. + * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldFilter $field_filter + * A filter on a document field. + * @type \Google\Cloud\Firestore\V1\StructuredQuery\UnaryFilter $unary_filter + * A filter that takes exactly one argument. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * A composite filter. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + * @return \Google\Cloud\Firestore\V1\StructuredQuery\CompositeFilter|null + */ + public function getCompositeFilter() + { + return $this->readOneof(1); + } + + public function hasCompositeFilter() + { + return $this->hasOneof(1); + } + + /** + * A composite filter. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; + * @param \Google\Cloud\Firestore\V1\StructuredQuery\CompositeFilter $var + * @return $this + */ + public function setCompositeFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\CompositeFilter::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A filter on a document field. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldFilter|null + */ + public function getFieldFilter() + { + return $this->readOneof(2); + } + + public function hasFieldFilter() + { + return $this->hasOneof(2); + } + + /** + * A filter on a document field. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; + * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldFilter $var + * @return $this + */ + public function setFieldFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldFilter::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A filter that takes exactly one argument. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + * @return \Google\Cloud\Firestore\V1\StructuredQuery\UnaryFilter|null + */ + public function getUnaryFilter() + { + return $this->readOneof(3); + } + + public function hasUnaryFilter() + { + return $this->hasOneof(3); + } + + /** + * A filter that takes exactly one argument. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; + * @param \Google\Cloud\Firestore\V1\StructuredQuery\UnaryFilter $var + * @return $this + */ + public function setUnaryFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\UnaryFilter::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getFilterType() + { + return $this->whichOneof("filter_type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Filter::class, \Google\Cloud\Firestore\V1\StructuredQuery_Filter::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Order.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Order.php new file mode 100644 index 000000000000..a71ebeb1b1d0 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Order.php @@ -0,0 +1,114 @@ +google.firestore.v1.StructuredQuery.Order + */ +class Order extends \Google\Protobuf\Internal\Message +{ + /** + * The field to order by. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; + */ + protected $field = null; + /** + * The direction to order by. Defaults to `ASCENDING`. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.Direction direction = 2; + */ + protected $direction = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $field + * The field to order by. + * @type int $direction + * The direction to order by. Defaults to `ASCENDING`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The field to order by. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; + * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference|null + */ + public function getField() + { + return $this->field; + } + + public function hasField() + { + return isset($this->field); + } + + public function clearField() + { + unset($this->field); + } + + /** + * The field to order by. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; + * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); + $this->field = $var; + + return $this; + } + + /** + * The direction to order by. Defaults to `ASCENDING`. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.Direction direction = 2; + * @return int + */ + public function getDirection() + { + return $this->direction; + } + + /** + * The direction to order by. Defaults to `ASCENDING`. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.Direction direction = 2; + * @param int $var + * @return $this + */ + public function setDirection($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\StructuredQuery\Direction::class); + $this->direction = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Order::class, \Google\Cloud\Firestore\V1\StructuredQuery_Order::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Projection.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Projection.php new file mode 100644 index 000000000000..36909ca38947 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Projection.php @@ -0,0 +1,78 @@ +google.firestore.v1.StructuredQuery.Projection + */ +class Projection extends \Google\Protobuf\Internal\Message +{ + /** + * The fields to return. + * If empty, all fields are returned. To only return the name + * of the document, use `['__name__']`. + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + */ + private $fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Firestore\V1\StructuredQuery\FieldReference>|\Google\Protobuf\Internal\RepeatedField $fields + * The fields to return. + * If empty, all fields are returned. To only return the name + * of the document, use `['__name__']`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The fields to return. + * If empty, all fields are returned. To only return the name + * of the document, use `['__name__']`. + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * The fields to return. + * If empty, all fields are returned. To only return the name + * of the document, use `['__name__']`. + * + * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; + * @param array<\Google\Cloud\Firestore\V1\StructuredQuery\FieldReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); + $this->fields = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Projection::class, \Google\Cloud\Firestore\V1\StructuredQuery_Projection::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter.php new file mode 100644 index 000000000000..4f90d0cfdd4b --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter.php @@ -0,0 +1,112 @@ +google.firestore.v1.StructuredQuery.UnaryFilter + */ +class UnaryFilter extends \Google\Protobuf\Internal\Message +{ + /** + * The unary operator to apply. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; + */ + protected $op = 0; + protected $operand_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $op + * The unary operator to apply. + * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $field + * The field to which to apply the operator. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The unary operator to apply. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; + * @return int + */ + public function getOp() + { + return $this->op; + } + + /** + * The unary operator to apply. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; + * @param int $var + * @return $this + */ + public function setOp($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\StructuredQuery\UnaryFilter\Operator::class); + $this->op = $var; + + return $this; + } + + /** + * The field to which to apply the operator. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 2; + * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference|null + */ + public function getField() + { + return $this->readOneof(2); + } + + public function hasField() + { + return $this->hasOneof(2); + } + + /** + * The field to which to apply the operator. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 2; + * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getOperandType() + { + return $this->whichOneof("operand_type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(UnaryFilter::class, \Google\Cloud\Firestore\V1\StructuredQuery_UnaryFilter::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter/Operator.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter/Operator.php new file mode 100644 index 000000000000..d8a8dffc6d00 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter/Operator.php @@ -0,0 +1,84 @@ +google.firestore.v1.StructuredQuery.UnaryFilter.Operator + */ +class Operator +{ + /** + * Unspecified. This value must not be used. + * + * Generated from protobuf enum OPERATOR_UNSPECIFIED = 0; + */ + const OPERATOR_UNSPECIFIED = 0; + /** + * The given `field` is equal to `NaN`. + * + * Generated from protobuf enum IS_NAN = 2; + */ + const IS_NAN = 2; + /** + * The given `field` is equal to `NULL`. + * + * Generated from protobuf enum IS_NULL = 3; + */ + const IS_NULL = 3; + /** + * The given `field` is not equal to `NaN`. + * Requires: + * * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. + * * That `field` comes first in the `order_by`. + * + * Generated from protobuf enum IS_NOT_NAN = 4; + */ + const IS_NOT_NAN = 4; + /** + * The given `field` is not equal to `NULL`. + * Requires: + * * A single `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. + * * That `field` comes first in the `order_by`. + * + * Generated from protobuf enum IS_NOT_NULL = 5; + */ + const IS_NOT_NULL = 5; + + private static $valueToName = [ + self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED', + self::IS_NAN => 'IS_NAN', + self::IS_NULL => 'IS_NULL', + self::IS_NOT_NAN => 'IS_NOT_NAN', + self::IS_NOT_NULL => 'IS_NOT_NULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Operator::class, \Google\Cloud\Firestore\V1\StructuredQuery_UnaryFilter_Operator::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target.php new file mode 100644 index 000000000000..ac09a0b046f5 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target.php @@ -0,0 +1,407 @@ +google.firestore.v1.Target + */ +class Target extends \Google\Protobuf\Internal\Message +{ + /** + * The target ID that identifies the target on the stream. Must be a positive + * number and non-zero. + * If `target_id` is 0 (or unspecified), the server will assign an ID for this + * target and return that in a `TargetChange::ADD` event. Once a target with + * `target_id=0` is added, all subsequent targets must also have + * `target_id=0`. If an `AddTarget` request with `target_id != 0` is + * sent to the server after a target with `target_id=0` is added, the server + * will immediately send a response with a `TargetChange::Remove` event. + * Note that if the client sends multiple `AddTarget` requests + * without an ID, the order of IDs returned in `TargetChage.target_ids` are + * undefined. Therefore, clients should provide a target ID instead of relying + * on the server to assign one. + * If `target_id` is non-zero, there must not be an existing active target on + * this stream with the same ID. + * + * Generated from protobuf field int32 target_id = 5; + */ + protected $target_id = 0; + /** + * If the target should be removed once it is current and consistent. + * + * Generated from protobuf field bool once = 6; + */ + protected $once = false; + /** + * The number of documents that last matched the query at the resume token or + * read time. + * This value is only relevant when a `resume_type` is provided. This value + * being present and greater than zero signals that the client wants + * `ExistenceFilter.unchanged_names` to be included in the response. + * + * Generated from protobuf field .google.protobuf.Int32Value expected_count = 12; + */ + protected $expected_count = null; + protected $target_type; + protected $resume_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\Target\QueryTarget $query + * A target specified by a query. + * @type \Google\Cloud\Firestore\V1\Target\DocumentsTarget $documents + * A target specified by a set of document names. + * @type string $resume_token + * A resume token from a prior + * [TargetChange][google.firestore.v1.TargetChange] for an identical target. + * Using a resume token with a different target is unsupported and may fail. + * @type \Google\Protobuf\Timestamp $read_time + * Start listening after a specific `read_time`. + * The client must know the state of matching documents at this time. + * @type int $target_id + * The target ID that identifies the target on the stream. Must be a positive + * number and non-zero. + * If `target_id` is 0 (or unspecified), the server will assign an ID for this + * target and return that in a `TargetChange::ADD` event. Once a target with + * `target_id=0` is added, all subsequent targets must also have + * `target_id=0`. If an `AddTarget` request with `target_id != 0` is + * sent to the server after a target with `target_id=0` is added, the server + * will immediately send a response with a `TargetChange::Remove` event. + * Note that if the client sends multiple `AddTarget` requests + * without an ID, the order of IDs returned in `TargetChage.target_ids` are + * undefined. Therefore, clients should provide a target ID instead of relying + * on the server to assign one. + * If `target_id` is non-zero, there must not be an existing active target on + * this stream with the same ID. + * @type bool $once + * If the target should be removed once it is current and consistent. + * @type \Google\Protobuf\Int32Value $expected_count + * The number of documents that last matched the query at the resume token or + * read time. + * This value is only relevant when a `resume_type` is provided. This value + * being present and greater than zero signals that the client wants + * `ExistenceFilter.unchanged_names` to be included in the response. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * A target specified by a query. + * + * Generated from protobuf field .google.firestore.v1.Target.QueryTarget query = 2; + * @return \Google\Cloud\Firestore\V1\Target\QueryTarget|null + */ + public function getQuery() + { + return $this->readOneof(2); + } + + public function hasQuery() + { + return $this->hasOneof(2); + } + + /** + * A target specified by a query. + * + * Generated from protobuf field .google.firestore.v1.Target.QueryTarget query = 2; + * @param \Google\Cloud\Firestore\V1\Target\QueryTarget $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Target\QueryTarget::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A target specified by a set of document names. + * + * Generated from protobuf field .google.firestore.v1.Target.DocumentsTarget documents = 3; + * @return \Google\Cloud\Firestore\V1\Target\DocumentsTarget|null + */ + public function getDocuments() + { + return $this->readOneof(3); + } + + public function hasDocuments() + { + return $this->hasOneof(3); + } + + /** + * A target specified by a set of document names. + * + * Generated from protobuf field .google.firestore.v1.Target.DocumentsTarget documents = 3; + * @param \Google\Cloud\Firestore\V1\Target\DocumentsTarget $var + * @return $this + */ + public function setDocuments($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Target\DocumentsTarget::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A resume token from a prior + * [TargetChange][google.firestore.v1.TargetChange] for an identical target. + * Using a resume token with a different target is unsupported and may fail. + * + * Generated from protobuf field bytes resume_token = 4; + * @return string + */ + public function getResumeToken() + { + return $this->readOneof(4); + } + + public function hasResumeToken() + { + return $this->hasOneof(4); + } + + /** + * A resume token from a prior + * [TargetChange][google.firestore.v1.TargetChange] for an identical target. + * Using a resume token with a different target is unsupported and may fail. + * + * Generated from protobuf field bytes resume_token = 4; + * @param string $var + * @return $this + */ + public function setResumeToken($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Start listening after a specific `read_time`. + * The client must know the state of matching documents at this time. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 11; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->readOneof(11); + } + + public function hasReadTime() + { + return $this->hasOneof(11); + } + + /** + * Start listening after a specific `read_time`. + * The client must know the state of matching documents at this time. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 11; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * The target ID that identifies the target on the stream. Must be a positive + * number and non-zero. + * If `target_id` is 0 (or unspecified), the server will assign an ID for this + * target and return that in a `TargetChange::ADD` event. Once a target with + * `target_id=0` is added, all subsequent targets must also have + * `target_id=0`. If an `AddTarget` request with `target_id != 0` is + * sent to the server after a target with `target_id=0` is added, the server + * will immediately send a response with a `TargetChange::Remove` event. + * Note that if the client sends multiple `AddTarget` requests + * without an ID, the order of IDs returned in `TargetChage.target_ids` are + * undefined. Therefore, clients should provide a target ID instead of relying + * on the server to assign one. + * If `target_id` is non-zero, there must not be an existing active target on + * this stream with the same ID. + * + * Generated from protobuf field int32 target_id = 5; + * @return int + */ + public function getTargetId() + { + return $this->target_id; + } + + /** + * The target ID that identifies the target on the stream. Must be a positive + * number and non-zero. + * If `target_id` is 0 (or unspecified), the server will assign an ID for this + * target and return that in a `TargetChange::ADD` event. Once a target with + * `target_id=0` is added, all subsequent targets must also have + * `target_id=0`. If an `AddTarget` request with `target_id != 0` is + * sent to the server after a target with `target_id=0` is added, the server + * will immediately send a response with a `TargetChange::Remove` event. + * Note that if the client sends multiple `AddTarget` requests + * without an ID, the order of IDs returned in `TargetChage.target_ids` are + * undefined. Therefore, clients should provide a target ID instead of relying + * on the server to assign one. + * If `target_id` is non-zero, there must not be an existing active target on + * this stream with the same ID. + * + * Generated from protobuf field int32 target_id = 5; + * @param int $var + * @return $this + */ + public function setTargetId($var) + { + GPBUtil::checkInt32($var); + $this->target_id = $var; + + return $this; + } + + /** + * If the target should be removed once it is current and consistent. + * + * Generated from protobuf field bool once = 6; + * @return bool + */ + public function getOnce() + { + return $this->once; + } + + /** + * If the target should be removed once it is current and consistent. + * + * Generated from protobuf field bool once = 6; + * @param bool $var + * @return $this + */ + public function setOnce($var) + { + GPBUtil::checkBool($var); + $this->once = $var; + + return $this; + } + + /** + * The number of documents that last matched the query at the resume token or + * read time. + * This value is only relevant when a `resume_type` is provided. This value + * being present and greater than zero signals that the client wants + * `ExistenceFilter.unchanged_names` to be included in the response. + * + * Generated from protobuf field .google.protobuf.Int32Value expected_count = 12; + * @return \Google\Protobuf\Int32Value|null + */ + public function getExpectedCount() + { + return $this->expected_count; + } + + public function hasExpectedCount() + { + return isset($this->expected_count); + } + + public function clearExpectedCount() + { + unset($this->expected_count); + } + + /** + * Returns the unboxed value from getExpectedCount() + + * The number of documents that last matched the query at the resume token or + * read time. + * This value is only relevant when a `resume_type` is provided. This value + * being present and greater than zero signals that the client wants + * `ExistenceFilter.unchanged_names` to be included in the response. + * + * Generated from protobuf field .google.protobuf.Int32Value expected_count = 12; + * @return int|null + */ + public function getExpectedCountUnwrapped() + { + return $this->readWrapperValue("expected_count"); + } + + /** + * The number of documents that last matched the query at the resume token or + * read time. + * This value is only relevant when a `resume_type` is provided. This value + * being present and greater than zero signals that the client wants + * `ExistenceFilter.unchanged_names` to be included in the response. + * + * Generated from protobuf field .google.protobuf.Int32Value expected_count = 12; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setExpectedCount($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->expected_count = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * The number of documents that last matched the query at the resume token or + * read time. + * This value is only relevant when a `resume_type` is provided. This value + * being present and greater than zero signals that the client wants + * `ExistenceFilter.unchanged_names` to be included in the response. + * + * Generated from protobuf field .google.protobuf.Int32Value expected_count = 12; + * @param int|null $var + * @return $this + */ + public function setExpectedCountUnwrapped($var) + { + $this->writeWrapperValue("expected_count", $var); + return $this;} + + /** + * @return string + */ + public function getTargetType() + { + return $this->whichOneof("target_type"); + } + + /** + * @return string + */ + public function getResumeType() + { + return $this->whichOneof("resume_type"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/DocumentsTarget.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/DocumentsTarget.php new file mode 100644 index 000000000000..b96562c648cf --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/DocumentsTarget.php @@ -0,0 +1,82 @@ +google.firestore.v1.Target.DocumentsTarget + */ +class DocumentsTarget extends \Google\Protobuf\Internal\Message +{ + /** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of + * the given `database`. Duplicate names will be elided. + * + * Generated from protobuf field repeated string documents = 2; + */ + private $documents; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $documents + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of + * the given `database`. Duplicate names will be elided. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of + * the given `database`. Duplicate names will be elided. + * + * Generated from protobuf field repeated string documents = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDocuments() + { + return $this->documents; + } + + /** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of + * the given `database`. Duplicate names will be elided. + * + * Generated from protobuf field repeated string documents = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDocuments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->documents = $arr; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DocumentsTarget::class, \Google\Cloud\Firestore\V1\Target_DocumentsTarget::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/QueryTarget.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/QueryTarget.php new file mode 100644 index 000000000000..56c02faeb030 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/QueryTarget.php @@ -0,0 +1,132 @@ +google.firestore.v1.Target.QueryTarget + */ +class QueryTarget extends \Google\Protobuf\Internal\Message +{ + /** + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1; + */ + protected $parent = ''; + protected $query_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * @type \Google\Cloud\Firestore\V1\StructuredQuery $structured_query + * A structured query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * + * Generated from protobuf field string parent = 1; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * A structured query. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 2; + * @return \Google\Cloud\Firestore\V1\StructuredQuery|null + */ + public function getStructuredQuery() + { + return $this->readOneof(2); + } + + public function hasStructuredQuery() + { + return $this->hasOneof(2); + } + + /** + * A structured query. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 2; + * @param \Google\Cloud\Firestore\V1\StructuredQuery $var + * @return $this + */ + public function setStructuredQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getQueryType() + { + return $this->whichOneof("query_type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QueryTarget::class, \Google\Cloud\Firestore\V1\Target_QueryTarget::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange.php new file mode 100644 index 000000000000..7916d0c40af0 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange.php @@ -0,0 +1,267 @@ +google.firestore.v1.TargetChange + */ +class TargetChange extends \Google\Protobuf\Internal\Message +{ + /** + * The type of change that occurred. + * + * Generated from protobuf field .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; + */ + protected $target_change_type = 0; + /** + * The target IDs of targets that have changed. + * If empty, the change applies to all targets. + * The order of the target IDs is not defined. + * + * Generated from protobuf field repeated int32 target_ids = 2; + */ + private $target_ids; + /** + * The error that resulted in this change, if applicable. + * + * Generated from protobuf field .google.rpc.Status cause = 3; + */ + protected $cause = null; + /** + * A token that can be used to resume the stream for the given `target_ids`, + * or all targets if `target_ids` is empty. + * Not set on every target change. + * + * Generated from protobuf field bytes resume_token = 4; + */ + protected $resume_token = ''; + /** + * The consistent `read_time` for the given `target_ids` (omitted when the + * target_ids are not at a consistent snapshot). + * The stream is guaranteed to send a `read_time` with `target_ids` empty + * whenever the entire stream reaches a new consistent snapshot. ADD, + * CURRENT, and RESET messages are guaranteed to (eventually) result in a + * new consistent snapshot (while NO_CHANGE and REMOVE messages are not). + * For a given stream, `read_time` is guaranteed to be monotonically + * increasing. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; + */ + protected $read_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $target_change_type + * The type of change that occurred. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_ids + * The target IDs of targets that have changed. + * If empty, the change applies to all targets. + * The order of the target IDs is not defined. + * @type \Google\Rpc\Status $cause + * The error that resulted in this change, if applicable. + * @type string $resume_token + * A token that can be used to resume the stream for the given `target_ids`, + * or all targets if `target_ids` is empty. + * Not set on every target change. + * @type \Google\Protobuf\Timestamp $read_time + * The consistent `read_time` for the given `target_ids` (omitted when the + * target_ids are not at a consistent snapshot). + * The stream is guaranteed to send a `read_time` with `target_ids` empty + * whenever the entire stream reaches a new consistent snapshot. ADD, + * CURRENT, and RESET messages are guaranteed to (eventually) result in a + * new consistent snapshot (while NO_CHANGE and REMOVE messages are not). + * For a given stream, `read_time` is guaranteed to be monotonically + * increasing. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * The type of change that occurred. + * + * Generated from protobuf field .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; + * @return int + */ + public function getTargetChangeType() + { + return $this->target_change_type; + } + + /** + * The type of change that occurred. + * + * Generated from protobuf field .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; + * @param int $var + * @return $this + */ + public function setTargetChangeType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\TargetChange\TargetChangeType::class); + $this->target_change_type = $var; + + return $this; + } + + /** + * The target IDs of targets that have changed. + * If empty, the change applies to all targets. + * The order of the target IDs is not defined. + * + * Generated from protobuf field repeated int32 target_ids = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetIds() + { + return $this->target_ids; + } + + /** + * The target IDs of targets that have changed. + * If empty, the change applies to all targets. + * The order of the target IDs is not defined. + * + * Generated from protobuf field repeated int32 target_ids = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->target_ids = $arr; + + return $this; + } + + /** + * The error that resulted in this change, if applicable. + * + * Generated from protobuf field .google.rpc.Status cause = 3; + * @return \Google\Rpc\Status|null + */ + public function getCause() + { + return $this->cause; + } + + public function hasCause() + { + return isset($this->cause); + } + + public function clearCause() + { + unset($this->cause); + } + + /** + * The error that resulted in this change, if applicable. + * + * Generated from protobuf field .google.rpc.Status cause = 3; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setCause($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->cause = $var; + + return $this; + } + + /** + * A token that can be used to resume the stream for the given `target_ids`, + * or all targets if `target_ids` is empty. + * Not set on every target change. + * + * Generated from protobuf field bytes resume_token = 4; + * @return string + */ + public function getResumeToken() + { + return $this->resume_token; + } + + /** + * A token that can be used to resume the stream for the given `target_ids`, + * or all targets if `target_ids` is empty. + * Not set on every target change. + * + * Generated from protobuf field bytes resume_token = 4; + * @param string $var + * @return $this + */ + public function setResumeToken($var) + { + GPBUtil::checkString($var, False); + $this->resume_token = $var; + + return $this; + } + + /** + * The consistent `read_time` for the given `target_ids` (omitted when the + * target_ids are not at a consistent snapshot). + * The stream is guaranteed to send a `read_time` with `target_ids` empty + * whenever the entire stream reaches a new consistent snapshot. ADD, + * CURRENT, and RESET messages are guaranteed to (eventually) result in a + * new consistent snapshot (while NO_CHANGE and REMOVE messages are not). + * For a given stream, `read_time` is guaranteed to be monotonically + * increasing. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * The consistent `read_time` for the given `target_ids` (omitted when the + * target_ids are not at a consistent snapshot). + * The stream is guaranteed to send a `read_time` with `target_ids` empty + * whenever the entire stream reaches a new consistent snapshot. ADD, + * CURRENT, and RESET messages are guaranteed to (eventually) result in a + * new consistent snapshot (while NO_CHANGE and REMOVE messages are not). + * For a given stream, `read_time` is guaranteed to be monotonically + * increasing. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange/TargetChangeType.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange/TargetChangeType.php new file mode 100644 index 000000000000..23694a75db2e --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange/TargetChangeType.php @@ -0,0 +1,86 @@ +google.firestore.v1.TargetChange.TargetChangeType + */ +class TargetChangeType +{ + /** + * No change has occurred. Used only to send an updated `resume_token`. + * + * Generated from protobuf enum NO_CHANGE = 0; + */ + const NO_CHANGE = 0; + /** + * The targets have been added. + * + * Generated from protobuf enum ADD = 1; + */ + const ADD = 1; + /** + * The targets have been removed. + * + * Generated from protobuf enum REMOVE = 2; + */ + const REMOVE = 2; + /** + * The targets reflect all changes committed before the targets were added + * to the stream. + * This will be sent after or with a `read_time` that is greater than or + * equal to the time at which the targets were added. + * Listeners can wait for this change if read-after-write semantics + * are desired. + * + * Generated from protobuf enum CURRENT = 3; + */ + const CURRENT = 3; + /** + * The targets have been reset, and a new initial state for the targets + * will be returned in subsequent changes. + * After the initial state is complete, `CURRENT` will be returned even + * if the target was previously indicated to be `CURRENT`. + * + * Generated from protobuf enum RESET = 4; + */ + const RESET = 4; + + private static $valueToName = [ + self::NO_CHANGE => 'NO_CHANGE', + self::ADD => 'ADD', + self::REMOVE => 'REMOVE', + self::CURRENT => 'CURRENT', + self::RESET => 'RESET', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TargetChangeType::class, \Google\Cloud\Firestore\V1\TargetChange_TargetChangeType::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions.php new file mode 100644 index 000000000000..07498e58f517 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions.php @@ -0,0 +1,108 @@ +google.firestore.v1.TransactionOptions + */ +class TransactionOptions extends \Google\Protobuf\Internal\Message +{ + protected $mode; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\TransactionOptions\PBReadOnly $read_only + * The transaction can only be used for read operations. + * @type \Google\Cloud\Firestore\V1\TransactionOptions\ReadWrite $read_write + * The transaction can be used for both read and write operations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * The transaction can only be used for read operations. + * + * Generated from protobuf field .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + * @return \Google\Cloud\Firestore\V1\TransactionOptions\PBReadOnly|null + */ + public function getReadOnly() + { + return $this->readOneof(2); + } + + public function hasReadOnly() + { + return $this->hasOneof(2); + } + + /** + * The transaction can only be used for read operations. + * + * Generated from protobuf field .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; + * @param \Google\Cloud\Firestore\V1\TransactionOptions\PBReadOnly $var + * @return $this + */ + public function setReadOnly($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TransactionOptions\PBReadOnly::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The transaction can be used for both read and write operations. + * + * Generated from protobuf field .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + * @return \Google\Cloud\Firestore\V1\TransactionOptions\ReadWrite|null + */ + public function getReadWrite() + { + return $this->readOneof(3); + } + + public function hasReadWrite() + { + return $this->hasOneof(3); + } + + /** + * The transaction can be used for both read and write operations. + * + * Generated from protobuf field .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; + * @param \Google\Cloud\Firestore\V1\TransactionOptions\ReadWrite $var + * @return $this + */ + public function setReadWrite($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TransactionOptions\ReadWrite::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getMode() + { + return $this->whichOneof("mode"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/PBReadOnly.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/PBReadOnly.php new file mode 100644 index 000000000000..7b55ad3ed4fb --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/PBReadOnly.php @@ -0,0 +1,90 @@ +google.firestore.v1.TransactionOptions.ReadOnly + */ +class PBReadOnly extends \Google\Protobuf\Internal\Message +{ + protected $consistency_selector; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $read_time + * Reads documents at the given time. + * This must be a microsecond precision timestamp within the past one + * hour, or if Point-in-Time Recovery is enabled, can additionally be a + * whole minute timestamp within the past 7 days. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Reads documents at the given time. + * This must be a microsecond precision timestamp within the past one + * hour, or if Point-in-Time Recovery is enabled, can additionally be a + * whole minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->readOneof(2); + } + + public function hasReadTime() + { + return $this->hasOneof(2); + } + + /** + * Reads documents at the given time. + * This must be a microsecond precision timestamp within the past one + * hour, or if Point-in-Time Recovery is enabled, can additionally be a + * whole minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getConsistencySelector() + { + return $this->whichOneof("consistency_selector"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PBReadOnly::class, \Google\Cloud\Firestore\V1\TransactionOptions_ReadOnly::class); + +// Adding a class alias for backwards compatibility with the "readonly" keyword. +class_alias(PBReadOnly::class, __NAMESPACE__ . '\ReadOnly'); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/ReadOnly.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/ReadOnly.php new file mode 100644 index 000000000000..cb227a9fbefb --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/ReadOnly.php @@ -0,0 +1,9 @@ +google.firestore.v1.TransactionOptions.ReadWrite + */ +class ReadWrite extends \Google\Protobuf\Internal\Message +{ + /** + * An optional transaction to retry. + * + * Generated from protobuf field bytes retry_transaction = 1; + */ + protected $retry_transaction = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $retry_transaction + * An optional transaction to retry. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * An optional transaction to retry. + * + * Generated from protobuf field bytes retry_transaction = 1; + * @return string + */ + public function getRetryTransaction() + { + return $this->retry_transaction; + } + + /** + * An optional transaction to retry. + * + * Generated from protobuf field bytes retry_transaction = 1; + * @param string $var + * @return $this + */ + public function setRetryTransaction($var) + { + GPBUtil::checkString($var, False); + $this->retry_transaction = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ReadWrite::class, \Google\Cloud\Firestore\V1\TransactionOptions_ReadWrite::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/UpdateDocumentRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/UpdateDocumentRequest.php new file mode 100644 index 000000000000..ddc9406eaba7 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/UpdateDocumentRequest.php @@ -0,0 +1,268 @@ +google.firestore.v1.UpdateDocumentRequest + */ +class UpdateDocumentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The updated document. + * Creates the document if it does not already exist. + * + * Generated from protobuf field .google.firestore.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $document = null; + /** + * The fields to update. + * None of the field paths in the mask may contain a reserved name. + * If the document exists on the server and has fields not referenced in the + * mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask update_mask = 2; + */ + protected $update_mask = null; + /** + * The fields to return. If not set, returns all fields. + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 3; + */ + protected $mask = null; + /** + * An optional precondition on the document. + * The request will fail if this is set and not met by the target document. + * + * Generated from protobuf field .google.firestore.v1.Precondition current_document = 4; + */ + protected $current_document = null; + + /** + * @param \Google\Cloud\Firestore\V1\Document $document Required. The updated document. + * Creates the document if it does not already exist. + * @param \Google\Cloud\Firestore\V1\DocumentMask $updateMask The fields to update. + * None of the field paths in the mask may contain a reserved name. + * + * If the document exists on the server and has fields not referenced in the + * mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * + * @return \Google\Cloud\Firestore\V1\UpdateDocumentRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Firestore\V1\Document $document, \Google\Cloud\Firestore\V1\DocumentMask $updateMask): self + { + return (new self()) + ->setDocument($document) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\Document $document + * Required. The updated document. + * Creates the document if it does not already exist. + * @type \Google\Cloud\Firestore\V1\DocumentMask $update_mask + * The fields to update. + * None of the field paths in the mask may contain a reserved name. + * If the document exists on the server and has fields not referenced in the + * mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * @type \Google\Cloud\Firestore\V1\DocumentMask $mask + * The fields to return. If not set, returns all fields. + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * @type \Google\Cloud\Firestore\V1\Precondition $current_document + * An optional precondition on the document. + * The request will fail if this is set and not met by the target document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The updated document. + * Creates the document if it does not already exist. + * + * Generated from protobuf field .google.firestore.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Firestore\V1\Document|null + */ + public function getDocument() + { + return $this->document; + } + + public function hasDocument() + { + return isset($this->document); + } + + public function clearDocument() + { + unset($this->document); + } + + /** + * Required. The updated document. + * Creates the document if it does not already exist. + * + * Generated from protobuf field .google.firestore.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Firestore\V1\Document $var + * @return $this + */ + public function setDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Document::class); + $this->document = $var; + + return $this; + } + + /** + * The fields to update. + * None of the field paths in the mask may contain a reserved name. + * If the document exists on the server and has fields not referenced in the + * mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask update_mask = 2; + * @return \Google\Cloud\Firestore\V1\DocumentMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The fields to update. + * None of the field paths in the mask may contain a reserved name. + * If the document exists on the server and has fields not referenced in the + * mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask update_mask = 2; + * @param \Google\Cloud\Firestore\V1\DocumentMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * The fields to return. If not set, returns all fields. + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 3; + * @return \Google\Cloud\Firestore\V1\DocumentMask|null + */ + public function getMask() + { + return $this->mask; + } + + public function hasMask() + { + return isset($this->mask); + } + + public function clearMask() + { + unset($this->mask); + } + + /** + * The fields to return. If not set, returns all fields. + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 3; + * @param \Google\Cloud\Firestore\V1\DocumentMask $var + * @return $this + */ + public function setMask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); + $this->mask = $var; + + return $this; + } + + /** + * An optional precondition on the document. + * The request will fail if this is set and not met by the target document. + * + * Generated from protobuf field .google.firestore.v1.Precondition current_document = 4; + * @return \Google\Cloud\Firestore\V1\Precondition|null + */ + public function getCurrentDocument() + { + return $this->current_document; + } + + public function hasCurrentDocument() + { + return isset($this->current_document); + } + + public function clearCurrentDocument() + { + unset($this->current_document); + } + + /** + * An optional precondition on the document. + * The request will fail if this is set and not met by the target document. + * + * Generated from protobuf field .google.firestore.v1.Precondition current_document = 4; + * @param \Google\Cloud\Firestore\V1\Precondition $var + * @return $this + */ + public function setCurrentDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Precondition::class); + $this->current_document = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Value.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Value.php new file mode 100644 index 000000000000..de439f4118f4 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Value.php @@ -0,0 +1,435 @@ +google.firestore.v1.Value + */ +class Value extends \Google\Protobuf\Internal\Message +{ + protected $value_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $null_value + * A null value. + * @type bool $boolean_value + * A boolean value. + * @type int|string $integer_value + * An integer value. + * @type float $double_value + * A double value. + * @type \Google\Protobuf\Timestamp $timestamp_value + * A timestamp value. + * Precise only to microseconds. When stored, any additional precision is + * rounded down. + * @type string $string_value + * A string value. + * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. + * Only the first 1,500 bytes of the UTF-8 representation are considered by + * queries. + * @type string $bytes_value + * A bytes value. + * Must not exceed 1 MiB - 89 bytes. + * Only the first 1,500 bytes are considered by queries. + * @type string $reference_value + * A reference to a document. For example: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * @type \Google\Type\LatLng $geo_point_value + * A geo point value representing a point on the surface of Earth. + * @type \Google\Cloud\Firestore\V1\ArrayValue $array_value + * An array value. + * Cannot directly contain another array value, though can contain an + * map which contains another array. + * @type \Google\Cloud\Firestore\V1\MapValue $map_value + * A map value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Document::initOnce(); + parent::__construct($data); + } + + /** + * A null value. + * + * Generated from protobuf field .google.protobuf.NullValue null_value = 11; + * @return int + */ + public function getNullValue() + { + return $this->readOneof(11); + } + + public function hasNullValue() + { + return $this->hasOneof(11); + } + + /** + * A null value. + * + * Generated from protobuf field .google.protobuf.NullValue null_value = 11; + * @param int $var + * @return $this + */ + public function setNullValue($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\NullValue::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * A boolean value. + * + * Generated from protobuf field bool boolean_value = 1; + * @return bool + */ + public function getBooleanValue() + { + return $this->readOneof(1); + } + + public function hasBooleanValue() + { + return $this->hasOneof(1); + } + + /** + * A boolean value. + * + * Generated from protobuf field bool boolean_value = 1; + * @param bool $var + * @return $this + */ + public function setBooleanValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * An integer value. + * + * Generated from protobuf field int64 integer_value = 2; + * @return int|string + */ + public function getIntegerValue() + { + return $this->readOneof(2); + } + + public function hasIntegerValue() + { + return $this->hasOneof(2); + } + + /** + * An integer value. + * + * Generated from protobuf field int64 integer_value = 2; + * @param int|string $var + * @return $this + */ + public function setIntegerValue($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A double value. + * + * Generated from protobuf field double double_value = 3; + * @return float + */ + public function getDoubleValue() + { + return $this->readOneof(3); + } + + public function hasDoubleValue() + { + return $this->hasOneof(3); + } + + /** + * A double value. + * + * Generated from protobuf field double double_value = 3; + * @param float $var + * @return $this + */ + public function setDoubleValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A timestamp value. + * Precise only to microseconds. When stored, any additional precision is + * rounded down. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp_value = 10; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTimestampValue() + { + return $this->readOneof(10); + } + + public function hasTimestampValue() + { + return $this->hasOneof(10); + } + + /** + * A timestamp value. + * Precise only to microseconds. When stored, any additional precision is + * rounded down. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp_value = 10; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTimestampValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * A string value. + * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. + * Only the first 1,500 bytes of the UTF-8 representation are considered by + * queries. + * + * Generated from protobuf field string string_value = 17; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(17); + } + + public function hasStringValue() + { + return $this->hasOneof(17); + } + + /** + * A string value. + * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. + * Only the first 1,500 bytes of the UTF-8 representation are considered by + * queries. + * + * Generated from protobuf field string string_value = 17; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(17, $var); + + return $this; + } + + /** + * A bytes value. + * Must not exceed 1 MiB - 89 bytes. + * Only the first 1,500 bytes are considered by queries. + * + * Generated from protobuf field bytes bytes_value = 18; + * @return string + */ + public function getBytesValue() + { + return $this->readOneof(18); + } + + public function hasBytesValue() + { + return $this->hasOneof(18); + } + + /** + * A bytes value. + * Must not exceed 1 MiB - 89 bytes. + * Only the first 1,500 bytes are considered by queries. + * + * Generated from protobuf field bytes bytes_value = 18; + * @param string $var + * @return $this + */ + public function setBytesValue($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(18, $var); + + return $this; + } + + /** + * A reference to a document. For example: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string reference_value = 5; + * @return string + */ + public function getReferenceValue() + { + return $this->readOneof(5); + } + + public function hasReferenceValue() + { + return $this->hasOneof(5); + } + + /** + * A reference to a document. For example: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string reference_value = 5; + * @param string $var + * @return $this + */ + public function setReferenceValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * A geo point value representing a point on the surface of Earth. + * + * Generated from protobuf field .google.type.LatLng geo_point_value = 8; + * @return \Google\Type\LatLng|null + */ + public function getGeoPointValue() + { + return $this->readOneof(8); + } + + public function hasGeoPointValue() + { + return $this->hasOneof(8); + } + + /** + * A geo point value representing a point on the surface of Earth. + * + * Generated from protobuf field .google.type.LatLng geo_point_value = 8; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setGeoPointValue($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * An array value. + * Cannot directly contain another array value, though can contain an + * map which contains another array. + * + * Generated from protobuf field .google.firestore.v1.ArrayValue array_value = 9; + * @return \Google\Cloud\Firestore\V1\ArrayValue|null + */ + public function getArrayValue() + { + return $this->readOneof(9); + } + + public function hasArrayValue() + { + return $this->hasOneof(9); + } + + /** + * An array value. + * Cannot directly contain another array value, though can contain an + * map which contains another array. + * + * Generated from protobuf field .google.firestore.v1.ArrayValue array_value = 9; + * @param \Google\Cloud\Firestore\V1\ArrayValue $var + * @return $this + */ + public function setArrayValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ArrayValue::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * A map value. + * + * Generated from protobuf field .google.firestore.v1.MapValue map_value = 6; + * @return \Google\Cloud\Firestore\V1\MapValue|null + */ + public function getMapValue() + { + return $this->readOneof(6); + } + + public function hasMapValue() + { + return $this->hasOneof(6); + } + + /** + * A map value. + * + * Generated from protobuf field .google.firestore.v1.MapValue map_value = 6; + * @param \Google\Cloud\Firestore\V1\MapValue $var + * @return $this + */ + public function setMapValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\MapValue::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getValueType() + { + return $this->whichOneof("value_type"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Write.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Write.php new file mode 100644 index 000000000000..67920d9f8a1a --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Write.php @@ -0,0 +1,314 @@ +google.firestore.v1.Write + */ +class Write extends \Google\Protobuf\Internal\Message +{ + /** + * The fields to update in this write. + * This field can be set only when the operation is `update`. + * If the mask is not set for an `update` and the document exists, any + * existing data will be overwritten. + * If the mask is set and the document on the server has fields not covered by + * the mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * The field paths in this mask must not contain a reserved field name. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask update_mask = 3; + */ + protected $update_mask = null; + /** + * The transforms to perform after update. + * This field can be set only when the operation is `update`. If present, this + * write is equivalent to performing `update` and `transform` to the same + * document atomically and in order. + * + * Generated from protobuf field repeated .google.firestore.v1.DocumentTransform.FieldTransform update_transforms = 7; + */ + private $update_transforms; + /** + * An optional precondition on the document. + * The write will fail if this is set and not met by the target document. + * + * Generated from protobuf field .google.firestore.v1.Precondition current_document = 4; + */ + protected $current_document = null; + protected $operation; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\Document $update + * A document to write. + * @type string $delete + * A document name to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * @type \Google\Cloud\Firestore\V1\DocumentTransform $transform + * Applies a transformation to a document. + * @type \Google\Cloud\Firestore\V1\DocumentMask $update_mask + * The fields to update in this write. + * This field can be set only when the operation is `update`. + * If the mask is not set for an `update` and the document exists, any + * existing data will be overwritten. + * If the mask is set and the document on the server has fields not covered by + * the mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * The field paths in this mask must not contain a reserved field name. + * @type array<\Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform>|\Google\Protobuf\Internal\RepeatedField $update_transforms + * The transforms to perform after update. + * This field can be set only when the operation is `update`. If present, this + * write is equivalent to performing `update` and `transform` to the same + * document atomically and in order. + * @type \Google\Cloud\Firestore\V1\Precondition $current_document + * An optional precondition on the document. + * The write will fail if this is set and not met by the target document. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Write::initOnce(); + parent::__construct($data); + } + + /** + * A document to write. + * + * Generated from protobuf field .google.firestore.v1.Document update = 1; + * @return \Google\Cloud\Firestore\V1\Document|null + */ + public function getUpdate() + { + return $this->readOneof(1); + } + + public function hasUpdate() + { + return $this->hasOneof(1); + } + + /** + * A document to write. + * + * Generated from protobuf field .google.firestore.v1.Document update = 1; + * @param \Google\Cloud\Firestore\V1\Document $var + * @return $this + */ + public function setUpdate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Document::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A document name to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string delete = 2; + * @return string + */ + public function getDelete() + { + return $this->readOneof(2); + } + + public function hasDelete() + { + return $this->hasOneof(2); + } + + /** + * A document name to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * Generated from protobuf field string delete = 2; + * @param string $var + * @return $this + */ + public function setDelete($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Applies a transformation to a document. + * + * Generated from protobuf field .google.firestore.v1.DocumentTransform transform = 6; + * @return \Google\Cloud\Firestore\V1\DocumentTransform|null + */ + public function getTransform() + { + return $this->readOneof(6); + } + + public function hasTransform() + { + return $this->hasOneof(6); + } + + /** + * Applies a transformation to a document. + * + * Generated from protobuf field .google.firestore.v1.DocumentTransform transform = 6; + * @param \Google\Cloud\Firestore\V1\DocumentTransform $var + * @return $this + */ + public function setTransform($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentTransform::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The fields to update in this write. + * This field can be set only when the operation is `update`. + * If the mask is not set for an `update` and the document exists, any + * existing data will be overwritten. + * If the mask is set and the document on the server has fields not covered by + * the mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * The field paths in this mask must not contain a reserved field name. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask update_mask = 3; + * @return \Google\Cloud\Firestore\V1\DocumentMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The fields to update in this write. + * This field can be set only when the operation is `update`. + * If the mask is not set for an `update` and the document exists, any + * existing data will be overwritten. + * If the mask is set and the document on the server has fields not covered by + * the mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * The field paths in this mask must not contain a reserved field name. + * + * Generated from protobuf field .google.firestore.v1.DocumentMask update_mask = 3; + * @param \Google\Cloud\Firestore\V1\DocumentMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * The transforms to perform after update. + * This field can be set only when the operation is `update`. If present, this + * write is equivalent to performing `update` and `transform` to the same + * document atomically and in order. + * + * Generated from protobuf field repeated .google.firestore.v1.DocumentTransform.FieldTransform update_transforms = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUpdateTransforms() + { + return $this->update_transforms; + } + + /** + * The transforms to perform after update. + * This field can be set only when the operation is `update`. If present, this + * write is equivalent to performing `update` and `transform` to the same + * document atomically and in order. + * + * Generated from protobuf field repeated .google.firestore.v1.DocumentTransform.FieldTransform update_transforms = 7; + * @param array<\Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUpdateTransforms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform::class); + $this->update_transforms = $arr; + + return $this; + } + + /** + * An optional precondition on the document. + * The write will fail if this is set and not met by the target document. + * + * Generated from protobuf field .google.firestore.v1.Precondition current_document = 4; + * @return \Google\Cloud\Firestore\V1\Precondition|null + */ + public function getCurrentDocument() + { + return $this->current_document; + } + + public function hasCurrentDocument() + { + return isset($this->current_document); + } + + public function clearCurrentDocument() + { + unset($this->current_document); + } + + /** + * An optional precondition on the document. + * The write will fail if this is set and not met by the target document. + * + * Generated from protobuf field .google.firestore.v1.Precondition current_document = 4; + * @param \Google\Cloud\Firestore\V1\Precondition $var + * @return $this + */ + public function setCurrentDocument($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Precondition::class); + $this->current_document = $var; + + return $this; + } + + /** + * @return string + */ + public function getOperation() + { + return $this->whichOneof("operation"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteRequest.php new file mode 100644 index 000000000000..2bab538a188c --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteRequest.php @@ -0,0 +1,277 @@ +google.firestore.v1.WriteRequest + */ +class WriteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * This is only required in the first message. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $database = ''; + /** + * The ID of the write stream to resume. + * This may only be set in the first message. When left empty, a new write + * stream will be created. + * + * Generated from protobuf field string stream_id = 2; + */ + protected $stream_id = ''; + /** + * The writes to apply. + * Always executed atomically and in order. + * This must be empty on the first request. + * This may be empty on the last request. + * This must not be empty on all other requests. + * + * Generated from protobuf field repeated .google.firestore.v1.Write writes = 3; + */ + private $writes; + /** + * A stream token that was previously sent by the server. + * The client should set this field to the token from the most recent + * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This + * acknowledges that the client has received responses up to this token. After + * sending this token, earlier tokens may not be used anymore. + * The server may close the stream if there are too many unacknowledged + * responses. + * Leave this field unset when creating a new stream. To resume a stream at + * a specific point, set this field and the `stream_id` field. + * Leave this field unset when creating a new stream. + * + * Generated from protobuf field bytes stream_token = 4; + */ + protected $stream_token = ''; + /** + * Labels associated with this write request. + * + * Generated from protobuf field map labels = 5; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $database + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * This is only required in the first message. + * @type string $stream_id + * The ID of the write stream to resume. + * This may only be set in the first message. When left empty, a new write + * stream will be created. + * @type array<\Google\Cloud\Firestore\V1\Write>|\Google\Protobuf\Internal\RepeatedField $writes + * The writes to apply. + * Always executed atomically and in order. + * This must be empty on the first request. + * This may be empty on the last request. + * This must not be empty on all other requests. + * @type string $stream_token + * A stream token that was previously sent by the server. + * The client should set this field to the token from the most recent + * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This + * acknowledges that the client has received responses up to this token. After + * sending this token, earlier tokens may not be used anymore. + * The server may close the stream if there are too many unacknowledged + * responses. + * Leave this field unset when creating a new stream. To resume a stream at + * a specific point, set this field and the `stream_id` field. + * Leave this field unset when creating a new stream. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels associated with this write request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * This is only required in the first message. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * This is only required in the first message. + * + * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * The ID of the write stream to resume. + * This may only be set in the first message. When left empty, a new write + * stream will be created. + * + * Generated from protobuf field string stream_id = 2; + * @return string + */ + public function getStreamId() + { + return $this->stream_id; + } + + /** + * The ID of the write stream to resume. + * This may only be set in the first message. When left empty, a new write + * stream will be created. + * + * Generated from protobuf field string stream_id = 2; + * @param string $var + * @return $this + */ + public function setStreamId($var) + { + GPBUtil::checkString($var, True); + $this->stream_id = $var; + + return $this; + } + + /** + * The writes to apply. + * Always executed atomically and in order. + * This must be empty on the first request. + * This may be empty on the last request. + * This must not be empty on all other requests. + * + * Generated from protobuf field repeated .google.firestore.v1.Write writes = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWrites() + { + return $this->writes; + } + + /** + * The writes to apply. + * Always executed atomically and in order. + * This must be empty on the first request. + * This may be empty on the last request. + * This must not be empty on all other requests. + * + * Generated from protobuf field repeated .google.firestore.v1.Write writes = 3; + * @param array<\Google\Cloud\Firestore\V1\Write>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWrites($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Write::class); + $this->writes = $arr; + + return $this; + } + + /** + * A stream token that was previously sent by the server. + * The client should set this field to the token from the most recent + * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This + * acknowledges that the client has received responses up to this token. After + * sending this token, earlier tokens may not be used anymore. + * The server may close the stream if there are too many unacknowledged + * responses. + * Leave this field unset when creating a new stream. To resume a stream at + * a specific point, set this field and the `stream_id` field. + * Leave this field unset when creating a new stream. + * + * Generated from protobuf field bytes stream_token = 4; + * @return string + */ + public function getStreamToken() + { + return $this->stream_token; + } + + /** + * A stream token that was previously sent by the server. + * The client should set this field to the token from the most recent + * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This + * acknowledges that the client has received responses up to this token. After + * sending this token, earlier tokens may not be used anymore. + * The server may close the stream if there are too many unacknowledged + * responses. + * Leave this field unset when creating a new stream. To resume a stream at + * a specific point, set this field and the `stream_id` field. + * Leave this field unset when creating a new stream. + * + * Generated from protobuf field bytes stream_token = 4; + * @param string $var + * @return $this + */ + public function setStreamToken($var) + { + GPBUtil::checkString($var, False); + $this->stream_token = $var; + + return $this; + } + + /** + * Labels associated with this write request. + * + * Generated from protobuf field map labels = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels associated with this write request. + * + * Generated from protobuf field map labels = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResponse.php new file mode 100644 index 000000000000..da2c8584a0fd --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResponse.php @@ -0,0 +1,203 @@ +google.firestore.v1.WriteResponse + */ +class WriteResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of the stream. + * Only set on the first message, when a new stream was created. + * + * Generated from protobuf field string stream_id = 1; + */ + protected $stream_id = ''; + /** + * A token that represents the position of this response in the stream. + * This can be used by a client to resume the stream at this point. + * This field is always set. + * + * Generated from protobuf field bytes stream_token = 2; + */ + protected $stream_token = ''; + /** + * The result of applying the writes. + * This i-th write result corresponds to the i-th write in the + * request. + * + * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 3; + */ + private $write_results; + /** + * The time at which the commit occurred. Any read with an equal or greater + * `read_time` is guaranteed to see the effects of the write. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 4; + */ + protected $commit_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $stream_id + * The ID of the stream. + * Only set on the first message, when a new stream was created. + * @type string $stream_token + * A token that represents the position of this response in the stream. + * This can be used by a client to resume the stream at this point. + * This field is always set. + * @type array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $write_results + * The result of applying the writes. + * This i-th write result corresponds to the i-th write in the + * request. + * @type \Google\Protobuf\Timestamp $commit_time + * The time at which the commit occurred. Any read with an equal or greater + * `read_time` is guaranteed to see the effects of the write. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); + parent::__construct($data); + } + + /** + * The ID of the stream. + * Only set on the first message, when a new stream was created. + * + * Generated from protobuf field string stream_id = 1; + * @return string + */ + public function getStreamId() + { + return $this->stream_id; + } + + /** + * The ID of the stream. + * Only set on the first message, when a new stream was created. + * + * Generated from protobuf field string stream_id = 1; + * @param string $var + * @return $this + */ + public function setStreamId($var) + { + GPBUtil::checkString($var, True); + $this->stream_id = $var; + + return $this; + } + + /** + * A token that represents the position of this response in the stream. + * This can be used by a client to resume the stream at this point. + * This field is always set. + * + * Generated from protobuf field bytes stream_token = 2; + * @return string + */ + public function getStreamToken() + { + return $this->stream_token; + } + + /** + * A token that represents the position of this response in the stream. + * This can be used by a client to resume the stream at this point. + * This field is always set. + * + * Generated from protobuf field bytes stream_token = 2; + * @param string $var + * @return $this + */ + public function setStreamToken($var) + { + GPBUtil::checkString($var, False); + $this->stream_token = $var; + + return $this; + } + + /** + * The result of applying the writes. + * This i-th write result corresponds to the i-th write in the + * request. + * + * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWriteResults() + { + return $this->write_results; + } + + /** + * The result of applying the writes. + * This i-th write result corresponds to the i-th write in the + * request. + * + * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 3; + * @param array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWriteResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\WriteResult::class); + $this->write_results = $arr; + + return $this; + } + + /** + * The time at which the commit occurred. Any read with an equal or greater + * `read_time` is guaranteed to see the effects of the write. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCommitTime() + { + return $this->commit_time; + } + + public function hasCommitTime() + { + return isset($this->commit_time); + } + + public function clearCommitTime() + { + unset($this->commit_time); + } + + /** + * The time at which the commit occurred. Any read with an equal or greater + * `read_time` is guaranteed to see the effects of the write. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCommitTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->commit_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResult.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResult.php new file mode 100644 index 000000000000..f15058eb8a92 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResult.php @@ -0,0 +1,131 @@ +google.firestore.v1.WriteResult + */ +class WriteResult extends \Google\Protobuf\Internal\Message +{ + /** + * The last update time of the document after applying the write. Not set + * after a `delete`. + * If the write did not actually change the document, this will be the + * previous update_time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; + */ + protected $update_time = null; + /** + * The results of applying each + * [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], + * in the same order. + * + * Generated from protobuf field repeated .google.firestore.v1.Value transform_results = 2; + */ + private $transform_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $update_time + * The last update time of the document after applying the write. Not set + * after a `delete`. + * If the write did not actually change the document, this will be the + * previous update_time. + * @type array<\Google\Cloud\Firestore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $transform_results + * The results of applying each + * [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], + * in the same order. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Write::initOnce(); + parent::__construct($data); + } + + /** + * The last update time of the document after applying the write. Not set + * after a `delete`. + * If the write did not actually change the document, this will be the + * previous update_time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * The last update time of the document after applying the write. Not set + * after a `delete`. + * If the write did not actually change the document, this will be the + * previous update_time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * The results of applying each + * [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], + * in the same order. + * + * Generated from protobuf field repeated .google.firestore.v1.Value transform_results = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTransformResults() + { + return $this->transform_results; + } + + /** + * The results of applying each + * [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], + * in the same order. + * + * Generated from protobuf field repeated .google.firestore.v1.Value transform_results = 2; + * @param array<\Google\Cloud\Firestore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTransformResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class); + $this->transform_results = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_get_documents.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_get_documents.php new file mode 100644 index 000000000000..781b03696dc1 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_get_documents.php @@ -0,0 +1,86 @@ +setDatabase($database) + ->setDocuments($documents); + + // Call the API and handle any network failures. + try { + /** @var ServerStream $stream */ + $stream = $firestoreClient->batchGetDocuments($request); + + /** @var BatchGetDocumentsResponse $element */ + foreach ($stream->readAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $database = '[DATABASE]'; + $documentsElement = '[DOCUMENTS]'; + + batch_get_documents_sample($database, $documentsElement); +} +// [END firestore_v1_generated_Firestore_BatchGetDocuments_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_write.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_write.php new file mode 100644 index 000000000000..a43ae1584ac0 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_write.php @@ -0,0 +1,66 @@ +batchWrite($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END firestore_v1_generated_Firestore_BatchWrite_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/begin_transaction.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/begin_transaction.php new file mode 100644 index 000000000000..dc729abcdc4a --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/begin_transaction.php @@ -0,0 +1,71 @@ +setDatabase($database); + + // Call the API and handle any network failures. + try { + /** @var BeginTransactionResponse $response */ + $response = $firestoreClient->beginTransaction($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $database = '[DATABASE]'; + + begin_transaction_sample($database); +} +// [END firestore_v1_generated_Firestore_BeginTransaction_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/commit.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/commit.php new file mode 100644 index 000000000000..08897b94984b --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/commit.php @@ -0,0 +1,74 @@ +setDatabase($database) + ->setWrites($writes); + + // Call the API and handle any network failures. + try { + /** @var CommitResponse $response */ + $response = $firestoreClient->commit($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $database = '[DATABASE]'; + + commit_sample($database); +} +// [END firestore_v1_generated_Firestore_Commit_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/create_document.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/create_document.php new file mode 100644 index 000000000000..2a04cde30cef --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/create_document.php @@ -0,0 +1,83 @@ +setParent($parent) + ->setCollectionId($collectionId) + ->setDocumentId($documentId) + ->setDocument($document); + + // Call the API and handle any network failures. + try { + /** @var Document $response */ + $response = $firestoreClient->createDocument($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + $collectionId = '[COLLECTION_ID]'; + $documentId = '[DOCUMENT_ID]'; + + create_document_sample($parent, $collectionId, $documentId); +} +// [END firestore_v1_generated_Firestore_CreateDocument_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/delete_document.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/delete_document.php new file mode 100644 index 000000000000..db75cab94ac5 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/delete_document.php @@ -0,0 +1,69 @@ +setName($name); + + // Call the API and handle any network failures. + try { + $firestoreClient->deleteDocument($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + delete_document_sample($name); +} +// [END firestore_v1_generated_Firestore_DeleteDocument_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/get_document.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/get_document.php new file mode 100644 index 000000000000..787990595efd --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/get_document.php @@ -0,0 +1,71 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var Document $response */ + $response = $firestoreClient->getDocument($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $name = '[NAME]'; + + get_document_sample($name); +} +// [END firestore_v1_generated_Firestore_GetDocument_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_collection_ids.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_collection_ids.php new file mode 100644 index 000000000000..92f6bd51fb17 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_collection_ids.php @@ -0,0 +1,77 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $firestoreClient->listCollectionIds($request); + + /** @var string $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + list_collection_ids_sample($parent); +} +// [END firestore_v1_generated_Firestore_ListCollectionIds_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_documents.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_documents.php new file mode 100644 index 000000000000..e0dd4b7e4568 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_documents.php @@ -0,0 +1,89 @@ +setParent($parent) + ->setCollectionId($collectionId); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $firestoreClient->listDocuments($request); + + /** @var Document $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + $collectionId = '[COLLECTION_ID]'; + + list_documents_sample($parent, $collectionId); +} +// [END firestore_v1_generated_Firestore_ListDocuments_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/listen.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/listen.php new file mode 100644 index 000000000000..fb6754339467 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/listen.php @@ -0,0 +1,78 @@ +setDatabase($database); + + // Call the API and handle any network failures. + try { + /** @var BidiStream $stream */ + $stream = $firestoreClient->listen(); + $stream->writeAll([$request,]); + + /** @var ListenResponse $element */ + foreach ($stream->closeWriteAndReadAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $database = '[DATABASE]'; + + listen_sample($database); +} +// [END firestore_v1_generated_Firestore_Listen_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/partition_query.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/partition_query.php new file mode 100644 index 000000000000..6166c53e86e7 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/partition_query.php @@ -0,0 +1,64 @@ +partitionQuery($request); + + /** @var Cursor $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END firestore_v1_generated_Firestore_PartitionQuery_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/rollback.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/rollback.php new file mode 100644 index 000000000000..45a9b5c8f2b5 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/rollback.php @@ -0,0 +1,72 @@ +setDatabase($database) + ->setTransaction($transaction); + + // Call the API and handle any network failures. + try { + $firestoreClient->rollback($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $database = '[DATABASE]'; + $transaction = '...'; + + rollback_sample($database, $transaction); +} +// [END firestore_v1_generated_Firestore_Rollback_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_aggregation_query.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_aggregation_query.php new file mode 100644 index 000000000000..7d06d1816f7d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_aggregation_query.php @@ -0,0 +1,92 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var ServerStream $stream */ + $stream = $firestoreClient->runAggregationQuery($request); + + /** @var RunAggregationQueryResponse $element */ + foreach ($stream->readAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + run_aggregation_query_sample($parent); +} +// [END firestore_v1_generated_Firestore_RunAggregationQuery_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_query.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_query.php new file mode 100644 index 000000000000..c4ebe1603da7 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_query.php @@ -0,0 +1,80 @@ +setParent($parent); + + // Call the API and handle any network failures. + try { + /** @var ServerStream $stream */ + $stream = $firestoreClient->runQuery($request); + + /** @var RunQueryResponse $element */ + foreach ($stream->readAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + + run_query_sample($parent); +} +// [END firestore_v1_generated_Firestore_RunQuery_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/update_document.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/update_document.php new file mode 100644 index 000000000000..0200a86b0464 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/update_document.php @@ -0,0 +1,62 @@ +setDocument($document) + ->setUpdateMask($updateMask); + + // Call the API and handle any network failures. + try { + /** @var Document $response */ + $response = $firestoreClient->updateDocument($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END firestore_v1_generated_Firestore_UpdateDocument_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/write.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/write.php new file mode 100644 index 000000000000..19f9fba7d7dd --- /dev/null +++ b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/write.php @@ -0,0 +1,79 @@ +setDatabase($database); + + // Call the API and handle any network failures. + try { + /** @var BidiStream $stream */ + $stream = $firestoreClient->write(); + $stream->writeAll([$request,]); + + /** @var WriteResponse $element */ + foreach ($stream->closeWriteAndReadAll() as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $database = '[DATABASE]'; + + write_sample($database); +} +// [END firestore_v1_generated_Firestore_Write_sync] diff --git a/owl-bot-staging/Firestore/v1/src/V1/Client/FirestoreClient.php b/owl-bot-staging/Firestore/v1/src/V1/Client/FirestoreClient.php new file mode 100644 index 000000000000..cf0bb35375e2 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/src/V1/Client/FirestoreClient.php @@ -0,0 +1,619 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/firestore_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/firestore_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/firestore_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/firestore_rest_client_config.php', + ], + ], + ]; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'firestore.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Gets multiple documents. + * + * Documents returned by this method are not guaranteed to be returned in the + * same order that they were requested. + * + * @example samples/V1/FirestoreClient/batch_get_documents.php + * + * @param BatchGetDocumentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return ServerStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchGetDocuments(BatchGetDocumentsRequest $request, array $callOptions = []): ServerStream + { + return $this->startApiCall('BatchGetDocuments', $request, $callOptions); + } + + /** + * Applies a batch of write operations. + * + * The BatchWrite method does not apply the write operations atomically + * and can apply them out of order. Method does not allow more than one write + * per document. Each write succeeds or fails independently. See the + * [BatchWriteResponse][google.firestore.v1.BatchWriteResponse] for the + * success status of each write. + * + * If you require an atomically applied set of writes, use + * [Commit][google.firestore.v1.Firestore.Commit] instead. + * + * The async variant is {@see FirestoreClient::batchWriteAsync()} . + * + * @example samples/V1/FirestoreClient/batch_write.php + * + * @param BatchWriteRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BatchWriteResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function batchWrite(BatchWriteRequest $request, array $callOptions = []): BatchWriteResponse + { + return $this->startApiCall('BatchWrite', $request, $callOptions)->wait(); + } + + /** + * Starts a new transaction. + * + * The async variant is {@see FirestoreClient::beginTransactionAsync()} . + * + * @example samples/V1/FirestoreClient/begin_transaction.php + * + * @param BeginTransactionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BeginTransactionResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function beginTransaction(BeginTransactionRequest $request, array $callOptions = []): BeginTransactionResponse + { + return $this->startApiCall('BeginTransaction', $request, $callOptions)->wait(); + } + + /** + * Commits a transaction, while optionally updating documents. + * + * The async variant is {@see FirestoreClient::commitAsync()} . + * + * @example samples/V1/FirestoreClient/commit.php + * + * @param CommitRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return CommitResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function commit(CommitRequest $request, array $callOptions = []): CommitResponse + { + return $this->startApiCall('Commit', $request, $callOptions)->wait(); + } + + /** + * Creates a new document. + * + * The async variant is {@see FirestoreClient::createDocumentAsync()} . + * + * @example samples/V1/FirestoreClient/create_document.php + * + * @param CreateDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Document + * + * @throws ApiException Thrown if the API call fails. + */ + public function createDocument(CreateDocumentRequest $request, array $callOptions = []): Document + { + return $this->startApiCall('CreateDocument', $request, $callOptions)->wait(); + } + + /** + * Deletes a document. + * + * The async variant is {@see FirestoreClient::deleteDocumentAsync()} . + * + * @example samples/V1/FirestoreClient/delete_document.php + * + * @param DeleteDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteDocument(DeleteDocumentRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteDocument', $request, $callOptions)->wait(); + } + + /** + * Gets a single document. + * + * The async variant is {@see FirestoreClient::getDocumentAsync()} . + * + * @example samples/V1/FirestoreClient/get_document.php + * + * @param GetDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Document + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDocument(GetDocumentRequest $request, array $callOptions = []): Document + { + return $this->startApiCall('GetDocument', $request, $callOptions)->wait(); + } + + /** + * Lists all the collection IDs underneath a document. + * + * The async variant is {@see FirestoreClient::listCollectionIdsAsync()} . + * + * @example samples/V1/FirestoreClient/list_collection_ids.php + * + * @param ListCollectionIdsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listCollectionIds(ListCollectionIdsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListCollectionIds', $request, $callOptions); + } + + /** + * Lists documents. + * + * The async variant is {@see FirestoreClient::listDocumentsAsync()} . + * + * @example samples/V1/FirestoreClient/list_documents.php + * + * @param ListDocumentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDocuments(ListDocumentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListDocuments', $request, $callOptions); + } + + /** + * Listens to changes. This method is only available via gRPC or WebChannel + * (not REST). + * + * @example samples/V1/FirestoreClient/listen.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function listen(array $callOptions = []): BidiStream + { + return $this->startApiCall('Listen', null, $callOptions); + } + + /** + * Partitions a query by returning partition cursors that can be used to run + * the query in parallel. The returned partition cursors are split points that + * can be used by RunQuery as starting/end points for the query results. + * + * The async variant is {@see FirestoreClient::partitionQueryAsync()} . + * + * @example samples/V1/FirestoreClient/partition_query.php + * + * @param PartitionQueryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function partitionQuery(PartitionQueryRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('PartitionQuery', $request, $callOptions); + } + + /** + * Rolls back a transaction. + * + * The async variant is {@see FirestoreClient::rollbackAsync()} . + * + * @example samples/V1/FirestoreClient/rollback.php + * + * @param RollbackRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function rollback(RollbackRequest $request, array $callOptions = []): void + { + $this->startApiCall('Rollback', $request, $callOptions)->wait(); + } + + /** + * Runs an aggregation query. + * + * Rather than producing [Document][google.firestore.v1.Document] results like + * [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery], this API + * allows running an aggregation to produce a series of + * [AggregationResult][google.firestore.v1.AggregationResult] server-side. + * + * High-Level Example: + * + * ``` + * -- Return the number of documents in table given a filter. + * SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); + * ``` + * + * @example samples/V1/FirestoreClient/run_aggregation_query.php + * + * @param RunAggregationQueryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return ServerStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function runAggregationQuery(RunAggregationQueryRequest $request, array $callOptions = []): ServerStream + { + return $this->startApiCall('RunAggregationQuery', $request, $callOptions); + } + + /** + * Runs a query. + * + * @example samples/V1/FirestoreClient/run_query.php + * + * @param RunQueryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return ServerStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function runQuery(RunQueryRequest $request, array $callOptions = []): ServerStream + { + return $this->startApiCall('RunQuery', $request, $callOptions); + } + + /** + * Updates or inserts a document. + * + * The async variant is {@see FirestoreClient::updateDocumentAsync()} . + * + * @example samples/V1/FirestoreClient/update_document.php + * + * @param UpdateDocumentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Document + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDocument(UpdateDocumentRequest $request, array $callOptions = []): Document + { + return $this->startApiCall('UpdateDocument', $request, $callOptions)->wait(); + } + + /** + * Streams batches of document updates and deletes, in order. This method is + * only available via gRPC or WebChannel (not REST). + * + * @example samples/V1/FirestoreClient/write.php + * + * @param array $callOptions { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return BidiStream + * + * @throws ApiException Thrown if the API call fails. + */ + public function write(array $callOptions = []): BidiStream + { + return $this->startApiCall('Write', null, $callOptions); + } +} diff --git a/owl-bot-staging/Firestore/v1/src/V1/FirestoreClient.php b/owl-bot-staging/Firestore/v1/src/V1/FirestoreClient.php new file mode 100644 index 000000000000..da1c71ebe61d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/src/V1/FirestoreClient.php @@ -0,0 +1,34 @@ +batchGetDocuments($database, $documents); + * foreach ($stream->readAll() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Firestore\V1\Client\FirestoreClient}. + */ +class FirestoreGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.firestore.v1.Firestore'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'firestore.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'firestore.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/datastore', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/firestore_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/firestore_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/firestore_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/firestore_rest_client_config.php', + ], + ], + ]; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'firestore.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Gets multiple documents. + * + * Documents returned by this method are not guaranteed to be returned in the + * same order that they were requested. + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $database = 'database'; + * $documents = []; + * // Read all responses until the stream is complete + * $stream = $firestoreClient->batchGetDocuments($database, $documents); + * foreach ($stream->readAll() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param string $database Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @param string[] $documents The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of the + * given `database`. Duplicate names will be elided. + * @param array $optionalArgs { + * Optional. + * + * @type DocumentMask $mask + * The fields to return. If not set, returns all fields. + * + * If a document has a field that is not present in this mask, that field will + * not be returned in the response. + * @type string $transaction + * Reads documents in a transaction. + * @type TransactionOptions $newTransaction + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + * @type Timestamp $readTime + * Reads documents as they were at the given time. + * + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return \Google\ApiCore\ServerStream + * + * @throws ApiException if the remote call fails + */ + public function batchGetDocuments($database, $documents, array $optionalArgs = []) + { + $request = new BatchGetDocumentsRequest(); + $requestParamHeaders = []; + $request->setDatabase($database); + $request->setDocuments($documents); + $requestParamHeaders['database'] = $database; + if (isset($optionalArgs['mask'])) { + $request->setMask($optionalArgs['mask']); + } + + if (isset($optionalArgs['transaction'])) { + $request->setTransaction($optionalArgs['transaction']); + } + + if (isset($optionalArgs['newTransaction'])) { + $request->setNewTransaction($optionalArgs['newTransaction']); + } + + if (isset($optionalArgs['readTime'])) { + $request->setReadTime($optionalArgs['readTime']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('BatchGetDocuments', BatchGetDocumentsResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); + } + + /** + * Applies a batch of write operations. + * + * The BatchWrite method does not apply the write operations atomically + * and can apply them out of order. Method does not allow more than one write + * per document. Each write succeeds or fails independently. See the + * [BatchWriteResponse][google.firestore.v1.BatchWriteResponse] for the + * success status of each write. + * + * If you require an atomically applied set of writes, use + * [Commit][google.firestore.v1.Firestore.Commit] instead. + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $response = $firestoreClient->batchWrite(); + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $database + * Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @type Write[] $writes + * The writes to apply. + * + * Method does not apply writes atomically and does not guarantee ordering. + * Each write succeeds or fails independently. You cannot write to the same + * document more than once per request. + * @type array $labels + * Labels associated with this batch write. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Firestore\V1\BatchWriteResponse + * + * @throws ApiException if the remote call fails + */ + public function batchWrite(array $optionalArgs = []) + { + $request = new BatchWriteRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['database'])) { + $request->setDatabase($optionalArgs['database']); + $requestParamHeaders['database'] = $optionalArgs['database']; + } + + if (isset($optionalArgs['writes'])) { + $request->setWrites($optionalArgs['writes']); + } + + if (isset($optionalArgs['labels'])) { + $request->setLabels($optionalArgs['labels']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('BatchWrite', BatchWriteResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Starts a new transaction. + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $database = 'database'; + * $response = $firestoreClient->beginTransaction($database); + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param string $database Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @param array $optionalArgs { + * Optional. + * + * @type TransactionOptions $options + * The options for the transaction. + * Defaults to a read-write transaction. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Firestore\V1\BeginTransactionResponse + * + * @throws ApiException if the remote call fails + */ + public function beginTransaction($database, array $optionalArgs = []) + { + $request = new BeginTransactionRequest(); + $requestParamHeaders = []; + $request->setDatabase($database); + $requestParamHeaders['database'] = $database; + if (isset($optionalArgs['options'])) { + $request->setOptions($optionalArgs['options']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('BeginTransaction', BeginTransactionResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Commits a transaction, while optionally updating documents. + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $database = 'database'; + * $writes = []; + * $response = $firestoreClient->commit($database, $writes); + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param string $database Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @param Write[] $writes The writes to apply. + * + * Always executed atomically and in order. + * @param array $optionalArgs { + * Optional. + * + * @type string $transaction + * If set, applies all writes in this transaction, and commits it. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Firestore\V1\CommitResponse + * + * @throws ApiException if the remote call fails + */ + public function commit($database, $writes, array $optionalArgs = []) + { + $request = new CommitRequest(); + $requestParamHeaders = []; + $request->setDatabase($database); + $request->setWrites($writes); + $requestParamHeaders['database'] = $database; + if (isset($optionalArgs['transaction'])) { + $request->setTransaction($optionalArgs['transaction']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Commit', CommitResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new document. + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $parent = 'parent'; + * $collectionId = 'collection_id'; + * $documentId = 'document_id'; + * $document = new Document(); + * $response = $firestoreClient->createDocument($parent, $collectionId, $documentId, $document); + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource. For example: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + * @param string $collectionId Required. The collection ID, relative to `parent`, to list. For example: + * `chatrooms`. + * @param string $documentId The client-assigned document ID to use for this document. + * + * Optional. If not specified, an ID will be assigned by the service. + * @param Document $document Required. The document to create. `name` must not be set. + * @param array $optionalArgs { + * Optional. + * + * @type DocumentMask $mask + * The fields to return. If not set, returns all fields. + * + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Firestore\V1\Document + * + * @throws ApiException if the remote call fails + */ + public function createDocument($parent, $collectionId, $documentId, $document, array $optionalArgs = []) + { + $request = new CreateDocumentRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setCollectionId($collectionId); + $request->setDocumentId($documentId); + $request->setDocument($document); + $requestParamHeaders['parent'] = $parent; + $requestParamHeaders['collection_id'] = $collectionId; + if (isset($optionalArgs['mask'])) { + $request->setMask($optionalArgs['mask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateDocument', Document::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a document. + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $name = 'name'; + * $firestoreClient->deleteDocument($name); + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the Document to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * @param array $optionalArgs { + * Optional. + * + * @type Precondition $currentDocument + * An optional precondition on the document. + * The request will fail if this is set and not met by the target document. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteDocument($name, array $optionalArgs = []) + { + $request = new DeleteDocumentRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['currentDocument'])) { + $request->setCurrentDocument($optionalArgs['currentDocument']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('DeleteDocument', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a single document. + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $name = 'name'; + * $response = $firestoreClient->getDocument($name); + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param string $name Required. The resource name of the Document to get. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * @param array $optionalArgs { + * Optional. + * + * @type DocumentMask $mask + * The fields to return. If not set, returns all fields. + * + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * @type string $transaction + * Reads the document in a transaction. + * @type Timestamp $readTime + * Reads the version of the document at the given time. + * + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Firestore\V1\Document + * + * @throws ApiException if the remote call fails + */ + public function getDocument($name, array $optionalArgs = []) + { + $request = new GetDocumentRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['mask'])) { + $request->setMask($optionalArgs['mask']); + } + + if (isset($optionalArgs['transaction'])) { + $request->setTransaction($optionalArgs['transaction']); + } + + if (isset($optionalArgs['readTime'])) { + $request->setReadTime($optionalArgs['readTime']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetDocument', Document::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists all the collection IDs underneath a document. + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $parent = 'parent'; + * // Iterate over pages of elements + * $pagedResponse = $firestoreClient->listCollectionIds($parent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $firestoreClient->listCollectionIds($parent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent document. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type Timestamp $readTime + * Reads documents as they were at the given time. + * + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listCollectionIds($parent, array $optionalArgs = []) + { + $request = new ListCollectionIdsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['readTime'])) { + $request->setReadTime($optionalArgs['readTime']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListCollectionIds', $optionalArgs, ListCollectionIdsResponse::class, $request); + } + + /** + * Lists documents. + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $parent = 'parent'; + * $collectionId = 'collection_id'; + * // Iterate over pages of elements + * $pagedResponse = $firestoreClient->listDocuments($parent, $collectionId); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $firestoreClient->listDocuments($parent, $collectionId); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * @param string $collectionId Optional. The collection ID, relative to `parent`, to list. + * + * For example: `chatrooms` or `messages`. + * + * This is optional, and when not provided, Firestore will list documents + * from all collections under the provided `parent`. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $orderBy + * Optional. The optional ordering of the documents to return. + * + * For example: `priority desc, __name__ desc`. + * + * This mirrors the [`ORDER BY`][google.firestore.v1.StructuredQuery.order_by] + * used in Firestore queries but in a string representation. When absent, + * documents are ordered based on `__name__ ASC`. + * @type DocumentMask $mask + * Optional. The fields to return. If not set, returns all fields. + * + * If a document has a field that is not present in this mask, that field + * will not be returned in the response. + * @type string $transaction + * Perform the read as part of an already active transaction. + * @type Timestamp $readTime + * Perform the read at the provided time. + * + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * @type bool $showMissing + * If the list should show missing documents. + * + * A document is missing if it does not exist, but there are sub-documents + * nested underneath it. When true, such missing documents will be returned + * with a key but will not have fields, + * [`create_time`][google.firestore.v1.Document.create_time], or + * [`update_time`][google.firestore.v1.Document.update_time] set. + * + * Requests with `show_missing` may not specify `where` or `order_by`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listDocuments($parent, $collectionId, array $optionalArgs = []) + { + $request = new ListDocumentsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setCollectionId($collectionId); + $requestParamHeaders['parent'] = $parent; + $requestParamHeaders['collection_id'] = $collectionId; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + if (isset($optionalArgs['mask'])) { + $request->setMask($optionalArgs['mask']); + } + + if (isset($optionalArgs['transaction'])) { + $request->setTransaction($optionalArgs['transaction']); + } + + if (isset($optionalArgs['readTime'])) { + $request->setReadTime($optionalArgs['readTime']); + } + + if (isset($optionalArgs['showMissing'])) { + $request->setShowMissing($optionalArgs['showMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListDocuments', $optionalArgs, ListDocumentsResponse::class, $request); + } + + /** + * Listens to changes. This method is only available via gRPC or WebChannel + * (not REST). + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $database = 'database'; + * $request = new ListenRequest(); + * $request->setDatabase($database); + * // Write all requests to the server, then read all responses until the + * // stream is complete + * $requests = [ + * $request, + * ]; + * $stream = $firestoreClient->listen(); + * $stream->writeAll($requests); + * foreach ($stream->closeWriteAndReadAll() as $element) { + * // doSomethingWith($element); + * } + * // Alternatively: + * // Write requests individually, making read() calls if + * // required. Call closeWrite() once writes are complete, and read the + * // remaining responses from the server. + * $requests = [ + * $request, + * ]; + * $stream = $firestoreClient->listen(); + * foreach ($requests as $request) { + * $stream->write($request); + * // if required, read a single response from the stream + * $element = $stream->read(); + * // doSomethingWith($element) + * } + * $stream->closeWrite(); + * $element = $stream->read(); + * while (!is_null($element)) { + * // doSomethingWith($element) + * $element = $stream->read(); + * } + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return \Google\ApiCore\BidiStream + * + * @throws ApiException if the remote call fails + */ + public function listen(array $optionalArgs = []) + { + return $this->startCall('Listen', ListenResponse::class, $optionalArgs, null, Call::BIDI_STREAMING_CALL); + } + + /** + * Partitions a query by returning partition cursors that can be used to run + * the query in parallel. The returned partition cursors are split points that + * can be used by RunQuery as starting/end points for the query results. + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $firestoreClient->partitionQuery(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $firestoreClient->partitionQuery(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $parent + * Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents`. + * Document resource names are not supported; only database resource names + * can be specified. + * @type StructuredQuery $structuredQuery + * A structured query. + * Query must specify collection with all descendants and be ordered by name + * ascending. Other filters, order bys, limits, offsets, and start/end + * cursors are not supported. + * @type int $partitionCount + * The desired maximum number of partition points. + * The partitions may be returned across multiple pages of results. + * The number must be positive. The actual number of partitions + * returned may be fewer. + * + * For example, this may be set to one fewer than the number of parallel + * queries to be run, or in running a data pipeline job, one fewer than the + * number of workers or compute instances available. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type Timestamp $readTime + * Reads documents as they were at the given time. + * + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function partitionQuery(array $optionalArgs = []) + { + $request = new PartitionQueryRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['parent'])) { + $request->setParent($optionalArgs['parent']); + $requestParamHeaders['parent'] = $optionalArgs['parent']; + } + + if (isset($optionalArgs['structuredQuery'])) { + $request->setStructuredQuery($optionalArgs['structuredQuery']); + } + + if (isset($optionalArgs['partitionCount'])) { + $request->setPartitionCount($optionalArgs['partitionCount']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['readTime'])) { + $request->setReadTime($optionalArgs['readTime']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('PartitionQuery', $optionalArgs, PartitionQueryResponse::class, $request); + } + + /** + * Rolls back a transaction. + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $database = 'database'; + * $transaction = '...'; + * $firestoreClient->rollback($database, $transaction); + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param string $database Required. The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * @param string $transaction Required. The transaction to roll back. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function rollback($database, $transaction, array $optionalArgs = []) + { + $request = new RollbackRequest(); + $requestParamHeaders = []; + $request->setDatabase($database); + $request->setTransaction($transaction); + $requestParamHeaders['database'] = $database; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Rollback', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Runs an aggregation query. + * + * Rather than producing [Document][google.firestore.v1.Document] results like + * [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery], this API + * allows running an aggregation to produce a series of + * [AggregationResult][google.firestore.v1.AggregationResult] server-side. + * + * High-Level Example: + * + * ``` + * -- Return the number of documents in table given a filter. + * SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); + * ``` + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $parent = 'parent'; + * // Read all responses until the stream is complete + * $stream = $firestoreClient->runAggregationQuery($parent); + * foreach ($stream->readAll() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * @param array $optionalArgs { + * Optional. + * + * @type StructuredAggregationQuery $structuredAggregationQuery + * An aggregation query. + * @type string $transaction + * Run the aggregation within an already active transaction. + * + * The value here is the opaque transaction ID to execute the query in. + * @type TransactionOptions $newTransaction + * Starts a new transaction as part of the query, defaulting to read-only. + * + * The new transaction ID will be returned as the first response in the + * stream. + * @type Timestamp $readTime + * Executes the query at the given timestamp. + * + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return \Google\ApiCore\ServerStream + * + * @throws ApiException if the remote call fails + */ + public function runAggregationQuery($parent, array $optionalArgs = []) + { + $request = new RunAggregationQueryRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['structuredAggregationQuery'])) { + $request->setStructuredAggregationQuery($optionalArgs['structuredAggregationQuery']); + } + + if (isset($optionalArgs['transaction'])) { + $request->setTransaction($optionalArgs['transaction']); + } + + if (isset($optionalArgs['newTransaction'])) { + $request->setNewTransaction($optionalArgs['newTransaction']); + } + + if (isset($optionalArgs['readTime'])) { + $request->setReadTime($optionalArgs['readTime']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RunAggregationQuery', RunAggregationQueryResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); + } + + /** + * Runs a query. + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $parent = 'parent'; + * // Read all responses until the stream is complete + * $stream = $firestoreClient->runQuery($parent); + * foreach ($stream->readAll() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * @param array $optionalArgs { + * Optional. + * + * @type StructuredQuery $structuredQuery + * A structured query. + * @type string $transaction + * Run the query within an already active transaction. + * + * The value here is the opaque transaction ID to execute the query in. + * @type TransactionOptions $newTransaction + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + * @type Timestamp $readTime + * Reads documents as they were at the given time. + * + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return \Google\ApiCore\ServerStream + * + * @throws ApiException if the remote call fails + */ + public function runQuery($parent, array $optionalArgs = []) + { + $request = new RunQueryRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['structuredQuery'])) { + $request->setStructuredQuery($optionalArgs['structuredQuery']); + } + + if (isset($optionalArgs['transaction'])) { + $request->setTransaction($optionalArgs['transaction']); + } + + if (isset($optionalArgs['newTransaction'])) { + $request->setNewTransaction($optionalArgs['newTransaction']); + } + + if (isset($optionalArgs['readTime'])) { + $request->setReadTime($optionalArgs['readTime']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RunQuery', RunQueryResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); + } + + /** + * Updates or inserts a document. + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $document = new Document(); + * $updateMask = new DocumentMask(); + * $response = $firestoreClient->updateDocument($document, $updateMask); + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param Document $document Required. The updated document. + * Creates the document if it does not already exist. + * @param DocumentMask $updateMask The fields to update. + * None of the field paths in the mask may contain a reserved name. + * + * If the document exists on the server and has fields not referenced in the + * mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * @param array $optionalArgs { + * Optional. + * + * @type DocumentMask $mask + * The fields to return. If not set, returns all fields. + * + * If the document has a field that is not present in this mask, that field + * will not be returned in the response. + * @type Precondition $currentDocument + * An optional precondition on the document. + * The request will fail if this is set and not met by the target document. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Firestore\V1\Document + * + * @throws ApiException if the remote call fails + */ + public function updateDocument($document, $updateMask, array $optionalArgs = []) + { + $request = new UpdateDocumentRequest(); + $requestParamHeaders = []; + $request->setDocument($document); + $request->setUpdateMask($updateMask); + $requestParamHeaders['document.name'] = $document->getName(); + if (isset($optionalArgs['mask'])) { + $request->setMask($optionalArgs['mask']); + } + + if (isset($optionalArgs['currentDocument'])) { + $request->setCurrentDocument($optionalArgs['currentDocument']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateDocument', Document::class, $optionalArgs, $request)->wait(); + } + + /** + * Streams batches of document updates and deletes, in order. This method is + * only available via gRPC or WebChannel (not REST). + * + * Sample code: + * ``` + * $firestoreClient = new FirestoreClient(); + * try { + * $database = 'database'; + * $request = new WriteRequest(); + * $request->setDatabase($database); + * // Write all requests to the server, then read all responses until the + * // stream is complete + * $requests = [ + * $request, + * ]; + * $stream = $firestoreClient->write(); + * $stream->writeAll($requests); + * foreach ($stream->closeWriteAndReadAll() as $element) { + * // doSomethingWith($element); + * } + * // Alternatively: + * // Write requests individually, making read() calls if + * // required. Call closeWrite() once writes are complete, and read the + * // remaining responses from the server. + * $requests = [ + * $request, + * ]; + * $stream = $firestoreClient->write(); + * foreach ($requests as $request) { + * $stream->write($request); + * // if required, read a single response from the stream + * $element = $stream->read(); + * // doSomethingWith($element) + * } + * $stream->closeWrite(); + * $element = $stream->read(); + * while (!is_null($element)) { + * // doSomethingWith($element) + * $element = $stream->read(); + * } + * } finally { + * $firestoreClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type int $timeoutMillis + * Timeout to use for this call. + * } + * + * @return \Google\ApiCore\BidiStream + * + * @throws ApiException if the remote call fails + */ + public function write(array $optionalArgs = []) + { + return $this->startCall('Write', WriteResponse::class, $optionalArgs, null, Call::BIDI_STREAMING_CALL); + } +} diff --git a/owl-bot-staging/Firestore/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Firestore/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..16969eb8ec78 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/src/V1/gapic_metadata.json @@ -0,0 +1,98 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.firestore.v1", + "libraryPackage": "Google\\Cloud\\Firestore\\V1", + "services": { + "Firestore": { + "clients": { + "grpc": { + "libraryClient": "FirestoreGapicClient", + "rpcs": { + "BatchGetDocuments": { + "methods": [ + "batchGetDocuments" + ] + }, + "BatchWrite": { + "methods": [ + "batchWrite" + ] + }, + "BeginTransaction": { + "methods": [ + "beginTransaction" + ] + }, + "Commit": { + "methods": [ + "commit" + ] + }, + "CreateDocument": { + "methods": [ + "createDocument" + ] + }, + "DeleteDocument": { + "methods": [ + "deleteDocument" + ] + }, + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "ListCollectionIds": { + "methods": [ + "listCollectionIds" + ] + }, + "ListDocuments": { + "methods": [ + "listDocuments" + ] + }, + "Listen": { + "methods": [ + "listen" + ] + }, + "PartitionQuery": { + "methods": [ + "partitionQuery" + ] + }, + "Rollback": { + "methods": [ + "rollback" + ] + }, + "RunAggregationQuery": { + "methods": [ + "runAggregationQuery" + ] + }, + "RunQuery": { + "methods": [ + "runQuery" + ] + }, + "UpdateDocument": { + "methods": [ + "updateDocument" + ] + }, + "Write": { + "methods": [ + "write" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_client_config.json b/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_client_config.json new file mode 100644 index 000000000000..0fb2c36f7df8 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_client_config.json @@ -0,0 +1,174 @@ +{ + "interfaces": { + "google.firestore.v1.Firestore": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "RESOURCE_EXHAUSTED", + "UNAVAILABLE" + ], + "retry_policy_2_codes": [ + "RESOURCE_EXHAUSTED", + "UNAVAILABLE", + "INTERNAL", + "DEADLINE_EXCEEDED" + ], + "retry_policy_3_codes": [ + "RESOURCE_EXHAUSTED", + "UNAVAILABLE", + "INTERNAL", + "DEADLINE_EXCEEDED" + ], + "no_retry_1_codes": [], + "retry_policy_4_codes": [ + "RESOURCE_EXHAUSTED", + "UNAVAILABLE", + "INTERNAL", + "DEADLINE_EXCEEDED" + ], + "retry_policy_5_codes": [ + "RESOURCE_EXHAUSTED", + "UNAVAILABLE", + "ABORTED" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 300000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 300000, + "total_timeout_millis": 300000 + }, + "retry_policy_3_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 86400000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 86400000, + "total_timeout_millis": 86400000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 86400000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 86400000, + "total_timeout_millis": 86400000 + }, + "retry_policy_4_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_5_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "BatchGetDocuments": { + "timeout_millis": 300000 + }, + "BatchWrite": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_5_codes", + "retry_params_name": "retry_policy_5_params" + }, + "BeginTransaction": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "Commit": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "GetDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "ListCollectionIds": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "ListDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "Listen": { + "timeout_millis": 86400000 + }, + "PartitionQuery": { + "timeout_millis": 300000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" + }, + "Rollback": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_4_codes", + "retry_params_name": "retry_policy_4_params" + }, + "RunAggregationQuery": { + "timeout_millis": 300000 + }, + "RunQuery": { + "timeout_millis": 300000 + }, + "UpdateDocument": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Write": { + "timeout_millis": 86400000 + } + } + } + } +} diff --git a/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_descriptor_config.php b/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_descriptor_config.php new file mode 100644 index 000000000000..7d2b1c57c94f --- /dev/null +++ b/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_descriptor_config.php @@ -0,0 +1,252 @@ + [ + 'google.firestore.v1.Firestore' => [ + 'BatchGetDocuments' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'ServerStreaming', + ], + 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\BatchGetDocumentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'database', + 'fieldAccessors' => [ + 'getDatabase', + ], + ], + ], + ], + 'BatchWrite' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\BatchWriteResponse', + 'headerParams' => [ + [ + 'keyName' => 'database', + 'fieldAccessors' => [ + 'getDatabase', + ], + ], + ], + ], + 'BeginTransaction' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\BeginTransactionResponse', + 'headerParams' => [ + [ + 'keyName' => 'database', + 'fieldAccessors' => [ + 'getDatabase', + ], + ], + ], + ], + 'Commit' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\CommitResponse', + 'headerParams' => [ + [ + 'keyName' => 'database', + 'fieldAccessors' => [ + 'getDatabase', + ], + ], + ], + ], + 'CreateDocument' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\Document', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + [ + 'keyName' => 'collection_id', + 'fieldAccessors' => [ + 'getCollectionId', + ], + ], + ], + ], + 'DeleteDocument' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetDocument' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\Document', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListCollectionIds' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getCollectionIds', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\ListCollectionIdsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListDocuments' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDocuments', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\ListDocumentsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + [ + 'keyName' => 'collection_id', + 'fieldAccessors' => [ + 'getCollectionId', + ], + ], + ], + ], + 'Listen' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\ListenResponse', + 'headerParams' => [ + [ + 'keyName' => 'database', + 'fieldAccessors' => [ + 'getDatabase', + ], + ], + ], + ], + 'PartitionQuery' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getPartitions', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\PartitionQueryResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'Rollback' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'database', + 'fieldAccessors' => [ + 'getDatabase', + ], + ], + ], + ], + 'RunAggregationQuery' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'ServerStreaming', + ], + 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\RunAggregationQueryResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'RunQuery' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'ServerStreaming', + ], + 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\RunQueryResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateDocument' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\Document', + 'headerParams' => [ + [ + 'keyName' => 'document.name', + 'fieldAccessors' => [ + 'getDocument', + 'getName', + ], + ], + ], + ], + 'Write' => [ + 'grpcStreaming' => [ + 'grpcStreamingType' => 'BidiStreaming', + ], + 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, + 'responseType' => 'Google\Cloud\Firestore\V1\WriteResponse', + 'headerParams' => [ + [ + 'keyName' => 'database', + 'fieldAccessors' => [ + 'getDatabase', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_rest_client_config.php b/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_rest_client_config.php new file mode 100644 index 000000000000..984cef14a450 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_rest_client_config.php @@ -0,0 +1,272 @@ + [ + 'google.firestore.v1.Firestore' => [ + 'BatchGetDocuments' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{database=projects/*/databases/*}/documents:batchGet', + 'body' => '*', + 'placeholders' => [ + 'database' => [ + 'getters' => [ + 'getDatabase', + ], + ], + ], + ], + 'BatchWrite' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{database=projects/*/databases/*}/documents:batchWrite', + 'body' => '*', + 'placeholders' => [ + 'database' => [ + 'getters' => [ + 'getDatabase', + ], + ], + ], + ], + 'BeginTransaction' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{database=projects/*/databases/*}/documents:beginTransaction', + 'body' => '*', + 'placeholders' => [ + 'database' => [ + 'getters' => [ + 'getDatabase', + ], + ], + ], + ], + 'Commit' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{database=projects/*/databases/*}/documents:commit', + 'body' => '*', + 'placeholders' => [ + 'database' => [ + 'getters' => [ + 'getDatabase', + ], + ], + ], + ], + 'CreateDocument' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents/**}/{collection_id}', + 'body' => 'document', + 'placeholders' => [ + 'collection_id' => [ + 'getters' => [ + 'getCollectionId', + ], + ], + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'document_id', + ], + ], + 'DeleteDocument' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/databases/*/documents/*/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetDocument' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/databases/*/documents/*/**}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListCollectionIds' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents}:listCollectionIds', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents/*/**}:listCollectionIds', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListDocuments' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents}/{collection_id}', + ], + ], + 'placeholders' => [ + 'collection_id' => [ + 'getters' => [ + 'getCollectionId', + ], + ], + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'PartitionQuery' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents}:partitionQuery', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents/*/**}:partitionQuery', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'Rollback' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{database=projects/*/databases/*}/documents:rollback', + 'body' => '*', + 'placeholders' => [ + 'database' => [ + 'getters' => [ + 'getDatabase', + ], + ], + ], + ], + 'RunAggregationQuery' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents}:runAggregationQuery', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents/*/**}:runAggregationQuery', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'RunQuery' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents}:runQuery', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents/*/**}:runQuery', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateDocument' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{document.name=projects/*/databases/*/documents/*/**}', + 'body' => 'document', + 'placeholders' => [ + 'document.name' => [ + 'getters' => [ + 'getDocument', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/databases/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/databases/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/databases/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/databases/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Firestore/v1/tests/Unit/V1/Client/FirestoreClientTest.php b/owl-bot-staging/Firestore/v1/tests/Unit/V1/Client/FirestoreClientTest.php new file mode 100644 index 000000000000..e071d92d5b47 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/tests/Unit/V1/Client/FirestoreClientTest.php @@ -0,0 +1,1323 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return FirestoreClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new FirestoreClient($options); + } + + /** @test */ + public function batchGetDocumentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $missing = 'missing1069449574'; + $transaction2 = '17'; + $expectedResponse = new BatchGetDocumentsResponse(); + $expectedResponse->setMissing($missing); + $expectedResponse->setTransaction($transaction2); + $transport->addResponse($expectedResponse); + $missing2 = 'missing21243859865'; + $transaction3 = '18'; + $expectedResponse2 = new BatchGetDocumentsResponse(); + $expectedResponse2->setMissing($missing2); + $expectedResponse2->setTransaction($transaction3); + $transport->addResponse($expectedResponse2); + $missing3 = 'missing31243859866'; + $transaction4 = '19'; + $expectedResponse3 = new BatchGetDocumentsResponse(); + $expectedResponse3->setMissing($missing3); + $expectedResponse3->setTransaction($transaction4); + $transport->addResponse($expectedResponse3); + // Mock request + $database = 'database1789464955'; + $documents = []; + $request = (new BatchGetDocumentsRequest()) + ->setDatabase($database) + ->setDocuments($documents); + $serverStream = $gapicClient->batchGetDocuments($request); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/BatchGetDocuments', $actualFuncCall); + $actualValue = $actualRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $actualValue = $actualRequestObject->getDocuments(); + $this->assertProtobufEquals($documents, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchGetDocumentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + // Mock request + $database = 'database1789464955'; + $documents = []; + $request = (new BatchGetDocumentsRequest()) + ->setDatabase($database) + ->setDocuments($documents); + $serverStream = $gapicClient->batchGetDocuments($request); + $results = $serverStream->readAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchWriteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchWriteResponse(); + $transport->addResponse($expectedResponse); + $request = new BatchWriteRequest(); + $response = $gapicClient->batchWrite($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/BatchWrite', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchWriteExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new BatchWriteRequest(); + try { + $gapicClient->batchWrite($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function beginTransactionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction = '-34'; + $expectedResponse = new BeginTransactionResponse(); + $expectedResponse->setTransaction($transaction); + $transport->addResponse($expectedResponse); + // Mock request + $database = 'database1789464955'; + $request = (new BeginTransactionRequest()) + ->setDatabase($database); + $response = $gapicClient->beginTransaction($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/BeginTransaction', $actualFuncCall); + $actualValue = $actualRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function beginTransactionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $database = 'database1789464955'; + $request = (new BeginTransactionRequest()) + ->setDatabase($database); + try { + $gapicClient->beginTransaction($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function commitTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new CommitResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $database = 'database1789464955'; + $writes = []; + $request = (new CommitRequest()) + ->setDatabase($database) + ->setWrites($writes); + $response = $gapicClient->commit($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/Commit', $actualFuncCall); + $actualValue = $actualRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $actualValue = $actualRequestObject->getWrites(); + $this->assertProtobufEquals($writes, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function commitExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $database = 'database1789464955'; + $writes = []; + $request = (new CommitRequest()) + ->setDatabase($database) + ->setWrites($writes); + try { + $gapicClient->commit($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDocumentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Document(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $collectionId = 'collectionId-821242276'; + $documentId = 'documentId506676927'; + $document = new Document(); + $request = (new CreateDocumentRequest()) + ->setParent($parent) + ->setCollectionId($collectionId) + ->setDocumentId($documentId) + ->setDocument($document); + $response = $gapicClient->createDocument($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/CreateDocument', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getCollectionId(); + $this->assertProtobufEquals($collectionId, $actualValue); + $actualValue = $actualRequestObject->getDocumentId(); + $this->assertProtobufEquals($documentId, $actualValue); + $actualValue = $actualRequestObject->getDocument(); + $this->assertProtobufEquals($document, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDocumentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $collectionId = 'collectionId-821242276'; + $documentId = 'documentId506676927'; + $document = new Document(); + $request = (new CreateDocumentRequest()) + ->setParent($parent) + ->setCollectionId($collectionId) + ->setDocumentId($documentId) + ->setDocument($document); + try { + $gapicClient->createDocument($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDocumentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new DeleteDocumentRequest()) + ->setName($name); + $gapicClient->deleteDocument($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/DeleteDocument', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDocumentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new DeleteDocumentRequest()) + ->setName($name); + try { + $gapicClient->deleteDocument($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDocumentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Document(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new GetDocumentRequest()) + ->setName($name); + $response = $gapicClient->getDocument($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/GetDocument', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDocumentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + $request = (new GetDocumentRequest()) + ->setName($name); + try { + $gapicClient->getDocument($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCollectionIdsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $collectionIdsElement = 'collectionIdsElement1368994900'; + $collectionIds = [ + $collectionIdsElement, + ]; + $expectedResponse = new ListCollectionIdsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setCollectionIds($collectionIds); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListCollectionIdsRequest()) + ->setParent($parent); + $response = $gapicClient->listCollectionIds($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCollectionIds()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/ListCollectionIds', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCollectionIdsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $request = (new ListCollectionIdsRequest()) + ->setParent($parent); + try { + $gapicClient->listCollectionIds($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDocumentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $documentsElement = new Document(); + $documents = [ + $documentsElement, + ]; + $expectedResponse = new ListDocumentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDocuments($documents); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $collectionId = 'collectionId-821242276'; + $request = (new ListDocumentsRequest()) + ->setParent($parent) + ->setCollectionId($collectionId); + $response = $gapicClient->listDocuments($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDocuments()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/ListDocuments', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getCollectionId(); + $this->assertProtobufEquals($collectionId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDocumentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $collectionId = 'collectionId-821242276'; + $request = (new ListDocumentsRequest()) + ->setParent($parent) + ->setCollectionId($collectionId); + try { + $gapicClient->listDocuments($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listenTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListenResponse(); + $transport->addResponse($expectedResponse); + $expectedResponse2 = new ListenResponse(); + $transport->addResponse($expectedResponse2); + $expectedResponse3 = new ListenResponse(); + $transport->addResponse($expectedResponse3); + // Mock request + $database = 'database1789464955'; + $request = new ListenRequest(); + $request->setDatabase($database); + $database2 = 'database21688906350'; + $request2 = new ListenRequest(); + $request2->setDatabase($database2); + $database3 = 'database31688906351'; + $request3 = new ListenRequest(); + $request3->setDatabase($database3); + $bidi = $gapicClient->listen(); + $this->assertInstanceOf(BidiStream::class, $bidi); + $bidi->write($request); + $responses = []; + $responses[] = $bidi->read(); + $bidi->writeAll([ + $request2, + $request3, + ]); + foreach ($bidi->closeWriteAndReadAll() as $response) { + $responses[] = $response; + } + + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $createStreamRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($createStreamRequests)); + $streamFuncCall = $createStreamRequests[0]->getFuncCall(); + $streamRequestObject = $createStreamRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/Listen', $streamFuncCall); + $this->assertNull($streamRequestObject); + $callObjects = $transport->popCallObjects(); + $this->assertSame(1, count($callObjects)); + $bidiCall = $callObjects[0]; + $writeRequests = $bidiCall->popReceivedCalls(); + $expectedRequests = []; + $expectedRequests[] = $request; + $expectedRequests[] = $request2; + $expectedRequests[] = $request3; + $this->assertEquals($expectedRequests, $writeRequests); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listenExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + $bidi = $gapicClient->listen(); + $results = $bidi->closeWriteAndReadAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function partitionQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $partitionsElement = new Cursor(); + $partitions = [ + $partitionsElement, + ]; + $expectedResponse = new PartitionQueryResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setPartitions($partitions); + $transport->addResponse($expectedResponse); + $request = new PartitionQueryRequest(); + $response = $gapicClient->partitionQuery($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getPartitions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/PartitionQuery', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function partitionQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new PartitionQueryRequest(); + try { + $gapicClient->partitionQuery($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rollbackTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $database = 'database1789464955'; + $transaction = '-34'; + $request = (new RollbackRequest()) + ->setDatabase($database) + ->setTransaction($transaction); + $gapicClient->rollback($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/Rollback', $actualFuncCall); + $actualValue = $actualRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $actualValue = $actualRequestObject->getTransaction(); + $this->assertProtobufEquals($transaction, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rollbackExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $database = 'database1789464955'; + $transaction = '-34'; + $request = (new RollbackRequest()) + ->setDatabase($database) + ->setTransaction($transaction); + try { + $gapicClient->rollback($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runAggregationQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction2 = '17'; + $expectedResponse = new RunAggregationQueryResponse(); + $expectedResponse->setTransaction($transaction2); + $transport->addResponse($expectedResponse); + $transaction3 = '18'; + $expectedResponse2 = new RunAggregationQueryResponse(); + $expectedResponse2->setTransaction($transaction3); + $transport->addResponse($expectedResponse2); + $transaction4 = '19'; + $expectedResponse3 = new RunAggregationQueryResponse(); + $expectedResponse3->setTransaction($transaction4); + $transport->addResponse($expectedResponse3); + // Mock request + $parent = 'parent-995424086'; + $request = (new RunAggregationQueryRequest()) + ->setParent($parent); + $serverStream = $gapicClient->runAggregationQuery($request); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/RunAggregationQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runAggregationQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + // Mock request + $parent = 'parent-995424086'; + $request = (new RunAggregationQueryRequest()) + ->setParent($parent); + $serverStream = $gapicClient->runAggregationQuery($request); + $results = $serverStream->readAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction2 = '17'; + $skippedResults = 880286183; + $done = true; + $expectedResponse = new RunQueryResponse(); + $expectedResponse->setTransaction($transaction2); + $expectedResponse->setSkippedResults($skippedResults); + $expectedResponse->setDone($done); + $transport->addResponse($expectedResponse); + $transaction3 = '18'; + $skippedResults2 = 153532454; + $done2 = false; + $expectedResponse2 = new RunQueryResponse(); + $expectedResponse2->setTransaction($transaction3); + $expectedResponse2->setSkippedResults($skippedResults2); + $expectedResponse2->setDone($done2); + $transport->addResponse($expectedResponse2); + $transaction4 = '19'; + $skippedResults3 = 153532453; + $done3 = true; + $expectedResponse3 = new RunQueryResponse(); + $expectedResponse3->setTransaction($transaction4); + $expectedResponse3->setSkippedResults($skippedResults3); + $expectedResponse3->setDone($done3); + $transport->addResponse($expectedResponse3); + // Mock request + $parent = 'parent-995424086'; + $request = (new RunQueryRequest()) + ->setParent($parent); + $serverStream = $gapicClient->runQuery($request); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/RunQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + // Mock request + $parent = 'parent-995424086'; + $request = (new RunQueryRequest()) + ->setParent($parent); + $serverStream = $gapicClient->runQuery($request); + $results = $serverStream->readAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDocumentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Document(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $document = new Document(); + $updateMask = new DocumentMask(); + $request = (new UpdateDocumentRequest()) + ->setDocument($document) + ->setUpdateMask($updateMask); + $response = $gapicClient->updateDocument($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/UpdateDocument', $actualFuncCall); + $actualValue = $actualRequestObject->getDocument(); + $this->assertProtobufEquals($document, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDocumentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $document = new Document(); + $updateMask = new DocumentMask(); + $request = (new UpdateDocumentRequest()) + ->setDocument($document) + ->setUpdateMask($updateMask); + try { + $gapicClient->updateDocument($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function writeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $streamId = 'streamId-315624902'; + $streamToken = '122'; + $expectedResponse = new WriteResponse(); + $expectedResponse->setStreamId($streamId); + $expectedResponse->setStreamToken($streamToken); + $transport->addResponse($expectedResponse); + $streamId2 = 'streamId21627150189'; + $streamToken2 = '-83'; + $expectedResponse2 = new WriteResponse(); + $expectedResponse2->setStreamId($streamId2); + $expectedResponse2->setStreamToken($streamToken2); + $transport->addResponse($expectedResponse2); + $streamId3 = 'streamId31627150190'; + $streamToken3 = '-82'; + $expectedResponse3 = new WriteResponse(); + $expectedResponse3->setStreamId($streamId3); + $expectedResponse3->setStreamToken($streamToken3); + $transport->addResponse($expectedResponse3); + // Mock request + $database = 'database1789464955'; + $request = new WriteRequest(); + $request->setDatabase($database); + $database2 = 'database21688906350'; + $request2 = new WriteRequest(); + $request2->setDatabase($database2); + $database3 = 'database31688906351'; + $request3 = new WriteRequest(); + $request3->setDatabase($database3); + $bidi = $gapicClient->write(); + $this->assertInstanceOf(BidiStream::class, $bidi); + $bidi->write($request); + $responses = []; + $responses[] = $bidi->read(); + $bidi->writeAll([ + $request2, + $request3, + ]); + foreach ($bidi->closeWriteAndReadAll() as $response) { + $responses[] = $response; + } + + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $createStreamRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($createStreamRequests)); + $streamFuncCall = $createStreamRequests[0]->getFuncCall(); + $streamRequestObject = $createStreamRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/Write', $streamFuncCall); + $this->assertNull($streamRequestObject); + $callObjects = $transport->popCallObjects(); + $this->assertSame(1, count($callObjects)); + $bidiCall = $callObjects[0]; + $writeRequests = $bidiCall->popReceivedCalls(); + $expectedRequests = []; + $expectedRequests[] = $request; + $expectedRequests[] = $request2; + $expectedRequests[] = $request3; + $this->assertEquals($expectedRequests, $writeRequests); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function writeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + $bidi = $gapicClient->write(); + $results = $bidi->closeWriteAndReadAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchWriteAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchWriteResponse(); + $transport->addResponse($expectedResponse); + $request = new BatchWriteRequest(); + $response = $gapicClient->batchWriteAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/BatchWrite', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Firestore/v1/tests/Unit/V1/FirestoreClientTest.php b/owl-bot-staging/Firestore/v1/tests/Unit/V1/FirestoreClientTest.php new file mode 100644 index 000000000000..e328eb47242a --- /dev/null +++ b/owl-bot-staging/Firestore/v1/tests/Unit/V1/FirestoreClientTest.php @@ -0,0 +1,1219 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return FirestoreClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new FirestoreClient($options); + } + + /** @test */ + public function batchGetDocumentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $missing = 'missing1069449574'; + $transaction2 = '17'; + $expectedResponse = new BatchGetDocumentsResponse(); + $expectedResponse->setMissing($missing); + $expectedResponse->setTransaction($transaction2); + $transport->addResponse($expectedResponse); + $missing2 = 'missing21243859865'; + $transaction3 = '18'; + $expectedResponse2 = new BatchGetDocumentsResponse(); + $expectedResponse2->setMissing($missing2); + $expectedResponse2->setTransaction($transaction3); + $transport->addResponse($expectedResponse2); + $missing3 = 'missing31243859866'; + $transaction4 = '19'; + $expectedResponse3 = new BatchGetDocumentsResponse(); + $expectedResponse3->setMissing($missing3); + $expectedResponse3->setTransaction($transaction4); + $transport->addResponse($expectedResponse3); + // Mock request + $database = 'database1789464955'; + $documents = []; + $serverStream = $gapicClient->batchGetDocuments($database, $documents); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/BatchGetDocuments', $actualFuncCall); + $actualValue = $actualRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $actualValue = $actualRequestObject->getDocuments(); + $this->assertProtobufEquals($documents, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchGetDocumentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + // Mock request + $database = 'database1789464955'; + $documents = []; + $serverStream = $gapicClient->batchGetDocuments($database, $documents); + $results = $serverStream->readAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchWriteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new BatchWriteResponse(); + $transport->addResponse($expectedResponse); + $response = $gapicClient->batchWrite(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/BatchWrite', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function batchWriteExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->batchWrite(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function beginTransactionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction = '-34'; + $expectedResponse = new BeginTransactionResponse(); + $expectedResponse->setTransaction($transaction); + $transport->addResponse($expectedResponse); + // Mock request + $database = 'database1789464955'; + $response = $gapicClient->beginTransaction($database); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/BeginTransaction', $actualFuncCall); + $actualValue = $actualRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function beginTransactionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $database = 'database1789464955'; + try { + $gapicClient->beginTransaction($database); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function commitTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new CommitResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $database = 'database1789464955'; + $writes = []; + $response = $gapicClient->commit($database, $writes); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/Commit', $actualFuncCall); + $actualValue = $actualRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $actualValue = $actualRequestObject->getWrites(); + $this->assertProtobufEquals($writes, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function commitExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $database = 'database1789464955'; + $writes = []; + try { + $gapicClient->commit($database, $writes); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDocumentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Document(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $collectionId = 'collectionId-821242276'; + $documentId = 'documentId506676927'; + $document = new Document(); + $response = $gapicClient->createDocument($parent, $collectionId, $documentId, $document); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/CreateDocument', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getCollectionId(); + $this->assertProtobufEquals($collectionId, $actualValue); + $actualValue = $actualRequestObject->getDocumentId(); + $this->assertProtobufEquals($documentId, $actualValue); + $actualValue = $actualRequestObject->getDocument(); + $this->assertProtobufEquals($document, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createDocumentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $collectionId = 'collectionId-821242276'; + $documentId = 'documentId506676927'; + $document = new Document(); + try { + $gapicClient->createDocument($parent, $collectionId, $documentId, $document); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDocumentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $gapicClient->deleteDocument($name); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/DeleteDocument', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteDocumentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + try { + $gapicClient->deleteDocument($name); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDocumentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new Document(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $response = $gapicClient->getDocument($name); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/GetDocument', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDocumentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $name = 'name3373707'; + try { + $gapicClient->getDocument($name); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCollectionIdsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $collectionIdsElement = 'collectionIdsElement1368994900'; + $collectionIds = [ + $collectionIdsElement, + ]; + $expectedResponse = new ListCollectionIdsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setCollectionIds($collectionIds); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $response = $gapicClient->listCollectionIds($parent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getCollectionIds()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/ListCollectionIds', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listCollectionIdsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + try { + $gapicClient->listCollectionIds($parent); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDocumentsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $documentsElement = new Document(); + $documents = [ + $documentsElement, + ]; + $expectedResponse = new ListDocumentsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDocuments($documents); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $collectionId = 'collectionId-821242276'; + $response = $gapicClient->listDocuments($parent, $collectionId); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDocuments()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/ListDocuments', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getCollectionId(); + $this->assertProtobufEquals($collectionId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDocumentsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $collectionId = 'collectionId-821242276'; + try { + $gapicClient->listDocuments($parent, $collectionId); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listenTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListenResponse(); + $transport->addResponse($expectedResponse); + $expectedResponse2 = new ListenResponse(); + $transport->addResponse($expectedResponse2); + $expectedResponse3 = new ListenResponse(); + $transport->addResponse($expectedResponse3); + // Mock request + $database = 'database1789464955'; + $request = new ListenRequest(); + $request->setDatabase($database); + $database2 = 'database21688906350'; + $request2 = new ListenRequest(); + $request2->setDatabase($database2); + $database3 = 'database31688906351'; + $request3 = new ListenRequest(); + $request3->setDatabase($database3); + $bidi = $gapicClient->listen(); + $this->assertInstanceOf(BidiStream::class, $bidi); + $bidi->write($request); + $responses = []; + $responses[] = $bidi->read(); + $bidi->writeAll([ + $request2, + $request3, + ]); + foreach ($bidi->closeWriteAndReadAll() as $response) { + $responses[] = $response; + } + + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $createStreamRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($createStreamRequests)); + $streamFuncCall = $createStreamRequests[0]->getFuncCall(); + $streamRequestObject = $createStreamRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/Listen', $streamFuncCall); + $this->assertNull($streamRequestObject); + $callObjects = $transport->popCallObjects(); + $this->assertSame(1, count($callObjects)); + $bidiCall = $callObjects[0]; + $writeRequests = $bidiCall->popReceivedCalls(); + $expectedRequests = []; + $expectedRequests[] = $request; + $expectedRequests[] = $request2; + $expectedRequests[] = $request3; + $this->assertEquals($expectedRequests, $writeRequests); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listenExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + $bidi = $gapicClient->listen(); + $results = $bidi->closeWriteAndReadAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function partitionQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $partitionsElement = new Cursor(); + $partitions = [ + $partitionsElement, + ]; + $expectedResponse = new PartitionQueryResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setPartitions($partitions); + $transport->addResponse($expectedResponse); + $response = $gapicClient->partitionQuery(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getPartitions()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/PartitionQuery', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function partitionQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + try { + $gapicClient->partitionQuery(); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rollbackTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $database = 'database1789464955'; + $transaction = '-34'; + $gapicClient->rollback($database, $transaction); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/Rollback', $actualFuncCall); + $actualValue = $actualRequestObject->getDatabase(); + $this->assertProtobufEquals($database, $actualValue); + $actualValue = $actualRequestObject->getTransaction(); + $this->assertProtobufEquals($transaction, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rollbackExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $database = 'database1789464955'; + $transaction = '-34'; + try { + $gapicClient->rollback($database, $transaction); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runAggregationQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction2 = '17'; + $expectedResponse = new RunAggregationQueryResponse(); + $expectedResponse->setTransaction($transaction2); + $transport->addResponse($expectedResponse); + $transaction3 = '18'; + $expectedResponse2 = new RunAggregationQueryResponse(); + $expectedResponse2->setTransaction($transaction3); + $transport->addResponse($expectedResponse2); + $transaction4 = '19'; + $expectedResponse3 = new RunAggregationQueryResponse(); + $expectedResponse3->setTransaction($transaction4); + $transport->addResponse($expectedResponse3); + // Mock request + $parent = 'parent-995424086'; + $serverStream = $gapicClient->runAggregationQuery($parent); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/RunAggregationQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runAggregationQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + // Mock request + $parent = 'parent-995424086'; + $serverStream = $gapicClient->runAggregationQuery($parent); + $results = $serverStream->readAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction2 = '17'; + $skippedResults = 880286183; + $done = true; + $expectedResponse = new RunQueryResponse(); + $expectedResponse->setTransaction($transaction2); + $expectedResponse->setSkippedResults($skippedResults); + $expectedResponse->setDone($done); + $transport->addResponse($expectedResponse); + $transaction3 = '18'; + $skippedResults2 = 153532454; + $done2 = false; + $expectedResponse2 = new RunQueryResponse(); + $expectedResponse2->setTransaction($transaction3); + $expectedResponse2->setSkippedResults($skippedResults2); + $expectedResponse2->setDone($done2); + $transport->addResponse($expectedResponse2); + $transaction4 = '19'; + $skippedResults3 = 153532453; + $done3 = true; + $expectedResponse3 = new RunQueryResponse(); + $expectedResponse3->setTransaction($transaction4); + $expectedResponse3->setSkippedResults($skippedResults3); + $expectedResponse3->setDone($done3); + $transport->addResponse($expectedResponse3); + // Mock request + $parent = 'parent-995424086'; + $serverStream = $gapicClient->runQuery($parent); + $this->assertInstanceOf(ServerStream::class, $serverStream); + $responses = iterator_to_array($serverStream->readAll()); + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/RunQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + // Mock request + $parent = 'parent-995424086'; + $serverStream = $gapicClient->runQuery($parent); + $results = $serverStream->readAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDocumentTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new Document(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $document = new Document(); + $updateMask = new DocumentMask(); + $response = $gapicClient->updateDocument($document, $updateMask); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/UpdateDocument', $actualFuncCall); + $actualValue = $actualRequestObject->getDocument(); + $this->assertProtobufEquals($document, $actualValue); + $actualValue = $actualRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateDocumentExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $document = new Document(); + $updateMask = new DocumentMask(); + try { + $gapicClient->updateDocument($document, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function writeTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $streamId = 'streamId-315624902'; + $streamToken = '122'; + $expectedResponse = new WriteResponse(); + $expectedResponse->setStreamId($streamId); + $expectedResponse->setStreamToken($streamToken); + $transport->addResponse($expectedResponse); + $streamId2 = 'streamId21627150189'; + $streamToken2 = '-83'; + $expectedResponse2 = new WriteResponse(); + $expectedResponse2->setStreamId($streamId2); + $expectedResponse2->setStreamToken($streamToken2); + $transport->addResponse($expectedResponse2); + $streamId3 = 'streamId31627150190'; + $streamToken3 = '-82'; + $expectedResponse3 = new WriteResponse(); + $expectedResponse3->setStreamId($streamId3); + $expectedResponse3->setStreamToken($streamToken3); + $transport->addResponse($expectedResponse3); + // Mock request + $database = 'database1789464955'; + $request = new WriteRequest(); + $request->setDatabase($database); + $database2 = 'database21688906350'; + $request2 = new WriteRequest(); + $request2->setDatabase($database2); + $database3 = 'database31688906351'; + $request3 = new WriteRequest(); + $request3->setDatabase($database3); + $bidi = $gapicClient->write(); + $this->assertInstanceOf(BidiStream::class, $bidi); + $bidi->write($request); + $responses = []; + $responses[] = $bidi->read(); + $bidi->writeAll([ + $request2, + $request3, + ]); + foreach ($bidi->closeWriteAndReadAll() as $response) { + $responses[] = $response; + } + + $expectedResponses = []; + $expectedResponses[] = $expectedResponse; + $expectedResponses[] = $expectedResponse2; + $expectedResponses[] = $expectedResponse3; + $this->assertEquals($expectedResponses, $responses); + $createStreamRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($createStreamRequests)); + $streamFuncCall = $createStreamRequests[0]->getFuncCall(); + $streamRequestObject = $createStreamRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.v1.Firestore/Write', $streamFuncCall); + $this->assertNull($streamRequestObject); + $callObjects = $transport->popCallObjects(); + $this->assertSame(1, count($callObjects)); + $bidiCall = $callObjects[0]; + $writeRequests = $bidiCall->popReceivedCalls(); + $expectedRequests = []; + $expectedRequests[] = $request; + $expectedRequests[] = $request2; + $expectedRequests[] = $request3; + $this->assertEquals($expectedRequests, $writeRequests); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function writeExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->setStreamingStatus($status); + $this->assertTrue($transport->isExhausted()); + $bidi = $gapicClient->write(); + $results = $bidi->closeWriteAndReadAll(); + try { + iterator_to_array($results); + // If the close stream method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} From c6cfc408526bd98e188059fa655c2151b51d6953 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 25 Jan 2024 20:06:37 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- Firestore/metadata/V1/Firestore.php | Bin 11207 -> 10892 bytes .../src/V1/Gapic/FirestoreGapicClient.php | 18 - .../src/V1/RunAggregationQueryRequest.php | 42 - .../src/V1/RunAggregationQueryResponse.php | 56 - Firestore/src/V1/RunQueryRequest.php | 42 - Firestore/src/V1/RunQueryResponse.php | 56 - .../Google/Firestore/Admin/V1/Database.php | Bin 2647 -> 0 bytes .../Google/Firestore/Admin/V1/Field.php | Bin 1669 -> 0 bytes .../Firestore/Admin/V1/FirestoreAdmin.php | 135 -- .../Google/Firestore/Admin/V1/Index.php | Bin 1837 -> 0 bytes .../Google/Firestore/Admin/V1/Location.php | 28 - .../Google/Firestore/Admin/V1/Operation.php | Bin 3457 -> 0 bytes .../Admin/V1/CreateDatabaseMetadata.php | 33 - .../Admin/V1/CreateDatabaseRequest.php | 196 --- .../Firestore/Admin/V1/CreateIndexRequest.php | 133 -- .../Cloud/Firestore/Admin/V1/Database.php | 657 ------- .../V1/Database/AppEngineIntegrationMode.php | 69 - .../Admin/V1/Database/ConcurrencyMode.php | 77 - .../Admin/V1/Database/DatabaseType.php | 67 - .../V1/Database/DeleteProtectionState.php | 64 - .../PointInTimeRecoveryEnablement.php | 70 - .../Admin/V1/DeleteDatabaseMetadata.php | 33 - .../Admin/V1/DeleteDatabaseRequest.php | 129 -- .../Firestore/Admin/V1/DeleteIndexRequest.php | 87 - .../Admin/V1/ExportDocumentsMetadata.php | 403 ----- .../Admin/V1/ExportDocumentsRequest.php | 301 ---- .../Admin/V1/ExportDocumentsResponse.php | 76 - .../Google/Cloud/Firestore/Admin/V1/Field.php | 261 --- .../Firestore/Admin/V1/Field/IndexConfig.php | 208 --- .../Firestore/Admin/V1/Field/TtlConfig.php | 74 - .../Admin/V1/Field/TtlConfig/State.php | 78 - .../Admin/V1/FieldOperationMetadata.php | 373 ---- .../IndexConfigDelta.php | 114 -- .../IndexConfigDelta/ChangeType.php | 64 - .../FieldOperationMetadata/TtlConfigDelta.php | 70 - .../TtlConfigDelta/ChangeType.php | 64 - .../Firestore/Admin/V1/GetDatabaseRequest.php | 87 - .../Firestore/Admin/V1/GetFieldRequest.php | 87 - .../Firestore/Admin/V1/GetIndexRequest.php | 87 - .../Admin/V1/ImportDocumentsMetadata.php | 351 ---- .../Admin/V1/ImportDocumentsRequest.php | 225 --- .../Google/Cloud/Firestore/Admin/V1/Index.php | 268 --- .../Firestore/Admin/V1/Index/ApiScope.php | 59 - .../Firestore/Admin/V1/Index/IndexField.php | 158 -- .../Admin/V1/Index/IndexField/ArrayConfig.php | 57 - .../Admin/V1/Index/IndexField/Order.php | 64 - .../Firestore/Admin/V1/Index/QueryScope.php | 77 - .../Cloud/Firestore/Admin/V1/Index/State.php | 86 - .../Admin/V1/IndexOperationMetadata.php | 287 --- .../Admin/V1/ListDatabasesRequest.php | 86 - .../Admin/V1/ListDatabasesResponse.php | 129 -- .../Firestore/Admin/V1/ListFieldsRequest.php | 217 --- .../Firestore/Admin/V1/ListFieldsResponse.php | 106 -- .../Firestore/Admin/V1/ListIndexesRequest.php | 197 --- .../Admin/V1/ListIndexesResponse.php | 106 -- .../Firestore/Admin/V1/LocationMetadata.php | 34 - .../Firestore/Admin/V1/OperationState.php | 98 -- .../Cloud/Firestore/Admin/V1/Progress.php | 103 -- .../Admin/V1/UpdateDatabaseMetadata.php | 33 - .../Admin/V1/UpdateDatabaseRequest.php | 137 -- .../Firestore/Admin/V1/UpdateFieldRequest.php | 139 -- .../FirestoreAdminClient/create_database.php | 96 - .../V1/FirestoreAdminClient/create_index.php | 94 - .../FirestoreAdminClient/delete_database.php | 84 - .../V1/FirestoreAdminClient/delete_index.php | 75 - .../FirestoreAdminClient/export_documents.php | 94 - .../V1/FirestoreAdminClient/get_database.php | 72 - .../V1/FirestoreAdminClient/get_field.php | 77 - .../V1/FirestoreAdminClient/get_index.php | 77 - .../FirestoreAdminClient/import_documents.php | 85 - .../FirestoreAdminClient/list_databases.php | 72 - .../V1/FirestoreAdminClient/list_fields.php | 89 - .../V1/FirestoreAdminClient/list_indexes.php | 81 - .../FirestoreAdminClient/update_database.php | 71 - .../V1/FirestoreAdminClient/update_field.php | 124 -- .../src/V1/Client/FirestoreAdminClient.php | 789 --------- .../v1/Admin/src/V1/FirestoreAdminClient.php | 34 - .../V1/Gapic/FirestoreAdminGapicClient.php | 1444 ---------------- .../v1/Admin/src/V1/gapic_metadata.json | 88 - .../firestore_admin_client_config.json | 116 -- .../firestore_admin_descriptor_config.php | 250 --- .../firestore_admin_rest_client_config.php | 221 --- .../V1/Client/FirestoreAdminClientTest.php | 1540 ----------------- .../Unit/V1/FirestoreAdminClientTest.php | 1382 --------------- .../Google/Firestore/V1/AggregationResult.php | 33 - .../Google/Firestore/V1/BloomFilter.php | 34 - .../Google/Firestore/V1/Common.php | Bin 1296 -> 0 bytes .../Google/Firestore/V1/Document.php | Bin 1930 -> 0 bytes .../Google/Firestore/V1/Firestore.php | Bin 10892 -> 0 bytes .../GPBMetadata/Google/Firestore/V1/Query.php | Bin 3795 -> 0 bytes .../GPBMetadata/Google/Firestore/V1/Write.php | Bin 2679 -> 0 bytes .../Cloud/Firestore/V1/AggregationResult.php | 86 - .../Google/Cloud/Firestore/V1/ArrayValue.php | 67 - .../Firestore/V1/BatchGetDocumentsRequest.php | 296 ---- .../V1/BatchGetDocumentsResponse.php | 214 --- .../Cloud/Firestore/V1/BatchWriteRequest.php | 152 -- .../Cloud/Firestore/V1/BatchWriteResponse.php | 118 -- .../Firestore/V1/BeginTransactionRequest.php | 134 -- .../Firestore/V1/BeginTransactionResponse.php | 68 - .../Google/Cloud/Firestore/V1/BitSequence.php | 124 -- .../Google/Cloud/Firestore/V1/BloomFilter.php | 119 -- .../Cloud/Firestore/V1/CommitRequest.php | 161 -- .../Cloud/Firestore/V1/CommitResponse.php | 123 -- .../Firestore/V1/CreateDocumentRequest.php | 248 --- .../src/Google/Cloud/Firestore/V1/Cursor.php | 113 -- .../Firestore/V1/DeleteDocumentRequest.php | 134 -- .../Google/Cloud/Firestore/V1/Document.php | 290 ---- .../Cloud/Firestore/V1/DocumentChange.php | 154 -- .../Cloud/Firestore/V1/DocumentDelete.php | 158 -- .../Cloud/Firestore/V1/DocumentMask.php | 80 - .../Cloud/Firestore/V1/DocumentRemove.php | 160 -- .../Cloud/Firestore/V1/DocumentTransform.php | 109 -- .../V1/DocumentTransform/FieldTransform.php | 417 ----- .../FieldTransform/ServerValue.php | 59 - .../Cloud/Firestore/V1/ExistenceFilter.php | 209 --- .../Cloud/Firestore/V1/GetDocumentRequest.php | 208 --- .../Firestore/V1/ListCollectionIdsRequest.php | 219 --- .../V1/ListCollectionIdsResponse.php | 102 -- .../Firestore/V1/ListDocumentsRequest.php | 462 ----- .../Firestore/V1/ListDocumentsResponse.php | 106 -- .../Cloud/Firestore/V1/ListenRequest.php | 180 -- .../Cloud/Firestore/V1/ListenResponse.php | 219 --- .../Google/Cloud/Firestore/V1/MapValue.php | 83 - .../Firestore/V1/PartitionQueryRequest.php | 364 ---- .../Firestore/V1/PartitionQueryResponse.php | 162 -- .../Cloud/Firestore/V1/Precondition.php | 114 -- .../Cloud/Firestore/V1/RollbackRequest.php | 121 -- .../V1/RunAggregationQueryRequest.php | 256 --- .../V1/RunAggregationQueryResponse.php | 192 -- .../Cloud/Firestore/V1/RunQueryRequest.php | 258 --- .../Cloud/Firestore/V1/RunQueryResponse.php | 275 --- .../V1/StructuredAggregationQuery.php | 122 -- .../Aggregation.php | 290 ---- .../Aggregation/Avg.php | 86 - .../Aggregation/Count.php | 169 -- .../Aggregation/Sum.php | 95 - .../Cloud/Firestore/V1/StructuredQuery.php | 599 ------- .../V1/StructuredQuery/CollectionSelector.php | 116 -- .../V1/StructuredQuery/CompositeFilter.php | 112 -- .../CompositeFilter/Operator.php | 68 - .../V1/StructuredQuery/Direction.php | 64 - .../V1/StructuredQuery/FieldFilter.php | 158 -- .../StructuredQuery/FieldFilter/Operator.php | 146 -- .../V1/StructuredQuery/FieldReference.php | 86 - .../Firestore/V1/StructuredQuery/Filter.php | 144 -- .../Firestore/V1/StructuredQuery/Order.php | 114 -- .../V1/StructuredQuery/Projection.php | 78 - .../V1/StructuredQuery/UnaryFilter.php | 112 -- .../StructuredQuery/UnaryFilter/Operator.php | 84 - .../src/Google/Cloud/Firestore/V1/Target.php | 407 ----- .../Firestore/V1/Target/DocumentsTarget.php | 82 - .../Cloud/Firestore/V1/Target/QueryTarget.php | 132 -- .../Cloud/Firestore/V1/TargetChange.php | 267 --- .../V1/TargetChange/TargetChangeType.php | 86 - .../Cloud/Firestore/V1/TransactionOptions.php | 108 -- .../V1/TransactionOptions/PBReadOnly.php | 90 - .../V1/TransactionOptions/ReadOnly.php | 9 - .../V1/TransactionOptions/ReadWrite.php | 72 - .../Firestore/V1/UpdateDocumentRequest.php | 268 --- .../src/Google/Cloud/Firestore/V1/Value.php | 435 ----- .../src/Google/Cloud/Firestore/V1/Write.php | 314 ---- .../Cloud/Firestore/V1/WriteRequest.php | 277 --- .../Cloud/Firestore/V1/WriteResponse.php | 203 --- .../Google/Cloud/Firestore/V1/WriteResult.php | 131 -- .../FirestoreClient/batch_get_documents.php | 86 - .../V1/FirestoreClient/batch_write.php | 66 - .../V1/FirestoreClient/begin_transaction.php | 71 - .../v1/samples/V1/FirestoreClient/commit.php | 74 - .../V1/FirestoreClient/create_document.php | 83 - .../V1/FirestoreClient/delete_document.php | 69 - .../V1/FirestoreClient/get_document.php | 71 - .../FirestoreClient/list_collection_ids.php | 77 - .../V1/FirestoreClient/list_documents.php | 89 - .../v1/samples/V1/FirestoreClient/listen.php | 78 - .../V1/FirestoreClient/partition_query.php | 64 - .../samples/V1/FirestoreClient/rollback.php | 72 - .../FirestoreClient/run_aggregation_query.php | 92 - .../samples/V1/FirestoreClient/run_query.php | 80 - .../V1/FirestoreClient/update_document.php | 62 - .../v1/samples/V1/FirestoreClient/write.php | 79 - .../v1/src/V1/Client/FirestoreClient.php | 619 ------- .../Firestore/v1/src/V1/FirestoreClient.php | 34 - .../v1/src/V1/Gapic/FirestoreGapicClient.php | 1357 --------------- .../Firestore/v1/src/V1/gapic_metadata.json | 98 -- .../V1/resources/firestore_client_config.json | 174 -- .../resources/firestore_descriptor_config.php | 252 --- .../firestore_rest_client_config.php | 272 --- .../Unit/V1/Client/FirestoreClientTest.php | 1323 -------------- .../v1/tests/Unit/V1/FirestoreClientTest.php | 1219 ------------- 189 files changed, 33677 deletions(-) delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Database.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Field.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/FirestoreAdmin.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Index.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Location.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Operation.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseMetadata.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateIndexRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/AppEngineIntegrationMode.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/ConcurrencyMode.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DatabaseType.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DeleteProtectionState.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/PointInTimeRecoveryEnablement.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseMetadata.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteIndexRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsMetadata.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/IndexConfig.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig/State.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta/ChangeType.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta/ChangeType.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetDatabaseRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetFieldRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetIndexRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsMetadata.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/ApiScope.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/ArrayConfig.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/Order.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/QueryScope.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/State.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/IndexOperationMetadata.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/LocationMetadata.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/OperationState.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Progress.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseMetadata.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateFieldRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_database.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_index.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_database.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_index.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/export_documents.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_database.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_field.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_index.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/import_documents.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_databases.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_fields.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_indexes.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_database.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_field.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/Client/FirestoreAdminClient.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/FirestoreAdminClient.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/Gapic/FirestoreAdminGapicClient.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_client_config.json delete mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_descriptor_config.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_rest_client_config.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/Client/FirestoreAdminClientTest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/FirestoreAdminClientTest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/AggregationResult.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/BloomFilter.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Common.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Document.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Firestore.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Query.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Write.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/AggregationResult.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ArrayValue.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BitSequence.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BloomFilter.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CreateDocumentRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Cursor.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DeleteDocumentRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Document.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentChange.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentDelete.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentMask.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentRemove.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform/ServerValue.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExistenceFilter.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/GetDocumentRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/MapValue.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Precondition.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RollbackRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Avg.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Count.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Sum.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CollectionSelector.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter/Operator.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Direction.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter/Operator.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldReference.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Filter.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Order.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Projection.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter/Operator.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/DocumentsTarget.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/QueryTarget.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange/TargetChangeType.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/PBReadOnly.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/ReadOnly.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/ReadWrite.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/UpdateDocumentRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Value.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Write.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResult.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_get_documents.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_write.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/begin_transaction.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/commit.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/create_document.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/delete_document.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/get_document.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_collection_ids.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_documents.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/listen.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/partition_query.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/rollback.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_aggregation_query.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_query.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/update_document.php delete mode 100644 owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/write.php delete mode 100644 owl-bot-staging/Firestore/v1/src/V1/Client/FirestoreClient.php delete mode 100644 owl-bot-staging/Firestore/v1/src/V1/FirestoreClient.php delete mode 100644 owl-bot-staging/Firestore/v1/src/V1/Gapic/FirestoreGapicClient.php delete mode 100644 owl-bot-staging/Firestore/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Firestore/v1/src/V1/resources/firestore_client_config.json delete mode 100644 owl-bot-staging/Firestore/v1/src/V1/resources/firestore_descriptor_config.php delete mode 100644 owl-bot-staging/Firestore/v1/src/V1/resources/firestore_rest_client_config.php delete mode 100644 owl-bot-staging/Firestore/v1/tests/Unit/V1/Client/FirestoreClientTest.php delete mode 100644 owl-bot-staging/Firestore/v1/tests/Unit/V1/FirestoreClientTest.php diff --git a/Firestore/metadata/V1/Firestore.php b/Firestore/metadata/V1/Firestore.php index 2dd0f279b6c70c5f754a59c8ff57442a3adfb6b4..1e950f57c6bf8e2bd32450edff6065c641097719 100644 GIT binary patch delta 84 zcmX>e-V?eZmwEFBW&=i+dEQ*g6TOuuv$HsetReadTime($optionalArgs['readTime']); } - if (isset($optionalArgs['mode'])) { - $request->setMode($optionalArgs['mode']); - } - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startCall('RunAggregationQuery', RunAggregationQueryResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); @@ -1202,11 +1193,6 @@ public function runAggregationQuery($parent, array $optionalArgs = []) * This must be a microsecond precision timestamp within the past one hour, * or if Point-in-Time Recovery is enabled, can additionally be a whole * minute timestamp within the past 7 days. - * @type int $mode - * Optional. The mode in which the query request is processed. This field is - * optional, and when not provided, it defaults to `NORMAL` mode where no - * additional statistics will be returned with the query results. - * For allowed values, use constants defined on {@see \Google\Cloud\Firestore\V1\QueryMode} * @type int $timeoutMillis * Timeout to use for this call. * } @@ -1237,10 +1223,6 @@ public function runQuery($parent, array $optionalArgs = []) $request->setReadTime($optionalArgs['readTime']); } - if (isset($optionalArgs['mode'])) { - $request->setMode($optionalArgs['mode']); - } - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startCall('RunQuery', RunQueryResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); diff --git a/Firestore/src/V1/RunAggregationQueryRequest.php b/Firestore/src/V1/RunAggregationQueryRequest.php index 053fe63a6081..366f62b4698a 100644 --- a/Firestore/src/V1/RunAggregationQueryRequest.php +++ b/Firestore/src/V1/RunAggregationQueryRequest.php @@ -27,14 +27,6 @@ class RunAggregationQueryRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; */ private $parent = ''; - /** - * Optional. The mode in which the query request is processed. This field is - * optional, and when not provided, it defaults to `NORMAL` mode where no - * additional statistics will be returned with the query results. - * - * Generated from protobuf field .google.firestore.v1.QueryMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $mode = 0; protected $query_type; protected $consistency_selector; @@ -65,10 +57,6 @@ class RunAggregationQueryRequest extends \Google\Protobuf\Internal\Message * This must be a microsecond precision timestamp within the past one hour, * or if Point-in-Time Recovery is enabled, can additionally be a whole * minute timestamp within the past 7 days. - * @type int $mode - * Optional. The mode in which the query request is processed. This field is - * optional, and when not provided, it defaults to `NORMAL` mode where no - * additional statistics will be returned with the query results. * } */ public function __construct($data = NULL) { @@ -248,36 +236,6 @@ public function setReadTime($var) return $this; } - /** - * Optional. The mode in which the query request is processed. This field is - * optional, and when not provided, it defaults to `NORMAL` mode where no - * additional statistics will be returned with the query results. - * - * Generated from protobuf field .google.firestore.v1.QueryMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMode() - { - return $this->mode; - } - - /** - * Optional. The mode in which the query request is processed. This field is - * optional, and when not provided, it defaults to `NORMAL` mode where no - * additional statistics will be returned with the query results. - * - * Generated from protobuf field .google.firestore.v1.QueryMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\QueryMode::class); - $this->mode = $var; - - return $this; - } - /** * @return string */ diff --git a/Firestore/src/V1/RunAggregationQueryResponse.php b/Firestore/src/V1/RunAggregationQueryResponse.php index ffb0f164ecdb..878f1d28a2a2 100644 --- a/Firestore/src/V1/RunAggregationQueryResponse.php +++ b/Firestore/src/V1/RunAggregationQueryResponse.php @@ -43,15 +43,6 @@ class RunAggregationQueryResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; */ private $read_time = null; - /** - * Query plan and execution statistics. Note that the returned stats are - * subject to change as Firestore evolves. - * This is only present when the request specifies a mode other than `NORMAL` - * and is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.firestore.v1.ResultSetStats stats = 6; - */ - private $stats = null; /** * Constructor. @@ -74,11 +65,6 @@ class RunAggregationQueryResponse extends \Google\Protobuf\Internal\Message * If the query returns no results, a response with `read_time` and no * `result` will be sent, and this represents the time at which the query * was run. - * @type \Google\Cloud\Firestore\V1\ResultSetStats $stats - * Query plan and execution statistics. Note that the returned stats are - * subject to change as Firestore evolves. - * This is only present when the request specifies a mode other than `NORMAL` - * and is sent only once with the last response in the stream. * } */ public function __construct($data = NULL) { @@ -202,47 +188,5 @@ public function setReadTime($var) return $this; } - /** - * Query plan and execution statistics. Note that the returned stats are - * subject to change as Firestore evolves. - * This is only present when the request specifies a mode other than `NORMAL` - * and is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.firestore.v1.ResultSetStats stats = 6; - * @return \Google\Cloud\Firestore\V1\ResultSetStats|null - */ - public function getStats() - { - return $this->stats; - } - - public function hasStats() - { - return isset($this->stats); - } - - public function clearStats() - { - unset($this->stats); - } - - /** - * Query plan and execution statistics. Note that the returned stats are - * subject to change as Firestore evolves. - * This is only present when the request specifies a mode other than `NORMAL` - * and is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.firestore.v1.ResultSetStats stats = 6; - * @param \Google\Cloud\Firestore\V1\ResultSetStats $var - * @return $this - */ - public function setStats($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ResultSetStats::class); - $this->stats = $var; - - return $this; - } - } diff --git a/Firestore/src/V1/RunQueryRequest.php b/Firestore/src/V1/RunQueryRequest.php index 28e17d875fbb..bf8cbacbbf85 100644 --- a/Firestore/src/V1/RunQueryRequest.php +++ b/Firestore/src/V1/RunQueryRequest.php @@ -26,14 +26,6 @@ class RunQueryRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; */ private $parent = ''; - /** - * Optional. The mode in which the query request is processed. This field is - * optional, and when not provided, it defaults to `NORMAL` mode where no - * additional statistics will be returned with the query results. - * - * Generated from protobuf field .google.firestore.v1.QueryMode mode = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $mode = 0; protected $query_type; protected $consistency_selector; @@ -65,10 +57,6 @@ class RunQueryRequest extends \Google\Protobuf\Internal\Message * This must be a microsecond precision timestamp within the past one hour, * or if Point-in-Time Recovery is enabled, can additionally be a whole * minute timestamp within the past 7 days. - * @type int $mode - * Optional. The mode in which the query request is processed. This field is - * optional, and when not provided, it defaults to `NORMAL` mode where no - * additional statistics will be returned with the query results. * } */ public function __construct($data = NULL) { @@ -250,36 +238,6 @@ public function setReadTime($var) return $this; } - /** - * Optional. The mode in which the query request is processed. This field is - * optional, and when not provided, it defaults to `NORMAL` mode where no - * additional statistics will be returned with the query results. - * - * Generated from protobuf field .google.firestore.v1.QueryMode mode = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getMode() - { - return $this->mode; - } - - /** - * Optional. The mode in which the query request is processed. This field is - * optional, and when not provided, it defaults to `NORMAL` mode where no - * additional statistics will be returned with the query results. - * - * Generated from protobuf field .google.firestore.v1.QueryMode mode = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\QueryMode::class); - $this->mode = $var; - - return $this; - } - /** * @return string */ diff --git a/Firestore/src/V1/RunQueryResponse.php b/Firestore/src/V1/RunQueryResponse.php index 38200db768f4..ea86e37c0945 100644 --- a/Firestore/src/V1/RunQueryResponse.php +++ b/Firestore/src/V1/RunQueryResponse.php @@ -50,15 +50,6 @@ class RunQueryResponse extends \Google\Protobuf\Internal\Message * Generated from protobuf field int32 skipped_results = 4; */ private $skipped_results = 0; - /** - * Query plan and execution statistics. Note that the returned stats are - * subject to change as Firestore evolves. - * This is only present when the request specifies a mode other than `NORMAL` - * and is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.firestore.v1.ResultSetStats stats = 7; - */ - private $stats = null; protected $continuation_selector; /** @@ -88,11 +79,6 @@ class RunQueryResponse extends \Google\Protobuf\Internal\Message * @type bool $done * If present, Firestore has completely finished the request and no more * documents will be returned. - * @type \Google\Cloud\Firestore\V1\ResultSetStats $stats - * Query plan and execution statistics. Note that the returned stats are - * subject to change as Firestore evolves. - * This is only present when the request specifies a mode other than `NORMAL` - * and is sent only once with the last response in the stream. * } */ public function __construct($data = NULL) { @@ -277,48 +263,6 @@ public function setDone($var) return $this; } - /** - * Query plan and execution statistics. Note that the returned stats are - * subject to change as Firestore evolves. - * This is only present when the request specifies a mode other than `NORMAL` - * and is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.firestore.v1.ResultSetStats stats = 7; - * @return \Google\Cloud\Firestore\V1\ResultSetStats|null - */ - public function getStats() - { - return $this->stats; - } - - public function hasStats() - { - return isset($this->stats); - } - - public function clearStats() - { - unset($this->stats); - } - - /** - * Query plan and execution statistics. Note that the returned stats are - * subject to change as Firestore evolves. - * This is only present when the request specifies a mode other than `NORMAL` - * and is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.firestore.v1.ResultSetStats stats = 7; - * @param \Google\Cloud\Firestore\V1\ResultSetStats $var - * @return $this - */ - public function setStats($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ResultSetStats::class); - $this->stats = $var; - - return $this; - } - /** * @return string */ diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Database.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Database.php deleted file mode 100644 index 6036be1305fda288922810c3e6ff355d96905536..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2647 zcma)8U31$+6va*`bR80-Hq;3u*(9BbJ5U?9yi{odvLzeM)Rsn8(n&`%8d+XD0$I{X zav*dv{1D!F)Qa0{Ap+t9*=#0?2`J(2}u=HMFWfu!yD}kZwM4`95?n6vRx~R zu$c0ow+O>0m=0XW#!+m=@blP-OviI#$8w!tU>yf|WVsOm@b%cy)U#v9_b>%0o=vJx zaKcGr9|u0H`v7MZsZv|b&mb){@9t z?$a9cY3;1Bo=(-Rz^Q|YnXePiu5YIN%)#J=`Y>I5I=^*wKF(H{1nm4-LLX=T<(AMQ zJp+{jE>!PxWwbDLhLr{S(p>mgSm3@vB|9W=98F47`4DDG&(>>cch`GXEPu8YdH@7dEZB%Xb4 zPW&OMtT3+U^Ki9h*e*c1?@;B8gb{engu_8R>N+zZq2muLpR#4HWwg0CnL8704$&&H zLe~M;nHd$+mSgb$)z(GZfe(I!D~9a})M5KTbZ!#Q8n|QvMO9YW3WcncyVO!Cne5RW z)KVrXC*myhxfKLJJ$5_-DPuBDj#{GR1D5CIJb8p5kQj?RBVm$0Lg+_wZU!M4IX_n( z0%PjEH|WujxS%r3`7vSlq)G2DQu&PKeKAj7kx{5QL!S~*-@|P`uGlo)&TF)kxrdo% z1FeaIE;NO{Wa=lXWFGbUs??I(vLu#2;2xrKTh^q$u4t0k6Lk4lDi=5oEmKf3+EqlU zT-^Bytz2~wMqjj)Uh7EHq+aX9q=8rHml0A_UGB<#U2XyK3M#2mzn={hxoxyD3ou{H z`uC>P(`Eg{>}bl7+AlBc{8m64ckgTiJyjLCr<-!mgk+MbNiF4A(oTR&XuguVKzXIG z9kh8TM1*2@(bg?7qTHvvBFHj8m0RubB{KE|RfQ@#a!-Qlbg83(#!BxdtxD*lq+FVN z2`;u-l3&s4&3kX`pYKktk7K3vXW7u0I`S2%38AU+#_q2U??~M`GW>U_br+y|~zEwflb*w>qpRs{czB*g@qEt2^Nfn;j~jz~AVTav-^>48ze;+O SORdbUZ48S{nvDx|fzW^UXHTdA diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Field.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Field.php deleted file mode 100644 index f9245a9df94009f01eae011a49b15b422adf9533..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1669 zcma)6%Wl&^6eUStnO0S50V)xXp)G2PicQK2mlipR69tJhN=z5XQsg+3bdYOX_Bf(c z`2aqG4NF%11RMT<9qWDtcgBemsSlb(;>_H0=H4^M=gnLH#7CRBMqCnDjP!8#46_r0 z{lH_M?K!v`_4_2iws-1NhXgXll_T6ZGO%8$8&3fmdQo5#6%Rab;1H!x0}?VXAd1yH zrLHn8!V+M;N>z10SRx%?DeR1o<#e=<3vrLCda20+%z}u_ zo{n)qSQNPXqHj(xN}kLs#L|2Uf`KX}a$*gs7pUrVswv5J&=wir+^tcUZwG|wkvOy`|1E{GNoP_8&2zWMimmRwyrGX+ zmINxdIgV?b*?5QM#XspDT5B7cp?5ws+D*M&uh#WS?vAvAmdY(%GwO|6E+rwfpp}jK zv7SpyIkeKy^-8h{`mKMdahQkwtu9b)I^BNWxZ8oC^2W^ zcAU2mxEJZom`7Dbm8vF8sw${d^|;tw0Iit!YCCz0cjG*piN9;3PgKSMH9{kV{sCLH B9gzS4 diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/FirestoreAdmin.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/FirestoreAdmin.php deleted file mode 100644 index 785f61992d5d..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/FirestoreAdmin.php +++ /dev/null @@ -1,135 +0,0 @@ -internalAddGeneratedFile( - ' -È- -/google/firestore/admin/v1/firestore_admin.protogoogle.firestore.admin.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto(google/firestore/admin/v1/database.proto%google/firestore/admin/v1/field.proto%google/firestore/admin/v1/index.proto)google/firestore/admin/v1/operation.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"Q -ListDatabasesRequest9 -parent ( B)àAúA#!firestore.googleapis.com/Database"¨ -CreateDatabaseRequest9 -parent ( B)àAúA#!firestore.googleapis.com/Database: -database ( 2#.google.firestore.admin.v1.DatabaseBàA - database_id ( BàA" -CreateDatabaseMetadata"d -ListDatabasesResponse6 - databases ( 2#.google.firestore.admin.v1.Database - unreachable ( "M -GetDatabaseRequest7 -name ( B)àAúA# -!firestore.googleapis.com/Database"„ -UpdateDatabaseRequest: -database ( 2#.google.firestore.admin.v1.DatabaseBàA/ - update_mask ( 2.google.protobuf.FieldMask" -UpdateDatabaseMetadata"^ -DeleteDatabaseRequest7 -name ( B)àAúA# -!firestore.googleapis.com/Database -etag ( " -DeleteDatabaseMetadata"Œ -CreateIndexRequest@ -parent ( B0àAúA* -(firestore.googleapis.com/CollectionGroup4 -index ( 2 .google.firestore.admin.v1.IndexBàA" -ListIndexesRequest@ -parent ( B0àAúA* -(firestore.googleapis.com/CollectionGroup -filter (  - page_size ( - -page_token ( "a -ListIndexesResponse1 -indexes ( 2 .google.firestore.admin.v1.Index -next_page_token ( "G -GetIndexRequest4 -name ( B&àAúA -firestore.googleapis.com/Index"J -DeleteIndexRequest4 -name ( B&àAúA -firestore.googleapis.com/Index"{ -UpdateFieldRequest4 -field ( 2 .google.firestore.admin.v1.FieldBàA/ - update_mask ( 2.google.protobuf.FieldMask"G -GetFieldRequest4 -name ( B&àAúA -firestore.googleapis.com/Field"Œ -ListFieldsRequest@ -parent ( B0àAúA* -(firestore.googleapis.com/CollectionGroup -filter (  - page_size ( - -page_token ( "_ -ListFieldsResponse0 -fields ( 2 .google.firestore.admin.v1.Field -next_page_token ( "Î -ExportDocumentsRequest7 -name ( B)àAúA# -!firestore.googleapis.com/Database -collection_ids (  -output_uri_prefix (  - namespace_ids ( 1 - snapshot_time ( 2.google.protobuf.Timestamp"š -ImportDocumentsRequest7 -name ( B)àAúA# -!firestore.googleapis.com/Database -collection_ids (  -input_uri_prefix (  - namespace_ids ( 2© -FirestoreAdminÛ - CreateIndex-.google.firestore.admin.v1.CreateIndexRequest.google.longrunning.Operation"~‚Óä“G">/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes:indexÚA parent,indexÊA -IndexIndexOperationMetadata½ - ListIndexes-.google.firestore.admin.v1.ListIndexesRequest..google.firestore.admin.v1.ListIndexesResponse"O‚Óä“@>/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexesÚAparent§ -GetIndex*.google.firestore.admin.v1.GetIndexRequest .google.firestore.admin.v1.Index"M‚Óä“@>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}ÚAname£ - DeleteIndex-.google.firestore.admin.v1.DeleteIndexRequest.google.protobuf.Empty"M‚Óä“@*>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}ÚAname¦ -GetField*.google.firestore.admin.v1.GetFieldRequest .google.firestore.admin.v1.Field"L‚Óä“?=/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}ÚAnameÙ - UpdateField-.google.firestore.admin.v1.UpdateFieldRequest.google.longrunning.Operation"|‚Óä“L2C/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}:fieldÚAfieldÊA -FieldFieldOperationMetadata¹ - -ListFields,.google.firestore.admin.v1.ListFieldsRequest-.google.firestore.admin.v1.ListFieldsResponse"N‚Óä“?=/v1/{parent=projects/*/databases/*/collectionGroups/*}/fieldsÚAparentÝ -ExportDocuments1.google.firestore.admin.v1.ExportDocumentsRequest.google.longrunning.Operation"x‚Óä“6"1/v1/{name=projects/*/databases/*}:exportDocuments:*ÚAnameÊA2 -ExportDocumentsResponseExportDocumentsMetadataÛ -ImportDocuments1.google.firestore.admin.v1.ImportDocumentsRequest.google.longrunning.Operation"v‚Óä“6"1/v1/{name=projects/*/databases/*}:importDocuments:*ÚAnameÊA0 -google.protobuf.EmptyImportDocumentsMetadataÙ -CreateDatabase0.google.firestore.admin.v1.CreateDatabaseRequest.google.longrunning.Operation"v‚Óä“-"!/v1/{parent=projects/*}/databases:databaseÚAparent,database,database_idÊA" -DatabaseCreateDatabaseMetadata“ - GetDatabase-.google.firestore.admin.v1.GetDatabaseRequest#.google.firestore.admin.v1.Database"0‚Óä“#!/v1/{name=projects/*/databases/*}ÚAname¦ - ListDatabases/.google.firestore.admin.v1.ListDatabasesRequest0.google.firestore.admin.v1.ListDatabasesResponse"2‚Óä“#!/v1/{parent=projects/*}/databasesÚAparentÛ -UpdateDatabase0.google.firestore.admin.v1.UpdateDatabaseRequest.google.longrunning.Operation"x‚Óä“62*/v1/{database.name=projects/*/databases/*}:databaseÚAdatabase,update_maskÊA" -DatabaseUpdateDatabaseMetadata¸ -DeleteDatabase0.google.firestore.admin.v1.DeleteDatabaseRequest.google.longrunning.Operation"U‚Óä“#*!/v1/{name=projects/*/databases/*}ÚAnameÊA" -DatabaseDeleteDatabaseMetadatavÊAfirestore.googleapis.comÒAXhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastoreB¥ -com.google.firestore.admin.v1BFirestoreAdminProtoPZ9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb¢GCFSªGoogle.Cloud.Firestore.Admin.V1ÊGoogle\\Cloud\\Firestore\\Admin\\V1ê#Google::Cloud::Firestore::Admin::V1êAL -!firestore.googleapis.com/Location\'projects/{project}/locations/{location}êAq -(firestore.googleapis.com/CollectionGroupEprojects/{project}/databases/{database}/collectionGroups/{collection}bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Index.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Index.php deleted file mode 100644 index 933a1f2181b7e78b568eb1f7603b6a5bebb2df32..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1837 zcmb7F-HzKt6y9VvZF4qM!732`hqTbF3XTFosNOE%*iLGxjZ-^WX)8;XV^6Y!yteVr z!nVrGaEW*YUVwWpc!fR%GvmaGwyd_~BC$`-_nq&YGyeSOhxjyxyJ(0*oVXeG(d+_c zrx?Xalto??pjkej;{JE> zu75_t?s>0ELLdJsaz=pAJ;Q12dKeAI{iir{eK&LMAqU%oHQ1IJ*gozZ0(gO&rbuTb z@DdRH#Q7{B9!fJeqd)gZ>X49R#0|&`+QAW;yFrR6^7Y(#9(oyxLc{<@=;6)*DmYp0 zy*Q#BAEC9JF&hFMfUSoaPC_@ZRh)VWiD`dhnkq>PoRyFKrsy;CVk^eNR^EW#2Ew4(KvFB|R&4 zAO5bx=Wnz{;r${_ESD|vWsB#%_8&K)#&;z&V2>@kRY8?bUHB39f6j4o;iO&^<5rah zZ-4zjypl-dB;qrMu^2>n1a&tiD}0UP53a@2ArC7L8A2ePlH&{RY6f8|2tI zi+tQB09*V25Z-$>)yxyeQjD>7iH2%Wj3-YtWuhA+s_70iH}}raG^XQbRcOJTt*EIf zQ`6FqwdQWS3%AOnvJW@q(TO9Eb=vE@AgJ<0wkC$DIZq8$zN7q8@B;FHa>R6G;(tfwNi-7ep_Fs1(a z6ZW#S`*L-)>@w?|xhbZx_2sflO*^1@)Z~Uql*jbHO=MYkF#{0hr_26775JDIx%#a1 zixbSPa9nx*&PV?qtTaDM(B&kk3=zg72!%E0=)`st9Hy{K@e((*-_ zS-yDO`)i$H+dReIdM&Kp3-rbCs(QEJktCiaNhOmcaVkkV?#*t{VP(-b_e-n$vhdw4 Qo4(Sbd1m3JOIQN@3!f%D+5i9m diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Location.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Location.php deleted file mode 100644 index 3c93ac4fddbd..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Location.php +++ /dev/null @@ -1,28 +0,0 @@ -internalAddGeneratedFile( - ' -À -(google/firestore/admin/v1/location.protogoogle.firestore.admin.v1" -LocationMetadataBÜ -com.google.firestore.admin.v1B LocationProtoPZ9cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb¢GCFSªGoogle.Cloud.Firestore.Admin.V1ÊGoogle\\Cloud\\Firestore\\Admin\\V1ê#Google::Cloud::Firestore::Admin::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Operation.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Operation.php deleted file mode 100644 index d93d92524fae1174838a9b129ba812521514aec7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3457 zcmeHK&2A$_5XN?XE5w*VoAqXe(m1=?1TAAZaDWNf#ql2_65EQMNJN%~@l4xkF`gdH zw3h^w3va=N1Kc=r;KmE^4xEvA3c7nd6KCy&1fo5y4{_S6`nu|?pRW4!xp(5hI;vq8 z`zFIS>YgEXf|2J_MlI@~?y%RxKCRo(!PW9 zJ>uhlQ6J|`dqCX$i$b1y0-I1*m8bx&IlzHuS{T)uyZe}#w#m#+O#*bP5kRLX06Is7 zZ2-$Lg8(%mAovat|9Hc$Lo5_9j&7kxBru3e7%?64E%#&x^-L$gTzgWsH*_sw5fTaw z*TNf{D8v-9k37mf-$9W{O+f}HqNBSE`>yG9$~drm;&DHlTvXHgn8g%|Up6*J*9th& zLmQ!unl@qN4r2ZgkKc}vkJ-?7x24?z;5`1XGlj6CM>+?16b9|Wp$q+KT9Y($?`(Xk z-54QerA>G^nK|&L>q<61ct%Ft6>U4Fs>)MpBX&->`UHNy2b(v}CFMaVs>W%j%Cu8o z6jmQ!jY5Q{VK%O=jl^Vb@*w9~go6$X!uB)-7Euo-12ZbBc z=Y<&8<_S-}N%ET9T-34yxp% z;tA^vU4t%Ra?b$9)E~nA(&xo`tzxvlY*viJdaGF}=~cZ_&b*<_L#kLVXA%m)+(Bi( zaa749SAR`F`m*!NSJV9b;u=e?$h6C_V_yDWqjSHd;C|)QqdqG~ec=@q=PtZOqvzZR z`JuYqi$G&!prnmxWJ|H<*4iW~jMN>@iKK%gRrbFfpnKAT<;rX~nPP3vM z7nOUk9M3*dV?k;ZU^#G2FF2v2mt;}8aLr4S`<@3*AG{76f6>AR=?(&yg$!|T5x3k& z6UD>lFps(co}L6^Kv>Laun<42Jcsz`LK?ay zVLxYq(PrZK6U(7PJ5u4=`92-rBRs;Fh;W;bf4%PZ==-PSOs!OH{gPa($>l*UNu+qT zRf}SUP>%|KL=v5j6zPnu8KXUeFB*R**FzjllTw-%BWaq1(zK&OcaG0OjDGke9$cS> XGyK@dFB%%Lri}YiGMvoM;T+%}ggoogle.firestore.admin.v1.CreateDatabaseMetadata - */ -class CreateDatabaseMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseRequest.php deleted file mode 100644 index 2380588c92cd..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseRequest.php +++ /dev/null @@ -1,196 +0,0 @@ -google.firestore.admin.v1.CreateDatabaseRequest - */ -class CreateDatabaseRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A parent name of the form - * `projects/{project_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The Database to create. - * - * Generated from protobuf field .google.firestore.admin.v1.Database database = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $database = null; - /** - * Required. The ID to use for the database, which will become the final - * component of the database's resource name. - * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ - * with first character a letter and the last a letter or a number. Must not - * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. - * "(default)" database id is also valid. - * - * Generated from protobuf field string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $database_id = ''; - - /** - * @param string $parent Required. A parent name of the form - * `projects/{project_id}` - * Please see {@see FirestoreAdminClient::projectName()} for help formatting this field. - * @param \Google\Cloud\Firestore\Admin\V1\Database $database Required. The Database to create. - * @param string $databaseId Required. The ID to use for the database, which will become the final - * component of the database's resource name. - * - * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ - * with first character a letter and the last a letter or a number. Must not - * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. - * - * "(default)" database id is also valid. - * - * @return \Google\Cloud\Firestore\Admin\V1\CreateDatabaseRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Firestore\Admin\V1\Database $database, string $databaseId): self - { - return (new self()) - ->setParent($parent) - ->setDatabase($database) - ->setDatabaseId($databaseId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. A parent name of the form - * `projects/{project_id}` - * @type \Google\Cloud\Firestore\Admin\V1\Database $database - * Required. The Database to create. - * @type string $database_id - * Required. The ID to use for the database, which will become the final - * component of the database's resource name. - * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ - * with first character a letter and the last a letter or a number. Must not - * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. - * "(default)" database id is also valid. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. A parent name of the form - * `projects/{project_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. A parent name of the form - * `projects/{project_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The Database to create. - * - * Generated from protobuf field .google.firestore.admin.v1.Database database = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Firestore\Admin\V1\Database|null - */ - public function getDatabase() - { - return $this->database; - } - - public function hasDatabase() - { - return isset($this->database); - } - - public function clearDatabase() - { - unset($this->database); - } - - /** - * Required. The Database to create. - * - * Generated from protobuf field .google.firestore.admin.v1.Database database = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Firestore\Admin\V1\Database $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Database::class); - $this->database = $var; - - return $this; - } - - /** - * Required. The ID to use for the database, which will become the final - * component of the database's resource name. - * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ - * with first character a letter and the last a letter or a number. Must not - * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. - * "(default)" database id is also valid. - * - * Generated from protobuf field string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDatabaseId() - { - return $this->database_id; - } - - /** - * Required. The ID to use for the database, which will become the final - * component of the database's resource name. - * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ - * with first character a letter and the last a letter or a number. Must not - * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. - * "(default)" database id is also valid. - * - * Generated from protobuf field string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDatabaseId($var) - { - GPBUtil::checkString($var, True); - $this->database_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateIndexRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateIndexRequest.php deleted file mode 100644 index a09b8194ce62..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateIndexRequest.php +++ /dev/null @@ -1,133 +0,0 @@ -google.firestore.admin.v1.CreateIndexRequest - */ -class CreateIndexRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The composite index to create. - * - * Generated from protobuf field .google.firestore.admin.v1.Index index = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $index = null; - - /** - * @param string $parent Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * Please see {@see FirestoreAdminClient::collectionGroupName()} for help formatting this field. - * @param \Google\Cloud\Firestore\Admin\V1\Index $index Required. The composite index to create. - * - * @return \Google\Cloud\Firestore\Admin\V1\CreateIndexRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Firestore\Admin\V1\Index $index): self - { - return (new self()) - ->setParent($parent) - ->setIndex($index); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * @type \Google\Cloud\Firestore\Admin\V1\Index $index - * Required. The composite index to create. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The composite index to create. - * - * Generated from protobuf field .google.firestore.admin.v1.Index index = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Firestore\Admin\V1\Index|null - */ - public function getIndex() - { - return $this->index; - } - - public function hasIndex() - { - return isset($this->index); - } - - public function clearIndex() - { - unset($this->index); - } - - /** - * Required. The composite index to create. - * - * Generated from protobuf field .google.firestore.admin.v1.Index index = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Firestore\Admin\V1\Index $var - * @return $this - */ - public function setIndex($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Index::class); - $this->index = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database.php deleted file mode 100644 index 07826f071ff8..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database.php +++ /dev/null @@ -1,657 +0,0 @@ -google.firestore.admin.v1.Database - */ -class Database extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the Database. - * Format: `projects/{project}/databases/{database}` - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Output only. The system-generated UUID4 for this Database. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. The timestamp at which this database was created. Databases - * created before 2016 do not populate create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The timestamp at which this database was most recently - * updated. Note this only includes updates to the database resource and not - * data contained by the database. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * The location of the database. Available locations are listed at - * https://cloud.google.com/firestore/docs/locations. - * - * Generated from protobuf field string location_id = 9; - */ - protected $location_id = ''; - /** - * The type of the database. - * See https://cloud.google.com/datastore/docs/firestore-or-datastore for - * information about how to choose. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.DatabaseType type = 10; - */ - protected $type = 0; - /** - * The concurrency control mode to use for this database. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; - */ - protected $concurrency_mode = 0; - /** - * Output only. The period during which past versions of data are retained in - * the database. - * Any [read][google.firestore.v1.GetDocumentRequest.read_time] - * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify - * a `read_time` within this window, and will read the state of the database - * at that time. - * If the PITR feature is enabled, the retention period is 7 days. Otherwise, - * the retention period is 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $version_retention_period = null; - /** - * Output only. The earliest timestamp at which older versions of the data can - * be read from the database. See [version_retention_period] above; this field - * is populated with `now - version_retention_period`. - * This value is continuously updated, and becomes stale the moment it is - * queried. If you are using this value to recover data, make sure to account - * for the time from the moment when the value is queried to the moment when - * you initiate the recovery. - * - * Generated from protobuf field .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $earliest_version_time = null; - /** - * Whether to enable the PITR feature on this database. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; - */ - protected $point_in_time_recovery_enablement = 0; - /** - * The App Engine integration mode to use for this database. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.AppEngineIntegrationMode app_engine_integration_mode = 19; - */ - protected $app_engine_integration_mode = 0; - /** - * Output only. The key_prefix for this database. This key_prefix is used, in - * combination with the project id ("~") to construct - * the application id that is returned from the Cloud Datastore APIs in Google - * App Engine first generation runtimes. - * This value may be empty in which case the appid to use for URL-encoded keys - * is the project_id (eg: foo instead of v~foo). - * - * Generated from protobuf field string key_prefix = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $key_prefix = ''; - /** - * State of delete protection for the database. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; - */ - protected $delete_protection_state = 0; - /** - * This checksum is computed by the server based on the value of other - * fields, and may be sent on update and delete requests to ensure the - * client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 99; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the Database. - * Format: `projects/{project}/databases/{database}` - * @type string $uid - * Output only. The system-generated UUID4 for this Database. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The timestamp at which this database was created. Databases - * created before 2016 do not populate create_time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The timestamp at which this database was most recently - * updated. Note this only includes updates to the database resource and not - * data contained by the database. - * @type string $location_id - * The location of the database. Available locations are listed at - * https://cloud.google.com/firestore/docs/locations. - * @type int $type - * The type of the database. - * See https://cloud.google.com/datastore/docs/firestore-or-datastore for - * information about how to choose. - * @type int $concurrency_mode - * The concurrency control mode to use for this database. - * @type \Google\Protobuf\Duration $version_retention_period - * Output only. The period during which past versions of data are retained in - * the database. - * Any [read][google.firestore.v1.GetDocumentRequest.read_time] - * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify - * a `read_time` within this window, and will read the state of the database - * at that time. - * If the PITR feature is enabled, the retention period is 7 days. Otherwise, - * the retention period is 1 hour. - * @type \Google\Protobuf\Timestamp $earliest_version_time - * Output only. The earliest timestamp at which older versions of the data can - * be read from the database. See [version_retention_period] above; this field - * is populated with `now - version_retention_period`. - * This value is continuously updated, and becomes stale the moment it is - * queried. If you are using this value to recover data, make sure to account - * for the time from the moment when the value is queried to the moment when - * you initiate the recovery. - * @type int $point_in_time_recovery_enablement - * Whether to enable the PITR feature on this database. - * @type int $app_engine_integration_mode - * The App Engine integration mode to use for this database. - * @type string $key_prefix - * Output only. The key_prefix for this database. This key_prefix is used, in - * combination with the project id ("~") to construct - * the application id that is returned from the Cloud Datastore APIs in Google - * App Engine first generation runtimes. - * This value may be empty in which case the appid to use for URL-encoded keys - * is the project_id (eg: foo instead of v~foo). - * @type int $delete_protection_state - * State of delete protection for the database. - * @type string $etag - * This checksum is computed by the server based on the value of other - * fields, and may be sent on update and delete requests to ensure the - * client has an up-to-date value before proceeding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Database::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the Database. - * Format: `projects/{project}/databases/{database}` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the Database. - * Format: `projects/{project}/databases/{database}` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The system-generated UUID4 for this Database. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. The system-generated UUID4 for this Database. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. The timestamp at which this database was created. Databases - * created before 2016 do not populate create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The timestamp at which this database was created. Databases - * created before 2016 do not populate create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The timestamp at which this database was most recently - * updated. Note this only includes updates to the database resource and not - * data contained by the database. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The timestamp at which this database was most recently - * updated. Note this only includes updates to the database resource and not - * data contained by the database. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * The location of the database. Available locations are listed at - * https://cloud.google.com/firestore/docs/locations. - * - * Generated from protobuf field string location_id = 9; - * @return string - */ - public function getLocationId() - { - return $this->location_id; - } - - /** - * The location of the database. Available locations are listed at - * https://cloud.google.com/firestore/docs/locations. - * - * Generated from protobuf field string location_id = 9; - * @param string $var - * @return $this - */ - public function setLocationId($var) - { - GPBUtil::checkString($var, True); - $this->location_id = $var; - - return $this; - } - - /** - * The type of the database. - * See https://cloud.google.com/datastore/docs/firestore-or-datastore for - * information about how to choose. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.DatabaseType type = 10; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The type of the database. - * See https://cloud.google.com/datastore/docs/firestore-or-datastore for - * information about how to choose. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.DatabaseType type = 10; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Database\DatabaseType::class); - $this->type = $var; - - return $this; - } - - /** - * The concurrency control mode to use for this database. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; - * @return int - */ - public function getConcurrencyMode() - { - return $this->concurrency_mode; - } - - /** - * The concurrency control mode to use for this database. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; - * @param int $var - * @return $this - */ - public function setConcurrencyMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Database\ConcurrencyMode::class); - $this->concurrency_mode = $var; - - return $this; - } - - /** - * Output only. The period during which past versions of data are retained in - * the database. - * Any [read][google.firestore.v1.GetDocumentRequest.read_time] - * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify - * a `read_time` within this window, and will read the state of the database - * at that time. - * If the PITR feature is enabled, the retention period is 7 days. Otherwise, - * the retention period is 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Duration|null - */ - public function getVersionRetentionPeriod() - { - return $this->version_retention_period; - } - - public function hasVersionRetentionPeriod() - { - return isset($this->version_retention_period); - } - - public function clearVersionRetentionPeriod() - { - unset($this->version_retention_period); - } - - /** - * Output only. The period during which past versions of data are retained in - * the database. - * Any [read][google.firestore.v1.GetDocumentRequest.read_time] - * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify - * a `read_time` within this window, and will read the state of the database - * at that time. - * If the PITR feature is enabled, the retention period is 7 days. Otherwise, - * the retention period is 1 hour. - * - * Generated from protobuf field .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setVersionRetentionPeriod($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->version_retention_period = $var; - - return $this; - } - - /** - * Output only. The earliest timestamp at which older versions of the data can - * be read from the database. See [version_retention_period] above; this field - * is populated with `now - version_retention_period`. - * This value is continuously updated, and becomes stale the moment it is - * queried. If you are using this value to recover data, make sure to account - * for the time from the moment when the value is queried to the moment when - * you initiate the recovery. - * - * Generated from protobuf field .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEarliestVersionTime() - { - return $this->earliest_version_time; - } - - public function hasEarliestVersionTime() - { - return isset($this->earliest_version_time); - } - - public function clearEarliestVersionTime() - { - unset($this->earliest_version_time); - } - - /** - * Output only. The earliest timestamp at which older versions of the data can - * be read from the database. See [version_retention_period] above; this field - * is populated with `now - version_retention_period`. - * This value is continuously updated, and becomes stale the moment it is - * queried. If you are using this value to recover data, make sure to account - * for the time from the moment when the value is queried to the moment when - * you initiate the recovery. - * - * Generated from protobuf field .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEarliestVersionTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->earliest_version_time = $var; - - return $this; - } - - /** - * Whether to enable the PITR feature on this database. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; - * @return int - */ - public function getPointInTimeRecoveryEnablement() - { - return $this->point_in_time_recovery_enablement; - } - - /** - * Whether to enable the PITR feature on this database. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; - * @param int $var - * @return $this - */ - public function setPointInTimeRecoveryEnablement($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Database\PointInTimeRecoveryEnablement::class); - $this->point_in_time_recovery_enablement = $var; - - return $this; - } - - /** - * The App Engine integration mode to use for this database. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.AppEngineIntegrationMode app_engine_integration_mode = 19; - * @return int - */ - public function getAppEngineIntegrationMode() - { - return $this->app_engine_integration_mode; - } - - /** - * The App Engine integration mode to use for this database. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.AppEngineIntegrationMode app_engine_integration_mode = 19; - * @param int $var - * @return $this - */ - public function setAppEngineIntegrationMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Database\AppEngineIntegrationMode::class); - $this->app_engine_integration_mode = $var; - - return $this; - } - - /** - * Output only. The key_prefix for this database. This key_prefix is used, in - * combination with the project id ("~") to construct - * the application id that is returned from the Cloud Datastore APIs in Google - * App Engine first generation runtimes. - * This value may be empty in which case the appid to use for URL-encoded keys - * is the project_id (eg: foo instead of v~foo). - * - * Generated from protobuf field string key_prefix = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getKeyPrefix() - { - return $this->key_prefix; - } - - /** - * Output only. The key_prefix for this database. This key_prefix is used, in - * combination with the project id ("~") to construct - * the application id that is returned from the Cloud Datastore APIs in Google - * App Engine first generation runtimes. - * This value may be empty in which case the appid to use for URL-encoded keys - * is the project_id (eg: foo instead of v~foo). - * - * Generated from protobuf field string key_prefix = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setKeyPrefix($var) - { - GPBUtil::checkString($var, True); - $this->key_prefix = $var; - - return $this; - } - - /** - * State of delete protection for the database. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; - * @return int - */ - public function getDeleteProtectionState() - { - return $this->delete_protection_state; - } - - /** - * State of delete protection for the database. - * - * Generated from protobuf field .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; - * @param int $var - * @return $this - */ - public function setDeleteProtectionState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Database\DeleteProtectionState::class); - $this->delete_protection_state = $var; - - return $this; - } - - /** - * This checksum is computed by the server based on the value of other - * fields, and may be sent on update and delete requests to ensure the - * client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 99; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * This checksum is computed by the server based on the value of other - * fields, and may be sent on update and delete requests to ensure the - * client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 99; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/AppEngineIntegrationMode.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/AppEngineIntegrationMode.php deleted file mode 100644 index 2a871f5971f6..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/AppEngineIntegrationMode.php +++ /dev/null @@ -1,69 +0,0 @@ -google.firestore.admin.v1.Database.AppEngineIntegrationMode - */ -class AppEngineIntegrationMode -{ - /** - * Not used. - * - * Generated from protobuf enum APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED = 0; - */ - const APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED = 0; - /** - * If an App Engine application exists in the same region as this database, - * App Engine configuration will impact this database. This includes - * disabling of the application & database, as well as disabling writes to - * the database. - * - * Generated from protobuf enum ENABLED = 1; - */ - const ENABLED = 1; - /** - * App Engine has no effect on the ability of this database to serve - * requests. - * This is the default setting for databases created with the Firestore API. - * - * Generated from protobuf enum DISABLED = 2; - */ - const DISABLED = 2; - - private static $valueToName = [ - self::APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED => 'APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED', - self::ENABLED => 'ENABLED', - self::DISABLED => 'DISABLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(AppEngineIntegrationMode::class, \Google\Cloud\Firestore\Admin\V1\Database_AppEngineIntegrationMode::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/ConcurrencyMode.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/ConcurrencyMode.php deleted file mode 100644 index 2e88fde688f8..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/ConcurrencyMode.php +++ /dev/null @@ -1,77 +0,0 @@ -google.firestore.admin.v1.Database.ConcurrencyMode - */ -class ConcurrencyMode -{ - /** - * Not used. - * - * Generated from protobuf enum CONCURRENCY_MODE_UNSPECIFIED = 0; - */ - const CONCURRENCY_MODE_UNSPECIFIED = 0; - /** - * Use optimistic concurrency control by default. This mode is available - * for Cloud Firestore databases. - * - * Generated from protobuf enum OPTIMISTIC = 1; - */ - const OPTIMISTIC = 1; - /** - * Use pessimistic concurrency control by default. This mode is available - * for Cloud Firestore databases. - * This is the default setting for Cloud Firestore. - * - * Generated from protobuf enum PESSIMISTIC = 2; - */ - const PESSIMISTIC = 2; - /** - * Use optimistic concurrency control with entity groups by default. - * This is the only available mode for Cloud Datastore. - * This mode is also available for Cloud Firestore with Datastore Mode but - * is not recommended. - * - * Generated from protobuf enum OPTIMISTIC_WITH_ENTITY_GROUPS = 3; - */ - const OPTIMISTIC_WITH_ENTITY_GROUPS = 3; - - private static $valueToName = [ - self::CONCURRENCY_MODE_UNSPECIFIED => 'CONCURRENCY_MODE_UNSPECIFIED', - self::OPTIMISTIC => 'OPTIMISTIC', - self::PESSIMISTIC => 'PESSIMISTIC', - self::OPTIMISTIC_WITH_ENTITY_GROUPS => 'OPTIMISTIC_WITH_ENTITY_GROUPS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConcurrencyMode::class, \Google\Cloud\Firestore\Admin\V1\Database_ConcurrencyMode::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DatabaseType.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DatabaseType.php deleted file mode 100644 index 18bfd4d8e662..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DatabaseType.php +++ /dev/null @@ -1,67 +0,0 @@ -google.firestore.admin.v1.Database.DatabaseType - */ -class DatabaseType -{ - /** - * The default value. This value is used if the database type is omitted. - * - * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; - */ - const DATABASE_TYPE_UNSPECIFIED = 0; - /** - * Firestore Native Mode - * - * Generated from protobuf enum FIRESTORE_NATIVE = 1; - */ - const FIRESTORE_NATIVE = 1; - /** - * Firestore in Datastore Mode. - * - * Generated from protobuf enum DATASTORE_MODE = 2; - */ - const DATASTORE_MODE = 2; - - private static $valueToName = [ - self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', - self::FIRESTORE_NATIVE => 'FIRESTORE_NATIVE', - self::DATASTORE_MODE => 'DATASTORE_MODE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DatabaseType::class, \Google\Cloud\Firestore\Admin\V1\Database_DatabaseType::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DeleteProtectionState.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DeleteProtectionState.php deleted file mode 100644 index 34ade3e23333..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/DeleteProtectionState.php +++ /dev/null @@ -1,64 +0,0 @@ -google.firestore.admin.v1.Database.DeleteProtectionState - */ -class DeleteProtectionState -{ - /** - * The default value. Delete protection type is not specified - * - * Generated from protobuf enum DELETE_PROTECTION_STATE_UNSPECIFIED = 0; - */ - const DELETE_PROTECTION_STATE_UNSPECIFIED = 0; - /** - * Delete protection is disabled - * - * Generated from protobuf enum DELETE_PROTECTION_DISABLED = 1; - */ - const DELETE_PROTECTION_DISABLED = 1; - /** - * Delete protection is enabled - * - * Generated from protobuf enum DELETE_PROTECTION_ENABLED = 2; - */ - const DELETE_PROTECTION_ENABLED = 2; - - private static $valueToName = [ - self::DELETE_PROTECTION_STATE_UNSPECIFIED => 'DELETE_PROTECTION_STATE_UNSPECIFIED', - self::DELETE_PROTECTION_DISABLED => 'DELETE_PROTECTION_DISABLED', - self::DELETE_PROTECTION_ENABLED => 'DELETE_PROTECTION_ENABLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DeleteProtectionState::class, \Google\Cloud\Firestore\Admin\V1\Database_DeleteProtectionState::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/PointInTimeRecoveryEnablement.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/PointInTimeRecoveryEnablement.php deleted file mode 100644 index 14a69b79b174..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Database/PointInTimeRecoveryEnablement.php +++ /dev/null @@ -1,70 +0,0 @@ -google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement - */ -class PointInTimeRecoveryEnablement -{ - /** - * Not used. - * - * Generated from protobuf enum POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED = 0; - */ - const POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED = 0; - /** - * Reads are supported on selected versions of the data from within the past - * 7 days: - * * Reads against any timestamp within the past hour - * * Reads against 1-minute snapshots beyond 1 hour and within 7 days - * `version_retention_period` and `earliest_version_time` can be - * used to determine the supported versions. - * - * Generated from protobuf enum POINT_IN_TIME_RECOVERY_ENABLED = 1; - */ - const POINT_IN_TIME_RECOVERY_ENABLED = 1; - /** - * Reads are supported on any version of the data from within the past 1 - * hour. - * - * Generated from protobuf enum POINT_IN_TIME_RECOVERY_DISABLED = 2; - */ - const POINT_IN_TIME_RECOVERY_DISABLED = 2; - - private static $valueToName = [ - self::POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED => 'POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED', - self::POINT_IN_TIME_RECOVERY_ENABLED => 'POINT_IN_TIME_RECOVERY_ENABLED', - self::POINT_IN_TIME_RECOVERY_DISABLED => 'POINT_IN_TIME_RECOVERY_DISABLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PointInTimeRecoveryEnablement::class, \Google\Cloud\Firestore\Admin\V1\Database_PointInTimeRecoveryEnablement::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseMetadata.php deleted file mode 100644 index c411410ff5b5..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.firestore.admin.v1.DeleteDatabaseMetadata - */ -class DeleteDatabaseMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseRequest.php deleted file mode 100644 index 5118ae7c1271..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteDatabaseRequest.php +++ /dev/null @@ -1,129 +0,0 @@ -google.firestore.admin.v1.DeleteDatabaseRequest - */ -class DeleteDatabaseRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * The current etag of the Database. - * If an etag is provided and does not match the current etag of the database, - * deletion will be blocked and a FAILED_PRECONDITION error will be returned. - * - * Generated from protobuf field string etag = 3; - */ - protected $etag = ''; - - /** - * @param string $name Required. A name of the form - * `projects/{project_id}/databases/{database_id}` - * Please see {@see FirestoreAdminClient::databaseName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\DeleteDatabaseRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}` - * @type string $etag - * The current etag of the Database. - * If an etag is provided and does not match the current etag of the database, - * deletion will be blocked and a FAILED_PRECONDITION error will be returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The current etag of the Database. - * If an etag is provided and does not match the current etag of the database, - * deletion will be blocked and a FAILED_PRECONDITION error will be returned. - * - * Generated from protobuf field string etag = 3; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * The current etag of the Database. - * If an etag is provided and does not match the current etag of the database, - * deletion will be blocked and a FAILED_PRECONDITION error will be returned. - * - * Generated from protobuf field string etag = 3; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteIndexRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteIndexRequest.php deleted file mode 100644 index 0ff8c174cfd6..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteIndexRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.firestore.admin.v1.DeleteIndexRequest - */ -class DeleteIndexRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * Please see {@see FirestoreAdminClient::indexName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\DeleteIndexRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsMetadata.php deleted file mode 100644 index 480f1e8ffea5..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsMetadata.php +++ /dev/null @@ -1,403 +0,0 @@ -google.firestore.admin.v1.ExportDocumentsMetadata - */ -class ExportDocumentsMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The time this operation started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - protected $start_time = null; - /** - * The time this operation completed. Will be unset if operation still in - * progress. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - protected $end_time = null; - /** - * The state of the export operation. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; - */ - protected $operation_state = 0; - /** - * The progress, in documents, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; - */ - protected $progress_documents = null; - /** - * The progress, in bytes, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; - */ - protected $progress_bytes = null; - /** - * Which collection ids are being exported. - * - * Generated from protobuf field repeated string collection_ids = 6; - */ - private $collection_ids; - /** - * Where the documents are being exported to. - * - * Generated from protobuf field string output_uri_prefix = 7; - */ - protected $output_uri_prefix = ''; - /** - * Which namespace ids are being exported. - * - * Generated from protobuf field repeated string namespace_ids = 8; - */ - private $namespace_ids; - /** - * The timestamp that corresponds to the version of the database that is being - * exported. If unspecified, there are no guarantees about the consistency of - * the documents being exported. - * - * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 9; - */ - protected $snapshot_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * The time this operation started. - * @type \Google\Protobuf\Timestamp $end_time - * The time this operation completed. Will be unset if operation still in - * progress. - * @type int $operation_state - * The state of the export operation. - * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_documents - * The progress, in documents, of this operation. - * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_bytes - * The progress, in bytes, of this operation. - * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids - * Which collection ids are being exported. - * @type string $output_uri_prefix - * Where the documents are being exported to. - * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids - * Which namespace ids are being exported. - * @type \Google\Protobuf\Timestamp $snapshot_time - * The timestamp that corresponds to the version of the database that is being - * exported. If unspecified, there are no guarantees about the consistency of - * the documents being exported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); - parent::__construct($data); - } - - /** - * The time this operation started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * The time this operation started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * The time this operation completed. Will be unset if operation still in - * progress. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * The time this operation completed. Will be unset if operation still in - * progress. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * The state of the export operation. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; - * @return int - */ - public function getOperationState() - { - return $this->operation_state; - } - - /** - * The state of the export operation. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; - * @param int $var - * @return $this - */ - public function setOperationState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\OperationState::class); - $this->operation_state = $var; - - return $this; - } - - /** - * The progress, in documents, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; - * @return \Google\Cloud\Firestore\Admin\V1\Progress|null - */ - public function getProgressDocuments() - { - return $this->progress_documents; - } - - public function hasProgressDocuments() - { - return isset($this->progress_documents); - } - - public function clearProgressDocuments() - { - unset($this->progress_documents); - } - - /** - * The progress, in documents, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; - * @param \Google\Cloud\Firestore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressDocuments($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); - $this->progress_documents = $var; - - return $this; - } - - /** - * The progress, in bytes, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; - * @return \Google\Cloud\Firestore\Admin\V1\Progress|null - */ - public function getProgressBytes() - { - return $this->progress_bytes; - } - - public function hasProgressBytes() - { - return isset($this->progress_bytes); - } - - public function clearProgressBytes() - { - unset($this->progress_bytes); - } - - /** - * The progress, in bytes, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; - * @param \Google\Cloud\Firestore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressBytes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); - $this->progress_bytes = $var; - - return $this; - } - - /** - * Which collection ids are being exported. - * - * Generated from protobuf field repeated string collection_ids = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCollectionIds() - { - return $this->collection_ids; - } - - /** - * Which collection ids are being exported. - * - * Generated from protobuf field repeated string collection_ids = 6; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCollectionIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->collection_ids = $arr; - - return $this; - } - - /** - * Where the documents are being exported to. - * - * Generated from protobuf field string output_uri_prefix = 7; - * @return string - */ - public function getOutputUriPrefix() - { - return $this->output_uri_prefix; - } - - /** - * Where the documents are being exported to. - * - * Generated from protobuf field string output_uri_prefix = 7; - * @param string $var - * @return $this - */ - public function setOutputUriPrefix($var) - { - GPBUtil::checkString($var, True); - $this->output_uri_prefix = $var; - - return $this; - } - - /** - * Which namespace ids are being exported. - * - * Generated from protobuf field repeated string namespace_ids = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNamespaceIds() - { - return $this->namespace_ids; - } - - /** - * Which namespace ids are being exported. - * - * Generated from protobuf field repeated string namespace_ids = 8; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNamespaceIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->namespace_ids = $arr; - - return $this; - } - - /** - * The timestamp that corresponds to the version of the database that is being - * exported. If unspecified, there are no guarantees about the consistency of - * the documents being exported. - * - * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 9; - * @return \Google\Protobuf\Timestamp|null - */ - public function getSnapshotTime() - { - return $this->snapshot_time; - } - - public function hasSnapshotTime() - { - return isset($this->snapshot_time); - } - - public function clearSnapshotTime() - { - unset($this->snapshot_time); - } - - /** - * The timestamp that corresponds to the version of the database that is being - * exported. If unspecified, there are no guarantees about the consistency of - * the documents being exported. - * - * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 9; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setSnapshotTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->snapshot_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsRequest.php deleted file mode 100644 index e5024b86ac8d..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsRequest.php +++ /dev/null @@ -1,301 +0,0 @@ -google.firestore.admin.v1.ExportDocumentsRequest - */ -class ExportDocumentsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Database to export. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Which collection ids to export. Unspecified means all collections. - * - * Generated from protobuf field repeated string collection_ids = 2; - */ - private $collection_ids; - /** - * The output URI. Currently only supports Google Cloud Storage URIs of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name - * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional - * Google Cloud Storage namespace path. When - * choosing a name, be sure to consider Google Cloud Storage naming - * guidelines: https://cloud.google.com/storage/docs/naming. - * If the URI is a bucket (without a namespace path), a prefix will be - * generated based on the start time. - * - * Generated from protobuf field string output_uri_prefix = 3; - */ - protected $output_uri_prefix = ''; - /** - * An empty list represents all namespaces. This is the preferred - * usage for databases that don't use namespaces. - * An empty string element represents the default namespace. This should be - * used if the database has data in non-default namespaces, but doesn't want - * to include them. Each namespace in this list must be unique. - * - * Generated from protobuf field repeated string namespace_ids = 4; - */ - private $namespace_ids; - /** - * The timestamp that corresponds to the version of the database to be - * exported. The timestamp must be in the past, rounded to the minute and not - * older than - * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time]. - * If specified, then the exported documents will represent a consistent view - * of the database at the provided time. Otherwise, there are no guarantees - * about the consistency of the exported documents. - * - * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 5; - */ - protected $snapshot_time = null; - - /** - * @param string $name Required. Database to export. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. Please see - * {@see FirestoreAdminClient::databaseName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\ExportDocumentsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Database to export. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids - * Which collection ids to export. Unspecified means all collections. - * @type string $output_uri_prefix - * The output URI. Currently only supports Google Cloud Storage URIs of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name - * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional - * Google Cloud Storage namespace path. When - * choosing a name, be sure to consider Google Cloud Storage naming - * guidelines: https://cloud.google.com/storage/docs/naming. - * If the URI is a bucket (without a namespace path), a prefix will be - * generated based on the start time. - * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids - * An empty list represents all namespaces. This is the preferred - * usage for databases that don't use namespaces. - * An empty string element represents the default namespace. This should be - * used if the database has data in non-default namespaces, but doesn't want - * to include them. Each namespace in this list must be unique. - * @type \Google\Protobuf\Timestamp $snapshot_time - * The timestamp that corresponds to the version of the database to be - * exported. The timestamp must be in the past, rounded to the minute and not - * older than - * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time]. - * If specified, then the exported documents will represent a consistent view - * of the database at the provided time. Otherwise, there are no guarantees - * about the consistency of the exported documents. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. Database to export. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Database to export. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Which collection ids to export. Unspecified means all collections. - * - * Generated from protobuf field repeated string collection_ids = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCollectionIds() - { - return $this->collection_ids; - } - - /** - * Which collection ids to export. Unspecified means all collections. - * - * Generated from protobuf field repeated string collection_ids = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCollectionIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->collection_ids = $arr; - - return $this; - } - - /** - * The output URI. Currently only supports Google Cloud Storage URIs of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name - * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional - * Google Cloud Storage namespace path. When - * choosing a name, be sure to consider Google Cloud Storage naming - * guidelines: https://cloud.google.com/storage/docs/naming. - * If the URI is a bucket (without a namespace path), a prefix will be - * generated based on the start time. - * - * Generated from protobuf field string output_uri_prefix = 3; - * @return string - */ - public function getOutputUriPrefix() - { - return $this->output_uri_prefix; - } - - /** - * The output URI. Currently only supports Google Cloud Storage URIs of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name - * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional - * Google Cloud Storage namespace path. When - * choosing a name, be sure to consider Google Cloud Storage naming - * guidelines: https://cloud.google.com/storage/docs/naming. - * If the URI is a bucket (without a namespace path), a prefix will be - * generated based on the start time. - * - * Generated from protobuf field string output_uri_prefix = 3; - * @param string $var - * @return $this - */ - public function setOutputUriPrefix($var) - { - GPBUtil::checkString($var, True); - $this->output_uri_prefix = $var; - - return $this; - } - - /** - * An empty list represents all namespaces. This is the preferred - * usage for databases that don't use namespaces. - * An empty string element represents the default namespace. This should be - * used if the database has data in non-default namespaces, but doesn't want - * to include them. Each namespace in this list must be unique. - * - * Generated from protobuf field repeated string namespace_ids = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNamespaceIds() - { - return $this->namespace_ids; - } - - /** - * An empty list represents all namespaces. This is the preferred - * usage for databases that don't use namespaces. - * An empty string element represents the default namespace. This should be - * used if the database has data in non-default namespaces, but doesn't want - * to include them. Each namespace in this list must be unique. - * - * Generated from protobuf field repeated string namespace_ids = 4; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNamespaceIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->namespace_ids = $arr; - - return $this; - } - - /** - * The timestamp that corresponds to the version of the database to be - * exported. The timestamp must be in the past, rounded to the minute and not - * older than - * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time]. - * If specified, then the exported documents will represent a consistent view - * of the database at the provided time. Otherwise, there are no guarantees - * about the consistency of the exported documents. - * - * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getSnapshotTime() - { - return $this->snapshot_time; - } - - public function hasSnapshotTime() - { - return isset($this->snapshot_time); - } - - public function clearSnapshotTime() - { - unset($this->snapshot_time); - } - - /** - * The timestamp that corresponds to the version of the database to be - * exported. The timestamp must be in the past, rounded to the minute and not - * older than - * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time]. - * If specified, then the exported documents will represent a consistent view - * of the database at the provided time. Otherwise, there are no guarantees - * about the consistency of the exported documents. - * - * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setSnapshotTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->snapshot_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsResponse.php deleted file mode 100644 index 98d2d38246b1..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsResponse.php +++ /dev/null @@ -1,76 +0,0 @@ -google.firestore.admin.v1.ExportDocumentsResponse - */ -class ExportDocumentsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Location of the output files. This can be used to begin an import - * into Cloud Firestore (this project or another project) after the operation - * completes successfully. - * - * Generated from protobuf field string output_uri_prefix = 1; - */ - protected $output_uri_prefix = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $output_uri_prefix - * Location of the output files. This can be used to begin an import - * into Cloud Firestore (this project or another project) after the operation - * completes successfully. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); - parent::__construct($data); - } - - /** - * Location of the output files. This can be used to begin an import - * into Cloud Firestore (this project or another project) after the operation - * completes successfully. - * - * Generated from protobuf field string output_uri_prefix = 1; - * @return string - */ - public function getOutputUriPrefix() - { - return $this->output_uri_prefix; - } - - /** - * Location of the output files. This can be used to begin an import - * into Cloud Firestore (this project or another project) after the operation - * completes successfully. - * - * Generated from protobuf field string output_uri_prefix = 1; - * @param string $var - * @return $this - */ - public function setOutputUriPrefix($var) - { - GPBUtil::checkString($var, True); - $this->output_uri_prefix = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field.php deleted file mode 100644 index 3443f452678d..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field.php +++ /dev/null @@ -1,261 +0,0 @@ -google.firestore.admin.v1.Field - */ -class Field extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A field name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * A field path may be a simple field name, e.g. `address` or a path to fields - * within map_value , e.g. `address.city`, - * or a special field path. The only valid special field is `*`, which - * represents any field. - * Field paths may be quoted using ` (backtick). The only character that needs - * to be escaped within a quoted field path is the backtick character itself, - * escaped using a backslash. Special characters in field paths that - * must be quoted include: `*`, `.`, - * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. - * Examples: - * (Note: Comments here are written in markdown syntax, so there is an - * additional layer of backticks to represent a code block) - * `\`address.city\`` represents a field named `address.city`, not the map key - * `city` in the field `address`. - * `\`*\`` represents a field named `*`, not any field. - * A special `Field` contains the default indexing settings for all fields. - * This field's resource name is: - * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` - * Indexes defined on this `Field` will be applied to all fields which do not - * have their own `Field` index configuration. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * The index configuration for this field. If unset, field indexing will - * revert to the configuration defined by the `ancestor_field`. To - * explicitly remove all indexes for this field, specify an index config - * with an empty list of indexes. - * - * Generated from protobuf field .google.firestore.admin.v1.Field.IndexConfig index_config = 2; - */ - protected $index_config = null; - /** - * The TTL configuration for this `Field`. - * Setting or unsetting this will enable or disable the TTL for - * documents that have this `Field`. - * - * Generated from protobuf field .google.firestore.admin.v1.Field.TtlConfig ttl_config = 3; - */ - protected $ttl_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. A field name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * A field path may be a simple field name, e.g. `address` or a path to fields - * within map_value , e.g. `address.city`, - * or a special field path. The only valid special field is `*`, which - * represents any field. - * Field paths may be quoted using ` (backtick). The only character that needs - * to be escaped within a quoted field path is the backtick character itself, - * escaped using a backslash. Special characters in field paths that - * must be quoted include: `*`, `.`, - * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. - * Examples: - * (Note: Comments here are written in markdown syntax, so there is an - * additional layer of backticks to represent a code block) - * `\`address.city\`` represents a field named `address.city`, not the map key - * `city` in the field `address`. - * `\`*\`` represents a field named `*`, not any field. - * A special `Field` contains the default indexing settings for all fields. - * This field's resource name is: - * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` - * Indexes defined on this `Field` will be applied to all fields which do not - * have their own `Field` index configuration. - * @type \Google\Cloud\Firestore\Admin\V1\Field\IndexConfig $index_config - * The index configuration for this field. If unset, field indexing will - * revert to the configuration defined by the `ancestor_field`. To - * explicitly remove all indexes for this field, specify an index config - * with an empty list of indexes. - * @type \Google\Cloud\Firestore\Admin\V1\Field\TtlConfig $ttl_config - * The TTL configuration for this `Field`. - * Setting or unsetting this will enable or disable the TTL for - * documents that have this `Field`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Field::initOnce(); - parent::__construct($data); - } - - /** - * Required. A field name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * A field path may be a simple field name, e.g. `address` or a path to fields - * within map_value , e.g. `address.city`, - * or a special field path. The only valid special field is `*`, which - * represents any field. - * Field paths may be quoted using ` (backtick). The only character that needs - * to be escaped within a quoted field path is the backtick character itself, - * escaped using a backslash. Special characters in field paths that - * must be quoted include: `*`, `.`, - * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. - * Examples: - * (Note: Comments here are written in markdown syntax, so there is an - * additional layer of backticks to represent a code block) - * `\`address.city\`` represents a field named `address.city`, not the map key - * `city` in the field `address`. - * `\`*\`` represents a field named `*`, not any field. - * A special `Field` contains the default indexing settings for all fields. - * This field's resource name is: - * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` - * Indexes defined on this `Field` will be applied to all fields which do not - * have their own `Field` index configuration. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. A field name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * A field path may be a simple field name, e.g. `address` or a path to fields - * within map_value , e.g. `address.city`, - * or a special field path. The only valid special field is `*`, which - * represents any field. - * Field paths may be quoted using ` (backtick). The only character that needs - * to be escaped within a quoted field path is the backtick character itself, - * escaped using a backslash. Special characters in field paths that - * must be quoted include: `*`, `.`, - * ``` (backtick), `[`, `]`, as well as any ascii symbolic characters. - * Examples: - * (Note: Comments here are written in markdown syntax, so there is an - * additional layer of backticks to represent a code block) - * `\`address.city\`` represents a field named `address.city`, not the map key - * `city` in the field `address`. - * `\`*\`` represents a field named `*`, not any field. - * A special `Field` contains the default indexing settings for all fields. - * This field's resource name is: - * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*` - * Indexes defined on this `Field` will be applied to all fields which do not - * have their own `Field` index configuration. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The index configuration for this field. If unset, field indexing will - * revert to the configuration defined by the `ancestor_field`. To - * explicitly remove all indexes for this field, specify an index config - * with an empty list of indexes. - * - * Generated from protobuf field .google.firestore.admin.v1.Field.IndexConfig index_config = 2; - * @return \Google\Cloud\Firestore\Admin\V1\Field\IndexConfig|null - */ - public function getIndexConfig() - { - return $this->index_config; - } - - public function hasIndexConfig() - { - return isset($this->index_config); - } - - public function clearIndexConfig() - { - unset($this->index_config); - } - - /** - * The index configuration for this field. If unset, field indexing will - * revert to the configuration defined by the `ancestor_field`. To - * explicitly remove all indexes for this field, specify an index config - * with an empty list of indexes. - * - * Generated from protobuf field .google.firestore.admin.v1.Field.IndexConfig index_config = 2; - * @param \Google\Cloud\Firestore\Admin\V1\Field\IndexConfig $var - * @return $this - */ - public function setIndexConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Field\IndexConfig::class); - $this->index_config = $var; - - return $this; - } - - /** - * The TTL configuration for this `Field`. - * Setting or unsetting this will enable or disable the TTL for - * documents that have this `Field`. - * - * Generated from protobuf field .google.firestore.admin.v1.Field.TtlConfig ttl_config = 3; - * @return \Google\Cloud\Firestore\Admin\V1\Field\TtlConfig|null - */ - public function getTtlConfig() - { - return $this->ttl_config; - } - - public function hasTtlConfig() - { - return isset($this->ttl_config); - } - - public function clearTtlConfig() - { - unset($this->ttl_config); - } - - /** - * The TTL configuration for this `Field`. - * Setting or unsetting this will enable or disable the TTL for - * documents that have this `Field`. - * - * Generated from protobuf field .google.firestore.admin.v1.Field.TtlConfig ttl_config = 3; - * @param \Google\Cloud\Firestore\Admin\V1\Field\TtlConfig $var - * @return $this - */ - public function setTtlConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Field\TtlConfig::class); - $this->ttl_config = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/IndexConfig.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/IndexConfig.php deleted file mode 100644 index 08601827331f..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/IndexConfig.php +++ /dev/null @@ -1,208 +0,0 @@ -google.firestore.admin.v1.Field.IndexConfig - */ -class IndexConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The indexes supported for this field. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Index indexes = 1; - */ - private $indexes; - /** - * Output only. When true, the `Field`'s index configuration is set from the - * configuration specified by the `ancestor_field`. - * When false, the `Field`'s index configuration is defined explicitly. - * - * Generated from protobuf field bool uses_ancestor_config = 2; - */ - protected $uses_ancestor_config = false; - /** - * Output only. Specifies the resource name of the `Field` from which this field's - * index configuration is set (when `uses_ancestor_config` is true), - * or from which it *would* be set if this field had no index configuration - * (when `uses_ancestor_config` is false). - * - * Generated from protobuf field string ancestor_field = 3; - */ - protected $ancestor_field = ''; - /** - * Output only - * When true, the `Field`'s index configuration is in the process of being - * reverted. Once complete, the index config will transition to the same - * state as the field specified by `ancestor_field`, at which point - * `uses_ancestor_config` will be `true` and `reverting` will be `false`. - * - * Generated from protobuf field bool reverting = 4; - */ - protected $reverting = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Firestore\Admin\V1\Index>|\Google\Protobuf\Internal\RepeatedField $indexes - * The indexes supported for this field. - * @type bool $uses_ancestor_config - * Output only. When true, the `Field`'s index configuration is set from the - * configuration specified by the `ancestor_field`. - * When false, the `Field`'s index configuration is defined explicitly. - * @type string $ancestor_field - * Output only. Specifies the resource name of the `Field` from which this field's - * index configuration is set (when `uses_ancestor_config` is true), - * or from which it *would* be set if this field had no index configuration - * (when `uses_ancestor_config` is false). - * @type bool $reverting - * Output only - * When true, the `Field`'s index configuration is in the process of being - * reverted. Once complete, the index config will transition to the same - * state as the field specified by `ancestor_field`, at which point - * `uses_ancestor_config` will be `true` and `reverting` will be `false`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Field::initOnce(); - parent::__construct($data); - } - - /** - * The indexes supported for this field. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Index indexes = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIndexes() - { - return $this->indexes; - } - - /** - * The indexes supported for this field. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Index indexes = 1; - * @param array<\Google\Cloud\Firestore\Admin\V1\Index>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIndexes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\Index::class); - $this->indexes = $arr; - - return $this; - } - - /** - * Output only. When true, the `Field`'s index configuration is set from the - * configuration specified by the `ancestor_field`. - * When false, the `Field`'s index configuration is defined explicitly. - * - * Generated from protobuf field bool uses_ancestor_config = 2; - * @return bool - */ - public function getUsesAncestorConfig() - { - return $this->uses_ancestor_config; - } - - /** - * Output only. When true, the `Field`'s index configuration is set from the - * configuration specified by the `ancestor_field`. - * When false, the `Field`'s index configuration is defined explicitly. - * - * Generated from protobuf field bool uses_ancestor_config = 2; - * @param bool $var - * @return $this - */ - public function setUsesAncestorConfig($var) - { - GPBUtil::checkBool($var); - $this->uses_ancestor_config = $var; - - return $this; - } - - /** - * Output only. Specifies the resource name of the `Field` from which this field's - * index configuration is set (when `uses_ancestor_config` is true), - * or from which it *would* be set if this field had no index configuration - * (when `uses_ancestor_config` is false). - * - * Generated from protobuf field string ancestor_field = 3; - * @return string - */ - public function getAncestorField() - { - return $this->ancestor_field; - } - - /** - * Output only. Specifies the resource name of the `Field` from which this field's - * index configuration is set (when `uses_ancestor_config` is true), - * or from which it *would* be set if this field had no index configuration - * (when `uses_ancestor_config` is false). - * - * Generated from protobuf field string ancestor_field = 3; - * @param string $var - * @return $this - */ - public function setAncestorField($var) - { - GPBUtil::checkString($var, True); - $this->ancestor_field = $var; - - return $this; - } - - /** - * Output only - * When true, the `Field`'s index configuration is in the process of being - * reverted. Once complete, the index config will transition to the same - * state as the field specified by `ancestor_field`, at which point - * `uses_ancestor_config` will be `true` and `reverting` will be `false`. - * - * Generated from protobuf field bool reverting = 4; - * @return bool - */ - public function getReverting() - { - return $this->reverting; - } - - /** - * Output only - * When true, the `Field`'s index configuration is in the process of being - * reverted. Once complete, the index config will transition to the same - * state as the field specified by `ancestor_field`, at which point - * `uses_ancestor_config` will be `true` and `reverting` will be `false`. - * - * Generated from protobuf field bool reverting = 4; - * @param bool $var - * @return $this - */ - public function setReverting($var) - { - GPBUtil::checkBool($var); - $this->reverting = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IndexConfig::class, \Google\Cloud\Firestore\Admin\V1\Field_IndexConfig::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig.php deleted file mode 100644 index ba50384a783f..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig.php +++ /dev/null @@ -1,74 +0,0 @@ -google.firestore.admin.v1.Field.TtlConfig - */ -class TtlConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The state of the TTL configuration. - * - * Generated from protobuf field .google.firestore.admin.v1.Field.TtlConfig.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * Output only. The state of the TTL configuration. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Field::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The state of the TTL configuration. - * - * Generated from protobuf field .google.firestore.admin.v1.Field.TtlConfig.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The state of the TTL configuration. - * - * Generated from protobuf field .google.firestore.admin.v1.Field.TtlConfig.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Field\TtlConfig\State::class); - $this->state = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TtlConfig::class, \Google\Cloud\Firestore\Admin\V1\Field_TtlConfig::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig/State.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig/State.php deleted file mode 100644 index 7722ca6e7e0a..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig/State.php +++ /dev/null @@ -1,78 +0,0 @@ -google.firestore.admin.v1.Field.TtlConfig.State - */ -class State -{ - /** - * The state is unspecified or unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The TTL is being applied. There is an active long-running operation to - * track the change. Newly written documents will have TTLs applied as - * requested. Requested TTLs on existing documents are still being - * processed. When TTLs on all existing documents have been processed, the - * state will move to 'ACTIVE'. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The TTL is active for all documents. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * The TTL configuration could not be enabled for all existing documents. - * Newly written documents will continue to have their TTL applied. - * The LRO returned when last attempting to enable TTL for this `Field` - * has failed, and may have more details. - * - * Generated from protobuf enum NEEDS_REPAIR = 3; - */ - const NEEDS_REPAIR = 3; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::ACTIVE => 'ACTIVE', - self::NEEDS_REPAIR => 'NEEDS_REPAIR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Firestore\Admin\V1\Field_TtlConfig_State::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata.php deleted file mode 100644 index 1d5d2218c70e..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata.php +++ /dev/null @@ -1,373 +0,0 @@ -google.firestore.admin.v1.FieldOperationMetadata - */ -class FieldOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The time this operation started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - protected $start_time = null; - /** - * The time this operation completed. Will be unset if operation still in - * progress. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - protected $end_time = null; - /** - * The field resource that this operation is acting on. For example: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * - * Generated from protobuf field string field = 3; - */ - protected $field = ''; - /** - * A list of - * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], - * which describe the intent of this operation. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; - */ - private $index_config_deltas; - /** - * The state of the operation. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState state = 5; - */ - protected $state = 0; - /** - * The progress, in documents, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 6; - */ - protected $progress_documents = null; - /** - * The progress, in bytes, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 7; - */ - protected $progress_bytes = null; - /** - * Describes the deltas of TTL configuration. - * - * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta ttl_config_delta = 8; - */ - protected $ttl_config_delta = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * The time this operation started. - * @type \Google\Protobuf\Timestamp $end_time - * The time this operation completed. Will be unset if operation still in - * progress. - * @type string $field - * The field resource that this operation is acting on. For example: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * @type array<\Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\IndexConfigDelta>|\Google\Protobuf\Internal\RepeatedField $index_config_deltas - * A list of - * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], - * which describe the intent of this operation. - * @type int $state - * The state of the operation. - * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_documents - * The progress, in documents, of this operation. - * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_bytes - * The progress, in bytes, of this operation. - * @type \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\TtlConfigDelta $ttl_config_delta - * Describes the deltas of TTL configuration. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); - parent::__construct($data); - } - - /** - * The time this operation started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * The time this operation started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * The time this operation completed. Will be unset if operation still in - * progress. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * The time this operation completed. Will be unset if operation still in - * progress. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * The field resource that this operation is acting on. For example: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * - * Generated from protobuf field string field = 3; - * @return string - */ - public function getField() - { - return $this->field; - } - - /** - * The field resource that this operation is acting on. For example: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` - * - * Generated from protobuf field string field = 3; - * @param string $var - * @return $this - */ - public function setField($var) - { - GPBUtil::checkString($var, True); - $this->field = $var; - - return $this; - } - - /** - * A list of - * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], - * which describe the intent of this operation. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIndexConfigDeltas() - { - return $this->index_config_deltas; - } - - /** - * A list of - * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], - * which describe the intent of this operation. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta index_config_deltas = 4; - * @param array<\Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\IndexConfigDelta>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIndexConfigDeltas($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\IndexConfigDelta::class); - $this->index_config_deltas = $arr; - - return $this; - } - - /** - * The state of the operation. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState state = 5; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The state of the operation. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState state = 5; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\OperationState::class); - $this->state = $var; - - return $this; - } - - /** - * The progress, in documents, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 6; - * @return \Google\Cloud\Firestore\Admin\V1\Progress|null - */ - public function getProgressDocuments() - { - return $this->progress_documents; - } - - public function hasProgressDocuments() - { - return isset($this->progress_documents); - } - - public function clearProgressDocuments() - { - unset($this->progress_documents); - } - - /** - * The progress, in documents, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 6; - * @param \Google\Cloud\Firestore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressDocuments($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); - $this->progress_documents = $var; - - return $this; - } - - /** - * The progress, in bytes, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 7; - * @return \Google\Cloud\Firestore\Admin\V1\Progress|null - */ - public function getProgressBytes() - { - return $this->progress_bytes; - } - - public function hasProgressBytes() - { - return isset($this->progress_bytes); - } - - public function clearProgressBytes() - { - unset($this->progress_bytes); - } - - /** - * The progress, in bytes, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 7; - * @param \Google\Cloud\Firestore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressBytes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); - $this->progress_bytes = $var; - - return $this; - } - - /** - * Describes the deltas of TTL configuration. - * - * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta ttl_config_delta = 8; - * @return \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\TtlConfigDelta|null - */ - public function getTtlConfigDelta() - { - return $this->ttl_config_delta; - } - - public function hasTtlConfigDelta() - { - return isset($this->ttl_config_delta); - } - - public function clearTtlConfigDelta() - { - unset($this->ttl_config_delta); - } - - /** - * Describes the deltas of TTL configuration. - * - * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta ttl_config_delta = 8; - * @param \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\TtlConfigDelta $var - * @return $this - */ - public function setTtlConfigDelta($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\TtlConfigDelta::class); - $this->ttl_config_delta = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta.php deleted file mode 100644 index 1ad9e51b4401..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta.php +++ /dev/null @@ -1,114 +0,0 @@ -google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta - */ -class IndexConfigDelta extends \Google\Protobuf\Internal\Message -{ - /** - * Specifies how the index is changing. - * - * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; - */ - protected $change_type = 0; - /** - * The index being changed. - * - * Generated from protobuf field .google.firestore.admin.v1.Index index = 2; - */ - protected $index = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $change_type - * Specifies how the index is changing. - * @type \Google\Cloud\Firestore\Admin\V1\Index $index - * The index being changed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); - parent::__construct($data); - } - - /** - * Specifies how the index is changing. - * - * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; - * @return int - */ - public function getChangeType() - { - return $this->change_type; - } - - /** - * Specifies how the index is changing. - * - * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType change_type = 1; - * @param int $var - * @return $this - */ - public function setChangeType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\IndexConfigDelta\ChangeType::class); - $this->change_type = $var; - - return $this; - } - - /** - * The index being changed. - * - * Generated from protobuf field .google.firestore.admin.v1.Index index = 2; - * @return \Google\Cloud\Firestore\Admin\V1\Index|null - */ - public function getIndex() - { - return $this->index; - } - - public function hasIndex() - { - return isset($this->index); - } - - public function clearIndex() - { - unset($this->index); - } - - /** - * The index being changed. - * - * Generated from protobuf field .google.firestore.admin.v1.Index index = 2; - * @param \Google\Cloud\Firestore\Admin\V1\Index $var - * @return $this - */ - public function setIndex($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Index::class); - $this->index = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IndexConfigDelta::class, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata_IndexConfigDelta::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta/ChangeType.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta/ChangeType.php deleted file mode 100644 index df7d29035371..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/IndexConfigDelta/ChangeType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType - */ -class ChangeType -{ - /** - * The type of change is not specified or known. - * - * Generated from protobuf enum CHANGE_TYPE_UNSPECIFIED = 0; - */ - const CHANGE_TYPE_UNSPECIFIED = 0; - /** - * The single field index is being added. - * - * Generated from protobuf enum ADD = 1; - */ - const ADD = 1; - /** - * The single field index is being removed. - * - * Generated from protobuf enum REMOVE = 2; - */ - const REMOVE = 2; - - private static $valueToName = [ - self::CHANGE_TYPE_UNSPECIFIED => 'CHANGE_TYPE_UNSPECIFIED', - self::ADD => 'ADD', - self::REMOVE => 'REMOVE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ChangeType::class, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata_IndexConfigDelta_ChangeType::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta.php deleted file mode 100644 index a9d9a6a54440..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta.php +++ /dev/null @@ -1,70 +0,0 @@ -google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta - */ -class TtlConfigDelta extends \Google\Protobuf\Internal\Message -{ - /** - * Specifies how the TTL configuration is changing. - * - * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType change_type = 1; - */ - protected $change_type = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $change_type - * Specifies how the TTL configuration is changing. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); - parent::__construct($data); - } - - /** - * Specifies how the TTL configuration is changing. - * - * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType change_type = 1; - * @return int - */ - public function getChangeType() - { - return $this->change_type; - } - - /** - * Specifies how the TTL configuration is changing. - * - * Generated from protobuf field .google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType change_type = 1; - * @param int $var - * @return $this - */ - public function setChangeType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata\TtlConfigDelta\ChangeType::class); - $this->change_type = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TtlConfigDelta::class, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata_TtlConfigDelta::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta/ChangeType.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta/ChangeType.php deleted file mode 100644 index 600dbab57322..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/FieldOperationMetadata/TtlConfigDelta/ChangeType.php +++ /dev/null @@ -1,64 +0,0 @@ -google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType - */ -class ChangeType -{ - /** - * The type of change is not specified or known. - * - * Generated from protobuf enum CHANGE_TYPE_UNSPECIFIED = 0; - */ - const CHANGE_TYPE_UNSPECIFIED = 0; - /** - * The TTL config is being added. - * - * Generated from protobuf enum ADD = 1; - */ - const ADD = 1; - /** - * The TTL config is being removed. - * - * Generated from protobuf enum REMOVE = 2; - */ - const REMOVE = 2; - - private static $valueToName = [ - self::CHANGE_TYPE_UNSPECIFIED => 'CHANGE_TYPE_UNSPECIFIED', - self::ADD => 'ADD', - self::REMOVE => 'REMOVE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ChangeType::class, \Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata_TtlConfigDelta_ChangeType::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetDatabaseRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetDatabaseRequest.php deleted file mode 100644 index 21451d1b0a94..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetDatabaseRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.firestore.admin.v1.GetDatabaseRequest - */ -class GetDatabaseRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. A name of the form - * `projects/{project_id}/databases/{database_id}` - * Please see {@see FirestoreAdminClient::databaseName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\GetDatabaseRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetFieldRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetFieldRequest.php deleted file mode 100644 index 3b25bbe324d8..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetFieldRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.firestore.admin.v1.GetFieldRequest - */ -class GetFieldRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` - * Please see {@see FirestoreAdminClient::fieldName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\GetFieldRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetIndexRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetIndexRequest.php deleted file mode 100644 index 5b700df02b53..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetIndexRequest.php +++ /dev/null @@ -1,87 +0,0 @@ -google.firestore.admin.v1.GetIndexRequest - */ -class GetIndexRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * Please see {@see FirestoreAdminClient::indexName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\GetIndexRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsMetadata.php deleted file mode 100644 index 07d7a2c0d768..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsMetadata.php +++ /dev/null @@ -1,351 +0,0 @@ -google.firestore.admin.v1.ImportDocumentsMetadata - */ -class ImportDocumentsMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The time this operation started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - protected $start_time = null; - /** - * The time this operation completed. Will be unset if operation still in - * progress. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - protected $end_time = null; - /** - * The state of the import operation. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; - */ - protected $operation_state = 0; - /** - * The progress, in documents, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; - */ - protected $progress_documents = null; - /** - * The progress, in bytes, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; - */ - protected $progress_bytes = null; - /** - * Which collection ids are being imported. - * - * Generated from protobuf field repeated string collection_ids = 6; - */ - private $collection_ids; - /** - * The location of the documents being imported. - * - * Generated from protobuf field string input_uri_prefix = 7; - */ - protected $input_uri_prefix = ''; - /** - * Which namespace ids are being imported. - * - * Generated from protobuf field repeated string namespace_ids = 8; - */ - private $namespace_ids; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * The time this operation started. - * @type \Google\Protobuf\Timestamp $end_time - * The time this operation completed. Will be unset if operation still in - * progress. - * @type int $operation_state - * The state of the import operation. - * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_documents - * The progress, in documents, of this operation. - * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_bytes - * The progress, in bytes, of this operation. - * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids - * Which collection ids are being imported. - * @type string $input_uri_prefix - * The location of the documents being imported. - * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids - * Which namespace ids are being imported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); - parent::__construct($data); - } - - /** - * The time this operation started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * The time this operation started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * The time this operation completed. Will be unset if operation still in - * progress. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * The time this operation completed. Will be unset if operation still in - * progress. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * The state of the import operation. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; - * @return int - */ - public function getOperationState() - { - return $this->operation_state; - } - - /** - * The state of the import operation. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; - * @param int $var - * @return $this - */ - public function setOperationState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\OperationState::class); - $this->operation_state = $var; - - return $this; - } - - /** - * The progress, in documents, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; - * @return \Google\Cloud\Firestore\Admin\V1\Progress|null - */ - public function getProgressDocuments() - { - return $this->progress_documents; - } - - public function hasProgressDocuments() - { - return isset($this->progress_documents); - } - - public function clearProgressDocuments() - { - unset($this->progress_documents); - } - - /** - * The progress, in documents, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 4; - * @param \Google\Cloud\Firestore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressDocuments($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); - $this->progress_documents = $var; - - return $this; - } - - /** - * The progress, in bytes, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; - * @return \Google\Cloud\Firestore\Admin\V1\Progress|null - */ - public function getProgressBytes() - { - return $this->progress_bytes; - } - - public function hasProgressBytes() - { - return isset($this->progress_bytes); - } - - public function clearProgressBytes() - { - unset($this->progress_bytes); - } - - /** - * The progress, in bytes, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 5; - * @param \Google\Cloud\Firestore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressBytes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); - $this->progress_bytes = $var; - - return $this; - } - - /** - * Which collection ids are being imported. - * - * Generated from protobuf field repeated string collection_ids = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCollectionIds() - { - return $this->collection_ids; - } - - /** - * Which collection ids are being imported. - * - * Generated from protobuf field repeated string collection_ids = 6; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCollectionIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->collection_ids = $arr; - - return $this; - } - - /** - * The location of the documents being imported. - * - * Generated from protobuf field string input_uri_prefix = 7; - * @return string - */ - public function getInputUriPrefix() - { - return $this->input_uri_prefix; - } - - /** - * The location of the documents being imported. - * - * Generated from protobuf field string input_uri_prefix = 7; - * @param string $var - * @return $this - */ - public function setInputUriPrefix($var) - { - GPBUtil::checkString($var, True); - $this->input_uri_prefix = $var; - - return $this; - } - - /** - * Which namespace ids are being imported. - * - * Generated from protobuf field repeated string namespace_ids = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNamespaceIds() - { - return $this->namespace_ids; - } - - /** - * Which namespace ids are being imported. - * - * Generated from protobuf field repeated string namespace_ids = 8; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNamespaceIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->namespace_ids = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsRequest.php deleted file mode 100644 index 3f05e1ac6ea7..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ImportDocumentsRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -google.firestore.admin.v1.ImportDocumentsRequest - */ -class ImportDocumentsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Database to import into. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Which collection ids to import. Unspecified means all collections included - * in the import. - * - * Generated from protobuf field repeated string collection_ids = 2; - */ - private $collection_ids; - /** - * Location of the exported files. - * This must match the output_uri_prefix of an ExportDocumentsResponse from - * an export that has completed successfully. - * See: - * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]. - * - * Generated from protobuf field string input_uri_prefix = 3; - */ - protected $input_uri_prefix = ''; - /** - * An empty list represents all namespaces. This is the preferred - * usage for databases that don't use namespaces. - * An empty string element represents the default namespace. This should be - * used if the database has data in non-default namespaces, but doesn't want - * to include them. Each namespace in this list must be unique. - * - * Generated from protobuf field repeated string namespace_ids = 4; - */ - private $namespace_ids; - - /** - * @param string $name Required. Database to import into. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. Please see - * {@see FirestoreAdminClient::databaseName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\ImportDocumentsRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Database to import into. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids - * Which collection ids to import. Unspecified means all collections included - * in the import. - * @type string $input_uri_prefix - * Location of the exported files. - * This must match the output_uri_prefix of an ExportDocumentsResponse from - * an export that has completed successfully. - * See: - * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]. - * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids - * An empty list represents all namespaces. This is the preferred - * usage for databases that don't use namespaces. - * An empty string element represents the default namespace. This should be - * used if the database has data in non-default namespaces, but doesn't want - * to include them. Each namespace in this list must be unique. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. Database to import into. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Database to import into. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Which collection ids to import. Unspecified means all collections included - * in the import. - * - * Generated from protobuf field repeated string collection_ids = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCollectionIds() - { - return $this->collection_ids; - } - - /** - * Which collection ids to import. Unspecified means all collections included - * in the import. - * - * Generated from protobuf field repeated string collection_ids = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCollectionIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->collection_ids = $arr; - - return $this; - } - - /** - * Location of the exported files. - * This must match the output_uri_prefix of an ExportDocumentsResponse from - * an export that has completed successfully. - * See: - * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]. - * - * Generated from protobuf field string input_uri_prefix = 3; - * @return string - */ - public function getInputUriPrefix() - { - return $this->input_uri_prefix; - } - - /** - * Location of the exported files. - * This must match the output_uri_prefix of an ExportDocumentsResponse from - * an export that has completed successfully. - * See: - * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]. - * - * Generated from protobuf field string input_uri_prefix = 3; - * @param string $var - * @return $this - */ - public function setInputUriPrefix($var) - { - GPBUtil::checkString($var, True); - $this->input_uri_prefix = $var; - - return $this; - } - - /** - * An empty list represents all namespaces. This is the preferred - * usage for databases that don't use namespaces. - * An empty string element represents the default namespace. This should be - * used if the database has data in non-default namespaces, but doesn't want - * to include them. Each namespace in this list must be unique. - * - * Generated from protobuf field repeated string namespace_ids = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNamespaceIds() - { - return $this->namespace_ids; - } - - /** - * An empty list represents all namespaces. This is the preferred - * usage for databases that don't use namespaces. - * An empty string element represents the default namespace. This should be - * used if the database has data in non-default namespaces, but doesn't want - * to include them. Each namespace in this list must be unique. - * - * Generated from protobuf field repeated string namespace_ids = 4; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNamespaceIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->namespace_ids = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index.php deleted file mode 100644 index abd8d051aae4..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index.php +++ /dev/null @@ -1,268 +0,0 @@ -google.firestore.admin.v1.Index - */ -class Index extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. A server defined name for this index. - * The form of this name for composite indexes will be: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` - * For single field indexes, this field will be empty. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * Indexes with a collection query scope specified allow queries - * against a collection that is the child of a specific document, specified at - * query time, and that has the same collection id. - * Indexes with a collection group query scope specified allow queries against - * all collections descended from a specific document, specified at query - * time, and that have the same collection id as this index. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.QueryScope query_scope = 2; - */ - protected $query_scope = 0; - /** - * The API scope supported by this index. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.ApiScope api_scope = 5; - */ - protected $api_scope = 0; - /** - * The fields supported by this index. - * For composite indexes, this requires a minimum of 2 and a maximum of 100 - * fields. The last field entry is always for the field path `__name__`. If, - * on creation, `__name__` was not specified as the last field, it will be - * added automatically with the same direction as that of the last field - * defined. If the final field in a composite index is not directional, the - * `__name__` will be ordered ASCENDING (unless explicitly specified). - * For single field indexes, this will always be exactly one entry with a - * field path equal to the field path of the associated field. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Index.IndexField fields = 3; - */ - private $fields; - /** - * Output only. The serving state of the index. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.State state = 4; - */ - protected $state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. A server defined name for this index. - * The form of this name for composite indexes will be: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` - * For single field indexes, this field will be empty. - * @type int $query_scope - * Indexes with a collection query scope specified allow queries - * against a collection that is the child of a specific document, specified at - * query time, and that has the same collection id. - * Indexes with a collection group query scope specified allow queries against - * all collections descended from a specific document, specified at query - * time, and that have the same collection id as this index. - * @type int $api_scope - * The API scope supported by this index. - * @type array<\Google\Cloud\Firestore\Admin\V1\Index\IndexField>|\Google\Protobuf\Internal\RepeatedField $fields - * The fields supported by this index. - * For composite indexes, this requires a minimum of 2 and a maximum of 100 - * fields. The last field entry is always for the field path `__name__`. If, - * on creation, `__name__` was not specified as the last field, it will be - * added automatically with the same direction as that of the last field - * defined. If the final field in a composite index is not directional, the - * `__name__` will be ordered ASCENDING (unless explicitly specified). - * For single field indexes, this will always be exactly one entry with a - * field path equal to the field path of the associated field. - * @type int $state - * Output only. The serving state of the index. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Index::initOnce(); - parent::__construct($data); - } - - /** - * Output only. A server defined name for this index. - * The form of this name for composite indexes will be: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` - * For single field indexes, this field will be empty. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. A server defined name for this index. - * The form of this name for composite indexes will be: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}` - * For single field indexes, this field will be empty. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Indexes with a collection query scope specified allow queries - * against a collection that is the child of a specific document, specified at - * query time, and that has the same collection id. - * Indexes with a collection group query scope specified allow queries against - * all collections descended from a specific document, specified at query - * time, and that have the same collection id as this index. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.QueryScope query_scope = 2; - * @return int - */ - public function getQueryScope() - { - return $this->query_scope; - } - - /** - * Indexes with a collection query scope specified allow queries - * against a collection that is the child of a specific document, specified at - * query time, and that has the same collection id. - * Indexes with a collection group query scope specified allow queries against - * all collections descended from a specific document, specified at query - * time, and that have the same collection id as this index. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.QueryScope query_scope = 2; - * @param int $var - * @return $this - */ - public function setQueryScope($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index\QueryScope::class); - $this->query_scope = $var; - - return $this; - } - - /** - * The API scope supported by this index. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.ApiScope api_scope = 5; - * @return int - */ - public function getApiScope() - { - return $this->api_scope; - } - - /** - * The API scope supported by this index. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.ApiScope api_scope = 5; - * @param int $var - * @return $this - */ - public function setApiScope($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index\ApiScope::class); - $this->api_scope = $var; - - return $this; - } - - /** - * The fields supported by this index. - * For composite indexes, this requires a minimum of 2 and a maximum of 100 - * fields. The last field entry is always for the field path `__name__`. If, - * on creation, `__name__` was not specified as the last field, it will be - * added automatically with the same direction as that of the last field - * defined. If the final field in a composite index is not directional, the - * `__name__` will be ordered ASCENDING (unless explicitly specified). - * For single field indexes, this will always be exactly one entry with a - * field path equal to the field path of the associated field. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Index.IndexField fields = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFields() - { - return $this->fields; - } - - /** - * The fields supported by this index. - * For composite indexes, this requires a minimum of 2 and a maximum of 100 - * fields. The last field entry is always for the field path `__name__`. If, - * on creation, `__name__` was not specified as the last field, it will be - * added automatically with the same direction as that of the last field - * defined. If the final field in a composite index is not directional, the - * `__name__` will be ordered ASCENDING (unless explicitly specified). - * For single field indexes, this will always be exactly one entry with a - * field path equal to the field path of the associated field. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Index.IndexField fields = 3; - * @param array<\Google\Cloud\Firestore\Admin\V1\Index\IndexField>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFields($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\Index\IndexField::class); - $this->fields = $arr; - - return $this; - } - - /** - * Output only. The serving state of the index. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.State state = 4; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The serving state of the index. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.State state = 4; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index\State::class); - $this->state = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/ApiScope.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/ApiScope.php deleted file mode 100644 index d85fe6616eec..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/ApiScope.php +++ /dev/null @@ -1,59 +0,0 @@ -google.firestore.admin.v1.Index.ApiScope - */ -class ApiScope -{ - /** - * The index can only be used by the Firestore Native query API. - * This is the default. - * - * Generated from protobuf enum ANY_API = 0; - */ - const ANY_API = 0; - /** - * The index can only be used by the Firestore in Datastore Mode query API. - * - * Generated from protobuf enum DATASTORE_MODE_API = 1; - */ - const DATASTORE_MODE_API = 1; - - private static $valueToName = [ - self::ANY_API => 'ANY_API', - self::DATASTORE_MODE_API => 'DATASTORE_MODE_API', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ApiScope::class, \Google\Cloud\Firestore\Admin\V1\Index_ApiScope::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField.php deleted file mode 100644 index 8c8cb50ff2cb..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField.php +++ /dev/null @@ -1,158 +0,0 @@ -google.firestore.admin.v1.Index.IndexField - */ -class IndexField extends \Google\Protobuf\Internal\Message -{ - /** - * Can be __name__. - * For single field indexes, this must match the name of the field or may - * be omitted. - * - * Generated from protobuf field string field_path = 1; - */ - protected $field_path = ''; - protected $value_mode; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $field_path - * Can be __name__. - * For single field indexes, this must match the name of the field or may - * be omitted. - * @type int $order - * Indicates that this field supports ordering by the specified order or - * comparing using =, !=, <, <=, >, >=. - * @type int $array_config - * Indicates that this field supports operations on `array_value`s. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Index::initOnce(); - parent::__construct($data); - } - - /** - * Can be __name__. - * For single field indexes, this must match the name of the field or may - * be omitted. - * - * Generated from protobuf field string field_path = 1; - * @return string - */ - public function getFieldPath() - { - return $this->field_path; - } - - /** - * Can be __name__. - * For single field indexes, this must match the name of the field or may - * be omitted. - * - * Generated from protobuf field string field_path = 1; - * @param string $var - * @return $this - */ - public function setFieldPath($var) - { - GPBUtil::checkString($var, True); - $this->field_path = $var; - - return $this; - } - - /** - * Indicates that this field supports ordering by the specified order or - * comparing using =, !=, <, <=, >, >=. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.Order order = 2; - * @return int - */ - public function getOrder() - { - return $this->readOneof(2); - } - - public function hasOrder() - { - return $this->hasOneof(2); - } - - /** - * Indicates that this field supports ordering by the specified order or - * comparing using =, !=, <, <=, >, >=. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.Order order = 2; - * @param int $var - * @return $this - */ - public function setOrder($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index\IndexField\Order::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Indicates that this field supports operations on `array_value`s. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3; - * @return int - */ - public function getArrayConfig() - { - return $this->readOneof(3); - } - - public function hasArrayConfig() - { - return $this->hasOneof(3); - } - - /** - * Indicates that this field supports operations on `array_value`s. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.ArrayConfig array_config = 3; - * @param int $var - * @return $this - */ - public function setArrayConfig($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Index\IndexField\ArrayConfig::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getValueMode() - { - return $this->whichOneof("value_mode"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IndexField::class, \Google\Cloud\Firestore\Admin\V1\Index_IndexField::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/ArrayConfig.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/ArrayConfig.php deleted file mode 100644 index e7ba6fe94de4..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/ArrayConfig.php +++ /dev/null @@ -1,57 +0,0 @@ -google.firestore.admin.v1.Index.IndexField.ArrayConfig - */ -class ArrayConfig -{ - /** - * The index does not support additional array queries. - * - * Generated from protobuf enum ARRAY_CONFIG_UNSPECIFIED = 0; - */ - const ARRAY_CONFIG_UNSPECIFIED = 0; - /** - * The index supports array containment queries. - * - * Generated from protobuf enum CONTAINS = 1; - */ - const CONTAINS = 1; - - private static $valueToName = [ - self::ARRAY_CONFIG_UNSPECIFIED => 'ARRAY_CONFIG_UNSPECIFIED', - self::CONTAINS => 'CONTAINS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ArrayConfig::class, \Google\Cloud\Firestore\Admin\V1\Index_IndexField_ArrayConfig::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/Order.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/Order.php deleted file mode 100644 index d523938322b4..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/Order.php +++ /dev/null @@ -1,64 +0,0 @@ -google.firestore.admin.v1.Index.IndexField.Order - */ -class Order -{ - /** - * The ordering is unspecified. Not a valid option. - * - * Generated from protobuf enum ORDER_UNSPECIFIED = 0; - */ - const ORDER_UNSPECIFIED = 0; - /** - * The field is ordered by ascending field value. - * - * Generated from protobuf enum ASCENDING = 1; - */ - const ASCENDING = 1; - /** - * The field is ordered by descending field value. - * - * Generated from protobuf enum DESCENDING = 2; - */ - const DESCENDING = 2; - - private static $valueToName = [ - self::ORDER_UNSPECIFIED => 'ORDER_UNSPECIFIED', - self::ASCENDING => 'ASCENDING', - self::DESCENDING => 'DESCENDING', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Order::class, \Google\Cloud\Firestore\Admin\V1\Index_IndexField_Order::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/QueryScope.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/QueryScope.php deleted file mode 100644 index 8de8f4c4803c..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/QueryScope.php +++ /dev/null @@ -1,77 +0,0 @@ -google.firestore.admin.v1.Index.QueryScope - */ -class QueryScope -{ - /** - * The query scope is unspecified. Not a valid option. - * - * Generated from protobuf enum QUERY_SCOPE_UNSPECIFIED = 0; - */ - const QUERY_SCOPE_UNSPECIFIED = 0; - /** - * Indexes with a collection query scope specified allow queries - * against a collection that is the child of a specific document, specified - * at query time, and that has the collection id specified by the index. - * - * Generated from protobuf enum COLLECTION = 1; - */ - const COLLECTION = 1; - /** - * Indexes with a collection group query scope specified allow queries - * against all collections that has the collection id specified by the - * index. - * - * Generated from protobuf enum COLLECTION_GROUP = 2; - */ - const COLLECTION_GROUP = 2; - /** - * Include all the collections's ancestor in the index. Only available for - * Datastore Mode databases. - * - * Generated from protobuf enum COLLECTION_RECURSIVE = 3; - */ - const COLLECTION_RECURSIVE = 3; - - private static $valueToName = [ - self::QUERY_SCOPE_UNSPECIFIED => 'QUERY_SCOPE_UNSPECIFIED', - self::COLLECTION => 'COLLECTION', - self::COLLECTION_GROUP => 'COLLECTION_GROUP', - self::COLLECTION_RECURSIVE => 'COLLECTION_RECURSIVE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QueryScope::class, \Google\Cloud\Firestore\Admin\V1\Index_QueryScope::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/State.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/State.php deleted file mode 100644 index d9f96475cd8e..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/State.php +++ /dev/null @@ -1,86 +0,0 @@ -google.firestore.admin.v1.Index.State - */ -class State -{ - /** - * The state is unspecified. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The index is being created. - * There is an active long-running operation for the index. - * The index is updated when writing a document. - * Some index data may exist. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The index is ready to be used. - * The index is updated when writing a document. - * The index is fully populated from all stored documents it applies to. - * - * Generated from protobuf enum READY = 2; - */ - const READY = 2; - /** - * The index was being created, but something went wrong. - * There is no active long-running operation for the index, - * and the most recently finished long-running operation failed. - * The index is not updated when writing a document. - * Some index data may exist. - * Use the google.longrunning.Operations API to determine why the operation - * that last attempted to create this index failed, then re-create the - * index. - * - * Generated from protobuf enum NEEDS_REPAIR = 3; - */ - const NEEDS_REPAIR = 3; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::READY => 'READY', - self::NEEDS_REPAIR => 'NEEDS_REPAIR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Firestore\Admin\V1\Index_State::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/IndexOperationMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/IndexOperationMetadata.php deleted file mode 100644 index 4144b5459434..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/IndexOperationMetadata.php +++ /dev/null @@ -1,287 +0,0 @@ -google.firestore.admin.v1.IndexOperationMetadata - */ -class IndexOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The time this operation started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - protected $start_time = null; - /** - * The time this operation completed. Will be unset if operation still in - * progress. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - protected $end_time = null; - /** - * The index resource that this operation is acting on. For example: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * - * Generated from protobuf field string index = 3; - */ - protected $index = ''; - /** - * The state of the operation. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState state = 4; - */ - protected $state = 0; - /** - * The progress, in documents, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 5; - */ - protected $progress_documents = null; - /** - * The progress, in bytes, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 6; - */ - protected $progress_bytes = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * The time this operation started. - * @type \Google\Protobuf\Timestamp $end_time - * The time this operation completed. Will be unset if operation still in - * progress. - * @type string $index - * The index resource that this operation is acting on. For example: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * @type int $state - * The state of the operation. - * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_documents - * The progress, in documents, of this operation. - * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_bytes - * The progress, in bytes, of this operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); - parent::__construct($data); - } - - /** - * The time this operation started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * The time this operation started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * The time this operation completed. Will be unset if operation still in - * progress. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * The time this operation completed. Will be unset if operation still in - * progress. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * The index resource that this operation is acting on. For example: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * - * Generated from protobuf field string index = 3; - * @return string - */ - public function getIndex() - { - return $this->index; - } - - /** - * The index resource that this operation is acting on. For example: - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * - * Generated from protobuf field string index = 3; - * @param string $var - * @return $this - */ - public function setIndex($var) - { - GPBUtil::checkString($var, True); - $this->index = $var; - - return $this; - } - - /** - * The state of the operation. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState state = 4; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The state of the operation. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState state = 4; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\OperationState::class); - $this->state = $var; - - return $this; - } - - /** - * The progress, in documents, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 5; - * @return \Google\Cloud\Firestore\Admin\V1\Progress|null - */ - public function getProgressDocuments() - { - return $this->progress_documents; - } - - public function hasProgressDocuments() - { - return isset($this->progress_documents); - } - - public function clearProgressDocuments() - { - unset($this->progress_documents); - } - - /** - * The progress, in documents, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_documents = 5; - * @param \Google\Cloud\Firestore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressDocuments($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); - $this->progress_documents = $var; - - return $this; - } - - /** - * The progress, in bytes, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 6; - * @return \Google\Cloud\Firestore\Admin\V1\Progress|null - */ - public function getProgressBytes() - { - return $this->progress_bytes; - } - - public function hasProgressBytes() - { - return isset($this->progress_bytes); - } - - public function clearProgressBytes() - { - unset($this->progress_bytes); - } - - /** - * The progress, in bytes, of this operation. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_bytes = 6; - * @param \Google\Cloud\Firestore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressBytes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); - $this->progress_bytes = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesRequest.php deleted file mode 100644 index 3afd3b83c9bb..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -google.firestore.admin.v1.ListDatabasesRequest - */ -class ListDatabasesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A parent name of the form - * `projects/{project_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - - /** - * @param string $parent Required. A parent name of the form - * `projects/{project_id}` - * Please see {@see FirestoreAdminClient::projectName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\ListDatabasesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. A parent name of the form - * `projects/{project_id}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. A parent name of the form - * `projects/{project_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. A parent name of the form - * `projects/{project_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesResponse.php deleted file mode 100644 index efe6b7b4ae83..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesResponse.php +++ /dev/null @@ -1,129 +0,0 @@ -google.firestore.admin.v1.ListDatabasesResponse - */ -class ListDatabasesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The databases in the project. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Database databases = 1; - */ - private $databases; - /** - * In the event that data about individual databases cannot be listed they - * will be recorded here. - * An example entry might be: projects/some_project/locations/some_location - * This can happen if the Cloud Region that the Database resides in is - * currently unavailable. In this case we can't fetch all the details about - * the database. You may be able to get a more detailed error message - * (or possibly fetch the resource) by sending a 'Get' request for the - * resource or a 'List' request for the specific location. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Firestore\Admin\V1\Database>|\Google\Protobuf\Internal\RepeatedField $databases - * The databases in the project. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * In the event that data about individual databases cannot be listed they - * will be recorded here. - * An example entry might be: projects/some_project/locations/some_location - * This can happen if the Cloud Region that the Database resides in is - * currently unavailable. In this case we can't fetch all the details about - * the database. You may be able to get a more detailed error message - * (or possibly fetch the resource) by sending a 'Get' request for the - * resource or a 'List' request for the specific location. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * The databases in the project. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Database databases = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDatabases() - { - return $this->databases; - } - - /** - * The databases in the project. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Database databases = 1; - * @param array<\Google\Cloud\Firestore\Admin\V1\Database>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDatabases($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\Database::class); - $this->databases = $arr; - - return $this; - } - - /** - * In the event that data about individual databases cannot be listed they - * will be recorded here. - * An example entry might be: projects/some_project/locations/some_location - * This can happen if the Cloud Region that the Database resides in is - * currently unavailable. In this case we can't fetch all the details about - * the database. You may be able to get a more detailed error message - * (or possibly fetch the resource) by sending a 'Get' request for the - * resource or a 'List' request for the specific location. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * In the event that data about individual databases cannot be listed they - * will be recorded here. - * An example entry might be: projects/some_project/locations/some_location - * This can happen if the Cloud Region that the Database resides in is - * currently unavailable. In this case we can't fetch all the details about - * the database. You may be able to get a more detailed error message - * (or possibly fetch the resource) by sending a 'Get' request for the - * resource or a 'List' request for the specific location. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUnreachable($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->unreachable = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsRequest.php deleted file mode 100644 index d1144d213756..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsRequest.php +++ /dev/null @@ -1,217 +0,0 @@ -google.firestore.admin.v1.ListFieldsRequest - */ -class ListFieldsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The filter to apply to list results. Currently, - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * only supports listing fields that have been explicitly overridden. To issue - * this query, call - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with a filter that includes `indexConfig.usesAncestorConfig:false` . - * - * Generated from protobuf field string filter = 2; - */ - protected $filter = ''; - /** - * The number of results to return. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * A page token, returned from a previous call to - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], - * that may be used to get the next page of results. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * Please see {@see FirestoreAdminClient::collectionGroupName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\ListFieldsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * @type string $filter - * The filter to apply to list results. Currently, - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * only supports listing fields that have been explicitly overridden. To issue - * this query, call - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with a filter that includes `indexConfig.usesAncestorConfig:false` . - * @type int $page_size - * The number of results to return. - * @type string $page_token - * A page token, returned from a previous call to - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], - * that may be used to get the next page of results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The filter to apply to list results. Currently, - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * only supports listing fields that have been explicitly overridden. To issue - * this query, call - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with a filter that includes `indexConfig.usesAncestorConfig:false` . - * - * Generated from protobuf field string filter = 2; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * The filter to apply to list results. Currently, - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * only supports listing fields that have been explicitly overridden. To issue - * this query, call - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with a filter that includes `indexConfig.usesAncestorConfig:false` . - * - * Generated from protobuf field string filter = 2; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * The number of results to return. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The number of results to return. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token, returned from a previous call to - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], - * that may be used to get the next page of results. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token, returned from a previous call to - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields], - * that may be used to get the next page of results. - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsResponse.php deleted file mode 100644 index 58d931b50c93..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.firestore.admin.v1.ListFieldsResponse - */ -class ListFieldsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The requested fields. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Field fields = 1; - */ - private $fields; - /** - * A page token that may be used to request another page of results. If blank, - * this is the last page. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Firestore\Admin\V1\Field>|\Google\Protobuf\Internal\RepeatedField $fields - * The requested fields. - * @type string $next_page_token - * A page token that may be used to request another page of results. If blank, - * this is the last page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * The requested fields. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Field fields = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFields() - { - return $this->fields; - } - - /** - * The requested fields. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Field fields = 1; - * @param array<\Google\Cloud\Firestore\Admin\V1\Field>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFields($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\Field::class); - $this->fields = $arr; - - return $this; - } - - /** - * A page token that may be used to request another page of results. If blank, - * this is the last page. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A page token that may be used to request another page of results. If blank, - * this is the last page. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesRequest.php deleted file mode 100644 index a0d52b953646..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesRequest.php +++ /dev/null @@ -1,197 +0,0 @@ -google.firestore.admin.v1.ListIndexesRequest - */ -class ListIndexesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The filter to apply to list results. - * - * Generated from protobuf field string filter = 2; - */ - protected $filter = ''; - /** - * The number of results to return. - * - * Generated from protobuf field int32 page_size = 3; - */ - protected $page_size = 0; - /** - * A page token, returned from a previous call to - * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], - * that may be used to get the next page of results. - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - - /** - * @param string $parent Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * Please see {@see FirestoreAdminClient::collectionGroupName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\ListIndexesRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * @type string $filter - * The filter to apply to list results. - * @type int $page_size - * The number of results to return. - * @type string $page_token - * A page token, returned from a previous call to - * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], - * that may be used to get the next page of results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The filter to apply to list results. - * - * Generated from protobuf field string filter = 2; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * The filter to apply to list results. - * - * Generated from protobuf field string filter = 2; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * The number of results to return. - * - * Generated from protobuf field int32 page_size = 3; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The number of results to return. - * - * Generated from protobuf field int32 page_size = 3; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token, returned from a previous call to - * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], - * that may be used to get the next page of results. - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token, returned from a previous call to - * [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes], - * that may be used to get the next page of results. - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesResponse.php deleted file mode 100644 index 6b6ba380cd71..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListIndexesResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.firestore.admin.v1.ListIndexesResponse - */ -class ListIndexesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The requested indexes. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Index indexes = 1; - */ - private $indexes; - /** - * A page token that may be used to request another page of results. If blank, - * this is the last page. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Firestore\Admin\V1\Index>|\Google\Protobuf\Internal\RepeatedField $indexes - * The requested indexes. - * @type string $next_page_token - * A page token that may be used to request another page of results. If blank, - * this is the last page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * The requested indexes. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Index indexes = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIndexes() - { - return $this->indexes; - } - - /** - * The requested indexes. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Index indexes = 1; - * @param array<\Google\Cloud\Firestore\Admin\V1\Index>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIndexes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\Index::class); - $this->indexes = $arr; - - return $this; - } - - /** - * A page token that may be used to request another page of results. If blank, - * this is the last page. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A page token that may be used to request another page of results. If blank, - * this is the last page. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/LocationMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/LocationMetadata.php deleted file mode 100644 index 36d656955673..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/LocationMetadata.php +++ /dev/null @@ -1,34 +0,0 @@ -google.firestore.admin.v1.LocationMetadata - */ -class LocationMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Location::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/OperationState.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/OperationState.php deleted file mode 100644 index 73244df17d28..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/OperationState.php +++ /dev/null @@ -1,98 +0,0 @@ -google.firestore.admin.v1.OperationState - */ -class OperationState -{ - /** - * Unspecified. - * - * Generated from protobuf enum OPERATION_STATE_UNSPECIFIED = 0; - */ - const OPERATION_STATE_UNSPECIFIED = 0; - /** - * Request is being prepared for processing. - * - * Generated from protobuf enum INITIALIZING = 1; - */ - const INITIALIZING = 1; - /** - * Request is actively being processed. - * - * Generated from protobuf enum PROCESSING = 2; - */ - const PROCESSING = 2; - /** - * Request is in the process of being cancelled after user called - * google.longrunning.Operations.CancelOperation on the operation. - * - * Generated from protobuf enum CANCELLING = 3; - */ - const CANCELLING = 3; - /** - * Request has been processed and is in its finalization stage. - * - * Generated from protobuf enum FINALIZING = 4; - */ - const FINALIZING = 4; - /** - * Request has completed successfully. - * - * Generated from protobuf enum SUCCESSFUL = 5; - */ - const SUCCESSFUL = 5; - /** - * Request has finished being processed, but encountered an error. - * - * Generated from protobuf enum FAILED = 6; - */ - const FAILED = 6; - /** - * Request has finished being cancelled after user called - * google.longrunning.Operations.CancelOperation. - * - * Generated from protobuf enum CANCELLED = 7; - */ - const CANCELLED = 7; - - private static $valueToName = [ - self::OPERATION_STATE_UNSPECIFIED => 'OPERATION_STATE_UNSPECIFIED', - self::INITIALIZING => 'INITIALIZING', - self::PROCESSING => 'PROCESSING', - self::CANCELLING => 'CANCELLING', - self::FINALIZING => 'FINALIZING', - self::SUCCESSFUL => 'SUCCESSFUL', - self::FAILED => 'FAILED', - self::CANCELLED => 'CANCELLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Progress.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Progress.php deleted file mode 100644 index 24ea17a96c10..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Progress.php +++ /dev/null @@ -1,103 +0,0 @@ -google.firestore.admin.v1.Progress - */ -class Progress extends \Google\Protobuf\Internal\Message -{ - /** - * The amount of work estimated. - * - * Generated from protobuf field int64 estimated_work = 1; - */ - protected $estimated_work = 0; - /** - * The amount of work completed. - * - * Generated from protobuf field int64 completed_work = 2; - */ - protected $completed_work = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $estimated_work - * The amount of work estimated. - * @type int|string $completed_work - * The amount of work completed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); - parent::__construct($data); - } - - /** - * The amount of work estimated. - * - * Generated from protobuf field int64 estimated_work = 1; - * @return int|string - */ - public function getEstimatedWork() - { - return $this->estimated_work; - } - - /** - * The amount of work estimated. - * - * Generated from protobuf field int64 estimated_work = 1; - * @param int|string $var - * @return $this - */ - public function setEstimatedWork($var) - { - GPBUtil::checkInt64($var); - $this->estimated_work = $var; - - return $this; - } - - /** - * The amount of work completed. - * - * Generated from protobuf field int64 completed_work = 2; - * @return int|string - */ - public function getCompletedWork() - { - return $this->completed_work; - } - - /** - * The amount of work completed. - * - * Generated from protobuf field int64 completed_work = 2; - * @param int|string $var - * @return $this - */ - public function setCompletedWork($var) - { - GPBUtil::checkInt64($var); - $this->completed_work = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseMetadata.php deleted file mode 100644 index bc68c8671ec8..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.firestore.admin.v1.UpdateDatabaseMetadata - */ -class UpdateDatabaseMetadata extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseRequest.php deleted file mode 100644 index 71f72a8e54b1..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateDatabaseRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -google.firestore.admin.v1.UpdateDatabaseRequest - */ -class UpdateDatabaseRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The database to update. - * - * Generated from protobuf field .google.firestore.admin.v1.Database database = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $database = null; - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Firestore\Admin\V1\Database $database Required. The database to update. - * @param \Google\Protobuf\FieldMask $updateMask The list of fields to be updated. - * - * @return \Google\Cloud\Firestore\Admin\V1\UpdateDatabaseRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Firestore\Admin\V1\Database $database, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setDatabase($database) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\Admin\V1\Database $database - * Required. The database to update. - * @type \Google\Protobuf\FieldMask $update_mask - * The list of fields to be updated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. The database to update. - * - * Generated from protobuf field .google.firestore.admin.v1.Database database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Firestore\Admin\V1\Database|null - */ - public function getDatabase() - { - return $this->database; - } - - public function hasDatabase() - { - return isset($this->database); - } - - public function clearDatabase() - { - unset($this->database); - } - - /** - * Required. The database to update. - * - * Generated from protobuf field .google.firestore.admin.v1.Database database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Firestore\Admin\V1\Database $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Database::class); - $this->database = $var; - - return $this; - } - - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * The list of fields to be updated. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateFieldRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateFieldRequest.php deleted file mode 100644 index a860a8be36a7..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateFieldRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.firestore.admin.v1.UpdateFieldRequest - */ -class UpdateFieldRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The field to be updated. - * - * Generated from protobuf field .google.firestore.admin.v1.Field field = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $field = null; - /** - * A mask, relative to the field. If specified, only configuration specified - * by this field_mask will be updated in the field. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - - /** - * @param \Google\Cloud\Firestore\Admin\V1\Field $field Required. The field to be updated. - * - * @return \Google\Cloud\Firestore\Admin\V1\UpdateFieldRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Firestore\Admin\V1\Field $field): self - { - return (new self()) - ->setField($field); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\Admin\V1\Field $field - * Required. The field to be updated. - * @type \Google\Protobuf\FieldMask $update_mask - * A mask, relative to the field. If specified, only configuration specified - * by this field_mask will be updated in the field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. The field to be updated. - * - * Generated from protobuf field .google.firestore.admin.v1.Field field = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Firestore\Admin\V1\Field|null - */ - public function getField() - { - return $this->field; - } - - public function hasField() - { - return isset($this->field); - } - - public function clearField() - { - unset($this->field); - } - - /** - * Required. The field to be updated. - * - * Generated from protobuf field .google.firestore.admin.v1.Field field = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Firestore\Admin\V1\Field $var - * @return $this - */ - public function setField($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Field::class); - $this->field = $var; - - return $this; - } - - /** - * A mask, relative to the field. If specified, only configuration specified - * by this field_mask will be updated in the field. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * A mask, relative to the field. If specified, only configuration specified - * by this field_mask will be updated in the field. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_database.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_database.php deleted file mode 100644 index 23cf55551637..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_database.php +++ /dev/null @@ -1,96 +0,0 @@ -setParent($formattedParent) - ->setDatabase($database) - ->setDatabaseId($databaseId); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $firestoreAdminClient->createDatabase($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Database $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = FirestoreAdminClient::projectName('[PROJECT]'); - $databaseId = '[DATABASE_ID]'; - - create_database_sample($formattedParent, $databaseId); -} -// [END firestore_v1_generated_FirestoreAdmin_CreateDatabase_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_index.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_index.php deleted file mode 100644 index b3868089e22d..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_index.php +++ /dev/null @@ -1,94 +0,0 @@ -setParent($formattedParent) - ->setIndex($index); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $firestoreAdminClient->createIndex($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Index $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = FirestoreAdminClient::collectionGroupName( - '[PROJECT]', - '[DATABASE]', - '[COLLECTION]' - ); - - create_index_sample($formattedParent); -} -// [END firestore_v1_generated_FirestoreAdmin_CreateIndex_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_database.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_database.php deleted file mode 100644 index e9e63f6359ab..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_database.php +++ /dev/null @@ -1,84 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $firestoreAdminClient->deleteDatabase($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Database $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = FirestoreAdminClient::databaseName('[PROJECT]', '[DATABASE]'); - - delete_database_sample($formattedName); -} -// [END firestore_v1_generated_FirestoreAdmin_DeleteDatabase_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_index.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_index.php deleted file mode 100644 index 1da8adead502..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_index.php +++ /dev/null @@ -1,75 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $firestoreAdminClient->deleteIndex($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = FirestoreAdminClient::indexName( - '[PROJECT]', - '[DATABASE]', - '[COLLECTION]', - '[INDEX]' - ); - - delete_index_sample($formattedName); -} -// [END firestore_v1_generated_FirestoreAdmin_DeleteIndex_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/export_documents.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/export_documents.php deleted file mode 100644 index 9fde0db173ba..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/export_documents.php +++ /dev/null @@ -1,94 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $firestoreAdminClient->exportDocuments($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ExportDocumentsResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = FirestoreAdminClient::databaseName('[PROJECT]', '[DATABASE]'); - - export_documents_sample($formattedName); -} -// [END firestore_v1_generated_FirestoreAdmin_ExportDocuments_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_database.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_database.php deleted file mode 100644 index 8206f7a163fc..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_database.php +++ /dev/null @@ -1,72 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Database $response */ - $response = $firestoreAdminClient->getDatabase($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = FirestoreAdminClient::databaseName('[PROJECT]', '[DATABASE]'); - - get_database_sample($formattedName); -} -// [END firestore_v1_generated_FirestoreAdmin_GetDatabase_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_field.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_field.php deleted file mode 100644 index e6fea83d16c5..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_field.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Field $response */ - $response = $firestoreAdminClient->getField($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = FirestoreAdminClient::fieldName( - '[PROJECT]', - '[DATABASE]', - '[COLLECTION]', - '[FIELD]' - ); - - get_field_sample($formattedName); -} -// [END firestore_v1_generated_FirestoreAdmin_GetField_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_index.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_index.php deleted file mode 100644 index 1b4ad8918c85..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_index.php +++ /dev/null @@ -1,77 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Index $response */ - $response = $firestoreAdminClient->getIndex($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = FirestoreAdminClient::indexName( - '[PROJECT]', - '[DATABASE]', - '[COLLECTION]', - '[INDEX]' - ); - - get_index_sample($formattedName); -} -// [END firestore_v1_generated_FirestoreAdmin_GetIndex_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/import_documents.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/import_documents.php deleted file mode 100644 index 9a2a04e7a9f5..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/import_documents.php +++ /dev/null @@ -1,85 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $firestoreAdminClient->importDocuments($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = FirestoreAdminClient::databaseName('[PROJECT]', '[DATABASE]'); - - import_documents_sample($formattedName); -} -// [END firestore_v1_generated_FirestoreAdmin_ImportDocuments_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_databases.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_databases.php deleted file mode 100644 index 695b54581c8c..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_databases.php +++ /dev/null @@ -1,72 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var ListDatabasesResponse $response */ - $response = $firestoreAdminClient->listDatabases($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = FirestoreAdminClient::projectName('[PROJECT]'); - - list_databases_sample($formattedParent); -} -// [END firestore_v1_generated_FirestoreAdmin_ListDatabases_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_fields.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_fields.php deleted file mode 100644 index 6a38c4d901ae..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_fields.php +++ /dev/null @@ -1,89 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $firestoreAdminClient->listFields($request); - - /** @var Field $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = FirestoreAdminClient::collectionGroupName( - '[PROJECT]', - '[DATABASE]', - '[COLLECTION]' - ); - - list_fields_sample($formattedParent); -} -// [END firestore_v1_generated_FirestoreAdmin_ListFields_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_indexes.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_indexes.php deleted file mode 100644 index 4b1b4a26a49e..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_indexes.php +++ /dev/null @@ -1,81 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $firestoreAdminClient->listIndexes($request); - - /** @var Index $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = FirestoreAdminClient::collectionGroupName( - '[PROJECT]', - '[DATABASE]', - '[COLLECTION]' - ); - - list_indexes_sample($formattedParent); -} -// [END firestore_v1_generated_FirestoreAdmin_ListIndexes_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_database.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_database.php deleted file mode 100644 index c98f5c894ff9..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_database.php +++ /dev/null @@ -1,71 +0,0 @@ -setDatabase($database); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $firestoreAdminClient->updateDatabase($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Database $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END firestore_v1_generated_FirestoreAdmin_UpdateDatabase_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_field.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_field.php deleted file mode 100644 index 8482c64a4df9..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_field.php +++ /dev/null @@ -1,124 +0,0 @@ -setName($fieldName); - $request = (new UpdateFieldRequest()) - ->setField($field); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $firestoreAdminClient->updateField($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Field $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $fieldName = '[NAME]'; - - update_field_sample($fieldName); -} -// [END firestore_v1_generated_FirestoreAdmin_UpdateField_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/src/V1/Client/FirestoreAdminClient.php b/owl-bot-staging/Firestore/v1/Admin/src/V1/Client/FirestoreAdminClient.php deleted file mode 100644 index fdaa886fee35..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/src/V1/Client/FirestoreAdminClient.php +++ /dev/null @@ -1,789 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/firestore_admin_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/firestore_admin_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/firestore_admin_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/firestore_admin_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * collection_group resource. - * - * @param string $project - * @param string $database - * @param string $collection - * - * @return string The formatted collection_group resource. - */ - public static function collectionGroupName(string $project, string $database, string $collection): string - { - return self::getPathTemplate('collectionGroup')->render([ - 'project' => $project, - 'database' => $database, - 'collection' => $collection, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a database - * resource. - * - * @param string $project - * @param string $database - * - * @return string The formatted database resource. - */ - public static function databaseName(string $project, string $database): string - { - return self::getPathTemplate('database')->render([ - 'project' => $project, - 'database' => $database, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a field - * resource. - * - * @param string $project - * @param string $database - * @param string $collection - * @param string $field - * - * @return string The formatted field resource. - */ - public static function fieldName(string $project, string $database, string $collection, string $field): string - { - return self::getPathTemplate('field')->render([ - 'project' => $project, - 'database' => $database, - 'collection' => $collection, - 'field' => $field, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a index - * resource. - * - * @param string $project - * @param string $database - * @param string $collection - * @param string $index - * - * @return string The formatted index resource. - */ - public static function indexName(string $project, string $database, string $collection, string $index): string - { - return self::getPathTemplate('index')->render([ - 'project' => $project, - 'database' => $database, - 'collection' => $collection, - 'index' => $index, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName(string $project): string - { - return self::getPathTemplate('project')->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - collectionGroup: projects/{project}/databases/{database}/collectionGroups/{collection} - * - database: projects/{project}/databases/{database} - * - field: projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field} - * - index: projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index} - * - project: projects/{project} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName(string $formattedName, string $template = null): array - { - return self::parseFormattedName($formattedName, $template); - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'firestore.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Create a database. - * - * The async variant is {@see FirestoreAdminClient::createDatabaseAsync()} . - * - * @example samples/V1/FirestoreAdminClient/create_database.php - * - * @param CreateDatabaseRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createDatabase(CreateDatabaseRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateDatabase', $request, $callOptions)->wait(); - } - - /** - * Creates a composite index. This returns a - * [google.longrunning.Operation][google.longrunning.Operation] which may be - * used to track the status of the creation. The metadata for the operation - * will be the type - * [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata]. - * - * The async variant is {@see FirestoreAdminClient::createIndexAsync()} . - * - * @example samples/V1/FirestoreAdminClient/create_index.php - * - * @param CreateIndexRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createIndex(CreateIndexRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateIndex', $request, $callOptions)->wait(); - } - - /** - * Deletes a database. - * - * The async variant is {@see FirestoreAdminClient::deleteDatabaseAsync()} . - * - * @example samples/V1/FirestoreAdminClient/delete_database.php - * - * @param DeleteDatabaseRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteDatabase(DeleteDatabaseRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteDatabase', $request, $callOptions)->wait(); - } - - /** - * Deletes a composite index. - * - * The async variant is {@see FirestoreAdminClient::deleteIndexAsync()} . - * - * @example samples/V1/FirestoreAdminClient/delete_index.php - * - * @param DeleteIndexRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteIndex(DeleteIndexRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteIndex', $request, $callOptions)->wait(); - } - - /** - * Exports a copy of all or a subset of documents from Google Cloud Firestore - * to another storage system, such as Google Cloud Storage. Recent updates to - * documents may not be reflected in the export. The export occurs in the - * background and its progress can be monitored and managed via the - * Operation resource that is created. The output of an export may only be - * used once the associated operation is done. If an export operation is - * cancelled before completion it may leave partial data behind in Google - * Cloud Storage. - * - * For more details on export behavior and output format, refer to: - * https://cloud.google.com/firestore/docs/manage-data/export-import - * - * The async variant is {@see FirestoreAdminClient::exportDocumentsAsync()} . - * - * @example samples/V1/FirestoreAdminClient/export_documents.php - * - * @param ExportDocumentsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function exportDocuments(ExportDocumentsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ExportDocuments', $request, $callOptions)->wait(); - } - - /** - * Gets information about a database. - * - * The async variant is {@see FirestoreAdminClient::getDatabaseAsync()} . - * - * @example samples/V1/FirestoreAdminClient/get_database.php - * - * @param GetDatabaseRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Database - * - * @throws ApiException Thrown if the API call fails. - */ - public function getDatabase(GetDatabaseRequest $request, array $callOptions = []): Database - { - return $this->startApiCall('GetDatabase', $request, $callOptions)->wait(); - } - - /** - * Gets the metadata and configuration for a Field. - * - * The async variant is {@see FirestoreAdminClient::getFieldAsync()} . - * - * @example samples/V1/FirestoreAdminClient/get_field.php - * - * @param GetFieldRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Field - * - * @throws ApiException Thrown if the API call fails. - */ - public function getField(GetFieldRequest $request, array $callOptions = []): Field - { - return $this->startApiCall('GetField', $request, $callOptions)->wait(); - } - - /** - * Gets a composite index. - * - * The async variant is {@see FirestoreAdminClient::getIndexAsync()} . - * - * @example samples/V1/FirestoreAdminClient/get_index.php - * - * @param GetIndexRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Index - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIndex(GetIndexRequest $request, array $callOptions = []): Index - { - return $this->startApiCall('GetIndex', $request, $callOptions)->wait(); - } - - /** - * Imports documents into Google Cloud Firestore. Existing documents with the - * same name are overwritten. The import occurs in the background and its - * progress can be monitored and managed via the Operation resource that is - * created. If an ImportDocuments operation is cancelled, it is possible - * that a subset of the data has already been imported to Cloud Firestore. - * - * The async variant is {@see FirestoreAdminClient::importDocumentsAsync()} . - * - * @example samples/V1/FirestoreAdminClient/import_documents.php - * - * @param ImportDocumentsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function importDocuments(ImportDocumentsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ImportDocuments', $request, $callOptions)->wait(); - } - - /** - * List all the databases in the project. - * - * The async variant is {@see FirestoreAdminClient::listDatabasesAsync()} . - * - * @example samples/V1/FirestoreAdminClient/list_databases.php - * - * @param ListDatabasesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ListDatabasesResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listDatabases(ListDatabasesRequest $request, array $callOptions = []): ListDatabasesResponse - { - return $this->startApiCall('ListDatabases', $request, $callOptions)->wait(); - } - - /** - * Lists the field configuration and metadata for this database. - * - * Currently, - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * only supports listing fields that have been explicitly overridden. To issue - * this query, call - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with the filter set to `indexConfig.usesAncestorConfig:false` or - * `ttlConfig:*`. - * - * The async variant is {@see FirestoreAdminClient::listFieldsAsync()} . - * - * @example samples/V1/FirestoreAdminClient/list_fields.php - * - * @param ListFieldsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listFields(ListFieldsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListFields', $request, $callOptions); - } - - /** - * Lists composite indexes. - * - * The async variant is {@see FirestoreAdminClient::listIndexesAsync()} . - * - * @example samples/V1/FirestoreAdminClient/list_indexes.php - * - * @param ListIndexesRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listIndexes(ListIndexesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListIndexes', $request, $callOptions); - } - - /** - * Updates a database. - * - * The async variant is {@see FirestoreAdminClient::updateDatabaseAsync()} . - * - * @example samples/V1/FirestoreAdminClient/update_database.php - * - * @param UpdateDatabaseRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateDatabase(UpdateDatabaseRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateDatabase', $request, $callOptions)->wait(); - } - - /** - * Updates a field configuration. Currently, field updates apply only to - * single field index configuration. However, calls to - * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] - * should provide a field mask to avoid changing any configuration that the - * caller isn't aware of. The field mask should be specified as: `{ paths: - * "index_config" }`. - * - * This call returns a - * [google.longrunning.Operation][google.longrunning.Operation] which may be - * used to track the status of the field update. The metadata for the - * operation will be the type - * [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata]. - * - * To configure the default field settings for the database, use - * the special `Field` with resource name: - * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. - * - * The async variant is {@see FirestoreAdminClient::updateFieldAsync()} . - * - * @example samples/V1/FirestoreAdminClient/update_field.php - * - * @param UpdateFieldRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateField(UpdateFieldRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('UpdateField', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Firestore/v1/Admin/src/V1/FirestoreAdminClient.php b/owl-bot-staging/Firestore/v1/Admin/src/V1/FirestoreAdminClient.php deleted file mode 100644 index c16524637b1e..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/src/V1/FirestoreAdminClient.php +++ /dev/null @@ -1,34 +0,0 @@ -projectName('[PROJECT]'); - * $database = new Database(); - * $databaseId = 'database_id'; - * $operationResponse = $firestoreAdminClient->createDatabase($formattedParent, $database, $databaseId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $firestoreAdminClient->createDatabase($formattedParent, $database, $databaseId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'createDatabase'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Firestore\Admin\V1\Client\FirestoreAdminClient}. - */ -class FirestoreAdminGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.firestore.admin.v1.FirestoreAdmin'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'firestore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'firestore.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/datastore', - ]; - - private static $collectionGroupNameTemplate; - - private static $databaseNameTemplate; - - private static $fieldNameTemplate; - - private static $indexNameTemplate; - - private static $projectNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/firestore_admin_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/firestore_admin_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/firestore_admin_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/firestore_admin_rest_client_config.php', - ], - ], - ]; - } - - private static function getCollectionGroupNameTemplate() - { - if (self::$collectionGroupNameTemplate == null) { - self::$collectionGroupNameTemplate = new PathTemplate('projects/{project}/databases/{database}/collectionGroups/{collection}'); - } - - return self::$collectionGroupNameTemplate; - } - - private static function getDatabaseNameTemplate() - { - if (self::$databaseNameTemplate == null) { - self::$databaseNameTemplate = new PathTemplate('projects/{project}/databases/{database}'); - } - - return self::$databaseNameTemplate; - } - - private static function getFieldNameTemplate() - { - if (self::$fieldNameTemplate == null) { - self::$fieldNameTemplate = new PathTemplate('projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}'); - } - - return self::$fieldNameTemplate; - } - - private static function getIndexNameTemplate() - { - if (self::$indexNameTemplate == null) { - self::$indexNameTemplate = new PathTemplate('projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}'); - } - - return self::$indexNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'collectionGroup' => self::getCollectionGroupNameTemplate(), - 'database' => self::getDatabaseNameTemplate(), - 'field' => self::getFieldNameTemplate(), - 'index' => self::getIndexNameTemplate(), - 'project' => self::getProjectNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a - * collection_group resource. - * - * @param string $project - * @param string $database - * @param string $collection - * - * @return string The formatted collection_group resource. - */ - public static function collectionGroupName($project, $database, $collection) - { - return self::getCollectionGroupNameTemplate()->render([ - 'project' => $project, - 'database' => $database, - 'collection' => $collection, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a database - * resource. - * - * @param string $project - * @param string $database - * - * @return string The formatted database resource. - */ - public static function databaseName($project, $database) - { - return self::getDatabaseNameTemplate()->render([ - 'project' => $project, - 'database' => $database, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a field - * resource. - * - * @param string $project - * @param string $database - * @param string $collection - * @param string $field - * - * @return string The formatted field resource. - */ - public static function fieldName($project, $database, $collection, $field) - { - return self::getFieldNameTemplate()->render([ - 'project' => $project, - 'database' => $database, - 'collection' => $collection, - 'field' => $field, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a index - * resource. - * - * @param string $project - * @param string $database - * @param string $collection - * @param string $index - * - * @return string The formatted index resource. - */ - public static function indexName($project, $database, $collection, $index) - { - return self::getIndexNameTemplate()->render([ - 'project' => $project, - 'database' => $database, - 'collection' => $collection, - 'index' => $index, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - collectionGroup: projects/{project}/databases/{database}/collectionGroups/{collection} - * - database: projects/{project}/databases/{database} - * - field: projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field} - * - index: projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index} - * - project: projects/{project} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'firestore.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Create a database. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedParent = $firestoreAdminClient->projectName('[PROJECT]'); - * $database = new Database(); - * $databaseId = 'database_id'; - * $operationResponse = $firestoreAdminClient->createDatabase($formattedParent, $database, $databaseId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $firestoreAdminClient->createDatabase($formattedParent, $database, $databaseId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'createDatabase'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. A parent name of the form - * `projects/{project_id}` - * @param Database $database Required. The Database to create. - * @param string $databaseId Required. The ID to use for the database, which will become the final - * component of the database's resource name. - * - * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ - * with first character a letter and the last a letter or a number. Must not - * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. - * - * "(default)" database id is also valid. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createDatabase($parent, $database, $databaseId, array $optionalArgs = []) - { - $request = new CreateDatabaseRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDatabase($database); - $request->setDatabaseId($databaseId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a composite index. This returns a - * [google.longrunning.Operation][google.longrunning.Operation] which may be - * used to track the status of the creation. The metadata for the operation - * will be the type - * [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata]. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedParent = $firestoreAdminClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - * $index = new Index(); - * $operationResponse = $firestoreAdminClient->createIndex($formattedParent, $index); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $firestoreAdminClient->createIndex($formattedParent, $index); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'createIndex'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * @param Index $index Required. The composite index to create. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createIndex($parent, $index, array $optionalArgs = []) - { - $request = new CreateIndexRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setIndex($index); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateIndex', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a database. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedName = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); - * $operationResponse = $firestoreAdminClient->deleteDatabase($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $firestoreAdminClient->deleteDatabase($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'deleteDatabase'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $name Required. A name of the form - * `projects/{project_id}/databases/{database_id}` - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * The current etag of the Database. - * If an etag is provided and does not match the current etag of the database, - * deletion will be blocked and a FAILED_PRECONDITION error will be returned. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteDatabase($name, array $optionalArgs = []) - { - $request = new DeleteDatabaseRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a composite index. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedName = $firestoreAdminClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); - * $firestoreAdminClient->deleteIndex($formattedName); - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $name Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteIndex($name, array $optionalArgs = []) - { - $request = new DeleteIndexRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteIndex', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Exports a copy of all or a subset of documents from Google Cloud Firestore - * to another storage system, such as Google Cloud Storage. Recent updates to - * documents may not be reflected in the export. The export occurs in the - * background and its progress can be monitored and managed via the - * Operation resource that is created. The output of an export may only be - * used once the associated operation is done. If an export operation is - * cancelled before completion it may leave partial data behind in Google - * Cloud Storage. - * - * For more details on export behavior and output format, refer to: - * https://cloud.google.com/firestore/docs/manage-data/export-import - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedName = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); - * $operationResponse = $firestoreAdminClient->exportDocuments($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $firestoreAdminClient->exportDocuments($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'exportDocuments'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $name Required. Database to export. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string[] $collectionIds - * Which collection ids to export. Unspecified means all collections. - * @type string $outputUriPrefix - * The output URI. Currently only supports Google Cloud Storage URIs of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name - * of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional - * Google Cloud Storage namespace path. When - * choosing a name, be sure to consider Google Cloud Storage naming - * guidelines: https://cloud.google.com/storage/docs/naming. - * If the URI is a bucket (without a namespace path), a prefix will be - * generated based on the start time. - * @type string[] $namespaceIds - * An empty list represents all namespaces. This is the preferred - * usage for databases that don't use namespaces. - * - * An empty string element represents the default namespace. This should be - * used if the database has data in non-default namespaces, but doesn't want - * to include them. Each namespace in this list must be unique. - * @type Timestamp $snapshotTime - * The timestamp that corresponds to the version of the database to be - * exported. The timestamp must be in the past, rounded to the minute and not - * older than - * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time]. - * If specified, then the exported documents will represent a consistent view - * of the database at the provided time. Otherwise, there are no guarantees - * about the consistency of the exported documents. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function exportDocuments($name, array $optionalArgs = []) - { - $request = new ExportDocumentsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['collectionIds'])) { - $request->setCollectionIds($optionalArgs['collectionIds']); - } - - if (isset($optionalArgs['outputUriPrefix'])) { - $request->setOutputUriPrefix($optionalArgs['outputUriPrefix']); - } - - if (isset($optionalArgs['namespaceIds'])) { - $request->setNamespaceIds($optionalArgs['namespaceIds']); - } - - if (isset($optionalArgs['snapshotTime'])) { - $request->setSnapshotTime($optionalArgs['snapshotTime']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ExportDocuments', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets information about a database. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedName = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); - * $response = $firestoreAdminClient->getDatabase($formattedName); - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $name Required. A name of the form - * `projects/{project_id}/databases/{database_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Firestore\Admin\V1\Database - * - * @throws ApiException if the remote call fails - */ - public function getDatabase($name, array $optionalArgs = []) - { - $request = new GetDatabaseRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetDatabase', Database::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the metadata and configuration for a Field. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedName = $firestoreAdminClient->fieldName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[FIELD]'); - * $response = $firestoreAdminClient->getField($formattedName); - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $name Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Firestore\Admin\V1\Field - * - * @throws ApiException if the remote call fails - */ - public function getField($name, array $optionalArgs = []) - { - $request = new GetFieldRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetField', Field::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a composite index. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedName = $firestoreAdminClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); - * $response = $firestoreAdminClient->getIndex($formattedName); - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $name Required. A name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Firestore\Admin\V1\Index - * - * @throws ApiException if the remote call fails - */ - public function getIndex($name, array $optionalArgs = []) - { - $request = new GetIndexRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIndex', Index::class, $optionalArgs, $request)->wait(); - } - - /** - * Imports documents into Google Cloud Firestore. Existing documents with the - * same name are overwritten. The import occurs in the background and its - * progress can be monitored and managed via the Operation resource that is - * created. If an ImportDocuments operation is cancelled, it is possible - * that a subset of the data has already been imported to Cloud Firestore. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedName = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); - * $operationResponse = $firestoreAdminClient->importDocuments($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $firestoreAdminClient->importDocuments($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'importDocuments'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $name Required. Database to import into. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string[] $collectionIds - * Which collection ids to import. Unspecified means all collections included - * in the import. - * @type string $inputUriPrefix - * Location of the exported files. - * This must match the output_uri_prefix of an ExportDocumentsResponse from - * an export that has completed successfully. - * See: - * [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]. - * @type string[] $namespaceIds - * An empty list represents all namespaces. This is the preferred - * usage for databases that don't use namespaces. - * - * An empty string element represents the default namespace. This should be - * used if the database has data in non-default namespaces, but doesn't want - * to include them. Each namespace in this list must be unique. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function importDocuments($name, array $optionalArgs = []) - { - $request = new ImportDocumentsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['collectionIds'])) { - $request->setCollectionIds($optionalArgs['collectionIds']); - } - - if (isset($optionalArgs['inputUriPrefix'])) { - $request->setInputUriPrefix($optionalArgs['inputUriPrefix']); - } - - if (isset($optionalArgs['namespaceIds'])) { - $request->setNamespaceIds($optionalArgs['namespaceIds']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ImportDocuments', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * List all the databases in the project. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedParent = $firestoreAdminClient->projectName('[PROJECT]'); - * $response = $firestoreAdminClient->listDatabases($formattedParent); - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. A parent name of the form - * `projects/{project_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Firestore\Admin\V1\ListDatabasesResponse - * - * @throws ApiException if the remote call fails - */ - public function listDatabases($parent, array $optionalArgs = []) - { - $request = new ListDatabasesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ListDatabases', ListDatabasesResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists the field configuration and metadata for this database. - * - * Currently, - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * only supports listing fields that have been explicitly overridden. To issue - * this query, call - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with the filter set to `indexConfig.usesAncestorConfig:false` or - * `ttlConfig:*`. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedParent = $firestoreAdminClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - * // Iterate over pages of elements - * $pagedResponse = $firestoreAdminClient->listFields($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $firestoreAdminClient->listFields($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The filter to apply to list results. Currently, - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * only supports listing fields that have been explicitly overridden. To issue - * this query, call - * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with a filter that includes `indexConfig.usesAncestorConfig:false` . - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listFields($parent, array $optionalArgs = []) - { - $request = new ListFieldsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListFields', $optionalArgs, ListFieldsResponse::class, $request); - } - - /** - * Lists composite indexes. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedParent = $firestoreAdminClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - * // Iterate over pages of elements - * $pagedResponse = $firestoreAdminClient->listIndexes($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $firestoreAdminClient->listIndexes($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. A parent name of the form - * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}` - * @param array $optionalArgs { - * Optional. - * - * @type string $filter - * The filter to apply to list results. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listIndexes($parent, array $optionalArgs = []) - { - $request = new ListIndexesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListIndexes', $optionalArgs, ListIndexesResponse::class, $request); - } - - /** - * Updates a database. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $database = new Database(); - * $operationResponse = $firestoreAdminClient->updateDatabase($database); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $firestoreAdminClient->updateDatabase($database); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'updateDatabase'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param Database $database Required. The database to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * The list of fields to be updated. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateDatabase($database, array $optionalArgs = []) - { - $request = new UpdateDatabaseRequest(); - $requestParamHeaders = []; - $request->setDatabase($database); - $requestParamHeaders['database.name'] = $database->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates a field configuration. Currently, field updates apply only to - * single field index configuration. However, calls to - * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] - * should provide a field mask to avoid changing any configuration that the - * caller isn't aware of. The field mask should be specified as: `{ paths: - * "index_config" }`. - * - * This call returns a - * [google.longrunning.Operation][google.longrunning.Operation] which may be - * used to track the status of the field update. The metadata for the - * operation will be the type - * [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata]. - * - * To configure the default field settings for the database, use - * the special `Field` with resource name: - * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $field = new Field(); - * $operationResponse = $firestoreAdminClient->updateField($field); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $firestoreAdminClient->updateField($field); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'updateField'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param Field $field Required. The field to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * A mask, relative to the field. If specified, only configuration specified - * by this field_mask will be updated in the field. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateField($field, array $optionalArgs = []) - { - $request = new UpdateFieldRequest(); - $requestParamHeaders = []; - $request->setField($field); - $requestParamHeaders['field.name'] = $field->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateField', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } -} diff --git a/owl-bot-staging/Firestore/v1/Admin/src/V1/gapic_metadata.json b/owl-bot-staging/Firestore/v1/Admin/src/V1/gapic_metadata.json deleted file mode 100644 index 251b3002719f..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/src/V1/gapic_metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.firestore.admin.v1", - "libraryPackage": "Google\\Cloud\\Firestore\\Admin\\V1", - "services": { - "FirestoreAdmin": { - "clients": { - "grpc": { - "libraryClient": "FirestoreAdminGapicClient", - "rpcs": { - "CreateDatabase": { - "methods": [ - "createDatabase" - ] - }, - "CreateIndex": { - "methods": [ - "createIndex" - ] - }, - "DeleteDatabase": { - "methods": [ - "deleteDatabase" - ] - }, - "DeleteIndex": { - "methods": [ - "deleteIndex" - ] - }, - "ExportDocuments": { - "methods": [ - "exportDocuments" - ] - }, - "GetDatabase": { - "methods": [ - "getDatabase" - ] - }, - "GetField": { - "methods": [ - "getField" - ] - }, - "GetIndex": { - "methods": [ - "getIndex" - ] - }, - "ImportDocuments": { - "methods": [ - "importDocuments" - ] - }, - "ListDatabases": { - "methods": [ - "listDatabases" - ] - }, - "ListFields": { - "methods": [ - "listFields" - ] - }, - "ListIndexes": { - "methods": [ - "listIndexes" - ] - }, - "UpdateDatabase": { - "methods": [ - "updateDatabase" - ] - }, - "UpdateField": { - "methods": [ - "updateField" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_client_config.json b/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_client_config.json deleted file mode 100644 index 46411a511d21..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_client_config.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "interfaces": { - "google.firestore.admin.v1.FirestoreAdmin": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "INTERNAL", - "DEADLINE_EXCEEDED" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "CreateDatabase": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "CreateIndex": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteDatabase": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteIndex": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ExportDocuments": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetDatabase": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetField": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetIndex": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ImportDocuments": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListDatabases": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListFields": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListIndexes": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "UpdateDatabase": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateField": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_descriptor_config.php b/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_descriptor_config.php deleted file mode 100644 index b668c10926a7..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_descriptor_config.php +++ /dev/null @@ -1,250 +0,0 @@ - [ - 'google.firestore.admin.v1.FirestoreAdmin' => [ - 'CreateDatabase' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\Database', - 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\CreateDatabaseMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'CreateIndex' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\Index', - 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\IndexOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteDatabase' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\Database', - 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\DeleteDatabaseMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ExportDocuments' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\ExportDocumentsResponse', - 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\ExportDocumentsMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ImportDocuments' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\ImportDocumentsMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'UpdateDatabase' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\Database', - 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\UpdateDatabaseMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'database.name', - 'fieldAccessors' => [ - 'getDatabase', - 'getName', - ], - ], - ], - ], - 'UpdateField' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\Field', - 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\FieldOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'field.name', - 'fieldAccessors' => [ - 'getField', - 'getName', - ], - ], - ], - ], - 'DeleteIndex' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetDatabase' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\Admin\V1\Database', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetField' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\Admin\V1\Field', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetIndex' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\Admin\V1\Index', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListDatabases' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\Admin\V1\ListDatabasesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListFields' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getFields', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Firestore\Admin\V1\ListFieldsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListIndexes' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getIndexes', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Firestore\Admin\V1\ListIndexesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'templateMap' => [ - 'collectionGroup' => 'projects/{project}/databases/{database}/collectionGroups/{collection}', - 'database' => 'projects/{project}/databases/{database}', - 'field' => 'projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}', - 'index' => 'projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}', - 'project' => 'projects/{project}', - ], - ], - ], -]; diff --git a/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_rest_client_config.php b/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_rest_client_config.php deleted file mode 100644 index a1558d611821..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_rest_client_config.php +++ /dev/null @@ -1,221 +0,0 @@ - [ - 'google.firestore.admin.v1.FirestoreAdmin' => [ - 'CreateDatabase' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*}/databases', - 'body' => 'database', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'database_id', - ], - ], - 'CreateIndex' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes', - 'body' => 'index', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteDatabase' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/databases/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteIndex' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ExportDocuments' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/databases/*}:exportDocuments', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetDatabase' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/databases/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetField' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetIndex' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ImportDocuments' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/databases/*}:importDocuments', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListDatabases' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*}/databases', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListFields' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/collectionGroups/*}/fields', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListIndexes' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateDatabase' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{database.name=projects/*/databases/*}', - 'body' => 'database', - 'placeholders' => [ - 'database.name' => [ - 'getters' => [ - 'getDatabase', - 'getName', - ], - ], - ], - ], - 'UpdateField' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}', - 'body' => 'field', - 'placeholders' => [ - 'field.name' => [ - 'getters' => [ - 'getField', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/databases/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/databases/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/databases/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/databases/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/Client/FirestoreAdminClientTest.php b/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/Client/FirestoreAdminClientTest.php deleted file mode 100644 index 71ace8051bb4..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/Client/FirestoreAdminClientTest.php +++ /dev/null @@ -1,1540 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return FirestoreAdminClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new FirestoreAdminClient($options); - } - - /** @test */ - public function createDatabaseTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $locationId = 'locationId552319461'; - $keyPrefix = 'keyPrefix438630514'; - $etag = 'etag3123477'; - $expectedResponse = new Database(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setKeyPrefix($keyPrefix); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $database = new Database(); - $databaseId = 'databaseId816491103'; - $request = (new CreateDatabaseRequest()) - ->setParent($formattedParent) - ->setDatabase($database) - ->setDatabaseId($databaseId); - $response = $gapicClient->createDatabase($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/CreateDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDatabase(); - $this->assertProtobufEquals($database, $actualValue); - $actualValue = $actualApiRequestObject->getDatabaseId(); - $this->assertProtobufEquals($databaseId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDatabaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDatabaseExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $database = new Database(); - $databaseId = 'databaseId816491103'; - $request = (new CreateDatabaseRequest()) - ->setParent($formattedParent) - ->setDatabase($database) - ->setDatabaseId($databaseId); - $response = $gapicClient->createDatabase($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDatabaseTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createIndexTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $expectedResponse = new Index(); - $expectedResponse->setName($name); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createIndexTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - $index = new Index(); - $request = (new CreateIndexRequest()) - ->setParent($formattedParent) - ->setIndex($index); - $response = $gapicClient->createIndex($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/CreateIndex', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getIndex(); - $this->assertProtobufEquals($index, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createIndexTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createIndexExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - $index = new Index(); - $request = (new CreateIndexRequest()) - ->setParent($formattedParent) - ->setIndex($index); - $response = $gapicClient->createIndex($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createIndexTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDatabaseTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $locationId = 'locationId552319461'; - $keyPrefix = 'keyPrefix438630514'; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Database(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setKeyPrefix($keyPrefix); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $request = (new DeleteDatabaseRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteDatabase($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDatabaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDatabaseExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $request = (new DeleteDatabaseRequest()) - ->setName($formattedName); - $response = $gapicClient->deleteDatabase($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDatabaseTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteIndexTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); - $request = (new DeleteIndexRequest()) - ->setName($formattedName); - $gapicClient->deleteIndex($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteIndex', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteIndexExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); - $request = (new DeleteIndexRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteIndex($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function exportDocumentsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $outputUriPrefix2 = 'outputUriPrefix2-377757258'; - $expectedResponse = new ExportDocumentsResponse(); - $expectedResponse->setOutputUriPrefix($outputUriPrefix2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportDocumentsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $request = (new ExportDocumentsRequest()) - ->setName($formattedName); - $response = $gapicClient->exportDocuments($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ExportDocuments', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportDocumentsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportDocumentsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $request = (new ExportDocumentsRequest()) - ->setName($formattedName); - $response = $gapicClient->exportDocuments($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportDocumentsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getDatabaseTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $locationId = 'locationId552319461'; - $keyPrefix = 'keyPrefix438630514'; - $etag = 'etag3123477'; - $expectedResponse = new Database(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setKeyPrefix($keyPrefix); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $request = (new GetDatabaseRequest()) - ->setName($formattedName); - $response = $gapicClient->getDatabase($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/GetDatabase', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDatabaseExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $request = (new GetDatabaseRequest()) - ->setName($formattedName); - try { - $gapicClient->getDatabase($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFieldTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Field(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->fieldName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[FIELD]'); - $request = (new GetFieldRequest()) - ->setName($formattedName); - $response = $gapicClient->getField($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/GetField', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFieldExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->fieldName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[FIELD]'); - $request = (new GetFieldRequest()) - ->setName($formattedName); - try { - $gapicClient->getField($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIndexTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Index(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); - $request = (new GetIndexRequest()) - ->setName($formattedName); - $response = $gapicClient->getIndex($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/GetIndex', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIndexExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); - $request = (new GetIndexRequest()) - ->setName($formattedName); - try { - $gapicClient->getIndex($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function importDocumentsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importDocumentsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $request = (new ImportDocumentsRequest()) - ->setName($formattedName); - $response = $gapicClient->importDocuments($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ImportDocuments', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importDocumentsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function importDocumentsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $request = (new ImportDocumentsRequest()) - ->setName($formattedName); - $response = $gapicClient->importDocuments($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importDocumentsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function listDatabasesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListDatabasesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListDatabasesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listDatabases($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ListDatabases', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDatabasesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListDatabasesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listDatabases($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFieldsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $fieldsElement = new Field(); - $fields = [ - $fieldsElement, - ]; - $expectedResponse = new ListFieldsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFields($fields); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - $request = (new ListFieldsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listFields($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFields()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ListFields', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFieldsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - $request = (new ListFieldsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listFields($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listIndexesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $indexesElement = new Index(); - $indexes = [ - $indexesElement, - ]; - $expectedResponse = new ListIndexesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setIndexes($indexes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - $request = (new ListIndexesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listIndexes($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getIndexes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ListIndexes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listIndexesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - $request = (new ListIndexesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listIndexes($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateDatabaseTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $locationId = 'locationId552319461'; - $keyPrefix = 'keyPrefix438630514'; - $etag = 'etag3123477'; - $expectedResponse = new Database(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setKeyPrefix($keyPrefix); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $database = new Database(); - $request = (new UpdateDatabaseRequest()) - ->setDatabase($database); - $response = $gapicClient->updateDatabase($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/UpdateDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getDatabase(); - $this->assertProtobufEquals($database, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDatabaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateDatabaseExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $database = new Database(); - $request = (new UpdateDatabaseRequest()) - ->setDatabase($database); - $response = $gapicClient->updateDatabase($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDatabaseTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFieldTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFieldTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $expectedResponse = new Field(); - $expectedResponse->setName($name); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFieldTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $field = new Field(); - $fieldName = 'fieldName1265009317'; - $field->setName($fieldName); - $request = (new UpdateFieldRequest()) - ->setField($field); - $response = $gapicClient->updateField($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/UpdateField', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getField(); - $this->assertProtobufEquals($field, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFieldTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFieldExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFieldTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $field = new Field(); - $fieldName = 'fieldName1265009317'; - $field->setName($fieldName); - $request = (new UpdateFieldRequest()) - ->setField($field); - $response = $gapicClient->updateField($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFieldTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDatabaseAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $locationId = 'locationId552319461'; - $keyPrefix = 'keyPrefix438630514'; - $etag = 'etag3123477'; - $expectedResponse = new Database(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setKeyPrefix($keyPrefix); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $database = new Database(); - $databaseId = 'databaseId816491103'; - $request = (new CreateDatabaseRequest()) - ->setParent($formattedParent) - ->setDatabase($database) - ->setDatabaseId($databaseId); - $response = $gapicClient->createDatabaseAsync($request)->wait(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/CreateDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDatabase(); - $this->assertProtobufEquals($database, $actualValue); - $actualValue = $actualApiRequestObject->getDatabaseId(); - $this->assertProtobufEquals($databaseId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDatabaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} diff --git a/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/FirestoreAdminClientTest.php b/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/FirestoreAdminClientTest.php deleted file mode 100644 index 76c08a0fc07c..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/FirestoreAdminClientTest.php +++ /dev/null @@ -1,1382 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return FirestoreAdminClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new FirestoreAdminClient($options); - } - - /** @test */ - public function createDatabaseTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $locationId = 'locationId552319461'; - $keyPrefix = 'keyPrefix438630514'; - $etag = 'etag3123477'; - $expectedResponse = new Database(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setKeyPrefix($keyPrefix); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $database = new Database(); - $databaseId = 'databaseId816491103'; - $response = $gapicClient->createDatabase($formattedParent, $database, $databaseId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/CreateDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDatabase(); - $this->assertProtobufEquals($database, $actualValue); - $actualValue = $actualApiRequestObject->getDatabaseId(); - $this->assertProtobufEquals($databaseId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDatabaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createDatabaseExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $database = new Database(); - $databaseId = 'databaseId816491103'; - $response = $gapicClient->createDatabase($formattedParent, $database, $databaseId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createDatabaseTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createIndexTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $expectedResponse = new Index(); - $expectedResponse->setName($name); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createIndexTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - $index = new Index(); - $response = $gapicClient->createIndex($formattedParent, $index); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/CreateIndex', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getIndex(); - $this->assertProtobufEquals($index, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createIndexTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createIndexExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - $index = new Index(); - $response = $gapicClient->createIndex($formattedParent, $index); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createIndexTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDatabaseTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $locationId = 'locationId552319461'; - $keyPrefix = 'keyPrefix438630514'; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Database(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setKeyPrefix($keyPrefix); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $response = $gapicClient->deleteDatabase($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDatabaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteDatabaseExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $response = $gapicClient->deleteDatabase($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDatabaseTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteIndexTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); - $gapicClient->deleteIndex($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteIndex', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteIndexExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); - try { - $gapicClient->deleteIndex($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function exportDocumentsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $outputUriPrefix2 = 'outputUriPrefix2-377757258'; - $expectedResponse = new ExportDocumentsResponse(); - $expectedResponse->setOutputUriPrefix($outputUriPrefix2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportDocumentsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $response = $gapicClient->exportDocuments($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ExportDocuments', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportDocumentsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportDocumentsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $response = $gapicClient->exportDocuments($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportDocumentsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getDatabaseTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $locationId = 'locationId552319461'; - $keyPrefix = 'keyPrefix438630514'; - $etag = 'etag3123477'; - $expectedResponse = new Database(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setKeyPrefix($keyPrefix); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $response = $gapicClient->getDatabase($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/GetDatabase', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDatabaseExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - try { - $gapicClient->getDatabase($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFieldTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Field(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->fieldName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[FIELD]'); - $response = $gapicClient->getField($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/GetField', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getFieldExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->fieldName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[FIELD]'); - try { - $gapicClient->getField($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIndexTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Index(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); - $response = $gapicClient->getIndex($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/GetIndex', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIndexExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->indexName('[PROJECT]', '[DATABASE]', '[COLLECTION]', '[INDEX]'); - try { - $gapicClient->getIndex($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function importDocumentsTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importDocumentsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $response = $gapicClient->importDocuments($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ImportDocuments', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importDocumentsTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function importDocumentsExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $response = $gapicClient->importDocuments($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importDocumentsTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function listDatabasesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListDatabasesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $response = $gapicClient->listDatabases($formattedParent); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ListDatabases', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDatabasesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - try { - $gapicClient->listDatabases($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFieldsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $fieldsElement = new Field(); - $fields = [ - $fieldsElement, - ]; - $expectedResponse = new ListFieldsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setFields($fields); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - $response = $gapicClient->listFields($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getFields()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ListFields', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listFieldsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - try { - $gapicClient->listFields($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listIndexesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $indexesElement = new Index(); - $indexes = [ - $indexesElement, - ]; - $expectedResponse = new ListIndexesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setIndexes($indexes); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - $response = $gapicClient->listIndexes($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getIndexes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/ListIndexes', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listIndexesExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->collectionGroupName('[PROJECT]', '[DATABASE]', '[COLLECTION]'); - try { - $gapicClient->listIndexes($formattedParent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateDatabaseTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $locationId = 'locationId552319461'; - $keyPrefix = 'keyPrefix438630514'; - $etag = 'etag3123477'; - $expectedResponse = new Database(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setLocationId($locationId); - $expectedResponse->setKeyPrefix($keyPrefix); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $database = new Database(); - $response = $gapicClient->updateDatabase($database); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/UpdateDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getDatabase(); - $this->assertProtobufEquals($database, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDatabaseTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateDatabaseExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateDatabaseTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $database = new Database(); - $response = $gapicClient->updateDatabase($database); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateDatabaseTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFieldTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFieldTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $expectedResponse = new Field(); - $expectedResponse->setName($name); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateFieldTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $field = new Field(); - $fieldName = 'fieldName1265009317'; - $field->setName($fieldName); - $response = $gapicClient->updateField($field); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/UpdateField', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getField(); - $this->assertProtobufEquals($field, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFieldTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function updateFieldExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateFieldTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $field = new Field(); - $fieldName = 'fieldName1265009317'; - $field->setName($fieldName); - $response = $gapicClient->updateField($field); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateFieldTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/AggregationResult.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/AggregationResult.php deleted file mode 100644 index 5f249ebfc8d4..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/AggregationResult.php +++ /dev/null @@ -1,33 +0,0 @@ -internalAddGeneratedFile( - ' -Ý -,google/firestore/v1/aggregation_result.protogoogle.firestore.v1"¾ -AggregationResultU -aggregate_fields ( 2;.google.firestore.v1.AggregationResult.AggregateFieldsEntryR -AggregateFieldsEntry -key ( ) -value ( 2.google.firestore.v1.Value:8BÎ -com.google.firestore.v1BAggregationResultProtoPZ;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb¢GCFSªGoogle.Cloud.Firestore.V1ÊGoogle\\Cloud\\Firestore\\V1êGoogle::Cloud::Firestore::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/BloomFilter.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/BloomFilter.php deleted file mode 100644 index 84249064625d..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/BloomFilter.php +++ /dev/null @@ -1,34 +0,0 @@ -internalAddGeneratedFile( - ' -“ -&google/firestore/v1/bloom_filter.protogoogle.firestore.v1". - BitSequence -bitmap (  -padding ("Q - BloomFilter. -bits ( 2 .google.firestore.v1.BitSequence - -hash_count (BÈ -com.google.firestore.v1BBloomFilterProtoPZ;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb¢GCFSªGoogle.Cloud.Firestore.V1ÊGoogle\\Cloud\\Firestore\\V1êGoogle::Cloud::Firestore::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Common.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Common.php deleted file mode 100644 index 57fc24775305fca474d9b6362acebc92c29cb815..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1296 zcmb7E-A)rh7^MXXOo_q8C=f43AX*aLx_Y-2jit13fo-J0#B9<`cfTzYw=O`QsLJ!-0{ z$w>JArL9XA>+10fI`Qx-iVDds)5vO(Bun`aeZPVJ+CgV6@3C9-*gf~Qw$VzHhv^8I zJ|^nDvxX`$g(T_=qR-TN3C~xTw*aklC4`(sremBrt7s8EQl+!=Qg!KY&hbzs6=ooy zuZ^+wviV$jy6H|b+6gi}aSPXnbB$GWvtaD&v4E|wW#sfEVT#y(cSM#ZOCU9od{}ny(pv@)MuW*lo#6jt&?x%jeODFeaqFFuDg5c z{hXc!fjtaneg@`m@T+_;hx)!f_Wc6v`={Pu(GJJ6hs8uc%9m_rC;zyQHZotD3v_|d EZyxKVYXATM diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Document.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Document.php deleted file mode 100644 index 0d2328d9b6142573315b7ae8e0cacf99427360f2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1930 zcmb_d-EPxJ6y79l)tt0c1OcT2F=UZQSBpcs+7-AIM1K-00j)&U3uGypI48zh$F|1f zO4(H<9)V}zk_+B~8y1W+%!?u~z|Pngn8-+A z=cL;iMQ%F5P+B@2K*%SU#N0*JKiqzal8?CLPG2*fUe0umyPE)Rz>|dSnhfwSF#5#l zFz{WLNG|E?uAdD2(3d_B{C`OM78~;*K_Xwoj?>VUeiSlAI0#*Aud^(t!rqM|s&$Ly zS`JnDRJyYtN)#avoLx*@;m1_jAwg~1Ls>LUt+dz8wkn-JX6;O)ZC?<%#iU5FygOq8 zWh%l=ty?8HEq*yOI#sB9O_^M2+h;YMrT8xK$ftvld=meE?$IG^hz7F#zJV=prpWCr)Np^}pr=x{_%S3^I0u*q3Igenk+CfBsAJIxG*#?Z`tzQmtFe0_x;F z6eggw)F^NbmPQd>TQuvcHx*j{6IO~-Ga;bRciWbwOQi5a&u}gir%vlvp)s6FOw4kV zmX~Px2CN9A2Mp=Po6x*rSg_(@G>9Y8Z9m`p3XL|`ipUFT;Xgvft%h>!47IZA3(^obvY<5n9 z&eVEefyF#+$=?}qw!d?D+223WecPWaaGj>ftPX51=a);raEFyQn{E)LqZ~`Lju(|i z43B-9GDY3-aI^ILLv^md(|i4~dZVugjJ2b4_3|-e9e2OvF~`wCr!<6U3Vp5K%&4}l m!?sXd7C)O_x%f&9-*_wAHq0NV6@fELmgwC7G=~ zGdnYGnyqpH?EwjCk#-U69#{z>4l5+CAdt8qA@&G@LoaaPfH;D^eSPizroOU#XY({{^_`YiBL#iiakd*Izh!yE4;+u=pI&MIl4J4^vdt#(U9(2? zTkEBJBrxk{V3u#Ot>sm@wfykP0z$Qh>HB*45Isja{Bv8?hE>!3zzpEOvzA}6Y%8$L zhV>q3zo>7S4WGd7?zLMjyB1iEtH4^mJYKNYL`^1*SI@ zupjQi)}!)@lx9e(daTwura)l1D%Ctbp{tH$))Bf2HXL z0~{M}-LxRz0<-D9#IcV&({+hA0Jt{XTKNG$vX!uh<=CY+Es;^hdOb{_RUnu1A>?TS zoI^i;3!UkMRq!#sD7Pi~Blq-5c1G+pT`ON>fae^P{Ziz`7DaWXDqt-ZTvVNDwy|3Q zf&=i1)k@w2wgiNV6^2S)UBIwIsn7(P3%r#l6fzyV!^$Im%HqC@( zr7&q%&KeiltY zIiy>Ga4S}w*}+WH@H858&23Wgp$0KM)6`@Q&mhE}2hI~>&kjppXkgl?(4NTy&UO)!Rk1m5^eRd5aCO z&d_ee3V6ZfSrsbOT`?*| zb4g-O{y{@iZSSZ7$D9cYvD;772Q^vyK8F-va=hM|NX@GqMs3gEDdl z7C4j+@a*k=vGB2mPAUB-U~x@SqoC-oD7_N#g-H7j{^D?o(Q;3881JXhiFMNpSUv9@ z)>qGEfFm^C{JcsH3RA!uwIPhV8)>LTk*1r*Gab*@|6h!%Xu8u4B071hmrz(z@+oD6 zmRg?gc*(8qKQuHhXd99MZcqv34y=aUA!akYg5Y+w8R}VWXphggx9=q5coB^>%qnU4 zaG#>}>XOogsCv1(Z2gKIczfAPC=>Y=XVB0Svd8aEcmk!LnvE9W*QG-0x@P=DLld$> z@hd~jD0XFJmyxKV9Kc;wkXt-(73|rP82HUV-vVJ85=o)T{W{YlAp}rE_NfjMA=UF%nVkud}O!xTPJupWiw<&gTwi^{m(V z8!R@kAGmkRYQXeYj2YA|$;vZ6Ss*aNg0)aA!LQKHGHA0#!1&7$8sWad*HJoJW5qjwh0-d|NZlJ5xb*M2Br8jaIFy9vMxCla(-iuE}e)+QZT+bH)2Ohw8< zoO{R7umdx7-Z9{-Xp%g0VORp41t)SkO~}lLnGrUgFkZhp|BzBd_AELgF(7oN2T2I= zW_m2!M45Xq>y3qZY3rESB?}VgO)V zI5|ImK(zSwTvXO396&3dkZ0Ao2h#X7O4rO5TxdB6uoMf!xf~zAQu>r?wj&+y4tv%| zV+~Dp=`(@G*6vr9ZWq^XtxO%lhtW`Rd3j0$HAgm9?%jX5GL?b?aCqtMjg6JH&8Zd5|Hj_1*iw;)jcv2?8)s1j0EqZ zlL`d|6;7kc*aVOl{ITSk4t@SncK41}&ZNTLuHwD#jHR$n@cO3)R@c$5P%Dgg5su0e zF6pYreBRf)9vf(ckCCCC(2hfa;rSOQ(b%dS>EjPHl!**@Z~}8imWaZgJ$U+PT>ti; z{{CTV9$%&-_vdtKy$Iy=4se&BpUcbP5&KybDEjl<+&=z~=n+EF!WU#J#xD94QsEk@ z)m%SIxtopeX-voW;VQ$Fgq{;-a($|qe;z~a{^J{XaS$o{odWQ0H8dHYXJWNA@kP?| z9`UF$TUX}4!IYHjpBo@Bh49k+qIg^ixEL9k;vawo@!@2G1@T4Ff@vAMu!^z2&lxv3 zl;#G8(u*Sda|!;HWQ+)meXMTB6;nNSbI7W@M#XZ0t|g}RqH&!&Tue(7(6yhJ4)qIF zF?20xbC)&zdzfl;j??f(>8V&kbS{&AO)xZJMrStayh+FyKWooD<`pX=sFx z->{+7U(V*Zzt!ESTqB(Pfa$tmTpLtZKD=WZ9+6~pahLw#&&NO2(5Rf%VRd&ZUrQG! zLHF^?g1{5ALZ;#IP{YVf82^>3DW-u*YQ~3!*)J>oE`@A}?%MbcC&qo@);@W0zu<}E zK>eM7fFApFF2iRMUH)+yW+c=@x~w~>=z*P zks%lL!s=k&6kh0(gFn(xnst9zePfPxhFLY)h$X_tn=DTY#@CpIGTr(hYepGh+IbD4 z@*`k4e$h{0IQ~*bLCtV-jnJ(4vJBT?_h+fvM=5laN{(F;5=vm#I;pU_1S*yb-9P2X z`9L#n42B%4drVUbo;$|!AW{T)RH9xK#pRY#J!&`LSUm=AFOZH%=#rxgg$q_#_-+`5 zL4n1(00vU99sdIIJ^m;AgnW-LlKS@O4L6vQcSXgAbnCATp6lvi+bv@D>F34Sc6Y+R zN`a4t{2Wx?KNi2W69leb$me%=cLg`gmwB@l?7+80POE;&ZJ5E9<25h#T23>TeI8kY zE_w!zP!WDZ!Hwq>p~&iTqr!eQXOF(@YQqSms=P4r;U*> WA?ZEOswuvLWGngCiu-6Eq5lC#>dCYE%*@1FCW$G!L7ee1-6w}d7! zh^@F}ER4cYsIOo%P0=BcIW#1;ji-VxfJfzYV825%zNF+E!)6=7~oQE0T{|DaV$k8LbF@_gt*FBag||{!G`-GYRNo_YR6QkS{LPxqZa146bGF)OCiax9pN3}HzW9p)5r7|UMBo}?Nbt71o(rFW6 z%lENTdCJK>!L>aSUtJJv;(E5R%lxJUkE3711u{vNhEfrITqP&UnP%FR$}FlG$s%Z6 z;bGlWy;EYi%flmGKD8CgBDS*_%H+KLkrs$2jmMEz`&d6)QFJuc>+nqh-ngJ}_?LVG zF{&)_Y`a)mgc=7?`4v}uJ+NW*hbb*T3S9TUmww)WjXq{X#SD-!D>nWlR}EQ zace0aR2XZPzXuu99ur$0oflS^8#kANcPNOz4H+z8+m#i!u*w#Hbs@Uu*$z5-3(~|G zQ{&9V#_NzaCliObg)|y-{7v9=?NoCM+>_WaVz-63LfqJqw zM%@!zS^g?)D7r3>v31cq#c&-aWTyCc0@8s@UC7g^W;&WnAYtW9WhhHTWA+|D~ov9Yd>GkJz$pNC9-6)eYeM1dhw^)lrA*kt$IBE{blurcR2 z--4uRvC!9d_Lg#XjzR3;Ku~Z%V(G2=t2sdf{GY-ty$hL$sQ@o`x{aPR==9{HcE8)G zwf0+$dj1l>3Mr{w&nNgaBs;x)viN-paxwY%DsU_fK{oF!6%r%p5!~wtZV}kVR1=!O z^_>rwC-7yT>2U+NGg`et8y6QcvHC9ko>(gS%aA>6^!xJQKx(4~uK*uC$|zOi!I5;B zPx5(KYxWw_pwaU!Q~Wi!5`Qx@Ug5LA`8bY8dfeOtnl#VDy434Q59L~?J&;=Metwn8 z-fHJFbm=F*$x{1aKFb57DFxa<@!KTiV)YovN=NImvc}LeS?ghj{SJGU3?E!7eZG|7 z7*4A%w^8jRpMzEU`{?j6pW@d6=mUmIKd$f_kPDxw0asmzHIp_5jz`ve-z9+aXY7lp zPzkbQJT$RwBPdjHVR_BZt$K(mZo>Lp*<&TYkp7^u0_y8cbzttekEW!qV7VS$7 z$VOh!!mPJ?joP5qY0tGfR-@FfHQM!7yNSh)iq{*_bF%ak2gO-*(sXK*DIO0^!{5t4 zhP)GP?=m}!1|wl}8KH2XAH$k5W2Jit-PCt4K+iiO#$HrYe@KbqUpTR1FZmvDs_7Zw zp+kC(1;iR9Lf_kvay)ttp?lE%=V9!7r#_!@HVp>ZbMZ-MQ{>};!^6AcutP@H*X0A? znEQMgIM0$@GsstT0*N0C-n+{Nr;ltw3f+7WqrZq$=;4c?ssf(Gf~~Q-2Ea;?&4N-L z(!l}hCZyRG;b5$^y8dI2zy?T<$OJD}EUlU9FA2DcXP8CFtpaNT>|EFECO+F$b<-P% zhKMOo&DdQ{u{6A{MJH@)v>W^VLvp2A+wcFFyw+rwHL=FHq6>w1y!~tVZ8&5fhp`JC x-st{JzUD(K752GOiNKZ0@%AXq@_OfbbUS$4zbVBoR{wgbVwV2Z=P^76_y=cOweSD{ diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Write.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Write.php deleted file mode 100644 index abcc4fb4abf939ee66ecb337b6ce2bac0cd6cdcf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2679 zcmbtW-EJF26vj@R;t8bAR;VT_>eN)!mB?ByDiRw4#IYSBk;WvBk&vZjvO9K0?CvZx zv!MayWw_)qxa1YMMnZ^(;LNOd?Gj^`lAG9`^PQjXd}ro-{Aqjy-fX|cBhzjiSFlGT2HpcB^{Oq`oJMF{%1At1N2#-2=%=tK=jS&-6DlTZ_ zvf21vFhyP=X4Z9g^IB4!58J*S$9$cJC~<@+1#3|Sx`D~l8Sb#HqWm= zDSTp+#WperB_va?JCj`05GW-m^1@-Vt>XIOEM}mhg(dQsK zJvYle)OOMO3`^EMR6XsS3_2(7VDF2wj(hg(wAa}`>>hU76+LEeoOHfC>zwx8{^3!l zQfO7sMy?ZAUB$GPpmj6ECsZbZ0@AZl(&Ijv=bV`AF0k{P&U%VAryk*r1Sb-vTF+1p zo4uWE!$s{ow2`TM|AItg3Xxxw_Offl0#zy^;MsDSFQJ7i^^&!PtdwAwhw0gxKC6Y( zkZp7M06#B=EHA=a+o&uk0mqt{bg1(RZxS;b?!@%`rNe3VO8+%ngl>19GpQ(S0_o#v zZNi5})tPeEzApda&O;{kiz|fmx{RedDW}tyT7* z`D=DI9Gb)7%+dv0*Pq3EDb#VyvE$@m#~C!w*G%g^c$7cB@2A_$%<}WEi;uBP_mXRL GjnLneB4OkJ diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/AggregationResult.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/AggregationResult.php deleted file mode 100644 index d98419955554..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/AggregationResult.php +++ /dev/null @@ -1,86 +0,0 @@ -google.firestore.v1.AggregationResult - */ -class AggregationResult extends \Google\Protobuf\Internal\Message -{ - /** - * The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. - * The key is the - * [alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias] - * assigned to the aggregation function on input and the size of this map - * equals the number of aggregation functions in the query. - * - * Generated from protobuf field map aggregate_fields = 2; - */ - private $aggregate_fields; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $aggregate_fields - * The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. - * The key is the - * [alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias] - * assigned to the aggregation function on input and the size of this map - * equals the number of aggregation functions in the query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\AggregationResult::initOnce(); - parent::__construct($data); - } - - /** - * The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. - * The key is the - * [alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias] - * assigned to the aggregation function on input and the size of this map - * equals the number of aggregation functions in the query. - * - * Generated from protobuf field map aggregate_fields = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAggregateFields() - { - return $this->aggregate_fields; - } - - /** - * The result of the aggregation functions, ex: `COUNT(*) AS total_docs`. - * The key is the - * [alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias] - * assigned to the aggregation function on input and the size of this map - * equals the number of aggregation functions in the query. - * - * Generated from protobuf field map aggregate_fields = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAggregateFields($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class); - $this->aggregate_fields = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ArrayValue.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ArrayValue.php deleted file mode 100644 index a5e67239f7a8..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ArrayValue.php +++ /dev/null @@ -1,67 +0,0 @@ -google.firestore.v1.ArrayValue - */ -class ArrayValue extends \Google\Protobuf\Internal\Message -{ - /** - * Values in the array. - * - * Generated from protobuf field repeated .google.firestore.v1.Value values = 1; - */ - private $values; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Firestore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $values - * Values in the array. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * Values in the array. - * - * Generated from protobuf field repeated .google.firestore.v1.Value values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getValues() - { - return $this->values; - } - - /** - * Values in the array. - * - * Generated from protobuf field repeated .google.firestore.v1.Value values = 1; - * @param array<\Google\Cloud\Firestore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class); - $this->values = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsRequest.php deleted file mode 100644 index d6e70f8173e6..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsRequest.php +++ /dev/null @@ -1,296 +0,0 @@ -google.firestore.v1.BatchGetDocumentsRequest - */ -class BatchGetDocumentsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $database = ''; - /** - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of the - * given `database`. Duplicate names will be elided. - * - * Generated from protobuf field repeated string documents = 2; - */ - private $documents; - /** - * The fields to return. If not set, returns all fields. - * If a document has a field that is not present in this mask, that field will - * not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 3; - */ - protected $mask = null; - protected $consistency_selector; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @type array|\Google\Protobuf\Internal\RepeatedField $documents - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of the - * given `database`. Duplicate names will be elided. - * @type \Google\Cloud\Firestore\V1\DocumentMask $mask - * The fields to return. If not set, returns all fields. - * If a document has a field that is not present in this mask, that field will - * not be returned in the response. - * @type string $transaction - * Reads documents in a transaction. - * @type \Google\Cloud\Firestore\V1\TransactionOptions $new_transaction - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - * @type \Google\Protobuf\Timestamp $read_time - * Reads documents as they were at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDatabase() - { - return $this->database; - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkString($var, True); - $this->database = $var; - - return $this; - } - - /** - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of the - * given `database`. Duplicate names will be elided. - * - * Generated from protobuf field repeated string documents = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDocuments() - { - return $this->documents; - } - - /** - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of the - * given `database`. Duplicate names will be elided. - * - * Generated from protobuf field repeated string documents = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDocuments($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->documents = $arr; - - return $this; - } - - /** - * The fields to return. If not set, returns all fields. - * If a document has a field that is not present in this mask, that field will - * not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 3; - * @return \Google\Cloud\Firestore\V1\DocumentMask|null - */ - public function getMask() - { - return $this->mask; - } - - public function hasMask() - { - return isset($this->mask); - } - - public function clearMask() - { - unset($this->mask); - } - - /** - * The fields to return. If not set, returns all fields. - * If a document has a field that is not present in this mask, that field will - * not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 3; - * @param \Google\Cloud\Firestore\V1\DocumentMask $var - * @return $this - */ - public function setMask($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); - $this->mask = $var; - - return $this; - } - - /** - * Reads documents in a transaction. - * - * Generated from protobuf field bytes transaction = 4; - * @return string - */ - public function getTransaction() - { - return $this->readOneof(4); - } - - public function hasTransaction() - { - return $this->hasOneof(4); - } - - /** - * Reads documents in a transaction. - * - * Generated from protobuf field bytes transaction = 4; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - * - * Generated from protobuf field .google.firestore.v1.TransactionOptions new_transaction = 5; - * @return \Google\Cloud\Firestore\V1\TransactionOptions|null - */ - public function getNewTransaction() - { - return $this->readOneof(5); - } - - public function hasNewTransaction() - { - return $this->hasOneof(5); - } - - /** - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - * - * Generated from protobuf field .google.firestore.v1.TransactionOptions new_transaction = 5; - * @param \Google\Cloud\Firestore\V1\TransactionOptions $var - * @return $this - */ - public function setNewTransaction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TransactionOptions::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Reads documents as they were at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->readOneof(7); - } - - public function hasReadTime() - { - return $this->hasOneof(7); - } - - /** - * Reads documents as they were at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * @return string - */ - public function getConsistencySelector() - { - return $this->whichOneof("consistency_selector"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsResponse.php deleted file mode 100644 index 97801733b24f..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchGetDocumentsResponse.php +++ /dev/null @@ -1,214 +0,0 @@ -google.firestore.v1.BatchGetDocumentsResponse - */ -class BatchGetDocumentsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The transaction that was started as part of this request. - * Will only be set in the first response, and only if - * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] - * was set in the request. - * - * Generated from protobuf field bytes transaction = 3; - */ - protected $transaction = ''; - /** - * The time at which the document was read. - * This may be monotically increasing, in this case the previous documents in - * the result stream are guaranteed not to have changed between their - * read_time and this one. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; - */ - protected $read_time = null; - protected $result; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\Document $found - * A document that was requested. - * @type string $missing - * A document name that was requested but does not exist. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @type string $transaction - * The transaction that was started as part of this request. - * Will only be set in the first response, and only if - * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] - * was set in the request. - * @type \Google\Protobuf\Timestamp $read_time - * The time at which the document was read. - * This may be monotically increasing, in this case the previous documents in - * the result stream are guaranteed not to have changed between their - * read_time and this one. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * A document that was requested. - * - * Generated from protobuf field .google.firestore.v1.Document found = 1; - * @return \Google\Cloud\Firestore\V1\Document|null - */ - public function getFound() - { - return $this->readOneof(1); - } - - public function hasFound() - { - return $this->hasOneof(1); - } - - /** - * A document that was requested. - * - * Generated from protobuf field .google.firestore.v1.Document found = 1; - * @param \Google\Cloud\Firestore\V1\Document $var - * @return $this - */ - public function setFound($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Document::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * A document name that was requested but does not exist. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string missing = 2; - * @return string - */ - public function getMissing() - { - return $this->readOneof(2); - } - - public function hasMissing() - { - return $this->hasOneof(2); - } - - /** - * A document name that was requested but does not exist. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string missing = 2; - * @param string $var - * @return $this - */ - public function setMissing($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The transaction that was started as part of this request. - * Will only be set in the first response, and only if - * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] - * was set in the request. - * - * Generated from protobuf field bytes transaction = 3; - * @return string - */ - public function getTransaction() - { - return $this->transaction; - } - - /** - * The transaction that was started as part of this request. - * Will only be set in the first response, and only if - * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] - * was set in the request. - * - * Generated from protobuf field bytes transaction = 3; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->transaction = $var; - - return $this; - } - - /** - * The time at which the document was read. - * This may be monotically increasing, in this case the previous documents in - * the result stream are guaranteed not to have changed between their - * read_time and this one. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->read_time; - } - - public function hasReadTime() - { - return isset($this->read_time); - } - - public function clearReadTime() - { - unset($this->read_time); - } - - /** - * The time at which the document was read. - * This may be monotically increasing, in this case the previous documents in - * the result stream are guaranteed not to have changed between their - * read_time and this one. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->read_time = $var; - - return $this; - } - - /** - * @return string - */ - public function getResult() - { - return $this->whichOneof("result"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteRequest.php deleted file mode 100644 index bc22dba85194..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteRequest.php +++ /dev/null @@ -1,152 +0,0 @@ -google.firestore.v1.BatchWriteRequest - */ -class BatchWriteRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $database = ''; - /** - * The writes to apply. - * Method does not apply writes atomically and does not guarantee ordering. - * Each write succeeds or fails independently. You cannot write to the same - * document more than once per request. - * - * Generated from protobuf field repeated .google.firestore.v1.Write writes = 2; - */ - private $writes; - /** - * Labels associated with this batch write. - * - * Generated from protobuf field map labels = 3; - */ - private $labels; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @type array<\Google\Cloud\Firestore\V1\Write>|\Google\Protobuf\Internal\RepeatedField $writes - * The writes to apply. - * Method does not apply writes atomically and does not guarantee ordering. - * Each write succeeds or fails independently. You cannot write to the same - * document more than once per request. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels associated with this batch write. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDatabase() - { - return $this->database; - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkString($var, True); - $this->database = $var; - - return $this; - } - - /** - * The writes to apply. - * Method does not apply writes atomically and does not guarantee ordering. - * Each write succeeds or fails independently. You cannot write to the same - * document more than once per request. - * - * Generated from protobuf field repeated .google.firestore.v1.Write writes = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWrites() - { - return $this->writes; - } - - /** - * The writes to apply. - * Method does not apply writes atomically and does not guarantee ordering. - * Each write succeeds or fails independently. You cannot write to the same - * document more than once per request. - * - * Generated from protobuf field repeated .google.firestore.v1.Write writes = 2; - * @param array<\Google\Cloud\Firestore\V1\Write>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWrites($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Write::class); - $this->writes = $arr; - - return $this; - } - - /** - * Labels associated with this batch write. - * - * Generated from protobuf field map labels = 3; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels associated with this batch write. - * - * Generated from protobuf field map labels = 3; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteResponse.php deleted file mode 100644 index da43ca0a535b..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BatchWriteResponse.php +++ /dev/null @@ -1,118 +0,0 @@ -google.firestore.v1.BatchWriteResponse - */ -class BatchWriteResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The result of applying the writes. - * This i-th write result corresponds to the i-th write in the - * request. - * - * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 1; - */ - private $write_results; - /** - * The status of applying the writes. - * This i-th write status corresponds to the i-th write in the - * request. - * - * Generated from protobuf field repeated .google.rpc.Status status = 2; - */ - private $status; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $write_results - * The result of applying the writes. - * This i-th write result corresponds to the i-th write in the - * request. - * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $status - * The status of applying the writes. - * This i-th write status corresponds to the i-th write in the - * request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * The result of applying the writes. - * This i-th write result corresponds to the i-th write in the - * request. - * - * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWriteResults() - { - return $this->write_results; - } - - /** - * The result of applying the writes. - * This i-th write result corresponds to the i-th write in the - * request. - * - * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 1; - * @param array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWriteResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\WriteResult::class); - $this->write_results = $arr; - - return $this; - } - - /** - * The status of applying the writes. - * This i-th write status corresponds to the i-th write in the - * request. - * - * Generated from protobuf field repeated .google.rpc.Status status = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getStatus() - { - return $this->status; - } - - /** - * The status of applying the writes. - * This i-th write status corresponds to the i-th write in the - * request. - * - * Generated from protobuf field repeated .google.rpc.Status status = 2; - * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setStatus($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); - $this->status = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionRequest.php deleted file mode 100644 index 08de515ed1e5..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionRequest.php +++ /dev/null @@ -1,134 +0,0 @@ -google.firestore.v1.BeginTransactionRequest - */ -class BeginTransactionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $database = ''; - /** - * The options for the transaction. - * Defaults to a read-write transaction. - * - * Generated from protobuf field .google.firestore.v1.TransactionOptions options = 2; - */ - protected $options = null; - - /** - * @param string $database Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * @return \Google\Cloud\Firestore\V1\BeginTransactionRequest - * - * @experimental - */ - public static function build(string $database): self - { - return (new self()) - ->setDatabase($database); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @type \Google\Cloud\Firestore\V1\TransactionOptions $options - * The options for the transaction. - * Defaults to a read-write transaction. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDatabase() - { - return $this->database; - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkString($var, True); - $this->database = $var; - - return $this; - } - - /** - * The options for the transaction. - * Defaults to a read-write transaction. - * - * Generated from protobuf field .google.firestore.v1.TransactionOptions options = 2; - * @return \Google\Cloud\Firestore\V1\TransactionOptions|null - */ - public function getOptions() - { - return $this->options; - } - - public function hasOptions() - { - return isset($this->options); - } - - public function clearOptions() - { - unset($this->options); - } - - /** - * The options for the transaction. - * Defaults to a read-write transaction. - * - * Generated from protobuf field .google.firestore.v1.TransactionOptions options = 2; - * @param \Google\Cloud\Firestore\V1\TransactionOptions $var - * @return $this - */ - public function setOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TransactionOptions::class); - $this->options = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionResponse.php deleted file mode 100644 index 2dcf768331c3..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BeginTransactionResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -google.firestore.v1.BeginTransactionResponse - */ -class BeginTransactionResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The transaction that was started. - * - * Generated from protobuf field bytes transaction = 1; - */ - protected $transaction = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $transaction - * The transaction that was started. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * The transaction that was started. - * - * Generated from protobuf field bytes transaction = 1; - * @return string - */ - public function getTransaction() - { - return $this->transaction; - } - - /** - * The transaction that was started. - * - * Generated from protobuf field bytes transaction = 1; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->transaction = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BitSequence.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BitSequence.php deleted file mode 100644 index 7ce2da3b9590..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BitSequence.php +++ /dev/null @@ -1,124 +0,0 @@ -google.firestore.v1.BitSequence - */ -class BitSequence extends \Google\Protobuf\Internal\Message -{ - /** - * The bytes that encode the bit sequence. - * May have a length of zero. - * - * Generated from protobuf field bytes bitmap = 1; - */ - protected $bitmap = ''; - /** - * The number of bits of the last byte in `bitmap` to ignore as "padding". - * If the length of `bitmap` is zero, then this value must be `0`. - * Otherwise, this value must be between 0 and 7, inclusive. - * - * Generated from protobuf field int32 padding = 2; - */ - protected $padding = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $bitmap - * The bytes that encode the bit sequence. - * May have a length of zero. - * @type int $padding - * The number of bits of the last byte in `bitmap` to ignore as "padding". - * If the length of `bitmap` is zero, then this value must be `0`. - * Otherwise, this value must be between 0 and 7, inclusive. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\BloomFilter::initOnce(); - parent::__construct($data); - } - - /** - * The bytes that encode the bit sequence. - * May have a length of zero. - * - * Generated from protobuf field bytes bitmap = 1; - * @return string - */ - public function getBitmap() - { - return $this->bitmap; - } - - /** - * The bytes that encode the bit sequence. - * May have a length of zero. - * - * Generated from protobuf field bytes bitmap = 1; - * @param string $var - * @return $this - */ - public function setBitmap($var) - { - GPBUtil::checkString($var, False); - $this->bitmap = $var; - - return $this; - } - - /** - * The number of bits of the last byte in `bitmap` to ignore as "padding". - * If the length of `bitmap` is zero, then this value must be `0`. - * Otherwise, this value must be between 0 and 7, inclusive. - * - * Generated from protobuf field int32 padding = 2; - * @return int - */ - public function getPadding() - { - return $this->padding; - } - - /** - * The number of bits of the last byte in `bitmap` to ignore as "padding". - * If the length of `bitmap` is zero, then this value must be `0`. - * Otherwise, this value must be between 0 and 7, inclusive. - * - * Generated from protobuf field int32 padding = 2; - * @param int $var - * @return $this - */ - public function setPadding($var) - { - GPBUtil::checkInt32($var); - $this->padding = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BloomFilter.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BloomFilter.php deleted file mode 100644 index 3a4b0b5d26af..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/BloomFilter.php +++ /dev/null @@ -1,119 +0,0 @@ -google.firestore.v1.BloomFilter - */ -class BloomFilter extends \Google\Protobuf\Internal\Message -{ - /** - * The bloom filter data. - * - * Generated from protobuf field .google.firestore.v1.BitSequence bits = 1; - */ - protected $bits = null; - /** - * The number of hashes used by the algorithm. - * - * Generated from protobuf field int32 hash_count = 2; - */ - protected $hash_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\BitSequence $bits - * The bloom filter data. - * @type int $hash_count - * The number of hashes used by the algorithm. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\BloomFilter::initOnce(); - parent::__construct($data); - } - - /** - * The bloom filter data. - * - * Generated from protobuf field .google.firestore.v1.BitSequence bits = 1; - * @return \Google\Cloud\Firestore\V1\BitSequence|null - */ - public function getBits() - { - return $this->bits; - } - - public function hasBits() - { - return isset($this->bits); - } - - public function clearBits() - { - unset($this->bits); - } - - /** - * The bloom filter data. - * - * Generated from protobuf field .google.firestore.v1.BitSequence bits = 1; - * @param \Google\Cloud\Firestore\V1\BitSequence $var - * @return $this - */ - public function setBits($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\BitSequence::class); - $this->bits = $var; - - return $this; - } - - /** - * The number of hashes used by the algorithm. - * - * Generated from protobuf field int32 hash_count = 2; - * @return int - */ - public function getHashCount() - { - return $this->hash_count; - } - - /** - * The number of hashes used by the algorithm. - * - * Generated from protobuf field int32 hash_count = 2; - * @param int $var - * @return $this - */ - public function setHashCount($var) - { - GPBUtil::checkInt32($var); - $this->hash_count = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitRequest.php deleted file mode 100644 index 01455af2f717..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitRequest.php +++ /dev/null @@ -1,161 +0,0 @@ -google.firestore.v1.CommitRequest - */ -class CommitRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $database = ''; - /** - * The writes to apply. - * Always executed atomically and in order. - * - * Generated from protobuf field repeated .google.firestore.v1.Write writes = 2; - */ - private $writes; - /** - * If set, applies all writes in this transaction, and commits it. - * - * Generated from protobuf field bytes transaction = 3; - */ - protected $transaction = ''; - - /** - * @param string $database Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param \Google\Cloud\Firestore\V1\Write[] $writes The writes to apply. - * - * Always executed atomically and in order. - * - * @return \Google\Cloud\Firestore\V1\CommitRequest - * - * @experimental - */ - public static function build(string $database, array $writes): self - { - return (new self()) - ->setDatabase($database) - ->setWrites($writes); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @type array<\Google\Cloud\Firestore\V1\Write>|\Google\Protobuf\Internal\RepeatedField $writes - * The writes to apply. - * Always executed atomically and in order. - * @type string $transaction - * If set, applies all writes in this transaction, and commits it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDatabase() - { - return $this->database; - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkString($var, True); - $this->database = $var; - - return $this; - } - - /** - * The writes to apply. - * Always executed atomically and in order. - * - * Generated from protobuf field repeated .google.firestore.v1.Write writes = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWrites() - { - return $this->writes; - } - - /** - * The writes to apply. - * Always executed atomically and in order. - * - * Generated from protobuf field repeated .google.firestore.v1.Write writes = 2; - * @param array<\Google\Cloud\Firestore\V1\Write>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWrites($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Write::class); - $this->writes = $arr; - - return $this; - } - - /** - * If set, applies all writes in this transaction, and commits it. - * - * Generated from protobuf field bytes transaction = 3; - * @return string - */ - public function getTransaction() - { - return $this->transaction; - } - - /** - * If set, applies all writes in this transaction, and commits it. - * - * Generated from protobuf field bytes transaction = 3; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->transaction = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitResponse.php deleted file mode 100644 index aa52dc11399d..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CommitResponse.php +++ /dev/null @@ -1,123 +0,0 @@ -google.firestore.v1.CommitResponse - */ -class CommitResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The result of applying the writes. - * This i-th write result corresponds to the i-th write in the - * request. - * - * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 1; - */ - private $write_results; - /** - * The time at which the commit occurred. Any read with an equal or greater - * `read_time` is guaranteed to see the effects of the commit. - * - * Generated from protobuf field .google.protobuf.Timestamp commit_time = 2; - */ - protected $commit_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $write_results - * The result of applying the writes. - * This i-th write result corresponds to the i-th write in the - * request. - * @type \Google\Protobuf\Timestamp $commit_time - * The time at which the commit occurred. Any read with an equal or greater - * `read_time` is guaranteed to see the effects of the commit. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * The result of applying the writes. - * This i-th write result corresponds to the i-th write in the - * request. - * - * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWriteResults() - { - return $this->write_results; - } - - /** - * The result of applying the writes. - * This i-th write result corresponds to the i-th write in the - * request. - * - * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 1; - * @param array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWriteResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\WriteResult::class); - $this->write_results = $arr; - - return $this; - } - - /** - * The time at which the commit occurred. Any read with an equal or greater - * `read_time` is guaranteed to see the effects of the commit. - * - * Generated from protobuf field .google.protobuf.Timestamp commit_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCommitTime() - { - return $this->commit_time; - } - - public function hasCommitTime() - { - return isset($this->commit_time); - } - - public function clearCommitTime() - { - unset($this->commit_time); - } - - /** - * The time at which the commit occurred. Any read with an equal or greater - * `read_time` is guaranteed to see the effects of the commit. - * - * Generated from protobuf field .google.protobuf.Timestamp commit_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCommitTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->commit_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CreateDocumentRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CreateDocumentRequest.php deleted file mode 100644 index 8e2171cf630c..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/CreateDocumentRequest.php +++ /dev/null @@ -1,248 +0,0 @@ -google.firestore.v1.CreateDocumentRequest - */ -class CreateDocumentRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource. For example: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * Required. The collection ID, relative to `parent`, to list. For example: - * `chatrooms`. - * - * Generated from protobuf field string collection_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $collection_id = ''; - /** - * The client-assigned document ID to use for this document. - * Optional. If not specified, an ID will be assigned by the service. - * - * Generated from protobuf field string document_id = 3; - */ - protected $document_id = ''; - /** - * Required. The document to create. `name` must not be set. - * - * Generated from protobuf field .google.firestore.v1.Document document = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $document = null; - /** - * The fields to return. If not set, returns all fields. - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 5; - */ - protected $mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource. For example: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - * @type string $collection_id - * Required. The collection ID, relative to `parent`, to list. For example: - * `chatrooms`. - * @type string $document_id - * The client-assigned document ID to use for this document. - * Optional. If not specified, an ID will be assigned by the service. - * @type \Google\Cloud\Firestore\V1\Document $document - * Required. The document to create. `name` must not be set. - * @type \Google\Cloud\Firestore\V1\DocumentMask $mask - * The fields to return. If not set, returns all fields. - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource. For example: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource. For example: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. The collection ID, relative to `parent`, to list. For example: - * `chatrooms`. - * - * Generated from protobuf field string collection_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCollectionId() - { - return $this->collection_id; - } - - /** - * Required. The collection ID, relative to `parent`, to list. For example: - * `chatrooms`. - * - * Generated from protobuf field string collection_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCollectionId($var) - { - GPBUtil::checkString($var, True); - $this->collection_id = $var; - - return $this; - } - - /** - * The client-assigned document ID to use for this document. - * Optional. If not specified, an ID will be assigned by the service. - * - * Generated from protobuf field string document_id = 3; - * @return string - */ - public function getDocumentId() - { - return $this->document_id; - } - - /** - * The client-assigned document ID to use for this document. - * Optional. If not specified, an ID will be assigned by the service. - * - * Generated from protobuf field string document_id = 3; - * @param string $var - * @return $this - */ - public function setDocumentId($var) - { - GPBUtil::checkString($var, True); - $this->document_id = $var; - - return $this; - } - - /** - * Required. The document to create. `name` must not be set. - * - * Generated from protobuf field .google.firestore.v1.Document document = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Firestore\V1\Document|null - */ - public function getDocument() - { - return $this->document; - } - - public function hasDocument() - { - return isset($this->document); - } - - public function clearDocument() - { - unset($this->document); - } - - /** - * Required. The document to create. `name` must not be set. - * - * Generated from protobuf field .google.firestore.v1.Document document = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Firestore\V1\Document $var - * @return $this - */ - public function setDocument($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Document::class); - $this->document = $var; - - return $this; - } - - /** - * The fields to return. If not set, returns all fields. - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 5; - * @return \Google\Cloud\Firestore\V1\DocumentMask|null - */ - public function getMask() - { - return $this->mask; - } - - public function hasMask() - { - return isset($this->mask); - } - - public function clearMask() - { - unset($this->mask); - } - - /** - * The fields to return. If not set, returns all fields. - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 5; - * @param \Google\Cloud\Firestore\V1\DocumentMask $var - * @return $this - */ - public function setMask($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); - $this->mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Cursor.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Cursor.php deleted file mode 100644 index 9fdaf73c3abe..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Cursor.php +++ /dev/null @@ -1,113 +0,0 @@ -google.firestore.v1.Cursor - */ -class Cursor extends \Google\Protobuf\Internal\Message -{ - /** - * The values that represent a position, in the order they appear in - * the order by clause of a query. - * Can contain fewer values than specified in the order by clause. - * - * Generated from protobuf field repeated .google.firestore.v1.Value values = 1; - */ - private $values; - /** - * If the position is just before or just after the given values, relative - * to the sort order defined by the query. - * - * Generated from protobuf field bool before = 2; - */ - protected $before = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Firestore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $values - * The values that represent a position, in the order they appear in - * the order by clause of a query. - * Can contain fewer values than specified in the order by clause. - * @type bool $before - * If the position is just before or just after the given values, relative - * to the sort order defined by the query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The values that represent a position, in the order they appear in - * the order by clause of a query. - * Can contain fewer values than specified in the order by clause. - * - * Generated from protobuf field repeated .google.firestore.v1.Value values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getValues() - { - return $this->values; - } - - /** - * The values that represent a position, in the order they appear in - * the order by clause of a query. - * Can contain fewer values than specified in the order by clause. - * - * Generated from protobuf field repeated .google.firestore.v1.Value values = 1; - * @param array<\Google\Cloud\Firestore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class); - $this->values = $arr; - - return $this; - } - - /** - * If the position is just before or just after the given values, relative - * to the sort order defined by the query. - * - * Generated from protobuf field bool before = 2; - * @return bool - */ - public function getBefore() - { - return $this->before; - } - - /** - * If the position is just before or just after the given values, relative - * to the sort order defined by the query. - * - * Generated from protobuf field bool before = 2; - * @param bool $var - * @return $this - */ - public function setBefore($var) - { - GPBUtil::checkBool($var); - $this->before = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DeleteDocumentRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DeleteDocumentRequest.php deleted file mode 100644 index 86172865d22c..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DeleteDocumentRequest.php +++ /dev/null @@ -1,134 +0,0 @@ -google.firestore.v1.DeleteDocumentRequest - */ -class DeleteDocumentRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Document to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * - * Generated from protobuf field .google.firestore.v1.Precondition current_document = 2; - */ - protected $current_document = null; - - /** - * @param string $name Required. The resource name of the Document to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * @return \Google\Cloud\Firestore\V1\DeleteDocumentRequest - * - * @experimental - */ - public static function build(string $name): self - { - return (new self()) - ->setName($name); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Document to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @type \Google\Cloud\Firestore\V1\Precondition $current_document - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Document to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the Document to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * - * Generated from protobuf field .google.firestore.v1.Precondition current_document = 2; - * @return \Google\Cloud\Firestore\V1\Precondition|null - */ - public function getCurrentDocument() - { - return $this->current_document; - } - - public function hasCurrentDocument() - { - return isset($this->current_document); - } - - public function clearCurrentDocument() - { - unset($this->current_document); - } - - /** - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * - * Generated from protobuf field .google.firestore.v1.Precondition current_document = 2; - * @param \Google\Cloud\Firestore\V1\Precondition $var - * @return $this - */ - public function setCurrentDocument($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Precondition::class); - $this->current_document = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Document.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Document.php deleted file mode 100644 index 594b70eed952..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Document.php +++ /dev/null @@ -1,290 +0,0 @@ -google.firestore.v1.Document - */ -class Document extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the document, for example - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - /** - * The document's fields. - * The map keys represent field names. - * Field names matching the regular expression `__.*__` are reserved. Reserved - * field names are forbidden except in certain documented contexts. The field - * names, represented as UTF-8, must not exceed 1,500 bytes and cannot be - * empty. - * Field paths may be used in other contexts to refer to structured fields - * defined here. For `map_value`, the field path is represented by a - * dot-delimited (`.`) string of segments. Each segment is either a simple - * field name (defined below) or a quoted field name. For example, the - * structured field `"foo" : { map_value: { "x&y" : { string_value: "hello" - * }}}` would be represented by the field path `` foo.`x&y` ``. - * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, - * `foo_bar_17`. - * A quoted field name starts and ends with `` ` `` and - * may contain any character. Some characters, including `` ` ``, must be - * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and - * `` `bak\`tik` `` represents `` bak`tik ``. - * - * Generated from protobuf field map fields = 2; - */ - private $fields; - /** - * Output only. The time at which the document was created. - * This value increases monotonically when a document is deleted then - * recreated. It can also be compared to values from other documents and - * the `read_time` of a query. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; - */ - protected $create_time = null; - /** - * Output only. The time at which the document was last changed. - * This value is initially set to the `create_time` then increases - * monotonically with each change to the document. It can also be - * compared to values from other documents and the `read_time` of a query. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - */ - protected $update_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The resource name of the document, for example - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @type array|\Google\Protobuf\Internal\MapField $fields - * The document's fields. - * The map keys represent field names. - * Field names matching the regular expression `__.*__` are reserved. Reserved - * field names are forbidden except in certain documented contexts. The field - * names, represented as UTF-8, must not exceed 1,500 bytes and cannot be - * empty. - * Field paths may be used in other contexts to refer to structured fields - * defined here. For `map_value`, the field path is represented by a - * dot-delimited (`.`) string of segments. Each segment is either a simple - * field name (defined below) or a quoted field name. For example, the - * structured field `"foo" : { map_value: { "x&y" : { string_value: "hello" - * }}}` would be represented by the field path `` foo.`x&y` ``. - * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, - * `foo_bar_17`. - * A quoted field name starts and ends with `` ` `` and - * may contain any character. Some characters, including `` ` ``, must be - * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and - * `` `bak\`tik` `` represents `` bak`tik ``. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time at which the document was created. - * This value increases monotonically when a document is deleted then - * recreated. It can also be compared to values from other documents and - * the `read_time` of a query. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The time at which the document was last changed. - * This value is initially set to the `create_time` then increases - * monotonically with each change to the document. It can also be - * compared to values from other documents and the `read_time` of a query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the document, for example - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the document, for example - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The document's fields. - * The map keys represent field names. - * Field names matching the regular expression `__.*__` are reserved. Reserved - * field names are forbidden except in certain documented contexts. The field - * names, represented as UTF-8, must not exceed 1,500 bytes and cannot be - * empty. - * Field paths may be used in other contexts to refer to structured fields - * defined here. For `map_value`, the field path is represented by a - * dot-delimited (`.`) string of segments. Each segment is either a simple - * field name (defined below) or a quoted field name. For example, the - * structured field `"foo" : { map_value: { "x&y" : { string_value: "hello" - * }}}` would be represented by the field path `` foo.`x&y` ``. - * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, - * `foo_bar_17`. - * A quoted field name starts and ends with `` ` `` and - * may contain any character. Some characters, including `` ` ``, must be - * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and - * `` `bak\`tik` `` represents `` bak`tik ``. - * - * Generated from protobuf field map fields = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getFields() - { - return $this->fields; - } - - /** - * The document's fields. - * The map keys represent field names. - * Field names matching the regular expression `__.*__` are reserved. Reserved - * field names are forbidden except in certain documented contexts. The field - * names, represented as UTF-8, must not exceed 1,500 bytes and cannot be - * empty. - * Field paths may be used in other contexts to refer to structured fields - * defined here. For `map_value`, the field path is represented by a - * dot-delimited (`.`) string of segments. Each segment is either a simple - * field name (defined below) or a quoted field name. For example, the - * structured field `"foo" : { map_value: { "x&y" : { string_value: "hello" - * }}}` would be represented by the field path `` foo.`x&y` ``. - * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, - * `foo_bar_17`. - * A quoted field name starts and ends with `` ` `` and - * may contain any character. Some characters, including `` ` ``, must be - * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and - * `` `bak\`tik` `` represents `` bak`tik ``. - * - * Generated from protobuf field map fields = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setFields($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class); - $this->fields = $arr; - - return $this; - } - - /** - * Output only. The time at which the document was created. - * This value increases monotonically when a document is deleted then - * recreated. It can also be compared to values from other documents and - * the `read_time` of a query. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time at which the document was created. - * This value increases monotonically when a document is deleted then - * recreated. It can also be compared to values from other documents and - * the `read_time` of a query. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time at which the document was last changed. - * This value is initially set to the `create_time` then increases - * monotonically with each change to the document. It can also be - * compared to values from other documents and the `read_time` of a query. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The time at which the document was last changed. - * This value is initially set to the `create_time` then increases - * monotonically with each change to the document. It can also be - * compared to values from other documents and the `read_time` of a query. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentChange.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentChange.php deleted file mode 100644 index f4e1a5181731..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentChange.php +++ /dev/null @@ -1,154 +0,0 @@ -google.firestore.v1.DocumentChange - */ -class DocumentChange extends \Google\Protobuf\Internal\Message -{ - /** - * The new state of the [Document][google.firestore.v1.Document]. - * If `mask` is set, contains only fields that were updated or added. - * - * Generated from protobuf field .google.firestore.v1.Document document = 1; - */ - protected $document = null; - /** - * A set of target IDs of targets that match this document. - * - * Generated from protobuf field repeated int32 target_ids = 5; - */ - private $target_ids; - /** - * A set of target IDs for targets that no longer match this document. - * - * Generated from protobuf field repeated int32 removed_target_ids = 6; - */ - private $removed_target_ids; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\Document $document - * The new state of the [Document][google.firestore.v1.Document]. - * If `mask` is set, contains only fields that were updated or added. - * @type array|\Google\Protobuf\Internal\RepeatedField $target_ids - * A set of target IDs of targets that match this document. - * @type array|\Google\Protobuf\Internal\RepeatedField $removed_target_ids - * A set of target IDs for targets that no longer match this document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Write::initOnce(); - parent::__construct($data); - } - - /** - * The new state of the [Document][google.firestore.v1.Document]. - * If `mask` is set, contains only fields that were updated or added. - * - * Generated from protobuf field .google.firestore.v1.Document document = 1; - * @return \Google\Cloud\Firestore\V1\Document|null - */ - public function getDocument() - { - return $this->document; - } - - public function hasDocument() - { - return isset($this->document); - } - - public function clearDocument() - { - unset($this->document); - } - - /** - * The new state of the [Document][google.firestore.v1.Document]. - * If `mask` is set, contains only fields that were updated or added. - * - * Generated from protobuf field .google.firestore.v1.Document document = 1; - * @param \Google\Cloud\Firestore\V1\Document $var - * @return $this - */ - public function setDocument($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Document::class); - $this->document = $var; - - return $this; - } - - /** - * A set of target IDs of targets that match this document. - * - * Generated from protobuf field repeated int32 target_ids = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTargetIds() - { - return $this->target_ids; - } - - /** - * A set of target IDs of targets that match this document. - * - * Generated from protobuf field repeated int32 target_ids = 5; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTargetIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); - $this->target_ids = $arr; - - return $this; - } - - /** - * A set of target IDs for targets that no longer match this document. - * - * Generated from protobuf field repeated int32 removed_target_ids = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRemovedTargetIds() - { - return $this->removed_target_ids; - } - - /** - * A set of target IDs for targets that no longer match this document. - * - * Generated from protobuf field repeated int32 removed_target_ids = 6; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRemovedTargetIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); - $this->removed_target_ids = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentDelete.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentDelete.php deleted file mode 100644 index 94b0fb72fcd8..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentDelete.php +++ /dev/null @@ -1,158 +0,0 @@ -google.firestore.v1.DocumentDelete - */ -class DocumentDelete extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the [Document][google.firestore.v1.Document] that was - * deleted. - * - * Generated from protobuf field string document = 1; - */ - protected $document = ''; - /** - * A set of target IDs for targets that previously matched this entity. - * - * Generated from protobuf field repeated int32 removed_target_ids = 6; - */ - private $removed_target_ids; - /** - * The read timestamp at which the delete was observed. - * Greater or equal to the `commit_time` of the delete. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; - */ - protected $read_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $document - * The resource name of the [Document][google.firestore.v1.Document] that was - * deleted. - * @type array|\Google\Protobuf\Internal\RepeatedField $removed_target_ids - * A set of target IDs for targets that previously matched this entity. - * @type \Google\Protobuf\Timestamp $read_time - * The read timestamp at which the delete was observed. - * Greater or equal to the `commit_time` of the delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Write::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the [Document][google.firestore.v1.Document] that was - * deleted. - * - * Generated from protobuf field string document = 1; - * @return string - */ - public function getDocument() - { - return $this->document; - } - - /** - * The resource name of the [Document][google.firestore.v1.Document] that was - * deleted. - * - * Generated from protobuf field string document = 1; - * @param string $var - * @return $this - */ - public function setDocument($var) - { - GPBUtil::checkString($var, True); - $this->document = $var; - - return $this; - } - - /** - * A set of target IDs for targets that previously matched this entity. - * - * Generated from protobuf field repeated int32 removed_target_ids = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRemovedTargetIds() - { - return $this->removed_target_ids; - } - - /** - * A set of target IDs for targets that previously matched this entity. - * - * Generated from protobuf field repeated int32 removed_target_ids = 6; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRemovedTargetIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); - $this->removed_target_ids = $arr; - - return $this; - } - - /** - * The read timestamp at which the delete was observed. - * Greater or equal to the `commit_time` of the delete. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->read_time; - } - - public function hasReadTime() - { - return isset($this->read_time); - } - - public function clearReadTime() - { - unset($this->read_time); - } - - /** - * The read timestamp at which the delete was observed. - * Greater or equal to the `commit_time` of the delete. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->read_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentMask.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentMask.php deleted file mode 100644 index 10644f490192..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentMask.php +++ /dev/null @@ -1,80 +0,0 @@ -google.firestore.v1.DocumentMask - */ -class DocumentMask extends \Google\Protobuf\Internal\Message -{ - /** - * The list of field paths in the mask. See - * [Document.fields][google.firestore.v1.Document.fields] for a field path - * syntax reference. - * - * Generated from protobuf field repeated string field_paths = 1; - */ - private $field_paths; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $field_paths - * The list of field paths in the mask. See - * [Document.fields][google.firestore.v1.Document.fields] for a field path - * syntax reference. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Common::initOnce(); - parent::__construct($data); - } - - /** - * The list of field paths in the mask. See - * [Document.fields][google.firestore.v1.Document.fields] for a field path - * syntax reference. - * - * Generated from protobuf field repeated string field_paths = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFieldPaths() - { - return $this->field_paths; - } - - /** - * The list of field paths in the mask. See - * [Document.fields][google.firestore.v1.Document.fields] for a field path - * syntax reference. - * - * Generated from protobuf field repeated string field_paths = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFieldPaths($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->field_paths = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentRemove.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentRemove.php deleted file mode 100644 index 7a435ef42700..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentRemove.php +++ /dev/null @@ -1,160 +0,0 @@ -google.firestore.v1.DocumentRemove - */ -class DocumentRemove extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the [Document][google.firestore.v1.Document] that has - * gone out of view. - * - * Generated from protobuf field string document = 1; - */ - protected $document = ''; - /** - * A set of target IDs for targets that previously matched this document. - * - * Generated from protobuf field repeated int32 removed_target_ids = 2; - */ - private $removed_target_ids; - /** - * The read timestamp at which the remove was observed. - * Greater or equal to the `commit_time` of the change/delete/remove. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; - */ - protected $read_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $document - * The resource name of the [Document][google.firestore.v1.Document] that has - * gone out of view. - * @type array|\Google\Protobuf\Internal\RepeatedField $removed_target_ids - * A set of target IDs for targets that previously matched this document. - * @type \Google\Protobuf\Timestamp $read_time - * The read timestamp at which the remove was observed. - * Greater or equal to the `commit_time` of the change/delete/remove. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Write::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the [Document][google.firestore.v1.Document] that has - * gone out of view. - * - * Generated from protobuf field string document = 1; - * @return string - */ - public function getDocument() - { - return $this->document; - } - - /** - * The resource name of the [Document][google.firestore.v1.Document] that has - * gone out of view. - * - * Generated from protobuf field string document = 1; - * @param string $var - * @return $this - */ - public function setDocument($var) - { - GPBUtil::checkString($var, True); - $this->document = $var; - - return $this; - } - - /** - * A set of target IDs for targets that previously matched this document. - * - * Generated from protobuf field repeated int32 removed_target_ids = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getRemovedTargetIds() - { - return $this->removed_target_ids; - } - - /** - * A set of target IDs for targets that previously matched this document. - * - * Generated from protobuf field repeated int32 removed_target_ids = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setRemovedTargetIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); - $this->removed_target_ids = $arr; - - return $this; - } - - /** - * The read timestamp at which the remove was observed. - * Greater or equal to the `commit_time` of the change/delete/remove. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->read_time; - } - - public function hasReadTime() - { - return isset($this->read_time); - } - - public function clearReadTime() - { - unset($this->read_time); - } - - /** - * The read timestamp at which the remove was observed. - * Greater or equal to the `commit_time` of the change/delete/remove. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->read_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform.php deleted file mode 100644 index 05828bedba2f..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform.php +++ /dev/null @@ -1,109 +0,0 @@ -google.firestore.v1.DocumentTransform - */ -class DocumentTransform extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the document to transform. - * - * Generated from protobuf field string document = 1; - */ - protected $document = ''; - /** - * The list of transformations to apply to the fields of the document, in - * order. - * This must not be empty. - * - * Generated from protobuf field repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; - */ - private $field_transforms; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $document - * The name of the document to transform. - * @type array<\Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform>|\Google\Protobuf\Internal\RepeatedField $field_transforms - * The list of transformations to apply to the fields of the document, in - * order. - * This must not be empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Write::initOnce(); - parent::__construct($data); - } - - /** - * The name of the document to transform. - * - * Generated from protobuf field string document = 1; - * @return string - */ - public function getDocument() - { - return $this->document; - } - - /** - * The name of the document to transform. - * - * Generated from protobuf field string document = 1; - * @param string $var - * @return $this - */ - public function setDocument($var) - { - GPBUtil::checkString($var, True); - $this->document = $var; - - return $this; - } - - /** - * The list of transformations to apply to the fields of the document, in - * order. - * This must not be empty. - * - * Generated from protobuf field repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFieldTransforms() - { - return $this->field_transforms; - } - - /** - * The list of transformations to apply to the fields of the document, in - * order. - * This must not be empty. - * - * Generated from protobuf field repeated .google.firestore.v1.DocumentTransform.FieldTransform field_transforms = 2; - * @param array<\Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFieldTransforms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform::class); - $this->field_transforms = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform.php deleted file mode 100644 index 1372f46bd038..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform.php +++ /dev/null @@ -1,417 +0,0 @@ -google.firestore.v1.DocumentTransform.FieldTransform - */ -class FieldTransform extends \Google\Protobuf\Internal\Message -{ - /** - * The path of the field. See - * [Document.fields][google.firestore.v1.Document.fields] for the field path - * syntax reference. - * - * Generated from protobuf field string field_path = 1; - */ - protected $field_path = ''; - protected $transform_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $field_path - * The path of the field. See - * [Document.fields][google.firestore.v1.Document.fields] for the field path - * syntax reference. - * @type int $set_to_server_value - * Sets the field to the given server value. - * @type \Google\Cloud\Firestore\V1\Value $increment - * Adds the given value to the field's current value. - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the given value. - * If either of the given value or the current field value are doubles, - * both values will be interpreted as doubles. Double arithmetic and - * representation of double values follow IEEE 754 semantics. - * If there is positive/negative integer overflow, the field is resolved - * to the largest magnitude positive/negative integer. - * @type \Google\Cloud\Firestore\V1\Value $maximum - * Sets the field to the maximum of its current value and the given value. - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the given value. - * If a maximum operation is applied where the field and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the field takes on the type of the larger operand. If the operands are - * equivalent (e.g. 3 and 3.0), the field does not change. - * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and - * zero input value is always the stored value. - * The maximum of any numeric value x and NaN is NaN. - * @type \Google\Cloud\Firestore\V1\Value $minimum - * Sets the field to the minimum of its current value and the given value. - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the input value. - * If a minimum operation is applied where the field and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the field takes on the type of the smaller operand. If the operands are - * equivalent (e.g. 3 and 3.0), the field does not change. - * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and - * zero input value is always the stored value. - * The minimum of any numeric value x and NaN is NaN. - * @type \Google\Cloud\Firestore\V1\ArrayValue $append_missing_elements - * Append the given elements in order if they are not already present in - * the current field value. - * If the field is not an array, or if the field does not yet exist, it is - * first set to the empty array. - * Equivalent numbers of different types (e.g. 3L and 3.0) are - * considered equal when checking if a value is missing. - * NaN is equal to NaN, and Null is equal to Null. - * If the input contains multiple equivalent values, only the first will - * be considered. - * The corresponding transform_result will be the null value. - * @type \Google\Cloud\Firestore\V1\ArrayValue $remove_all_from_array - * Remove all of the given elements from the array in the field. - * If the field is not an array, or if the field does not yet exist, it is - * set to the empty array. - * Equivalent numbers of the different types (e.g. 3L and 3.0) are - * considered equal when deciding whether an element should be removed. - * NaN is equal to NaN, and Null is equal to Null. - * This will remove all equivalent values if there are duplicates. - * The corresponding transform_result will be the null value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Write::initOnce(); - parent::__construct($data); - } - - /** - * The path of the field. See - * [Document.fields][google.firestore.v1.Document.fields] for the field path - * syntax reference. - * - * Generated from protobuf field string field_path = 1; - * @return string - */ - public function getFieldPath() - { - return $this->field_path; - } - - /** - * The path of the field. See - * [Document.fields][google.firestore.v1.Document.fields] for the field path - * syntax reference. - * - * Generated from protobuf field string field_path = 1; - * @param string $var - * @return $this - */ - public function setFieldPath($var) - { - GPBUtil::checkString($var, True); - $this->field_path = $var; - - return $this; - } - - /** - * Sets the field to the given server value. - * - * Generated from protobuf field .google.firestore.v1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2; - * @return int - */ - public function getSetToServerValue() - { - return $this->readOneof(2); - } - - public function hasSetToServerValue() - { - return $this->hasOneof(2); - } - - /** - * Sets the field to the given server value. - * - * Generated from protobuf field .google.firestore.v1.DocumentTransform.FieldTransform.ServerValue set_to_server_value = 2; - * @param int $var - * @return $this - */ - public function setSetToServerValue($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform\ServerValue::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Adds the given value to the field's current value. - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the given value. - * If either of the given value or the current field value are doubles, - * both values will be interpreted as doubles. Double arithmetic and - * representation of double values follow IEEE 754 semantics. - * If there is positive/negative integer overflow, the field is resolved - * to the largest magnitude positive/negative integer. - * - * Generated from protobuf field .google.firestore.v1.Value increment = 3; - * @return \Google\Cloud\Firestore\V1\Value|null - */ - public function getIncrement() - { - return $this->readOneof(3); - } - - public function hasIncrement() - { - return $this->hasOneof(3); - } - - /** - * Adds the given value to the field's current value. - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the given value. - * If either of the given value or the current field value are doubles, - * both values will be interpreted as doubles. Double arithmetic and - * representation of double values follow IEEE 754 semantics. - * If there is positive/negative integer overflow, the field is resolved - * to the largest magnitude positive/negative integer. - * - * Generated from protobuf field .google.firestore.v1.Value increment = 3; - * @param \Google\Cloud\Firestore\V1\Value $var - * @return $this - */ - public function setIncrement($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Value::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Sets the field to the maximum of its current value and the given value. - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the given value. - * If a maximum operation is applied where the field and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the field takes on the type of the larger operand. If the operands are - * equivalent (e.g. 3 and 3.0), the field does not change. - * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and - * zero input value is always the stored value. - * The maximum of any numeric value x and NaN is NaN. - * - * Generated from protobuf field .google.firestore.v1.Value maximum = 4; - * @return \Google\Cloud\Firestore\V1\Value|null - */ - public function getMaximum() - { - return $this->readOneof(4); - } - - public function hasMaximum() - { - return $this->hasOneof(4); - } - - /** - * Sets the field to the maximum of its current value and the given value. - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the given value. - * If a maximum operation is applied where the field and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the field takes on the type of the larger operand. If the operands are - * equivalent (e.g. 3 and 3.0), the field does not change. - * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and - * zero input value is always the stored value. - * The maximum of any numeric value x and NaN is NaN. - * - * Generated from protobuf field .google.firestore.v1.Value maximum = 4; - * @param \Google\Cloud\Firestore\V1\Value $var - * @return $this - */ - public function setMaximum($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Value::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Sets the field to the minimum of its current value and the given value. - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the input value. - * If a minimum operation is applied where the field and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the field takes on the type of the smaller operand. If the operands are - * equivalent (e.g. 3 and 3.0), the field does not change. - * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and - * zero input value is always the stored value. - * The minimum of any numeric value x and NaN is NaN. - * - * Generated from protobuf field .google.firestore.v1.Value minimum = 5; - * @return \Google\Cloud\Firestore\V1\Value|null - */ - public function getMinimum() - { - return $this->readOneof(5); - } - - public function hasMinimum() - { - return $this->hasOneof(5); - } - - /** - * Sets the field to the minimum of its current value and the given value. - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the input value. - * If a minimum operation is applied where the field and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the field takes on the type of the smaller operand. If the operands are - * equivalent (e.g. 3 and 3.0), the field does not change. - * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and - * zero input value is always the stored value. - * The minimum of any numeric value x and NaN is NaN. - * - * Generated from protobuf field .google.firestore.v1.Value minimum = 5; - * @param \Google\Cloud\Firestore\V1\Value $var - * @return $this - */ - public function setMinimum($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Value::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Append the given elements in order if they are not already present in - * the current field value. - * If the field is not an array, or if the field does not yet exist, it is - * first set to the empty array. - * Equivalent numbers of different types (e.g. 3L and 3.0) are - * considered equal when checking if a value is missing. - * NaN is equal to NaN, and Null is equal to Null. - * If the input contains multiple equivalent values, only the first will - * be considered. - * The corresponding transform_result will be the null value. - * - * Generated from protobuf field .google.firestore.v1.ArrayValue append_missing_elements = 6; - * @return \Google\Cloud\Firestore\V1\ArrayValue|null - */ - public function getAppendMissingElements() - { - return $this->readOneof(6); - } - - public function hasAppendMissingElements() - { - return $this->hasOneof(6); - } - - /** - * Append the given elements in order if they are not already present in - * the current field value. - * If the field is not an array, or if the field does not yet exist, it is - * first set to the empty array. - * Equivalent numbers of different types (e.g. 3L and 3.0) are - * considered equal when checking if a value is missing. - * NaN is equal to NaN, and Null is equal to Null. - * If the input contains multiple equivalent values, only the first will - * be considered. - * The corresponding transform_result will be the null value. - * - * Generated from protobuf field .google.firestore.v1.ArrayValue append_missing_elements = 6; - * @param \Google\Cloud\Firestore\V1\ArrayValue $var - * @return $this - */ - public function setAppendMissingElements($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ArrayValue::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Remove all of the given elements from the array in the field. - * If the field is not an array, or if the field does not yet exist, it is - * set to the empty array. - * Equivalent numbers of the different types (e.g. 3L and 3.0) are - * considered equal when deciding whether an element should be removed. - * NaN is equal to NaN, and Null is equal to Null. - * This will remove all equivalent values if there are duplicates. - * The corresponding transform_result will be the null value. - * - * Generated from protobuf field .google.firestore.v1.ArrayValue remove_all_from_array = 7; - * @return \Google\Cloud\Firestore\V1\ArrayValue|null - */ - public function getRemoveAllFromArray() - { - return $this->readOneof(7); - } - - public function hasRemoveAllFromArray() - { - return $this->hasOneof(7); - } - - /** - * Remove all of the given elements from the array in the field. - * If the field is not an array, or if the field does not yet exist, it is - * set to the empty array. - * Equivalent numbers of the different types (e.g. 3L and 3.0) are - * considered equal when deciding whether an element should be removed. - * NaN is equal to NaN, and Null is equal to Null. - * This will remove all equivalent values if there are duplicates. - * The corresponding transform_result will be the null value. - * - * Generated from protobuf field .google.firestore.v1.ArrayValue remove_all_from_array = 7; - * @param \Google\Cloud\Firestore\V1\ArrayValue $var - * @return $this - */ - public function setRemoveAllFromArray($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ArrayValue::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * @return string - */ - public function getTransformType() - { - return $this->whichOneof("transform_type"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FieldTransform::class, \Google\Cloud\Firestore\V1\DocumentTransform_FieldTransform::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform/ServerValue.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform/ServerValue.php deleted file mode 100644 index 47d3356c025d..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/DocumentTransform/FieldTransform/ServerValue.php +++ /dev/null @@ -1,59 +0,0 @@ -google.firestore.v1.DocumentTransform.FieldTransform.ServerValue - */ -class ServerValue -{ - /** - * Unspecified. This value must not be used. - * - * Generated from protobuf enum SERVER_VALUE_UNSPECIFIED = 0; - */ - const SERVER_VALUE_UNSPECIFIED = 0; - /** - * The time at which the server processed the request, with millisecond - * precision. If used on multiple fields (same or different documents) in - * a transaction, all the fields will get the same server timestamp. - * - * Generated from protobuf enum REQUEST_TIME = 1; - */ - const REQUEST_TIME = 1; - - private static $valueToName = [ - self::SERVER_VALUE_UNSPECIFIED => 'SERVER_VALUE_UNSPECIFIED', - self::REQUEST_TIME => 'REQUEST_TIME', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ServerValue::class, \Google\Cloud\Firestore\V1\DocumentTransform_FieldTransform_ServerValue::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExistenceFilter.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExistenceFilter.php deleted file mode 100644 index d6817e30b2fa..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExistenceFilter.php +++ /dev/null @@ -1,209 +0,0 @@ -google.firestore.v1.ExistenceFilter - */ -class ExistenceFilter extends \Google\Protobuf\Internal\Message -{ - /** - * The target ID to which this filter applies. - * - * Generated from protobuf field int32 target_id = 1; - */ - protected $target_id = 0; - /** - * The total count of documents that match - * [target_id][google.firestore.v1.ExistenceFilter.target_id]. - * If different from the count of documents in the client that match, the - * client must manually determine which documents no longer match the target. - * The client can use the `unchanged_names` bloom filter to assist with - * this determination by testing ALL the document names against the filter; - * if the document name is NOT in the filter, it means the document no - * longer matches the target. - * - * Generated from protobuf field int32 count = 2; - */ - protected $count = 0; - /** - * A bloom filter that, despite its name, contains the UTF-8 byte encodings of - * the resource names of ALL the documents that match - * [target_id][google.firestore.v1.ExistenceFilter.target_id], in the form - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * This bloom filter may be omitted at the server's discretion, such as if it - * is deemed that the client will not make use of it or if it is too - * computationally expensive to calculate or transmit. Clients must gracefully - * handle this field being absent by falling back to the logic used before - * this field existed; that is, re-add the target without a resume token to - * figure out which documents in the client's cache are out of sync. - * - * Generated from protobuf field .google.firestore.v1.BloomFilter unchanged_names = 3; - */ - protected $unchanged_names = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $target_id - * The target ID to which this filter applies. - * @type int $count - * The total count of documents that match - * [target_id][google.firestore.v1.ExistenceFilter.target_id]. - * If different from the count of documents in the client that match, the - * client must manually determine which documents no longer match the target. - * The client can use the `unchanged_names` bloom filter to assist with - * this determination by testing ALL the document names against the filter; - * if the document name is NOT in the filter, it means the document no - * longer matches the target. - * @type \Google\Cloud\Firestore\V1\BloomFilter $unchanged_names - * A bloom filter that, despite its name, contains the UTF-8 byte encodings of - * the resource names of ALL the documents that match - * [target_id][google.firestore.v1.ExistenceFilter.target_id], in the form - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * This bloom filter may be omitted at the server's discretion, such as if it - * is deemed that the client will not make use of it or if it is too - * computationally expensive to calculate or transmit. Clients must gracefully - * handle this field being absent by falling back to the logic used before - * this field existed; that is, re-add the target without a resume token to - * figure out which documents in the client's cache are out of sync. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Write::initOnce(); - parent::__construct($data); - } - - /** - * The target ID to which this filter applies. - * - * Generated from protobuf field int32 target_id = 1; - * @return int - */ - public function getTargetId() - { - return $this->target_id; - } - - /** - * The target ID to which this filter applies. - * - * Generated from protobuf field int32 target_id = 1; - * @param int $var - * @return $this - */ - public function setTargetId($var) - { - GPBUtil::checkInt32($var); - $this->target_id = $var; - - return $this; - } - - /** - * The total count of documents that match - * [target_id][google.firestore.v1.ExistenceFilter.target_id]. - * If different from the count of documents in the client that match, the - * client must manually determine which documents no longer match the target. - * The client can use the `unchanged_names` bloom filter to assist with - * this determination by testing ALL the document names against the filter; - * if the document name is NOT in the filter, it means the document no - * longer matches the target. - * - * Generated from protobuf field int32 count = 2; - * @return int - */ - public function getCount() - { - return $this->count; - } - - /** - * The total count of documents that match - * [target_id][google.firestore.v1.ExistenceFilter.target_id]. - * If different from the count of documents in the client that match, the - * client must manually determine which documents no longer match the target. - * The client can use the `unchanged_names` bloom filter to assist with - * this determination by testing ALL the document names against the filter; - * if the document name is NOT in the filter, it means the document no - * longer matches the target. - * - * Generated from protobuf field int32 count = 2; - * @param int $var - * @return $this - */ - public function setCount($var) - { - GPBUtil::checkInt32($var); - $this->count = $var; - - return $this; - } - - /** - * A bloom filter that, despite its name, contains the UTF-8 byte encodings of - * the resource names of ALL the documents that match - * [target_id][google.firestore.v1.ExistenceFilter.target_id], in the form - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * This bloom filter may be omitted at the server's discretion, such as if it - * is deemed that the client will not make use of it or if it is too - * computationally expensive to calculate or transmit. Clients must gracefully - * handle this field being absent by falling back to the logic used before - * this field existed; that is, re-add the target without a resume token to - * figure out which documents in the client's cache are out of sync. - * - * Generated from protobuf field .google.firestore.v1.BloomFilter unchanged_names = 3; - * @return \Google\Cloud\Firestore\V1\BloomFilter|null - */ - public function getUnchangedNames() - { - return $this->unchanged_names; - } - - public function hasUnchangedNames() - { - return isset($this->unchanged_names); - } - - public function clearUnchangedNames() - { - unset($this->unchanged_names); - } - - /** - * A bloom filter that, despite its name, contains the UTF-8 byte encodings of - * the resource names of ALL the documents that match - * [target_id][google.firestore.v1.ExistenceFilter.target_id], in the form - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * This bloom filter may be omitted at the server's discretion, such as if it - * is deemed that the client will not make use of it or if it is too - * computationally expensive to calculate or transmit. Clients must gracefully - * handle this field being absent by falling back to the logic used before - * this field existed; that is, re-add the target without a resume token to - * figure out which documents in the client's cache are out of sync. - * - * Generated from protobuf field .google.firestore.v1.BloomFilter unchanged_names = 3; - * @param \Google\Cloud\Firestore\V1\BloomFilter $var - * @return $this - */ - public function setUnchangedNames($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\BloomFilter::class); - $this->unchanged_names = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/GetDocumentRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/GetDocumentRequest.php deleted file mode 100644 index 7342dfd8c590..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/GetDocumentRequest.php +++ /dev/null @@ -1,208 +0,0 @@ -google.firestore.v1.GetDocumentRequest - */ -class GetDocumentRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the Document to get. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * The fields to return. If not set, returns all fields. - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 2; - */ - protected $mask = null; - protected $consistency_selector; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the Document to get. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @type \Google\Cloud\Firestore\V1\DocumentMask $mask - * The fields to return. If not set, returns all fields. - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * @type string $transaction - * Reads the document in a transaction. - * @type \Google\Protobuf\Timestamp $read_time - * Reads the version of the document at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the Document to get. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the Document to get. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The fields to return. If not set, returns all fields. - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 2; - * @return \Google\Cloud\Firestore\V1\DocumentMask|null - */ - public function getMask() - { - return $this->mask; - } - - public function hasMask() - { - return isset($this->mask); - } - - public function clearMask() - { - unset($this->mask); - } - - /** - * The fields to return. If not set, returns all fields. - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 2; - * @param \Google\Cloud\Firestore\V1\DocumentMask $var - * @return $this - */ - public function setMask($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); - $this->mask = $var; - - return $this; - } - - /** - * Reads the document in a transaction. - * - * Generated from protobuf field bytes transaction = 3; - * @return string - */ - public function getTransaction() - { - return $this->readOneof(3); - } - - public function hasTransaction() - { - return $this->hasOneof(3); - } - - /** - * Reads the document in a transaction. - * - * Generated from protobuf field bytes transaction = 3; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Reads the version of the document at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->readOneof(5); - } - - public function hasReadTime() - { - return $this->hasOneof(5); - } - - /** - * Reads the version of the document at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * @return string - */ - public function getConsistencySelector() - { - return $this->whichOneof("consistency_selector"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsRequest.php deleted file mode 100644 index 7603b7a00593..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsRequest.php +++ /dev/null @@ -1,219 +0,0 @@ -google.firestore.v1.ListCollectionIdsRequest - */ -class ListCollectionIdsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * The maximum number of results to return. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * A page token. Must be a value from - * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse]. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - protected $consistency_selector; - - /** - * @param string $parent Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * @return \Google\Cloud\Firestore\V1\ListCollectionIdsRequest - * - * @experimental - */ - public static function build(string $parent): self - { - return (new self()) - ->setParent($parent); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @type int $page_size - * The maximum number of results to return. - * @type string $page_token - * A page token. Must be a value from - * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse]. - * @type \Google\Protobuf\Timestamp $read_time - * Reads documents as they were at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of results to return. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of results to return. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * A page token. Must be a value from - * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse]. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token. Must be a value from - * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse]. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Reads documents as they were at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->readOneof(4); - } - - public function hasReadTime() - { - return $this->hasOneof(4); - } - - /** - * Reads documents as they were at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getConsistencySelector() - { - return $this->whichOneof("consistency_selector"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsResponse.php deleted file mode 100644 index b31178cf5166..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListCollectionIdsResponse.php +++ /dev/null @@ -1,102 +0,0 @@ -google.firestore.v1.ListCollectionIdsResponse - */ -class ListCollectionIdsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The collection ids. - * - * Generated from protobuf field repeated string collection_ids = 1; - */ - private $collection_ids; - /** - * A page token that may be used to continue the list. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids - * The collection ids. - * @type string $next_page_token - * A page token that may be used to continue the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * The collection ids. - * - * Generated from protobuf field repeated string collection_ids = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCollectionIds() - { - return $this->collection_ids; - } - - /** - * The collection ids. - * - * Generated from protobuf field repeated string collection_ids = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCollectionIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->collection_ids = $arr; - - return $this; - } - - /** - * A page token that may be used to continue the list. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A page token that may be used to continue the list. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsRequest.php deleted file mode 100644 index 51ea08cec401..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsRequest.php +++ /dev/null @@ -1,462 +0,0 @@ -google.firestore.v1.ListDocumentsRequest - */ -class ListDocumentsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * Optional. The collection ID, relative to `parent`, to list. - * For example: `chatrooms` or `messages`. - * This is optional, and when not provided, Firestore will list documents - * from all collections under the provided `parent`. - * - * Generated from protobuf field string collection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $collection_id = ''; - /** - * Optional. The maximum number of documents to return in a single response. - * Firestore may return fewer than this value. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_size = 0; - /** - * Optional. A page token, received from a previous `ListDocuments` response. - * Provide this to retrieve the subsequent page. When paginating, all other - * parameters (with the exception of `page_size`) must match the values set - * in the request that generated the page token. - * - * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $page_token = ''; - /** - * Optional. The optional ordering of the documents to return. - * For example: `priority desc, __name__ desc`. - * This mirrors the [`ORDER BY`][google.firestore.v1.StructuredQuery.order_by] - * used in Firestore queries but in a string representation. When absent, - * documents are ordered based on `__name__ ASC`. - * - * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $order_by = ''; - /** - * Optional. The fields to return. If not set, returns all fields. - * If a document has a field that is not present in this mask, that field - * will not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $mask = null; - /** - * If the list should show missing documents. - * A document is missing if it does not exist, but there are sub-documents - * nested underneath it. When true, such missing documents will be returned - * with a key but will not have fields, - * [`create_time`][google.firestore.v1.Document.create_time], or - * [`update_time`][google.firestore.v1.Document.update_time] set. - * Requests with `show_missing` may not specify `where` or `order_by`. - * - * Generated from protobuf field bool show_missing = 12; - */ - protected $show_missing = false; - protected $consistency_selector; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @type string $collection_id - * Optional. The collection ID, relative to `parent`, to list. - * For example: `chatrooms` or `messages`. - * This is optional, and when not provided, Firestore will list documents - * from all collections under the provided `parent`. - * @type int $page_size - * Optional. The maximum number of documents to return in a single response. - * Firestore may return fewer than this value. - * @type string $page_token - * Optional. A page token, received from a previous `ListDocuments` response. - * Provide this to retrieve the subsequent page. When paginating, all other - * parameters (with the exception of `page_size`) must match the values set - * in the request that generated the page token. - * @type string $order_by - * Optional. The optional ordering of the documents to return. - * For example: `priority desc, __name__ desc`. - * This mirrors the [`ORDER BY`][google.firestore.v1.StructuredQuery.order_by] - * used in Firestore queries but in a string representation. When absent, - * documents are ordered based on `__name__ ASC`. - * @type \Google\Cloud\Firestore\V1\DocumentMask $mask - * Optional. The fields to return. If not set, returns all fields. - * If a document has a field that is not present in this mask, that field - * will not be returned in the response. - * @type string $transaction - * Perform the read as part of an already active transaction. - * @type \Google\Protobuf\Timestamp $read_time - * Perform the read at the provided time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * @type bool $show_missing - * If the list should show missing documents. - * A document is missing if it does not exist, but there are sub-documents - * nested underneath it. When true, such missing documents will be returned - * with a key but will not have fields, - * [`create_time`][google.firestore.v1.Document.create_time], or - * [`update_time`][google.firestore.v1.Document.update_time] set. - * Requests with `show_missing` may not specify `where` or `order_by`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Optional. The collection ID, relative to `parent`, to list. - * For example: `chatrooms` or `messages`. - * This is optional, and when not provided, Firestore will list documents - * from all collections under the provided `parent`. - * - * Generated from protobuf field string collection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getCollectionId() - { - return $this->collection_id; - } - - /** - * Optional. The collection ID, relative to `parent`, to list. - * For example: `chatrooms` or `messages`. - * This is optional, and when not provided, Firestore will list documents - * from all collections under the provided `parent`. - * - * Generated from protobuf field string collection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setCollectionId($var) - { - GPBUtil::checkString($var, True); - $this->collection_id = $var; - - return $this; - } - - /** - * Optional. The maximum number of documents to return in a single response. - * Firestore may return fewer than this value. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Optional. The maximum number of documents to return in a single response. - * Firestore may return fewer than this value. - * - * Generated from protobuf field int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Optional. A page token, received from a previous `ListDocuments` response. - * Provide this to retrieve the subsequent page. When paginating, all other - * parameters (with the exception of `page_size`) must match the values set - * in the request that generated the page token. - * - * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Optional. A page token, received from a previous `ListDocuments` response. - * Provide this to retrieve the subsequent page. When paginating, all other - * parameters (with the exception of `page_size`) must match the values set - * in the request that generated the page token. - * - * Generated from protobuf field string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * Optional. The optional ordering of the documents to return. - * For example: `priority desc, __name__ desc`. - * This mirrors the [`ORDER BY`][google.firestore.v1.StructuredQuery.order_by] - * used in Firestore queries but in a string representation. When absent, - * documents are ordered based on `__name__ ASC`. - * - * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * Optional. The optional ordering of the documents to return. - * For example: `priority desc, __name__ desc`. - * This mirrors the [`ORDER BY`][google.firestore.v1.StructuredQuery.order_by] - * used in Firestore queries but in a string representation. When absent, - * documents are ordered based on `__name__ ASC`. - * - * Generated from protobuf field string order_by = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOrderBy($var) - { - GPBUtil::checkString($var, True); - $this->order_by = $var; - - return $this; - } - - /** - * Optional. The fields to return. If not set, returns all fields. - * If a document has a field that is not present in this mask, that field - * will not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Firestore\V1\DocumentMask|null - */ - public function getMask() - { - return $this->mask; - } - - public function hasMask() - { - return isset($this->mask); - } - - public function clearMask() - { - unset($this->mask); - } - - /** - * Optional. The fields to return. If not set, returns all fields. - * If a document has a field that is not present in this mask, that field - * will not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Firestore\V1\DocumentMask $var - * @return $this - */ - public function setMask($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); - $this->mask = $var; - - return $this; - } - - /** - * Perform the read as part of an already active transaction. - * - * Generated from protobuf field bytes transaction = 8; - * @return string - */ - public function getTransaction() - { - return $this->readOneof(8); - } - - public function hasTransaction() - { - return $this->hasOneof(8); - } - - /** - * Perform the read as part of an already active transaction. - * - * Generated from protobuf field bytes transaction = 8; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Perform the read at the provided time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 10; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->readOneof(10); - } - - public function hasReadTime() - { - return $this->hasOneof(10); - } - - /** - * Perform the read at the provided time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 10; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * If the list should show missing documents. - * A document is missing if it does not exist, but there are sub-documents - * nested underneath it. When true, such missing documents will be returned - * with a key but will not have fields, - * [`create_time`][google.firestore.v1.Document.create_time], or - * [`update_time`][google.firestore.v1.Document.update_time] set. - * Requests with `show_missing` may not specify `where` or `order_by`. - * - * Generated from protobuf field bool show_missing = 12; - * @return bool - */ - public function getShowMissing() - { - return $this->show_missing; - } - - /** - * If the list should show missing documents. - * A document is missing if it does not exist, but there are sub-documents - * nested underneath it. When true, such missing documents will be returned - * with a key but will not have fields, - * [`create_time`][google.firestore.v1.Document.create_time], or - * [`update_time`][google.firestore.v1.Document.update_time] set. - * Requests with `show_missing` may not specify `where` or `order_by`. - * - * Generated from protobuf field bool show_missing = 12; - * @param bool $var - * @return $this - */ - public function setShowMissing($var) - { - GPBUtil::checkBool($var); - $this->show_missing = $var; - - return $this; - } - - /** - * @return string - */ - public function getConsistencySelector() - { - return $this->whichOneof("consistency_selector"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsResponse.php deleted file mode 100644 index 3608a134151d..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListDocumentsResponse.php +++ /dev/null @@ -1,106 +0,0 @@ -google.firestore.v1.ListDocumentsResponse - */ -class ListDocumentsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The Documents found. - * - * Generated from protobuf field repeated .google.firestore.v1.Document documents = 1; - */ - private $documents; - /** - * A token to retrieve the next page of documents. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Firestore\V1\Document>|\Google\Protobuf\Internal\RepeatedField $documents - * The Documents found. - * @type string $next_page_token - * A token to retrieve the next page of documents. - * If this field is omitted, there are no subsequent pages. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * The Documents found. - * - * Generated from protobuf field repeated .google.firestore.v1.Document documents = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDocuments() - { - return $this->documents; - } - - /** - * The Documents found. - * - * Generated from protobuf field repeated .google.firestore.v1.Document documents = 1; - * @param array<\Google\Cloud\Firestore\V1\Document>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDocuments($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Document::class); - $this->documents = $arr; - - return $this; - } - - /** - * A token to retrieve the next page of documents. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A token to retrieve the next page of documents. - * If this field is omitted, there are no subsequent pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenRequest.php deleted file mode 100644 index 8fb415f4ed4b..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenRequest.php +++ /dev/null @@ -1,180 +0,0 @@ -google.firestore.v1.ListenRequest - */ -class ListenRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $database = ''; - /** - * Labels associated with this target change. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - protected $target_change; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @type \Google\Cloud\Firestore\V1\Target $add_target - * A target to add to this stream. - * @type int $remove_target - * The ID of a target to remove from this stream. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels associated with this target change. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDatabase() - { - return $this->database; - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkString($var, True); - $this->database = $var; - - return $this; - } - - /** - * A target to add to this stream. - * - * Generated from protobuf field .google.firestore.v1.Target add_target = 2; - * @return \Google\Cloud\Firestore\V1\Target|null - */ - public function getAddTarget() - { - return $this->readOneof(2); - } - - public function hasAddTarget() - { - return $this->hasOneof(2); - } - - /** - * A target to add to this stream. - * - * Generated from protobuf field .google.firestore.v1.Target add_target = 2; - * @param \Google\Cloud\Firestore\V1\Target $var - * @return $this - */ - public function setAddTarget($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Target::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The ID of a target to remove from this stream. - * - * Generated from protobuf field int32 remove_target = 3; - * @return int - */ - public function getRemoveTarget() - { - return $this->readOneof(3); - } - - public function hasRemoveTarget() - { - return $this->hasOneof(3); - } - - /** - * The ID of a target to remove from this stream. - * - * Generated from protobuf field int32 remove_target = 3; - * @param int $var - * @return $this - */ - public function setRemoveTarget($var) - { - GPBUtil::checkInt32($var); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Labels associated with this target change. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels associated with this target change. - * - * Generated from protobuf field map labels = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * @return string - */ - public function getTargetChange() - { - return $this->whichOneof("target_change"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenResponse.php deleted file mode 100644 index 64234422f378..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ListenResponse.php +++ /dev/null @@ -1,219 +0,0 @@ -google.firestore.v1.ListenResponse - */ -class ListenResponse extends \Google\Protobuf\Internal\Message -{ - protected $response_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\TargetChange $target_change - * Targets have changed. - * @type \Google\Cloud\Firestore\V1\DocumentChange $document_change - * A [Document][google.firestore.v1.Document] has changed. - * @type \Google\Cloud\Firestore\V1\DocumentDelete $document_delete - * A [Document][google.firestore.v1.Document] has been deleted. - * @type \Google\Cloud\Firestore\V1\DocumentRemove $document_remove - * A [Document][google.firestore.v1.Document] has been removed from a target - * (because it is no longer relevant to that target). - * @type \Google\Cloud\Firestore\V1\ExistenceFilter $filter - * A filter to apply to the set of documents previously returned for the - * given target. - * Returned when documents may have been removed from the given target, but - * the exact documents are unknown. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Targets have changed. - * - * Generated from protobuf field .google.firestore.v1.TargetChange target_change = 2; - * @return \Google\Cloud\Firestore\V1\TargetChange|null - */ - public function getTargetChange() - { - return $this->readOneof(2); - } - - public function hasTargetChange() - { - return $this->hasOneof(2); - } - - /** - * Targets have changed. - * - * Generated from protobuf field .google.firestore.v1.TargetChange target_change = 2; - * @param \Google\Cloud\Firestore\V1\TargetChange $var - * @return $this - */ - public function setTargetChange($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TargetChange::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * A [Document][google.firestore.v1.Document] has changed. - * - * Generated from protobuf field .google.firestore.v1.DocumentChange document_change = 3; - * @return \Google\Cloud\Firestore\V1\DocumentChange|null - */ - public function getDocumentChange() - { - return $this->readOneof(3); - } - - public function hasDocumentChange() - { - return $this->hasOneof(3); - } - - /** - * A [Document][google.firestore.v1.Document] has changed. - * - * Generated from protobuf field .google.firestore.v1.DocumentChange document_change = 3; - * @param \Google\Cloud\Firestore\V1\DocumentChange $var - * @return $this - */ - public function setDocumentChange($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentChange::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * A [Document][google.firestore.v1.Document] has been deleted. - * - * Generated from protobuf field .google.firestore.v1.DocumentDelete document_delete = 4; - * @return \Google\Cloud\Firestore\V1\DocumentDelete|null - */ - public function getDocumentDelete() - { - return $this->readOneof(4); - } - - public function hasDocumentDelete() - { - return $this->hasOneof(4); - } - - /** - * A [Document][google.firestore.v1.Document] has been deleted. - * - * Generated from protobuf field .google.firestore.v1.DocumentDelete document_delete = 4; - * @param \Google\Cloud\Firestore\V1\DocumentDelete $var - * @return $this - */ - public function setDocumentDelete($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentDelete::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * A [Document][google.firestore.v1.Document] has been removed from a target - * (because it is no longer relevant to that target). - * - * Generated from protobuf field .google.firestore.v1.DocumentRemove document_remove = 6; - * @return \Google\Cloud\Firestore\V1\DocumentRemove|null - */ - public function getDocumentRemove() - { - return $this->readOneof(6); - } - - public function hasDocumentRemove() - { - return $this->hasOneof(6); - } - - /** - * A [Document][google.firestore.v1.Document] has been removed from a target - * (because it is no longer relevant to that target). - * - * Generated from protobuf field .google.firestore.v1.DocumentRemove document_remove = 6; - * @param \Google\Cloud\Firestore\V1\DocumentRemove $var - * @return $this - */ - public function setDocumentRemove($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentRemove::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * A filter to apply to the set of documents previously returned for the - * given target. - * Returned when documents may have been removed from the given target, but - * the exact documents are unknown. - * - * Generated from protobuf field .google.firestore.v1.ExistenceFilter filter = 5; - * @return \Google\Cloud\Firestore\V1\ExistenceFilter|null - */ - public function getFilter() - { - return $this->readOneof(5); - } - - public function hasFilter() - { - return $this->hasOneof(5); - } - - /** - * A filter to apply to the set of documents previously returned for the - * given target. - * Returned when documents may have been removed from the given target, but - * the exact documents are unknown. - * - * Generated from protobuf field .google.firestore.v1.ExistenceFilter filter = 5; - * @param \Google\Cloud\Firestore\V1\ExistenceFilter $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ExistenceFilter::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * @return string - */ - public function getResponseType() - { - return $this->whichOneof("response_type"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/MapValue.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/MapValue.php deleted file mode 100644 index fa811000207c..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/MapValue.php +++ /dev/null @@ -1,83 +0,0 @@ -google.firestore.v1.MapValue - */ -class MapValue extends \Google\Protobuf\Internal\Message -{ - /** - * The map's fields. - * The map keys represent field names. Field names matching the regular - * expression `__.*__` are reserved. Reserved field names are forbidden except - * in certain documented contexts. The map keys, represented as UTF-8, must - * not exceed 1,500 bytes and cannot be empty. - * - * Generated from protobuf field map fields = 1; - */ - private $fields; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $fields - * The map's fields. - * The map keys represent field names. Field names matching the regular - * expression `__.*__` are reserved. Reserved field names are forbidden except - * in certain documented contexts. The map keys, represented as UTF-8, must - * not exceed 1,500 bytes and cannot be empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * The map's fields. - * The map keys represent field names. Field names matching the regular - * expression `__.*__` are reserved. Reserved field names are forbidden except - * in certain documented contexts. The map keys, represented as UTF-8, must - * not exceed 1,500 bytes and cannot be empty. - * - * Generated from protobuf field map fields = 1; - * @return \Google\Protobuf\Internal\MapField - */ - public function getFields() - { - return $this->fields; - } - - /** - * The map's fields. - * The map keys represent field names. Field names matching the regular - * expression `__.*__` are reserved. Reserved field names are forbidden except - * in certain documented contexts. The map keys, represented as UTF-8, must - * not exceed 1,500 bytes and cannot be empty. - * - * Generated from protobuf field map fields = 1; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setFields($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class); - $this->fields = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryRequest.php deleted file mode 100644 index 9b09a390000e..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryRequest.php +++ /dev/null @@ -1,364 +0,0 @@ -google.firestore.v1.PartitionQueryRequest - */ -class PartitionQueryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents`. - * Document resource names are not supported; only database resource names - * can be specified. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - /** - * The desired maximum number of partition points. - * The partitions may be returned across multiple pages of results. - * The number must be positive. The actual number of partitions - * returned may be fewer. - * For example, this may be set to one fewer than the number of parallel - * queries to be run, or in running a data pipeline job, one fewer than the - * number of workers or compute instances available. - * - * Generated from protobuf field int64 partition_count = 3; - */ - protected $partition_count = 0; - /** - * The `next_page_token` value returned from a previous call to - * PartitionQuery that may be used to get an additional set of results. - * There are no ordering guarantees between sets of results. Thus, using - * multiple sets of results will require merging the different result sets. - * For example, two subsequent calls using a page_token may return: - * * cursor B, cursor M, cursor Q - * * cursor A, cursor U, cursor W - * To obtain a complete result set ordered with respect to the results of the - * query supplied to PartitionQuery, the results sets should be merged: - * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W - * - * Generated from protobuf field string page_token = 4; - */ - protected $page_token = ''; - /** - * The maximum number of partitions to return in this call, subject to - * `partition_count`. - * For example, if `partition_count` = 10 and `page_size` = 8, the first call - * to PartitionQuery will return up to 8 partitions and a `next_page_token` - * if more results exist. A second call to PartitionQuery will return up to - * 2 partitions, to complete the total of 10 specified in `partition_count`. - * - * Generated from protobuf field int32 page_size = 5; - */ - protected $page_size = 0; - protected $query_type; - protected $consistency_selector; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents`. - * Document resource names are not supported; only database resource names - * can be specified. - * @type \Google\Cloud\Firestore\V1\StructuredQuery $structured_query - * A structured query. - * Query must specify collection with all descendants and be ordered by name - * ascending. Other filters, order bys, limits, offsets, and start/end - * cursors are not supported. - * @type int|string $partition_count - * The desired maximum number of partition points. - * The partitions may be returned across multiple pages of results. - * The number must be positive. The actual number of partitions - * returned may be fewer. - * For example, this may be set to one fewer than the number of parallel - * queries to be run, or in running a data pipeline job, one fewer than the - * number of workers or compute instances available. - * @type string $page_token - * The `next_page_token` value returned from a previous call to - * PartitionQuery that may be used to get an additional set of results. - * There are no ordering guarantees between sets of results. Thus, using - * multiple sets of results will require merging the different result sets. - * For example, two subsequent calls using a page_token may return: - * * cursor B, cursor M, cursor Q - * * cursor A, cursor U, cursor W - * To obtain a complete result set ordered with respect to the results of the - * query supplied to PartitionQuery, the results sets should be merged: - * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W - * @type int $page_size - * The maximum number of partitions to return in this call, subject to - * `partition_count`. - * For example, if `partition_count` = 10 and `page_size` = 8, the first call - * to PartitionQuery will return up to 8 partitions and a `next_page_token` - * if more results exist. A second call to PartitionQuery will return up to - * 2 partitions, to complete the total of 10 specified in `partition_count`. - * @type \Google\Protobuf\Timestamp $read_time - * Reads documents as they were at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents`. - * Document resource names are not supported; only database resource names - * can be specified. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents`. - * Document resource names are not supported; only database resource names - * can be specified. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * A structured query. - * Query must specify collection with all descendants and be ordered by name - * ascending. Other filters, order bys, limits, offsets, and start/end - * cursors are not supported. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 2; - * @return \Google\Cloud\Firestore\V1\StructuredQuery|null - */ - public function getStructuredQuery() - { - return $this->readOneof(2); - } - - public function hasStructuredQuery() - { - return $this->hasOneof(2); - } - - /** - * A structured query. - * Query must specify collection with all descendants and be ordered by name - * ascending. Other filters, order bys, limits, offsets, and start/end - * cursors are not supported. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 2; - * @param \Google\Cloud\Firestore\V1\StructuredQuery $var - * @return $this - */ - public function setStructuredQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The desired maximum number of partition points. - * The partitions may be returned across multiple pages of results. - * The number must be positive. The actual number of partitions - * returned may be fewer. - * For example, this may be set to one fewer than the number of parallel - * queries to be run, or in running a data pipeline job, one fewer than the - * number of workers or compute instances available. - * - * Generated from protobuf field int64 partition_count = 3; - * @return int|string - */ - public function getPartitionCount() - { - return $this->partition_count; - } - - /** - * The desired maximum number of partition points. - * The partitions may be returned across multiple pages of results. - * The number must be positive. The actual number of partitions - * returned may be fewer. - * For example, this may be set to one fewer than the number of parallel - * queries to be run, or in running a data pipeline job, one fewer than the - * number of workers or compute instances available. - * - * Generated from protobuf field int64 partition_count = 3; - * @param int|string $var - * @return $this - */ - public function setPartitionCount($var) - { - GPBUtil::checkInt64($var); - $this->partition_count = $var; - - return $this; - } - - /** - * The `next_page_token` value returned from a previous call to - * PartitionQuery that may be used to get an additional set of results. - * There are no ordering guarantees between sets of results. Thus, using - * multiple sets of results will require merging the different result sets. - * For example, two subsequent calls using a page_token may return: - * * cursor B, cursor M, cursor Q - * * cursor A, cursor U, cursor W - * To obtain a complete result set ordered with respect to the results of the - * query supplied to PartitionQuery, the results sets should be merged: - * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W - * - * Generated from protobuf field string page_token = 4; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The `next_page_token` value returned from a previous call to - * PartitionQuery that may be used to get an additional set of results. - * There are no ordering guarantees between sets of results. Thus, using - * multiple sets of results will require merging the different result sets. - * For example, two subsequent calls using a page_token may return: - * * cursor B, cursor M, cursor Q - * * cursor A, cursor U, cursor W - * To obtain a complete result set ordered with respect to the results of the - * query supplied to PartitionQuery, the results sets should be merged: - * cursor A, cursor B, cursor M, cursor Q, cursor U, cursor W - * - * Generated from protobuf field string page_token = 4; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The maximum number of partitions to return in this call, subject to - * `partition_count`. - * For example, if `partition_count` = 10 and `page_size` = 8, the first call - * to PartitionQuery will return up to 8 partitions and a `next_page_token` - * if more results exist. A second call to PartitionQuery will return up to - * 2 partitions, to complete the total of 10 specified in `partition_count`. - * - * Generated from protobuf field int32 page_size = 5; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of partitions to return in this call, subject to - * `partition_count`. - * For example, if `partition_count` = 10 and `page_size` = 8, the first call - * to PartitionQuery will return up to 8 partitions and a `next_page_token` - * if more results exist. A second call to PartitionQuery will return up to - * 2 partitions, to complete the total of 10 specified in `partition_count`. - * - * Generated from protobuf field int32 page_size = 5; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * Reads documents as they were at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->readOneof(6); - } - - public function hasReadTime() - { - return $this->hasOneof(6); - } - - /** - * Reads documents as they were at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * @return string - */ - public function getQueryType() - { - return $this->whichOneof("query_type"); - } - - /** - * @return string - */ - public function getConsistencySelector() - { - return $this->whichOneof("consistency_selector"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryResponse.php deleted file mode 100644 index d6281a637903..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PartitionQueryResponse.php +++ /dev/null @@ -1,162 +0,0 @@ -google.firestore.v1.PartitionQueryResponse - */ -class PartitionQueryResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Partition results. - * Each partition is a split point that can be used by RunQuery as a starting - * or end point for the query results. The RunQuery requests must be made with - * the same query supplied to this PartitionQuery request. The partition - * cursors will be ordered according to same ordering as the results of the - * query supplied to PartitionQuery. - * For example, if a PartitionQuery request returns partition cursors A and B, - * running the following three queries will return the entire result set of - * the original query: - * * query, end_at A - * * query, start_at A, end_at B - * * query, start_at B - * An empty result may indicate that the query has too few results to be - * partitioned, or that the query is not yet supported for partitioning. - * - * Generated from protobuf field repeated .google.firestore.v1.Cursor partitions = 1; - */ - private $partitions; - /** - * A page token that may be used to request an additional set of results, up - * to the number specified by `partition_count` in the PartitionQuery request. - * If blank, there are no more results. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Firestore\V1\Cursor>|\Google\Protobuf\Internal\RepeatedField $partitions - * Partition results. - * Each partition is a split point that can be used by RunQuery as a starting - * or end point for the query results. The RunQuery requests must be made with - * the same query supplied to this PartitionQuery request. The partition - * cursors will be ordered according to same ordering as the results of the - * query supplied to PartitionQuery. - * For example, if a PartitionQuery request returns partition cursors A and B, - * running the following three queries will return the entire result set of - * the original query: - * * query, end_at A - * * query, start_at A, end_at B - * * query, start_at B - * An empty result may indicate that the query has too few results to be - * partitioned, or that the query is not yet supported for partitioning. - * @type string $next_page_token - * A page token that may be used to request an additional set of results, up - * to the number specified by `partition_count` in the PartitionQuery request. - * If blank, there are no more results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Partition results. - * Each partition is a split point that can be used by RunQuery as a starting - * or end point for the query results. The RunQuery requests must be made with - * the same query supplied to this PartitionQuery request. The partition - * cursors will be ordered according to same ordering as the results of the - * query supplied to PartitionQuery. - * For example, if a PartitionQuery request returns partition cursors A and B, - * running the following three queries will return the entire result set of - * the original query: - * * query, end_at A - * * query, start_at A, end_at B - * * query, start_at B - * An empty result may indicate that the query has too few results to be - * partitioned, or that the query is not yet supported for partitioning. - * - * Generated from protobuf field repeated .google.firestore.v1.Cursor partitions = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPartitions() - { - return $this->partitions; - } - - /** - * Partition results. - * Each partition is a split point that can be used by RunQuery as a starting - * or end point for the query results. The RunQuery requests must be made with - * the same query supplied to this PartitionQuery request. The partition - * cursors will be ordered according to same ordering as the results of the - * query supplied to PartitionQuery. - * For example, if a PartitionQuery request returns partition cursors A and B, - * running the following three queries will return the entire result set of - * the original query: - * * query, end_at A - * * query, start_at A, end_at B - * * query, start_at B - * An empty result may indicate that the query has too few results to be - * partitioned, or that the query is not yet supported for partitioning. - * - * Generated from protobuf field repeated .google.firestore.v1.Cursor partitions = 1; - * @param array<\Google\Cloud\Firestore\V1\Cursor>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPartitions($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Cursor::class); - $this->partitions = $arr; - - return $this; - } - - /** - * A page token that may be used to request an additional set of results, up - * to the number specified by `partition_count` in the PartitionQuery request. - * If blank, there are no more results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A page token that may be used to request an additional set of results, up - * to the number specified by `partition_count` in the PartitionQuery request. - * If blank, there are no more results. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Precondition.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Precondition.php deleted file mode 100644 index 7f7b92595750..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Precondition.php +++ /dev/null @@ -1,114 +0,0 @@ -google.firestore.v1.Precondition - */ -class Precondition extends \Google\Protobuf\Internal\Message -{ - protected $condition_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $exists - * When set to `true`, the target document must exist. - * When set to `false`, the target document must not exist. - * @type \Google\Protobuf\Timestamp $update_time - * When set, the target document must exist and have been last updated at - * that time. Timestamp must be microsecond aligned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Common::initOnce(); - parent::__construct($data); - } - - /** - * When set to `true`, the target document must exist. - * When set to `false`, the target document must not exist. - * - * Generated from protobuf field bool exists = 1; - * @return bool - */ - public function getExists() - { - return $this->readOneof(1); - } - - public function hasExists() - { - return $this->hasOneof(1); - } - - /** - * When set to `true`, the target document must exist. - * When set to `false`, the target document must not exist. - * - * Generated from protobuf field bool exists = 1; - * @param bool $var - * @return $this - */ - public function setExists($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * When set, the target document must exist and have been last updated at - * that time. Timestamp must be microsecond aligned. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->readOneof(2); - } - - public function hasUpdateTime() - { - return $this->hasOneof(2); - } - - /** - * When set, the target document must exist and have been last updated at - * that time. Timestamp must be microsecond aligned. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getConditionType() - { - return $this->whichOneof("condition_type"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RollbackRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RollbackRequest.php deleted file mode 100644 index 8a1dca5d7d53..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RollbackRequest.php +++ /dev/null @@ -1,121 +0,0 @@ -google.firestore.v1.RollbackRequest - */ -class RollbackRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $database = ''; - /** - * Required. The transaction to roll back. - * - * Generated from protobuf field bytes transaction = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $transaction = ''; - - /** - * @param string $database Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param string $transaction Required. The transaction to roll back. - * - * @return \Google\Cloud\Firestore\V1\RollbackRequest - * - * @experimental - */ - public static function build(string $database, string $transaction): self - { - return (new self()) - ->setDatabase($database) - ->setTransaction($transaction); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @type string $transaction - * Required. The transaction to roll back. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDatabase() - { - return $this->database; - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkString($var, True); - $this->database = $var; - - return $this; - } - - /** - * Required. The transaction to roll back. - * - * Generated from protobuf field bytes transaction = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTransaction() - { - return $this->transaction; - } - - /** - * Required. The transaction to roll back. - * - * Generated from protobuf field bytes transaction = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->transaction = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryRequest.php deleted file mode 100644 index 3111353cce86..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryRequest.php +++ /dev/null @@ -1,256 +0,0 @@ -google.firestore.v1.RunAggregationQueryRequest - */ -class RunAggregationQueryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - protected $query_type; - protected $consistency_selector; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @type \Google\Cloud\Firestore\V1\StructuredAggregationQuery $structured_aggregation_query - * An aggregation query. - * @type string $transaction - * Run the aggregation within an already active transaction. - * The value here is the opaque transaction ID to execute the query in. - * @type \Google\Cloud\Firestore\V1\TransactionOptions $new_transaction - * Starts a new transaction as part of the query, defaulting to read-only. - * The new transaction ID will be returned as the first response in the - * stream. - * @type \Google\Protobuf\Timestamp $read_time - * Executes the query at the given timestamp. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * An aggregation query. - * - * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery structured_aggregation_query = 2; - * @return \Google\Cloud\Firestore\V1\StructuredAggregationQuery|null - */ - public function getStructuredAggregationQuery() - { - return $this->readOneof(2); - } - - public function hasStructuredAggregationQuery() - { - return $this->hasOneof(2); - } - - /** - * An aggregation query. - * - * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery structured_aggregation_query = 2; - * @param \Google\Cloud\Firestore\V1\StructuredAggregationQuery $var - * @return $this - */ - public function setStructuredAggregationQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredAggregationQuery::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Run the aggregation within an already active transaction. - * The value here is the opaque transaction ID to execute the query in. - * - * Generated from protobuf field bytes transaction = 4; - * @return string - */ - public function getTransaction() - { - return $this->readOneof(4); - } - - public function hasTransaction() - { - return $this->hasOneof(4); - } - - /** - * Run the aggregation within an already active transaction. - * The value here is the opaque transaction ID to execute the query in. - * - * Generated from protobuf field bytes transaction = 4; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Starts a new transaction as part of the query, defaulting to read-only. - * The new transaction ID will be returned as the first response in the - * stream. - * - * Generated from protobuf field .google.firestore.v1.TransactionOptions new_transaction = 5; - * @return \Google\Cloud\Firestore\V1\TransactionOptions|null - */ - public function getNewTransaction() - { - return $this->readOneof(5); - } - - public function hasNewTransaction() - { - return $this->hasOneof(5); - } - - /** - * Starts a new transaction as part of the query, defaulting to read-only. - * The new transaction ID will be returned as the first response in the - * stream. - * - * Generated from protobuf field .google.firestore.v1.TransactionOptions new_transaction = 5; - * @param \Google\Cloud\Firestore\V1\TransactionOptions $var - * @return $this - */ - public function setNewTransaction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TransactionOptions::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Executes the query at the given timestamp. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->readOneof(6); - } - - public function hasReadTime() - { - return $this->hasOneof(6); - } - - /** - * Executes the query at the given timestamp. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * @return string - */ - public function getQueryType() - { - return $this->whichOneof("query_type"); - } - - /** - * @return string - */ - public function getConsistencySelector() - { - return $this->whichOneof("consistency_selector"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryResponse.php deleted file mode 100644 index 4e61e23a404d..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryResponse.php +++ /dev/null @@ -1,192 +0,0 @@ -google.firestore.v1.RunAggregationQueryResponse - */ -class RunAggregationQueryResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A single aggregation result. - * Not present when reporting partial progress. - * - * Generated from protobuf field .google.firestore.v1.AggregationResult result = 1; - */ - protected $result = null; - /** - * The transaction that was started as part of this request. - * Only present on the first response when the request requested to start - * a new transaction. - * - * Generated from protobuf field bytes transaction = 2; - */ - protected $transaction = ''; - /** - * The time at which the aggregate result was computed. This is always - * monotonically increasing; in this case, the previous AggregationResult in - * the result stream are guaranteed not to have changed between their - * `read_time` and this one. - * If the query returns no results, a response with `read_time` and no - * `result` will be sent, and this represents the time at which the query - * was run. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; - */ - protected $read_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\AggregationResult $result - * A single aggregation result. - * Not present when reporting partial progress. - * @type string $transaction - * The transaction that was started as part of this request. - * Only present on the first response when the request requested to start - * a new transaction. - * @type \Google\Protobuf\Timestamp $read_time - * The time at which the aggregate result was computed. This is always - * monotonically increasing; in this case, the previous AggregationResult in - * the result stream are guaranteed not to have changed between their - * `read_time` and this one. - * If the query returns no results, a response with `read_time` and no - * `result` will be sent, and this represents the time at which the query - * was run. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * A single aggregation result. - * Not present when reporting partial progress. - * - * Generated from protobuf field .google.firestore.v1.AggregationResult result = 1; - * @return \Google\Cloud\Firestore\V1\AggregationResult|null - */ - public function getResult() - { - return $this->result; - } - - public function hasResult() - { - return isset($this->result); - } - - public function clearResult() - { - unset($this->result); - } - - /** - * A single aggregation result. - * Not present when reporting partial progress. - * - * Generated from protobuf field .google.firestore.v1.AggregationResult result = 1; - * @param \Google\Cloud\Firestore\V1\AggregationResult $var - * @return $this - */ - public function setResult($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\AggregationResult::class); - $this->result = $var; - - return $this; - } - - /** - * The transaction that was started as part of this request. - * Only present on the first response when the request requested to start - * a new transaction. - * - * Generated from protobuf field bytes transaction = 2; - * @return string - */ - public function getTransaction() - { - return $this->transaction; - } - - /** - * The transaction that was started as part of this request. - * Only present on the first response when the request requested to start - * a new transaction. - * - * Generated from protobuf field bytes transaction = 2; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->transaction = $var; - - return $this; - } - - /** - * The time at which the aggregate result was computed. This is always - * monotonically increasing; in this case, the previous AggregationResult in - * the result stream are guaranteed not to have changed between their - * `read_time` and this one. - * If the query returns no results, a response with `read_time` and no - * `result` will be sent, and this represents the time at which the query - * was run. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->read_time; - } - - public function hasReadTime() - { - return isset($this->read_time); - } - - public function clearReadTime() - { - unset($this->read_time); - } - - /** - * The time at which the aggregate result was computed. This is always - * monotonically increasing; in this case, the previous AggregationResult in - * the result stream are guaranteed not to have changed between their - * `read_time` and this one. - * If the query returns no results, a response with `read_time` and no - * `result` will be sent, and this represents the time at which the query - * was run. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->read_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryRequest.php deleted file mode 100644 index 554db6f12df2..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryRequest.php +++ /dev/null @@ -1,258 +0,0 @@ -google.firestore.v1.RunQueryRequest - */ -class RunQueryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $parent = ''; - protected $query_type; - protected $consistency_selector; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @type \Google\Cloud\Firestore\V1\StructuredQuery $structured_query - * A structured query. - * @type string $transaction - * Run the query within an already active transaction. - * The value here is the opaque transaction ID to execute the query in. - * @type \Google\Cloud\Firestore\V1\TransactionOptions $new_transaction - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - * @type \Google\Protobuf\Timestamp $read_time - * Reads documents as they were at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * A structured query. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 2; - * @return \Google\Cloud\Firestore\V1\StructuredQuery|null - */ - public function getStructuredQuery() - { - return $this->readOneof(2); - } - - public function hasStructuredQuery() - { - return $this->hasOneof(2); - } - - /** - * A structured query. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 2; - * @param \Google\Cloud\Firestore\V1\StructuredQuery $var - * @return $this - */ - public function setStructuredQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Run the query within an already active transaction. - * The value here is the opaque transaction ID to execute the query in. - * - * Generated from protobuf field bytes transaction = 5; - * @return string - */ - public function getTransaction() - { - return $this->readOneof(5); - } - - public function hasTransaction() - { - return $this->hasOneof(5); - } - - /** - * Run the query within an already active transaction. - * The value here is the opaque transaction ID to execute the query in. - * - * Generated from protobuf field bytes transaction = 5; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - * - * Generated from protobuf field .google.firestore.v1.TransactionOptions new_transaction = 6; - * @return \Google\Cloud\Firestore\V1\TransactionOptions|null - */ - public function getNewTransaction() - { - return $this->readOneof(6); - } - - public function hasNewTransaction() - { - return $this->hasOneof(6); - } - - /** - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - * - * Generated from protobuf field .google.firestore.v1.TransactionOptions new_transaction = 6; - * @param \Google\Cloud\Firestore\V1\TransactionOptions $var - * @return $this - */ - public function setNewTransaction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TransactionOptions::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Reads documents as they were at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->readOneof(7); - } - - public function hasReadTime() - { - return $this->hasOneof(7); - } - - /** - * Reads documents as they were at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * @return string - */ - public function getQueryType() - { - return $this->whichOneof("query_type"); - } - - /** - * @return string - */ - public function getConsistencySelector() - { - return $this->whichOneof("consistency_selector"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryResponse.php deleted file mode 100644 index ef6bbca5c468..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryResponse.php +++ /dev/null @@ -1,275 +0,0 @@ -google.firestore.v1.RunQueryResponse - */ -class RunQueryResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The transaction that was started as part of this request. - * Can only be set in the first response, and only if - * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] - * was set in the request. If set, no other fields will be set in this - * response. - * - * Generated from protobuf field bytes transaction = 2; - */ - protected $transaction = ''; - /** - * A query result, not set when reporting partial progress. - * - * Generated from protobuf field .google.firestore.v1.Document document = 1; - */ - protected $document = null; - /** - * The time at which the document was read. This may be monotonically - * increasing; in this case, the previous documents in the result stream are - * guaranteed not to have changed between their `read_time` and this one. - * If the query returns no results, a response with `read_time` and no - * `document` will be sent, and this represents the time at which the query - * was run. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; - */ - protected $read_time = null; - /** - * The number of results that have been skipped due to an offset between - * the last response and the current response. - * - * Generated from protobuf field int32 skipped_results = 4; - */ - protected $skipped_results = 0; - protected $continuation_selector; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $transaction - * The transaction that was started as part of this request. - * Can only be set in the first response, and only if - * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] - * was set in the request. If set, no other fields will be set in this - * response. - * @type \Google\Cloud\Firestore\V1\Document $document - * A query result, not set when reporting partial progress. - * @type \Google\Protobuf\Timestamp $read_time - * The time at which the document was read. This may be monotonically - * increasing; in this case, the previous documents in the result stream are - * guaranteed not to have changed between their `read_time` and this one. - * If the query returns no results, a response with `read_time` and no - * `document` will be sent, and this represents the time at which the query - * was run. - * @type int $skipped_results - * The number of results that have been skipped due to an offset between - * the last response and the current response. - * @type bool $done - * If present, Firestore has completely finished the request and no more - * documents will be returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * The transaction that was started as part of this request. - * Can only be set in the first response, and only if - * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] - * was set in the request. If set, no other fields will be set in this - * response. - * - * Generated from protobuf field bytes transaction = 2; - * @return string - */ - public function getTransaction() - { - return $this->transaction; - } - - /** - * The transaction that was started as part of this request. - * Can only be set in the first response, and only if - * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] - * was set in the request. If set, no other fields will be set in this - * response. - * - * Generated from protobuf field bytes transaction = 2; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->transaction = $var; - - return $this; - } - - /** - * A query result, not set when reporting partial progress. - * - * Generated from protobuf field .google.firestore.v1.Document document = 1; - * @return \Google\Cloud\Firestore\V1\Document|null - */ - public function getDocument() - { - return $this->document; - } - - public function hasDocument() - { - return isset($this->document); - } - - public function clearDocument() - { - unset($this->document); - } - - /** - * A query result, not set when reporting partial progress. - * - * Generated from protobuf field .google.firestore.v1.Document document = 1; - * @param \Google\Cloud\Firestore\V1\Document $var - * @return $this - */ - public function setDocument($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Document::class); - $this->document = $var; - - return $this; - } - - /** - * The time at which the document was read. This may be monotonically - * increasing; in this case, the previous documents in the result stream are - * guaranteed not to have changed between their `read_time` and this one. - * If the query returns no results, a response with `read_time` and no - * `document` will be sent, and this represents the time at which the query - * was run. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->read_time; - } - - public function hasReadTime() - { - return isset($this->read_time); - } - - public function clearReadTime() - { - unset($this->read_time); - } - - /** - * The time at which the document was read. This may be monotonically - * increasing; in this case, the previous documents in the result stream are - * guaranteed not to have changed between their `read_time` and this one. - * If the query returns no results, a response with `read_time` and no - * `document` will be sent, and this represents the time at which the query - * was run. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->read_time = $var; - - return $this; - } - - /** - * The number of results that have been skipped due to an offset between - * the last response and the current response. - * - * Generated from protobuf field int32 skipped_results = 4; - * @return int - */ - public function getSkippedResults() - { - return $this->skipped_results; - } - - /** - * The number of results that have been skipped due to an offset between - * the last response and the current response. - * - * Generated from protobuf field int32 skipped_results = 4; - * @param int $var - * @return $this - */ - public function setSkippedResults($var) - { - GPBUtil::checkInt32($var); - $this->skipped_results = $var; - - return $this; - } - - /** - * If present, Firestore has completely finished the request and no more - * documents will be returned. - * - * Generated from protobuf field bool done = 6; - * @return bool - */ - public function getDone() - { - return $this->readOneof(6); - } - - public function hasDone() - { - return $this->hasOneof(6); - } - - /** - * If present, Firestore has completely finished the request and no more - * documents will be returned. - * - * Generated from protobuf field bool done = 6; - * @param bool $var - * @return $this - */ - public function setDone($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * @return string - */ - public function getContinuationSelector() - { - return $this->whichOneof("continuation_selector"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery.php deleted file mode 100644 index 513a7aeb0f84..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery.php +++ /dev/null @@ -1,122 +0,0 @@ -google.firestore.v1.StructuredAggregationQuery - */ -class StructuredAggregationQuery extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Series of aggregations to apply over the results of the - * `structured_query`. - * Requires: - * * A minimum of one and maximum of five aggregations per query. - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredAggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $aggregations; - protected $query_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\StructuredQuery $structured_query - * Nested structured query. - * @type array<\Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation>|\Google\Protobuf\Internal\RepeatedField $aggregations - * Optional. Series of aggregations to apply over the results of the - * `structured_query`. - * Requires: - * * A minimum of one and maximum of five aggregations per query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * Nested structured query. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 1; - * @return \Google\Cloud\Firestore\V1\StructuredQuery|null - */ - public function getStructuredQuery() - { - return $this->readOneof(1); - } - - public function hasStructuredQuery() - { - return $this->hasOneof(1); - } - - /** - * Nested structured query. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 1; - * @param \Google\Cloud\Firestore\V1\StructuredQuery $var - * @return $this - */ - public function setStructuredQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Optional. Series of aggregations to apply over the results of the - * `structured_query`. - * Requires: - * * A minimum of one and maximum of five aggregations per query. - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredAggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAggregations() - { - return $this->aggregations; - } - - /** - * Optional. Series of aggregations to apply over the results of the - * `structured_query`. - * Requires: - * * A minimum of one and maximum of five aggregations per query. - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredAggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAggregations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation::class); - $this->aggregations = $arr; - - return $this; - } - - /** - * @return string - */ - public function getQueryType() - { - return $this->whichOneof("query_type"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation.php deleted file mode 100644 index 2e21334696cb..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation.php +++ /dev/null @@ -1,290 +0,0 @@ -google.firestore.v1.StructuredAggregationQuery.Aggregation - */ -class Aggregation extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Optional name of the field to store the result of the - * aggregation into. - * If not provided, Firestore will pick a default name following the format - * `field_`. For example: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2), - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) - * OVER ( - * ... - * ); - * ``` - * becomes: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2) AS field_1, - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) AS field_2 - * OVER ( - * ... - * ); - * ``` - * Requires: - * * Must be unique across all aggregation aliases. - * * Conform to [document field name][google.firestore.v1.Document.fields] - * limitations. - * - * Generated from protobuf field string alias = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $alias = ''; - protected $operator; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Count $count - * Count aggregator. - * @type \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Sum $sum - * Sum aggregator. - * @type \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Avg $avg - * Average aggregator. - * @type string $alias - * Optional. Optional name of the field to store the result of the - * aggregation into. - * If not provided, Firestore will pick a default name following the format - * `field_`. For example: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2), - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) - * OVER ( - * ... - * ); - * ``` - * becomes: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2) AS field_1, - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) AS field_2 - * OVER ( - * ... - * ); - * ``` - * Requires: - * * Must be unique across all aggregation aliases. - * * Conform to [document field name][google.firestore.v1.Document.fields] - * limitations. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * Count aggregator. - * - * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery.Aggregation.Count count = 1; - * @return \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Count|null - */ - public function getCount() - { - return $this->readOneof(1); - } - - public function hasCount() - { - return $this->hasOneof(1); - } - - /** - * Count aggregator. - * - * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery.Aggregation.Count count = 1; - * @param \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Count $var - * @return $this - */ - public function setCount($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Count::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Sum aggregator. - * - * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum sum = 2; - * @return \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Sum|null - */ - public function getSum() - { - return $this->readOneof(2); - } - - public function hasSum() - { - return $this->hasOneof(2); - } - - /** - * Sum aggregator. - * - * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum sum = 2; - * @param \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Sum $var - * @return $this - */ - public function setSum($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Sum::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Average aggregator. - * - * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg avg = 3; - * @return \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Avg|null - */ - public function getAvg() - { - return $this->readOneof(3); - } - - public function hasAvg() - { - return $this->hasOneof(3); - } - - /** - * Average aggregator. - * - * Generated from protobuf field .google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg avg = 3; - * @param \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Avg $var - * @return $this - */ - public function setAvg($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredAggregationQuery\Aggregation\Avg::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Optional. Optional name of the field to store the result of the - * aggregation into. - * If not provided, Firestore will pick a default name following the format - * `field_`. For example: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2), - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) - * OVER ( - * ... - * ); - * ``` - * becomes: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2) AS field_1, - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) AS field_2 - * OVER ( - * ... - * ); - * ``` - * Requires: - * * Must be unique across all aggregation aliases. - * * Conform to [document field name][google.firestore.v1.Document.fields] - * limitations. - * - * Generated from protobuf field string alias = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAlias() - { - return $this->alias; - } - - /** - * Optional. Optional name of the field to store the result of the - * aggregation into. - * If not provided, Firestore will pick a default name following the format - * `field_`. For example: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2), - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) - * OVER ( - * ... - * ); - * ``` - * becomes: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2) AS field_1, - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) AS field_2 - * OVER ( - * ... - * ); - * ``` - * Requires: - * * Must be unique across all aggregation aliases. - * * Conform to [document field name][google.firestore.v1.Document.fields] - * limitations. - * - * Generated from protobuf field string alias = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAlias($var) - { - GPBUtil::checkString($var, True); - $this->alias = $var; - - return $this; - } - - /** - * @return string - */ - public function getOperator() - { - return $this->whichOneof("operator"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Aggregation::class, \Google\Cloud\Firestore\V1\StructuredAggregationQuery_Aggregation::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Avg.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Avg.php deleted file mode 100644 index 4af9d9ee411c..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Avg.php +++ /dev/null @@ -1,86 +0,0 @@ -google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg - */ -class Avg extends \Google\Protobuf\Internal\Message -{ - /** - * The field to aggregate on. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; - */ - protected $field = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $field - * The field to aggregate on. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The field to aggregate on. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; - * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference|null - */ - public function getField() - { - return $this->field; - } - - public function hasField() - { - return isset($this->field); - } - - public function clearField() - { - unset($this->field); - } - - /** - * The field to aggregate on. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; - * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $var - * @return $this - */ - public function setField($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); - $this->field = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Avg::class, \Google\Cloud\Firestore\V1\StructuredAggregationQuery_Aggregation_Avg::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Count.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Count.php deleted file mode 100644 index 0bfb56baf641..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Count.php +++ /dev/null @@ -1,169 +0,0 @@ -google.firestore.v1.StructuredAggregationQuery.Aggregation.Count - */ -class Count extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Optional constraint on the maximum number of documents to - * count. - * This provides a way to set an upper bound on the number of documents - * to scan, limiting latency, and cost. - * Unspecified is interpreted as no bound. - * High-Level Example: - * ``` - * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - * ``` - * Requires: - * * Must be greater than zero when present. - * - * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $up_to = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Int64Value $up_to - * Optional. Optional constraint on the maximum number of documents to - * count. - * This provides a way to set an upper bound on the number of documents - * to scan, limiting latency, and cost. - * Unspecified is interpreted as no bound. - * High-Level Example: - * ``` - * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - * ``` - * Requires: - * * Must be greater than zero when present. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Optional constraint on the maximum number of documents to - * count. - * This provides a way to set an upper bound on the number of documents - * to scan, limiting latency, and cost. - * Unspecified is interpreted as no bound. - * High-Level Example: - * ``` - * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - * ``` - * Requires: - * * Must be greater than zero when present. - * - * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getUpTo() - { - return $this->up_to; - } - - public function hasUpTo() - { - return isset($this->up_to); - } - - public function clearUpTo() - { - unset($this->up_to); - } - - /** - * Returns the unboxed value from getUpTo() - - * Optional. Optional constraint on the maximum number of documents to - * count. - * This provides a way to set an upper bound on the number of documents - * to scan, limiting latency, and cost. - * Unspecified is interpreted as no bound. - * High-Level Example: - * ``` - * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - * ``` - * Requires: - * * Must be greater than zero when present. - * - * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getUpToUnwrapped() - { - return $this->readWrapperValue("up_to"); - } - - /** - * Optional. Optional constraint on the maximum number of documents to - * count. - * This provides a way to set an upper bound on the number of documents - * to scan, limiting latency, and cost. - * Unspecified is interpreted as no bound. - * High-Level Example: - * ``` - * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - * ``` - * Requires: - * * Must be greater than zero when present. - * - * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setUpTo($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->up_to = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. Optional constraint on the maximum number of documents to - * count. - * This provides a way to set an upper bound on the number of documents - * to scan, limiting latency, and cost. - * Unspecified is interpreted as no bound. - * High-Level Example: - * ``` - * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - * ``` - * Requires: - * * Must be greater than zero when present. - * - * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setUpToUnwrapped($var) - { - $this->writeWrapperValue("up_to", $var); - return $this;} - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Count::class, \Google\Cloud\Firestore\V1\StructuredAggregationQuery_Aggregation_Count::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Sum.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Sum.php deleted file mode 100644 index 215315c68ef8..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredAggregationQuery/Aggregation/Sum.php +++ /dev/null @@ -1,95 +0,0 @@ -google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum - */ -class Sum extends \Google\Protobuf\Internal\Message -{ - /** - * The field to aggregate on. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; - */ - protected $field = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $field - * The field to aggregate on. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The field to aggregate on. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; - * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference|null - */ - public function getField() - { - return $this->field; - } - - public function hasField() - { - return isset($this->field); - } - - public function clearField() - { - unset($this->field); - } - - /** - * The field to aggregate on. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; - * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $var - * @return $this - */ - public function setField($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); - $this->field = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Sum::class, \Google\Cloud\Firestore\V1\StructuredAggregationQuery_Aggregation_Sum::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery.php deleted file mode 100644 index dc6fcc123ed3..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery.php +++ /dev/null @@ -1,599 +0,0 @@ -google.firestore.v1.StructuredQuery - */ -class StructuredQuery extends \Google\Protobuf\Internal\Message -{ - /** - * Optional sub-set of the fields to return. - * This acts as a [DocumentMask][google.firestore.v1.DocumentMask] over the - * documents returned from a query. When not set, assumes that the caller - * wants all fields returned. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.Projection select = 1; - */ - protected $select = null; - /** - * The collections to query. - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; - */ - private $from; - /** - * The filter to apply. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.Filter where = 3; - */ - protected $where = null; - /** - * The order to apply to the query results. - * Firestore allows callers to provide a full ordering, a partial ordering, or - * no ordering at all. In all cases, Firestore guarantees a stable ordering - * through the following rules: - * * The `order_by` is required to reference all fields used with an - * inequality filter. - * * All fields that are required to be in the `order_by` but are not already - * present are appended in lexicographical ordering of the field name. - * * If an order on `__name__` is not specified, it is appended by default. - * Fields are appended with the same sort direction as the last order - * specified, or 'ASCENDING' if no order was specified. For example: - * * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` - * * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` - * * `WHERE a > 1` becomes `WHERE a > 1 ORDER BY a ASC, __name__ ASC` - * * `WHERE __name__ > ... AND a > 1` becomes - * `WHERE __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC` - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; - */ - private $order_by; - /** - * A potential prefix of a position in the result set to start the query at. - * The ordering of the result set is based on the `ORDER BY` clause of the - * original query. - * ``` - * SELECT * FROM k WHERE a = 1 AND b > 2 ORDER BY b ASC, __name__ ASC; - * ``` - * This query's results are ordered by `(b ASC, __name__ ASC)`. - * Cursors can reference either the full ordering or a prefix of the location, - * though it cannot reference more fields than what are in the provided - * `ORDER BY`. - * Continuing off the example above, attaching the following start cursors - * will have varying impact: - * - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND - * b > 2 AND __name__ > /k/123`. - * - `START AFTER (10)`: start the query right after `a = 1 AND b > 10`. - * Unlike `OFFSET` which requires scanning over the first N results to skip, - * a start cursor allows the query to begin at a logical position. This - * position is not required to match an actual result, it will scan forward - * from this position to find the next document. - * Requires: - * * The number of values cannot be greater than the number of fields - * specified in the `ORDER BY` clause. - * - * Generated from protobuf field .google.firestore.v1.Cursor start_at = 7; - */ - protected $start_at = null; - /** - * A potential prefix of a position in the result set to end the query at. - * This is similar to `START_AT` but with it controlling the end position - * rather than the start position. - * Requires: - * * The number of values cannot be greater than the number of fields - * specified in the `ORDER BY` clause. - * - * Generated from protobuf field .google.firestore.v1.Cursor end_at = 8; - */ - protected $end_at = null; - /** - * The number of documents to skip before returning the first result. - * This applies after the constraints specified by the `WHERE`, `START AT`, & - * `END AT` but before the `LIMIT` clause. - * Requires: - * * The value must be greater than or equal to zero if specified. - * - * Generated from protobuf field int32 offset = 6; - */ - protected $offset = 0; - /** - * The maximum number of results to return. - * Applies after all other constraints. - * Requires: - * * The value must be greater than or equal to zero if specified. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 5; - */ - protected $limit = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\StructuredQuery\Projection $select - * Optional sub-set of the fields to return. - * This acts as a [DocumentMask][google.firestore.v1.DocumentMask] over the - * documents returned from a query. When not set, assumes that the caller - * wants all fields returned. - * @type array<\Google\Cloud\Firestore\V1\StructuredQuery\CollectionSelector>|\Google\Protobuf\Internal\RepeatedField $from - * The collections to query. - * @type \Google\Cloud\Firestore\V1\StructuredQuery\Filter $where - * The filter to apply. - * @type array<\Google\Cloud\Firestore\V1\StructuredQuery\Order>|\Google\Protobuf\Internal\RepeatedField $order_by - * The order to apply to the query results. - * Firestore allows callers to provide a full ordering, a partial ordering, or - * no ordering at all. In all cases, Firestore guarantees a stable ordering - * through the following rules: - * * The `order_by` is required to reference all fields used with an - * inequality filter. - * * All fields that are required to be in the `order_by` but are not already - * present are appended in lexicographical ordering of the field name. - * * If an order on `__name__` is not specified, it is appended by default. - * Fields are appended with the same sort direction as the last order - * specified, or 'ASCENDING' if no order was specified. For example: - * * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` - * * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` - * * `WHERE a > 1` becomes `WHERE a > 1 ORDER BY a ASC, __name__ ASC` - * * `WHERE __name__ > ... AND a > 1` becomes - * `WHERE __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC` - * @type \Google\Cloud\Firestore\V1\Cursor $start_at - * A potential prefix of a position in the result set to start the query at. - * The ordering of the result set is based on the `ORDER BY` clause of the - * original query. - * ``` - * SELECT * FROM k WHERE a = 1 AND b > 2 ORDER BY b ASC, __name__ ASC; - * ``` - * This query's results are ordered by `(b ASC, __name__ ASC)`. - * Cursors can reference either the full ordering or a prefix of the location, - * though it cannot reference more fields than what are in the provided - * `ORDER BY`. - * Continuing off the example above, attaching the following start cursors - * will have varying impact: - * - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND - * b > 2 AND __name__ > /k/123`. - * - `START AFTER (10)`: start the query right after `a = 1 AND b > 10`. - * Unlike `OFFSET` which requires scanning over the first N results to skip, - * a start cursor allows the query to begin at a logical position. This - * position is not required to match an actual result, it will scan forward - * from this position to find the next document. - * Requires: - * * The number of values cannot be greater than the number of fields - * specified in the `ORDER BY` clause. - * @type \Google\Cloud\Firestore\V1\Cursor $end_at - * A potential prefix of a position in the result set to end the query at. - * This is similar to `START_AT` but with it controlling the end position - * rather than the start position. - * Requires: - * * The number of values cannot be greater than the number of fields - * specified in the `ORDER BY` clause. - * @type int $offset - * The number of documents to skip before returning the first result. - * This applies after the constraints specified by the `WHERE`, `START AT`, & - * `END AT` but before the `LIMIT` clause. - * Requires: - * * The value must be greater than or equal to zero if specified. - * @type \Google\Protobuf\Int32Value $limit - * The maximum number of results to return. - * Applies after all other constraints. - * Requires: - * * The value must be greater than or equal to zero if specified. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * Optional sub-set of the fields to return. - * This acts as a [DocumentMask][google.firestore.v1.DocumentMask] over the - * documents returned from a query. When not set, assumes that the caller - * wants all fields returned. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.Projection select = 1; - * @return \Google\Cloud\Firestore\V1\StructuredQuery\Projection|null - */ - public function getSelect() - { - return $this->select; - } - - public function hasSelect() - { - return isset($this->select); - } - - public function clearSelect() - { - unset($this->select); - } - - /** - * Optional sub-set of the fields to return. - * This acts as a [DocumentMask][google.firestore.v1.DocumentMask] over the - * documents returned from a query. When not set, assumes that the caller - * wants all fields returned. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.Projection select = 1; - * @param \Google\Cloud\Firestore\V1\StructuredQuery\Projection $var - * @return $this - */ - public function setSelect($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\Projection::class); - $this->select = $var; - - return $this; - } - - /** - * The collections to query. - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFrom() - { - return $this->from; - } - - /** - * The collections to query. - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.CollectionSelector from = 2; - * @param array<\Google\Cloud\Firestore\V1\StructuredQuery\CollectionSelector>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFrom($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\StructuredQuery\CollectionSelector::class); - $this->from = $arr; - - return $this; - } - - /** - * The filter to apply. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.Filter where = 3; - * @return \Google\Cloud\Firestore\V1\StructuredQuery\Filter|null - */ - public function getWhere() - { - return $this->where; - } - - public function hasWhere() - { - return isset($this->where); - } - - public function clearWhere() - { - unset($this->where); - } - - /** - * The filter to apply. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.Filter where = 3; - * @param \Google\Cloud\Firestore\V1\StructuredQuery\Filter $var - * @return $this - */ - public function setWhere($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\Filter::class); - $this->where = $var; - - return $this; - } - - /** - * The order to apply to the query results. - * Firestore allows callers to provide a full ordering, a partial ordering, or - * no ordering at all. In all cases, Firestore guarantees a stable ordering - * through the following rules: - * * The `order_by` is required to reference all fields used with an - * inequality filter. - * * All fields that are required to be in the `order_by` but are not already - * present are appended in lexicographical ordering of the field name. - * * If an order on `__name__` is not specified, it is appended by default. - * Fields are appended with the same sort direction as the last order - * specified, or 'ASCENDING' if no order was specified. For example: - * * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` - * * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` - * * `WHERE a > 1` becomes `WHERE a > 1 ORDER BY a ASC, __name__ ASC` - * * `WHERE __name__ > ... AND a > 1` becomes - * `WHERE __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC` - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * The order to apply to the query results. - * Firestore allows callers to provide a full ordering, a partial ordering, or - * no ordering at all. In all cases, Firestore guarantees a stable ordering - * through the following rules: - * * The `order_by` is required to reference all fields used with an - * inequality filter. - * * All fields that are required to be in the `order_by` but are not already - * present are appended in lexicographical ordering of the field name. - * * If an order on `__name__` is not specified, it is appended by default. - * Fields are appended with the same sort direction as the last order - * specified, or 'ASCENDING' if no order was specified. For example: - * * `ORDER BY a` becomes `ORDER BY a ASC, __name__ ASC` - * * `ORDER BY a DESC` becomes `ORDER BY a DESC, __name__ DESC` - * * `WHERE a > 1` becomes `WHERE a > 1 ORDER BY a ASC, __name__ ASC` - * * `WHERE __name__ > ... AND a > 1` becomes - * `WHERE __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC` - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.Order order_by = 4; - * @param array<\Google\Cloud\Firestore\V1\StructuredQuery\Order>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setOrderBy($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\StructuredQuery\Order::class); - $this->order_by = $arr; - - return $this; - } - - /** - * A potential prefix of a position in the result set to start the query at. - * The ordering of the result set is based on the `ORDER BY` clause of the - * original query. - * ``` - * SELECT * FROM k WHERE a = 1 AND b > 2 ORDER BY b ASC, __name__ ASC; - * ``` - * This query's results are ordered by `(b ASC, __name__ ASC)`. - * Cursors can reference either the full ordering or a prefix of the location, - * though it cannot reference more fields than what are in the provided - * `ORDER BY`. - * Continuing off the example above, attaching the following start cursors - * will have varying impact: - * - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND - * b > 2 AND __name__ > /k/123`. - * - `START AFTER (10)`: start the query right after `a = 1 AND b > 10`. - * Unlike `OFFSET` which requires scanning over the first N results to skip, - * a start cursor allows the query to begin at a logical position. This - * position is not required to match an actual result, it will scan forward - * from this position to find the next document. - * Requires: - * * The number of values cannot be greater than the number of fields - * specified in the `ORDER BY` clause. - * - * Generated from protobuf field .google.firestore.v1.Cursor start_at = 7; - * @return \Google\Cloud\Firestore\V1\Cursor|null - */ - public function getStartAt() - { - return $this->start_at; - } - - public function hasStartAt() - { - return isset($this->start_at); - } - - public function clearStartAt() - { - unset($this->start_at); - } - - /** - * A potential prefix of a position in the result set to start the query at. - * The ordering of the result set is based on the `ORDER BY` clause of the - * original query. - * ``` - * SELECT * FROM k WHERE a = 1 AND b > 2 ORDER BY b ASC, __name__ ASC; - * ``` - * This query's results are ordered by `(b ASC, __name__ ASC)`. - * Cursors can reference either the full ordering or a prefix of the location, - * though it cannot reference more fields than what are in the provided - * `ORDER BY`. - * Continuing off the example above, attaching the following start cursors - * will have varying impact: - * - `START BEFORE (2, /k/123)`: start the query right before `a = 1 AND - * b > 2 AND __name__ > /k/123`. - * - `START AFTER (10)`: start the query right after `a = 1 AND b > 10`. - * Unlike `OFFSET` which requires scanning over the first N results to skip, - * a start cursor allows the query to begin at a logical position. This - * position is not required to match an actual result, it will scan forward - * from this position to find the next document. - * Requires: - * * The number of values cannot be greater than the number of fields - * specified in the `ORDER BY` clause. - * - * Generated from protobuf field .google.firestore.v1.Cursor start_at = 7; - * @param \Google\Cloud\Firestore\V1\Cursor $var - * @return $this - */ - public function setStartAt($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Cursor::class); - $this->start_at = $var; - - return $this; - } - - /** - * A potential prefix of a position in the result set to end the query at. - * This is similar to `START_AT` but with it controlling the end position - * rather than the start position. - * Requires: - * * The number of values cannot be greater than the number of fields - * specified in the `ORDER BY` clause. - * - * Generated from protobuf field .google.firestore.v1.Cursor end_at = 8; - * @return \Google\Cloud\Firestore\V1\Cursor|null - */ - public function getEndAt() - { - return $this->end_at; - } - - public function hasEndAt() - { - return isset($this->end_at); - } - - public function clearEndAt() - { - unset($this->end_at); - } - - /** - * A potential prefix of a position in the result set to end the query at. - * This is similar to `START_AT` but with it controlling the end position - * rather than the start position. - * Requires: - * * The number of values cannot be greater than the number of fields - * specified in the `ORDER BY` clause. - * - * Generated from protobuf field .google.firestore.v1.Cursor end_at = 8; - * @param \Google\Cloud\Firestore\V1\Cursor $var - * @return $this - */ - public function setEndAt($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Cursor::class); - $this->end_at = $var; - - return $this; - } - - /** - * The number of documents to skip before returning the first result. - * This applies after the constraints specified by the `WHERE`, `START AT`, & - * `END AT` but before the `LIMIT` clause. - * Requires: - * * The value must be greater than or equal to zero if specified. - * - * Generated from protobuf field int32 offset = 6; - * @return int - */ - public function getOffset() - { - return $this->offset; - } - - /** - * The number of documents to skip before returning the first result. - * This applies after the constraints specified by the `WHERE`, `START AT`, & - * `END AT` but before the `LIMIT` clause. - * Requires: - * * The value must be greater than or equal to zero if specified. - * - * Generated from protobuf field int32 offset = 6; - * @param int $var - * @return $this - */ - public function setOffset($var) - { - GPBUtil::checkInt32($var); - $this->offset = $var; - - return $this; - } - - /** - * The maximum number of results to return. - * Applies after all other constraints. - * Requires: - * * The value must be greater than or equal to zero if specified. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 5; - * @return \Google\Protobuf\Int32Value|null - */ - public function getLimit() - { - return $this->limit; - } - - public function hasLimit() - { - return isset($this->limit); - } - - public function clearLimit() - { - unset($this->limit); - } - - /** - * Returns the unboxed value from getLimit() - - * The maximum number of results to return. - * Applies after all other constraints. - * Requires: - * * The value must be greater than or equal to zero if specified. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 5; - * @return int|null - */ - public function getLimitUnwrapped() - { - return $this->readWrapperValue("limit"); - } - - /** - * The maximum number of results to return. - * Applies after all other constraints. - * Requires: - * * The value must be greater than or equal to zero if specified. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 5; - * @param \Google\Protobuf\Int32Value $var - * @return $this - */ - public function setLimit($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); - $this->limit = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. - - * The maximum number of results to return. - * Applies after all other constraints. - * Requires: - * * The value must be greater than or equal to zero if specified. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 5; - * @param int|null $var - * @return $this - */ - public function setLimitUnwrapped($var) - { - $this->writeWrapperValue("limit", $var); - return $this;} - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CollectionSelector.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CollectionSelector.php deleted file mode 100644 index b06253d9d6ad..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CollectionSelector.php +++ /dev/null @@ -1,116 +0,0 @@ -google.firestore.v1.StructuredQuery.CollectionSelector - */ -class CollectionSelector extends \Google\Protobuf\Internal\Message -{ - /** - * The collection ID. - * When set, selects only collections with this ID. - * - * Generated from protobuf field string collection_id = 2; - */ - protected $collection_id = ''; - /** - * When false, selects only collections that are immediate children of - * the `parent` specified in the containing `RunQueryRequest`. - * When true, selects all descendant collections. - * - * Generated from protobuf field bool all_descendants = 3; - */ - protected $all_descendants = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $collection_id - * The collection ID. - * When set, selects only collections with this ID. - * @type bool $all_descendants - * When false, selects only collections that are immediate children of - * the `parent` specified in the containing `RunQueryRequest`. - * When true, selects all descendant collections. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The collection ID. - * When set, selects only collections with this ID. - * - * Generated from protobuf field string collection_id = 2; - * @return string - */ - public function getCollectionId() - { - return $this->collection_id; - } - - /** - * The collection ID. - * When set, selects only collections with this ID. - * - * Generated from protobuf field string collection_id = 2; - * @param string $var - * @return $this - */ - public function setCollectionId($var) - { - GPBUtil::checkString($var, True); - $this->collection_id = $var; - - return $this; - } - - /** - * When false, selects only collections that are immediate children of - * the `parent` specified in the containing `RunQueryRequest`. - * When true, selects all descendant collections. - * - * Generated from protobuf field bool all_descendants = 3; - * @return bool - */ - public function getAllDescendants() - { - return $this->all_descendants; - } - - /** - * When false, selects only collections that are immediate children of - * the `parent` specified in the containing `RunQueryRequest`. - * When true, selects all descendant collections. - * - * Generated from protobuf field bool all_descendants = 3; - * @param bool $var - * @return $this - */ - public function setAllDescendants($var) - { - GPBUtil::checkBool($var); - $this->all_descendants = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CollectionSelector::class, \Google\Cloud\Firestore\V1\StructuredQuery_CollectionSelector::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter.php deleted file mode 100644 index f63c324d982d..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter.php +++ /dev/null @@ -1,112 +0,0 @@ -google.firestore.v1.StructuredQuery.CompositeFilter - */ -class CompositeFilter extends \Google\Protobuf\Internal\Message -{ - /** - * The operator for combining multiple filters. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; - */ - protected $op = 0; - /** - * The list of filters to combine. - * Requires: - * * At least one filter is present. - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; - */ - private $filters; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $op - * The operator for combining multiple filters. - * @type array<\Google\Cloud\Firestore\V1\StructuredQuery\Filter>|\Google\Protobuf\Internal\RepeatedField $filters - * The list of filters to combine. - * Requires: - * * At least one filter is present. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The operator for combining multiple filters. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; - * @return int - */ - public function getOp() - { - return $this->op; - } - - /** - * The operator for combining multiple filters. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.CompositeFilter.Operator op = 1; - * @param int $var - * @return $this - */ - public function setOp($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\StructuredQuery\CompositeFilter\Operator::class); - $this->op = $var; - - return $this; - } - - /** - * The list of filters to combine. - * Requires: - * * At least one filter is present. - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFilters() - { - return $this->filters; - } - - /** - * The list of filters to combine. - * Requires: - * * At least one filter is present. - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.Filter filters = 2; - * @param array<\Google\Cloud\Firestore\V1\StructuredQuery\Filter>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFilters($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\StructuredQuery\Filter::class); - $this->filters = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(CompositeFilter::class, \Google\Cloud\Firestore\V1\StructuredQuery_CompositeFilter::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter/Operator.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter/Operator.php deleted file mode 100644 index b603b83dc965..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/CompositeFilter/Operator.php +++ /dev/null @@ -1,68 +0,0 @@ -google.firestore.v1.StructuredQuery.CompositeFilter.Operator - */ -class Operator -{ - /** - * Unspecified. This value must not be used. - * - * Generated from protobuf enum OPERATOR_UNSPECIFIED = 0; - */ - const OPERATOR_UNSPECIFIED = 0; - /** - * Documents are required to satisfy all of the combined filters. - * - * Generated from protobuf enum AND = 1; - */ - const PBAND = 1; - /** - * Documents are required to satisfy at least one of the combined filters. - * - * Generated from protobuf enum OR = 2; - */ - const PBOR = 2; - - private static $valueToName = [ - self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED', - self::PBAND => 'AND', - self::PBOR => 'OR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - $pbconst = __CLASS__. '::PB' . strtoupper($name); - if (!defined($pbconst)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($pbconst); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Operator::class, \Google\Cloud\Firestore\V1\StructuredQuery_CompositeFilter_Operator::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Direction.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Direction.php deleted file mode 100644 index 70989c758cf2..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Direction.php +++ /dev/null @@ -1,64 +0,0 @@ -google.firestore.v1.StructuredQuery.Direction - */ -class Direction -{ - /** - * Unspecified. - * - * Generated from protobuf enum DIRECTION_UNSPECIFIED = 0; - */ - const DIRECTION_UNSPECIFIED = 0; - /** - * Ascending. - * - * Generated from protobuf enum ASCENDING = 1; - */ - const ASCENDING = 1; - /** - * Descending. - * - * Generated from protobuf enum DESCENDING = 2; - */ - const DESCENDING = 2; - - private static $valueToName = [ - self::DIRECTION_UNSPECIFIED => 'DIRECTION_UNSPECIFIED', - self::ASCENDING => 'ASCENDING', - self::DESCENDING => 'DESCENDING', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Direction::class, \Google\Cloud\Firestore\V1\StructuredQuery_Direction::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter.php deleted file mode 100644 index d027d09f1050..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter.php +++ /dev/null @@ -1,158 +0,0 @@ -google.firestore.v1.StructuredQuery.FieldFilter - */ -class FieldFilter extends \Google\Protobuf\Internal\Message -{ - /** - * The field to filter by. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; - */ - protected $field = null; - /** - * The operator to filter by. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; - */ - protected $op = 0; - /** - * The value to compare to. - * - * Generated from protobuf field .google.firestore.v1.Value value = 3; - */ - protected $value = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $field - * The field to filter by. - * @type int $op - * The operator to filter by. - * @type \Google\Cloud\Firestore\V1\Value $value - * The value to compare to. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The field to filter by. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; - * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference|null - */ - public function getField() - { - return $this->field; - } - - public function hasField() - { - return isset($this->field); - } - - public function clearField() - { - unset($this->field); - } - - /** - * The field to filter by. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; - * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $var - * @return $this - */ - public function setField($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); - $this->field = $var; - - return $this; - } - - /** - * The operator to filter by. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; - * @return int - */ - public function getOp() - { - return $this->op; - } - - /** - * The operator to filter by. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldFilter.Operator op = 2; - * @param int $var - * @return $this - */ - public function setOp($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldFilter\Operator::class); - $this->op = $var; - - return $this; - } - - /** - * The value to compare to. - * - * Generated from protobuf field .google.firestore.v1.Value value = 3; - * @return \Google\Cloud\Firestore\V1\Value|null - */ - public function getValue() - { - return $this->value; - } - - public function hasValue() - { - return isset($this->value); - } - - public function clearValue() - { - unset($this->value); - } - - /** - * The value to compare to. - * - * Generated from protobuf field .google.firestore.v1.Value value = 3; - * @param \Google\Cloud\Firestore\V1\Value $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Value::class); - $this->value = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FieldFilter::class, \Google\Cloud\Firestore\V1\StructuredQuery_FieldFilter::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter/Operator.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter/Operator.php deleted file mode 100644 index 9721e2039d04..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldFilter/Operator.php +++ /dev/null @@ -1,146 +0,0 @@ -google.firestore.v1.StructuredQuery.FieldFilter.Operator - */ -class Operator -{ - /** - * Unspecified. This value must not be used. - * - * Generated from protobuf enum OPERATOR_UNSPECIFIED = 0; - */ - const OPERATOR_UNSPECIFIED = 0; - /** - * The given `field` is less than the given `value`. - * Requires: - * * That `field` come first in `order_by`. - * - * Generated from protobuf enum LESS_THAN = 1; - */ - const LESS_THAN = 1; - /** - * The given `field` is less than or equal to the given `value`. - * Requires: - * * That `field` come first in `order_by`. - * - * Generated from protobuf enum LESS_THAN_OR_EQUAL = 2; - */ - const LESS_THAN_OR_EQUAL = 2; - /** - * The given `field` is greater than the given `value`. - * Requires: - * * That `field` come first in `order_by`. - * - * Generated from protobuf enum GREATER_THAN = 3; - */ - const GREATER_THAN = 3; - /** - * The given `field` is greater than or equal to the given `value`. - * Requires: - * * That `field` come first in `order_by`. - * - * Generated from protobuf enum GREATER_THAN_OR_EQUAL = 4; - */ - const GREATER_THAN_OR_EQUAL = 4; - /** - * The given `field` is equal to the given `value`. - * - * Generated from protobuf enum EQUAL = 5; - */ - const EQUAL = 5; - /** - * The given `field` is not equal to the given `value`. - * Requires: - * * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. - * * That `field` comes first in the `order_by`. - * - * Generated from protobuf enum NOT_EQUAL = 6; - */ - const NOT_EQUAL = 6; - /** - * The given `field` is an array that contains the given `value`. - * - * Generated from protobuf enum ARRAY_CONTAINS = 7; - */ - const ARRAY_CONTAINS = 7; - /** - * The given `field` is equal to at least one value in the given array. - * Requires: - * * That `value` is a non-empty `ArrayValue`, subject to disjunction - * limits. - * * No `NOT_IN` filters in the same query. - * - * Generated from protobuf enum IN = 8; - */ - const IN = 8; - /** - * The given `field` is an array that contains any of the values in the - * given array. - * Requires: - * * That `value` is a non-empty `ArrayValue`, subject to disjunction - * limits. - * * No other `ARRAY_CONTAINS_ANY` filters within the same disjunction. - * * No `NOT_IN` filters in the same query. - * - * Generated from protobuf enum ARRAY_CONTAINS_ANY = 9; - */ - const ARRAY_CONTAINS_ANY = 9; - /** - * The value of the `field` is not in the given array. - * Requires: - * * That `value` is a non-empty `ArrayValue` with at most 10 values. - * * No other `OR`, `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`, - * `IS_NOT_NULL`, or `IS_NOT_NAN`. - * * That `field` comes first in the `order_by`. - * - * Generated from protobuf enum NOT_IN = 10; - */ - const NOT_IN = 10; - - private static $valueToName = [ - self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED', - self::LESS_THAN => 'LESS_THAN', - self::LESS_THAN_OR_EQUAL => 'LESS_THAN_OR_EQUAL', - self::GREATER_THAN => 'GREATER_THAN', - self::GREATER_THAN_OR_EQUAL => 'GREATER_THAN_OR_EQUAL', - self::EQUAL => 'EQUAL', - self::NOT_EQUAL => 'NOT_EQUAL', - self::ARRAY_CONTAINS => 'ARRAY_CONTAINS', - self::IN => 'IN', - self::ARRAY_CONTAINS_ANY => 'ARRAY_CONTAINS_ANY', - self::NOT_IN => 'NOT_IN', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Operator::class, \Google\Cloud\Firestore\V1\StructuredQuery_FieldFilter_Operator::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldReference.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldReference.php deleted file mode 100644 index be709a472fb1..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FieldReference.php +++ /dev/null @@ -1,86 +0,0 @@ -google.firestore.v1.StructuredQuery.FieldReference - */ -class FieldReference extends \Google\Protobuf\Internal\Message -{ - /** - * A reference to a field in a document. - * Requires: - * * MUST be a dot-delimited (`.`) string of segments, where each segment - * conforms to [document field name][google.firestore.v1.Document.fields] - * limitations. - * - * Generated from protobuf field string field_path = 2; - */ - protected $field_path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $field_path - * A reference to a field in a document. - * Requires: - * * MUST be a dot-delimited (`.`) string of segments, where each segment - * conforms to [document field name][google.firestore.v1.Document.fields] - * limitations. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * A reference to a field in a document. - * Requires: - * * MUST be a dot-delimited (`.`) string of segments, where each segment - * conforms to [document field name][google.firestore.v1.Document.fields] - * limitations. - * - * Generated from protobuf field string field_path = 2; - * @return string - */ - public function getFieldPath() - { - return $this->field_path; - } - - /** - * A reference to a field in a document. - * Requires: - * * MUST be a dot-delimited (`.`) string of segments, where each segment - * conforms to [document field name][google.firestore.v1.Document.fields] - * limitations. - * - * Generated from protobuf field string field_path = 2; - * @param string $var - * @return $this - */ - public function setFieldPath($var) - { - GPBUtil::checkString($var, True); - $this->field_path = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FieldReference::class, \Google\Cloud\Firestore\V1\StructuredQuery_FieldReference::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Filter.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Filter.php deleted file mode 100644 index dc43c16b7859..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Filter.php +++ /dev/null @@ -1,144 +0,0 @@ -google.firestore.v1.StructuredQuery.Filter - */ -class Filter extends \Google\Protobuf\Internal\Message -{ - protected $filter_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\StructuredQuery\CompositeFilter $composite_filter - * A composite filter. - * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldFilter $field_filter - * A filter on a document field. - * @type \Google\Cloud\Firestore\V1\StructuredQuery\UnaryFilter $unary_filter - * A filter that takes exactly one argument. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * A composite filter. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; - * @return \Google\Cloud\Firestore\V1\StructuredQuery\CompositeFilter|null - */ - public function getCompositeFilter() - { - return $this->readOneof(1); - } - - public function hasCompositeFilter() - { - return $this->hasOneof(1); - } - - /** - * A composite filter. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.CompositeFilter composite_filter = 1; - * @param \Google\Cloud\Firestore\V1\StructuredQuery\CompositeFilter $var - * @return $this - */ - public function setCompositeFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\CompositeFilter::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * A filter on a document field. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; - * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldFilter|null - */ - public function getFieldFilter() - { - return $this->readOneof(2); - } - - public function hasFieldFilter() - { - return $this->hasOneof(2); - } - - /** - * A filter on a document field. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldFilter field_filter = 2; - * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldFilter $var - * @return $this - */ - public function setFieldFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldFilter::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * A filter that takes exactly one argument. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; - * @return \Google\Cloud\Firestore\V1\StructuredQuery\UnaryFilter|null - */ - public function getUnaryFilter() - { - return $this->readOneof(3); - } - - public function hasUnaryFilter() - { - return $this->hasOneof(3); - } - - /** - * A filter that takes exactly one argument. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.UnaryFilter unary_filter = 3; - * @param \Google\Cloud\Firestore\V1\StructuredQuery\UnaryFilter $var - * @return $this - */ - public function setUnaryFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\UnaryFilter::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getFilterType() - { - return $this->whichOneof("filter_type"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Filter::class, \Google\Cloud\Firestore\V1\StructuredQuery_Filter::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Order.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Order.php deleted file mode 100644 index a71ebeb1b1d0..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Order.php +++ /dev/null @@ -1,114 +0,0 @@ -google.firestore.v1.StructuredQuery.Order - */ -class Order extends \Google\Protobuf\Internal\Message -{ - /** - * The field to order by. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; - */ - protected $field = null; - /** - * The direction to order by. Defaults to `ASCENDING`. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.Direction direction = 2; - */ - protected $direction = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $field - * The field to order by. - * @type int $direction - * The direction to order by. Defaults to `ASCENDING`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The field to order by. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; - * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference|null - */ - public function getField() - { - return $this->field; - } - - public function hasField() - { - return isset($this->field); - } - - public function clearField() - { - unset($this->field); - } - - /** - * The field to order by. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 1; - * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $var - * @return $this - */ - public function setField($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); - $this->field = $var; - - return $this; - } - - /** - * The direction to order by. Defaults to `ASCENDING`. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.Direction direction = 2; - * @return int - */ - public function getDirection() - { - return $this->direction; - } - - /** - * The direction to order by. Defaults to `ASCENDING`. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.Direction direction = 2; - * @param int $var - * @return $this - */ - public function setDirection($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\StructuredQuery\Direction::class); - $this->direction = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Order::class, \Google\Cloud\Firestore\V1\StructuredQuery_Order::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Projection.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Projection.php deleted file mode 100644 index 36909ca38947..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/Projection.php +++ /dev/null @@ -1,78 +0,0 @@ -google.firestore.v1.StructuredQuery.Projection - */ -class Projection extends \Google\Protobuf\Internal\Message -{ - /** - * The fields to return. - * If empty, all fields are returned. To only return the name - * of the document, use `['__name__']`. - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; - */ - private $fields; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Firestore\V1\StructuredQuery\FieldReference>|\Google\Protobuf\Internal\RepeatedField $fields - * The fields to return. - * If empty, all fields are returned. To only return the name - * of the document, use `['__name__']`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The fields to return. - * If empty, all fields are returned. To only return the name - * of the document, use `['__name__']`. - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFields() - { - return $this->fields; - } - - /** - * The fields to return. - * If empty, all fields are returned. To only return the name - * of the document, use `['__name__']`. - * - * Generated from protobuf field repeated .google.firestore.v1.StructuredQuery.FieldReference fields = 2; - * @param array<\Google\Cloud\Firestore\V1\StructuredQuery\FieldReference>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFields($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); - $this->fields = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Projection::class, \Google\Cloud\Firestore\V1\StructuredQuery_Projection::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter.php deleted file mode 100644 index 4f90d0cfdd4b..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter.php +++ /dev/null @@ -1,112 +0,0 @@ -google.firestore.v1.StructuredQuery.UnaryFilter - */ -class UnaryFilter extends \Google\Protobuf\Internal\Message -{ - /** - * The unary operator to apply. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; - */ - protected $op = 0; - protected $operand_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $op - * The unary operator to apply. - * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $field - * The field to which to apply the operator. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The unary operator to apply. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; - * @return int - */ - public function getOp() - { - return $this->op; - } - - /** - * The unary operator to apply. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.UnaryFilter.Operator op = 1; - * @param int $var - * @return $this - */ - public function setOp($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\StructuredQuery\UnaryFilter\Operator::class); - $this->op = $var; - - return $this; - } - - /** - * The field to which to apply the operator. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 2; - * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference|null - */ - public function getField() - { - return $this->readOneof(2); - } - - public function hasField() - { - return $this->hasOneof(2); - } - - /** - * The field to which to apply the operator. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference field = 2; - * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $var - * @return $this - */ - public function setField($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getOperandType() - { - return $this->whichOneof("operand_type"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(UnaryFilter::class, \Google\Cloud\Firestore\V1\StructuredQuery_UnaryFilter::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter/Operator.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter/Operator.php deleted file mode 100644 index d8a8dffc6d00..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/UnaryFilter/Operator.php +++ /dev/null @@ -1,84 +0,0 @@ -google.firestore.v1.StructuredQuery.UnaryFilter.Operator - */ -class Operator -{ - /** - * Unspecified. This value must not be used. - * - * Generated from protobuf enum OPERATOR_UNSPECIFIED = 0; - */ - const OPERATOR_UNSPECIFIED = 0; - /** - * The given `field` is equal to `NaN`. - * - * Generated from protobuf enum IS_NAN = 2; - */ - const IS_NAN = 2; - /** - * The given `field` is equal to `NULL`. - * - * Generated from protobuf enum IS_NULL = 3; - */ - const IS_NULL = 3; - /** - * The given `field` is not equal to `NaN`. - * Requires: - * * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. - * * That `field` comes first in the `order_by`. - * - * Generated from protobuf enum IS_NOT_NAN = 4; - */ - const IS_NOT_NAN = 4; - /** - * The given `field` is not equal to `NULL`. - * Requires: - * * A single `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. - * * That `field` comes first in the `order_by`. - * - * Generated from protobuf enum IS_NOT_NULL = 5; - */ - const IS_NOT_NULL = 5; - - private static $valueToName = [ - self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED', - self::IS_NAN => 'IS_NAN', - self::IS_NULL => 'IS_NULL', - self::IS_NOT_NAN => 'IS_NOT_NAN', - self::IS_NOT_NULL => 'IS_NOT_NULL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Operator::class, \Google\Cloud\Firestore\V1\StructuredQuery_UnaryFilter_Operator::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target.php deleted file mode 100644 index ac09a0b046f5..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target.php +++ /dev/null @@ -1,407 +0,0 @@ -google.firestore.v1.Target - */ -class Target extends \Google\Protobuf\Internal\Message -{ - /** - * The target ID that identifies the target on the stream. Must be a positive - * number and non-zero. - * If `target_id` is 0 (or unspecified), the server will assign an ID for this - * target and return that in a `TargetChange::ADD` event. Once a target with - * `target_id=0` is added, all subsequent targets must also have - * `target_id=0`. If an `AddTarget` request with `target_id != 0` is - * sent to the server after a target with `target_id=0` is added, the server - * will immediately send a response with a `TargetChange::Remove` event. - * Note that if the client sends multiple `AddTarget` requests - * without an ID, the order of IDs returned in `TargetChage.target_ids` are - * undefined. Therefore, clients should provide a target ID instead of relying - * on the server to assign one. - * If `target_id` is non-zero, there must not be an existing active target on - * this stream with the same ID. - * - * Generated from protobuf field int32 target_id = 5; - */ - protected $target_id = 0; - /** - * If the target should be removed once it is current and consistent. - * - * Generated from protobuf field bool once = 6; - */ - protected $once = false; - /** - * The number of documents that last matched the query at the resume token or - * read time. - * This value is only relevant when a `resume_type` is provided. This value - * being present and greater than zero signals that the client wants - * `ExistenceFilter.unchanged_names` to be included in the response. - * - * Generated from protobuf field .google.protobuf.Int32Value expected_count = 12; - */ - protected $expected_count = null; - protected $target_type; - protected $resume_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\Target\QueryTarget $query - * A target specified by a query. - * @type \Google\Cloud\Firestore\V1\Target\DocumentsTarget $documents - * A target specified by a set of document names. - * @type string $resume_token - * A resume token from a prior - * [TargetChange][google.firestore.v1.TargetChange] for an identical target. - * Using a resume token with a different target is unsupported and may fail. - * @type \Google\Protobuf\Timestamp $read_time - * Start listening after a specific `read_time`. - * The client must know the state of matching documents at this time. - * @type int $target_id - * The target ID that identifies the target on the stream. Must be a positive - * number and non-zero. - * If `target_id` is 0 (or unspecified), the server will assign an ID for this - * target and return that in a `TargetChange::ADD` event. Once a target with - * `target_id=0` is added, all subsequent targets must also have - * `target_id=0`. If an `AddTarget` request with `target_id != 0` is - * sent to the server after a target with `target_id=0` is added, the server - * will immediately send a response with a `TargetChange::Remove` event. - * Note that if the client sends multiple `AddTarget` requests - * without an ID, the order of IDs returned in `TargetChage.target_ids` are - * undefined. Therefore, clients should provide a target ID instead of relying - * on the server to assign one. - * If `target_id` is non-zero, there must not be an existing active target on - * this stream with the same ID. - * @type bool $once - * If the target should be removed once it is current and consistent. - * @type \Google\Protobuf\Int32Value $expected_count - * The number of documents that last matched the query at the resume token or - * read time. - * This value is only relevant when a `resume_type` is provided. This value - * being present and greater than zero signals that the client wants - * `ExistenceFilter.unchanged_names` to be included in the response. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * A target specified by a query. - * - * Generated from protobuf field .google.firestore.v1.Target.QueryTarget query = 2; - * @return \Google\Cloud\Firestore\V1\Target\QueryTarget|null - */ - public function getQuery() - { - return $this->readOneof(2); - } - - public function hasQuery() - { - return $this->hasOneof(2); - } - - /** - * A target specified by a query. - * - * Generated from protobuf field .google.firestore.v1.Target.QueryTarget query = 2; - * @param \Google\Cloud\Firestore\V1\Target\QueryTarget $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Target\QueryTarget::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * A target specified by a set of document names. - * - * Generated from protobuf field .google.firestore.v1.Target.DocumentsTarget documents = 3; - * @return \Google\Cloud\Firestore\V1\Target\DocumentsTarget|null - */ - public function getDocuments() - { - return $this->readOneof(3); - } - - public function hasDocuments() - { - return $this->hasOneof(3); - } - - /** - * A target specified by a set of document names. - * - * Generated from protobuf field .google.firestore.v1.Target.DocumentsTarget documents = 3; - * @param \Google\Cloud\Firestore\V1\Target\DocumentsTarget $var - * @return $this - */ - public function setDocuments($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Target\DocumentsTarget::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * A resume token from a prior - * [TargetChange][google.firestore.v1.TargetChange] for an identical target. - * Using a resume token with a different target is unsupported and may fail. - * - * Generated from protobuf field bytes resume_token = 4; - * @return string - */ - public function getResumeToken() - { - return $this->readOneof(4); - } - - public function hasResumeToken() - { - return $this->hasOneof(4); - } - - /** - * A resume token from a prior - * [TargetChange][google.firestore.v1.TargetChange] for an identical target. - * Using a resume token with a different target is unsupported and may fail. - * - * Generated from protobuf field bytes resume_token = 4; - * @param string $var - * @return $this - */ - public function setResumeToken($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Start listening after a specific `read_time`. - * The client must know the state of matching documents at this time. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 11; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->readOneof(11); - } - - public function hasReadTime() - { - return $this->hasOneof(11); - } - - /** - * Start listening after a specific `read_time`. - * The client must know the state of matching documents at this time. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 11; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(11, $var); - - return $this; - } - - /** - * The target ID that identifies the target on the stream. Must be a positive - * number and non-zero. - * If `target_id` is 0 (or unspecified), the server will assign an ID for this - * target and return that in a `TargetChange::ADD` event. Once a target with - * `target_id=0` is added, all subsequent targets must also have - * `target_id=0`. If an `AddTarget` request with `target_id != 0` is - * sent to the server after a target with `target_id=0` is added, the server - * will immediately send a response with a `TargetChange::Remove` event. - * Note that if the client sends multiple `AddTarget` requests - * without an ID, the order of IDs returned in `TargetChage.target_ids` are - * undefined. Therefore, clients should provide a target ID instead of relying - * on the server to assign one. - * If `target_id` is non-zero, there must not be an existing active target on - * this stream with the same ID. - * - * Generated from protobuf field int32 target_id = 5; - * @return int - */ - public function getTargetId() - { - return $this->target_id; - } - - /** - * The target ID that identifies the target on the stream. Must be a positive - * number and non-zero. - * If `target_id` is 0 (or unspecified), the server will assign an ID for this - * target and return that in a `TargetChange::ADD` event. Once a target with - * `target_id=0` is added, all subsequent targets must also have - * `target_id=0`. If an `AddTarget` request with `target_id != 0` is - * sent to the server after a target with `target_id=0` is added, the server - * will immediately send a response with a `TargetChange::Remove` event. - * Note that if the client sends multiple `AddTarget` requests - * without an ID, the order of IDs returned in `TargetChage.target_ids` are - * undefined. Therefore, clients should provide a target ID instead of relying - * on the server to assign one. - * If `target_id` is non-zero, there must not be an existing active target on - * this stream with the same ID. - * - * Generated from protobuf field int32 target_id = 5; - * @param int $var - * @return $this - */ - public function setTargetId($var) - { - GPBUtil::checkInt32($var); - $this->target_id = $var; - - return $this; - } - - /** - * If the target should be removed once it is current and consistent. - * - * Generated from protobuf field bool once = 6; - * @return bool - */ - public function getOnce() - { - return $this->once; - } - - /** - * If the target should be removed once it is current and consistent. - * - * Generated from protobuf field bool once = 6; - * @param bool $var - * @return $this - */ - public function setOnce($var) - { - GPBUtil::checkBool($var); - $this->once = $var; - - return $this; - } - - /** - * The number of documents that last matched the query at the resume token or - * read time. - * This value is only relevant when a `resume_type` is provided. This value - * being present and greater than zero signals that the client wants - * `ExistenceFilter.unchanged_names` to be included in the response. - * - * Generated from protobuf field .google.protobuf.Int32Value expected_count = 12; - * @return \Google\Protobuf\Int32Value|null - */ - public function getExpectedCount() - { - return $this->expected_count; - } - - public function hasExpectedCount() - { - return isset($this->expected_count); - } - - public function clearExpectedCount() - { - unset($this->expected_count); - } - - /** - * Returns the unboxed value from getExpectedCount() - - * The number of documents that last matched the query at the resume token or - * read time. - * This value is only relevant when a `resume_type` is provided. This value - * being present and greater than zero signals that the client wants - * `ExistenceFilter.unchanged_names` to be included in the response. - * - * Generated from protobuf field .google.protobuf.Int32Value expected_count = 12; - * @return int|null - */ - public function getExpectedCountUnwrapped() - { - return $this->readWrapperValue("expected_count"); - } - - /** - * The number of documents that last matched the query at the resume token or - * read time. - * This value is only relevant when a `resume_type` is provided. This value - * being present and greater than zero signals that the client wants - * `ExistenceFilter.unchanged_names` to be included in the response. - * - * Generated from protobuf field .google.protobuf.Int32Value expected_count = 12; - * @param \Google\Protobuf\Int32Value $var - * @return $this - */ - public function setExpectedCount($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); - $this->expected_count = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. - - * The number of documents that last matched the query at the resume token or - * read time. - * This value is only relevant when a `resume_type` is provided. This value - * being present and greater than zero signals that the client wants - * `ExistenceFilter.unchanged_names` to be included in the response. - * - * Generated from protobuf field .google.protobuf.Int32Value expected_count = 12; - * @param int|null $var - * @return $this - */ - public function setExpectedCountUnwrapped($var) - { - $this->writeWrapperValue("expected_count", $var); - return $this;} - - /** - * @return string - */ - public function getTargetType() - { - return $this->whichOneof("target_type"); - } - - /** - * @return string - */ - public function getResumeType() - { - return $this->whichOneof("resume_type"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/DocumentsTarget.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/DocumentsTarget.php deleted file mode 100644 index b96562c648cf..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/DocumentsTarget.php +++ /dev/null @@ -1,82 +0,0 @@ -google.firestore.v1.Target.DocumentsTarget - */ -class DocumentsTarget extends \Google\Protobuf\Internal\Message -{ - /** - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of - * the given `database`. Duplicate names will be elided. - * - * Generated from protobuf field repeated string documents = 2; - */ - private $documents; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $documents - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of - * the given `database`. Duplicate names will be elided. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of - * the given `database`. Duplicate names will be elided. - * - * Generated from protobuf field repeated string documents = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDocuments() - { - return $this->documents; - } - - /** - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of - * the given `database`. Duplicate names will be elided. - * - * Generated from protobuf field repeated string documents = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDocuments($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->documents = $arr; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DocumentsTarget::class, \Google\Cloud\Firestore\V1\Target_DocumentsTarget::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/QueryTarget.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/QueryTarget.php deleted file mode 100644 index 56c02faeb030..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Target/QueryTarget.php +++ /dev/null @@ -1,132 +0,0 @@ -google.firestore.v1.Target.QueryTarget - */ -class QueryTarget extends \Google\Protobuf\Internal\Message -{ - /** - * The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1; - */ - protected $parent = ''; - protected $query_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @type \Google\Cloud\Firestore\V1\StructuredQuery $structured_query - * A structured query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1; - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * - * Generated from protobuf field string parent = 1; - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * A structured query. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 2; - * @return \Google\Cloud\Firestore\V1\StructuredQuery|null - */ - public function getStructuredQuery() - { - return $this->readOneof(2); - } - - public function hasStructuredQuery() - { - return $this->hasOneof(2); - } - - /** - * A structured query. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery structured_query = 2; - * @param \Google\Cloud\Firestore\V1\StructuredQuery $var - * @return $this - */ - public function setStructuredQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getQueryType() - { - return $this->whichOneof("query_type"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(QueryTarget::class, \Google\Cloud\Firestore\V1\Target_QueryTarget::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange.php deleted file mode 100644 index 7916d0c40af0..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange.php +++ /dev/null @@ -1,267 +0,0 @@ -google.firestore.v1.TargetChange - */ -class TargetChange extends \Google\Protobuf\Internal\Message -{ - /** - * The type of change that occurred. - * - * Generated from protobuf field .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; - */ - protected $target_change_type = 0; - /** - * The target IDs of targets that have changed. - * If empty, the change applies to all targets. - * The order of the target IDs is not defined. - * - * Generated from protobuf field repeated int32 target_ids = 2; - */ - private $target_ids; - /** - * The error that resulted in this change, if applicable. - * - * Generated from protobuf field .google.rpc.Status cause = 3; - */ - protected $cause = null; - /** - * A token that can be used to resume the stream for the given `target_ids`, - * or all targets if `target_ids` is empty. - * Not set on every target change. - * - * Generated from protobuf field bytes resume_token = 4; - */ - protected $resume_token = ''; - /** - * The consistent `read_time` for the given `target_ids` (omitted when the - * target_ids are not at a consistent snapshot). - * The stream is guaranteed to send a `read_time` with `target_ids` empty - * whenever the entire stream reaches a new consistent snapshot. ADD, - * CURRENT, and RESET messages are guaranteed to (eventually) result in a - * new consistent snapshot (while NO_CHANGE and REMOVE messages are not). - * For a given stream, `read_time` is guaranteed to be monotonically - * increasing. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; - */ - protected $read_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $target_change_type - * The type of change that occurred. - * @type array|\Google\Protobuf\Internal\RepeatedField $target_ids - * The target IDs of targets that have changed. - * If empty, the change applies to all targets. - * The order of the target IDs is not defined. - * @type \Google\Rpc\Status $cause - * The error that resulted in this change, if applicable. - * @type string $resume_token - * A token that can be used to resume the stream for the given `target_ids`, - * or all targets if `target_ids` is empty. - * Not set on every target change. - * @type \Google\Protobuf\Timestamp $read_time - * The consistent `read_time` for the given `target_ids` (omitted when the - * target_ids are not at a consistent snapshot). - * The stream is guaranteed to send a `read_time` with `target_ids` empty - * whenever the entire stream reaches a new consistent snapshot. ADD, - * CURRENT, and RESET messages are guaranteed to (eventually) result in a - * new consistent snapshot (while NO_CHANGE and REMOVE messages are not). - * For a given stream, `read_time` is guaranteed to be monotonically - * increasing. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * The type of change that occurred. - * - * Generated from protobuf field .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; - * @return int - */ - public function getTargetChangeType() - { - return $this->target_change_type; - } - - /** - * The type of change that occurred. - * - * Generated from protobuf field .google.firestore.v1.TargetChange.TargetChangeType target_change_type = 1; - * @param int $var - * @return $this - */ - public function setTargetChangeType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\TargetChange\TargetChangeType::class); - $this->target_change_type = $var; - - return $this; - } - - /** - * The target IDs of targets that have changed. - * If empty, the change applies to all targets. - * The order of the target IDs is not defined. - * - * Generated from protobuf field repeated int32 target_ids = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTargetIds() - { - return $this->target_ids; - } - - /** - * The target IDs of targets that have changed. - * If empty, the change applies to all targets. - * The order of the target IDs is not defined. - * - * Generated from protobuf field repeated int32 target_ids = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTargetIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); - $this->target_ids = $arr; - - return $this; - } - - /** - * The error that resulted in this change, if applicable. - * - * Generated from protobuf field .google.rpc.Status cause = 3; - * @return \Google\Rpc\Status|null - */ - public function getCause() - { - return $this->cause; - } - - public function hasCause() - { - return isset($this->cause); - } - - public function clearCause() - { - unset($this->cause); - } - - /** - * The error that resulted in this change, if applicable. - * - * Generated from protobuf field .google.rpc.Status cause = 3; - * @param \Google\Rpc\Status $var - * @return $this - */ - public function setCause($var) - { - GPBUtil::checkMessage($var, \Google\Rpc\Status::class); - $this->cause = $var; - - return $this; - } - - /** - * A token that can be used to resume the stream for the given `target_ids`, - * or all targets if `target_ids` is empty. - * Not set on every target change. - * - * Generated from protobuf field bytes resume_token = 4; - * @return string - */ - public function getResumeToken() - { - return $this->resume_token; - } - - /** - * A token that can be used to resume the stream for the given `target_ids`, - * or all targets if `target_ids` is empty. - * Not set on every target change. - * - * Generated from protobuf field bytes resume_token = 4; - * @param string $var - * @return $this - */ - public function setResumeToken($var) - { - GPBUtil::checkString($var, False); - $this->resume_token = $var; - - return $this; - } - - /** - * The consistent `read_time` for the given `target_ids` (omitted when the - * target_ids are not at a consistent snapshot). - * The stream is guaranteed to send a `read_time` with `target_ids` empty - * whenever the entire stream reaches a new consistent snapshot. ADD, - * CURRENT, and RESET messages are guaranteed to (eventually) result in a - * new consistent snapshot (while NO_CHANGE and REMOVE messages are not). - * For a given stream, `read_time` is guaranteed to be monotonically - * increasing. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->read_time; - } - - public function hasReadTime() - { - return isset($this->read_time); - } - - public function clearReadTime() - { - unset($this->read_time); - } - - /** - * The consistent `read_time` for the given `target_ids` (omitted when the - * target_ids are not at a consistent snapshot). - * The stream is guaranteed to send a `read_time` with `target_ids` empty - * whenever the entire stream reaches a new consistent snapshot. ADD, - * CURRENT, and RESET messages are guaranteed to (eventually) result in a - * new consistent snapshot (while NO_CHANGE and REMOVE messages are not). - * For a given stream, `read_time` is guaranteed to be monotonically - * increasing. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->read_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange/TargetChangeType.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange/TargetChangeType.php deleted file mode 100644 index 23694a75db2e..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TargetChange/TargetChangeType.php +++ /dev/null @@ -1,86 +0,0 @@ -google.firestore.v1.TargetChange.TargetChangeType - */ -class TargetChangeType -{ - /** - * No change has occurred. Used only to send an updated `resume_token`. - * - * Generated from protobuf enum NO_CHANGE = 0; - */ - const NO_CHANGE = 0; - /** - * The targets have been added. - * - * Generated from protobuf enum ADD = 1; - */ - const ADD = 1; - /** - * The targets have been removed. - * - * Generated from protobuf enum REMOVE = 2; - */ - const REMOVE = 2; - /** - * The targets reflect all changes committed before the targets were added - * to the stream. - * This will be sent after or with a `read_time` that is greater than or - * equal to the time at which the targets were added. - * Listeners can wait for this change if read-after-write semantics - * are desired. - * - * Generated from protobuf enum CURRENT = 3; - */ - const CURRENT = 3; - /** - * The targets have been reset, and a new initial state for the targets - * will be returned in subsequent changes. - * After the initial state is complete, `CURRENT` will be returned even - * if the target was previously indicated to be `CURRENT`. - * - * Generated from protobuf enum RESET = 4; - */ - const RESET = 4; - - private static $valueToName = [ - self::NO_CHANGE => 'NO_CHANGE', - self::ADD => 'ADD', - self::REMOVE => 'REMOVE', - self::CURRENT => 'CURRENT', - self::RESET => 'RESET', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(TargetChangeType::class, \Google\Cloud\Firestore\V1\TargetChange_TargetChangeType::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions.php deleted file mode 100644 index 07498e58f517..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions.php +++ /dev/null @@ -1,108 +0,0 @@ -google.firestore.v1.TransactionOptions - */ -class TransactionOptions extends \Google\Protobuf\Internal\Message -{ - protected $mode; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\TransactionOptions\PBReadOnly $read_only - * The transaction can only be used for read operations. - * @type \Google\Cloud\Firestore\V1\TransactionOptions\ReadWrite $read_write - * The transaction can be used for both read and write operations. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Common::initOnce(); - parent::__construct($data); - } - - /** - * The transaction can only be used for read operations. - * - * Generated from protobuf field .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; - * @return \Google\Cloud\Firestore\V1\TransactionOptions\PBReadOnly|null - */ - public function getReadOnly() - { - return $this->readOneof(2); - } - - public function hasReadOnly() - { - return $this->hasOneof(2); - } - - /** - * The transaction can only be used for read operations. - * - * Generated from protobuf field .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2; - * @param \Google\Cloud\Firestore\V1\TransactionOptions\PBReadOnly $var - * @return $this - */ - public function setReadOnly($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TransactionOptions\PBReadOnly::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The transaction can be used for both read and write operations. - * - * Generated from protobuf field .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; - * @return \Google\Cloud\Firestore\V1\TransactionOptions\ReadWrite|null - */ - public function getReadWrite() - { - return $this->readOneof(3); - } - - public function hasReadWrite() - { - return $this->hasOneof(3); - } - - /** - * The transaction can be used for both read and write operations. - * - * Generated from protobuf field .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3; - * @param \Google\Cloud\Firestore\V1\TransactionOptions\ReadWrite $var - * @return $this - */ - public function setReadWrite($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\TransactionOptions\ReadWrite::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getMode() - { - return $this->whichOneof("mode"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/PBReadOnly.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/PBReadOnly.php deleted file mode 100644 index 7b55ad3ed4fb..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/PBReadOnly.php +++ /dev/null @@ -1,90 +0,0 @@ -google.firestore.v1.TransactionOptions.ReadOnly - */ -class PBReadOnly extends \Google\Protobuf\Internal\Message -{ - protected $consistency_selector; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $read_time - * Reads documents at the given time. - * This must be a microsecond precision timestamp within the past one - * hour, or if Point-in-Time Recovery is enabled, can additionally be a - * whole minute timestamp within the past 7 days. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Common::initOnce(); - parent::__construct($data); - } - - /** - * Reads documents at the given time. - * This must be a microsecond precision timestamp within the past one - * hour, or if Point-in-Time Recovery is enabled, can additionally be a - * whole minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->readOneof(2); - } - - public function hasReadTime() - { - return $this->hasOneof(2); - } - - /** - * Reads documents at the given time. - * This must be a microsecond precision timestamp within the past one - * hour, or if Point-in-Time Recovery is enabled, can additionally be a - * whole minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getConsistencySelector() - { - return $this->whichOneof("consistency_selector"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PBReadOnly::class, \Google\Cloud\Firestore\V1\TransactionOptions_ReadOnly::class); - -// Adding a class alias for backwards compatibility with the "readonly" keyword. -class_alias(PBReadOnly::class, __NAMESPACE__ . '\ReadOnly'); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/ReadOnly.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/ReadOnly.php deleted file mode 100644 index cb227a9fbefb..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/TransactionOptions/ReadOnly.php +++ /dev/null @@ -1,9 +0,0 @@ -google.firestore.v1.TransactionOptions.ReadWrite - */ -class ReadWrite extends \Google\Protobuf\Internal\Message -{ - /** - * An optional transaction to retry. - * - * Generated from protobuf field bytes retry_transaction = 1; - */ - protected $retry_transaction = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $retry_transaction - * An optional transaction to retry. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Common::initOnce(); - parent::__construct($data); - } - - /** - * An optional transaction to retry. - * - * Generated from protobuf field bytes retry_transaction = 1; - * @return string - */ - public function getRetryTransaction() - { - return $this->retry_transaction; - } - - /** - * An optional transaction to retry. - * - * Generated from protobuf field bytes retry_transaction = 1; - * @param string $var - * @return $this - */ - public function setRetryTransaction($var) - { - GPBUtil::checkString($var, False); - $this->retry_transaction = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReadWrite::class, \Google\Cloud\Firestore\V1\TransactionOptions_ReadWrite::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/UpdateDocumentRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/UpdateDocumentRequest.php deleted file mode 100644 index ddc9406eaba7..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/UpdateDocumentRequest.php +++ /dev/null @@ -1,268 +0,0 @@ -google.firestore.v1.UpdateDocumentRequest - */ -class UpdateDocumentRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The updated document. - * Creates the document if it does not already exist. - * - * Generated from protobuf field .google.firestore.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $document = null; - /** - * The fields to update. - * None of the field paths in the mask may contain a reserved name. - * If the document exists on the server and has fields not referenced in the - * mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask update_mask = 2; - */ - protected $update_mask = null; - /** - * The fields to return. If not set, returns all fields. - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 3; - */ - protected $mask = null; - /** - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * - * Generated from protobuf field .google.firestore.v1.Precondition current_document = 4; - */ - protected $current_document = null; - - /** - * @param \Google\Cloud\Firestore\V1\Document $document Required. The updated document. - * Creates the document if it does not already exist. - * @param \Google\Cloud\Firestore\V1\DocumentMask $updateMask The fields to update. - * None of the field paths in the mask may contain a reserved name. - * - * If the document exists on the server and has fields not referenced in the - * mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * - * @return \Google\Cloud\Firestore\V1\UpdateDocumentRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Firestore\V1\Document $document, \Google\Cloud\Firestore\V1\DocumentMask $updateMask): self - { - return (new self()) - ->setDocument($document) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\Document $document - * Required. The updated document. - * Creates the document if it does not already exist. - * @type \Google\Cloud\Firestore\V1\DocumentMask $update_mask - * The fields to update. - * None of the field paths in the mask may contain a reserved name. - * If the document exists on the server and has fields not referenced in the - * mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * @type \Google\Cloud\Firestore\V1\DocumentMask $mask - * The fields to return. If not set, returns all fields. - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * @type \Google\Cloud\Firestore\V1\Precondition $current_document - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The updated document. - * Creates the document if it does not already exist. - * - * Generated from protobuf field .google.firestore.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Firestore\V1\Document|null - */ - public function getDocument() - { - return $this->document; - } - - public function hasDocument() - { - return isset($this->document); - } - - public function clearDocument() - { - unset($this->document); - } - - /** - * Required. The updated document. - * Creates the document if it does not already exist. - * - * Generated from protobuf field .google.firestore.v1.Document document = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Firestore\V1\Document $var - * @return $this - */ - public function setDocument($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Document::class); - $this->document = $var; - - return $this; - } - - /** - * The fields to update. - * None of the field paths in the mask may contain a reserved name. - * If the document exists on the server and has fields not referenced in the - * mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask update_mask = 2; - * @return \Google\Cloud\Firestore\V1\DocumentMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * The fields to update. - * None of the field paths in the mask may contain a reserved name. - * If the document exists on the server and has fields not referenced in the - * mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask update_mask = 2; - * @param \Google\Cloud\Firestore\V1\DocumentMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * The fields to return. If not set, returns all fields. - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 3; - * @return \Google\Cloud\Firestore\V1\DocumentMask|null - */ - public function getMask() - { - return $this->mask; - } - - public function hasMask() - { - return isset($this->mask); - } - - public function clearMask() - { - unset($this->mask); - } - - /** - * The fields to return. If not set, returns all fields. - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask mask = 3; - * @param \Google\Cloud\Firestore\V1\DocumentMask $var - * @return $this - */ - public function setMask($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); - $this->mask = $var; - - return $this; - } - - /** - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * - * Generated from protobuf field .google.firestore.v1.Precondition current_document = 4; - * @return \Google\Cloud\Firestore\V1\Precondition|null - */ - public function getCurrentDocument() - { - return $this->current_document; - } - - public function hasCurrentDocument() - { - return isset($this->current_document); - } - - public function clearCurrentDocument() - { - unset($this->current_document); - } - - /** - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * - * Generated from protobuf field .google.firestore.v1.Precondition current_document = 4; - * @param \Google\Cloud\Firestore\V1\Precondition $var - * @return $this - */ - public function setCurrentDocument($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Precondition::class); - $this->current_document = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Value.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Value.php deleted file mode 100644 index de439f4118f4..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Value.php +++ /dev/null @@ -1,435 +0,0 @@ -google.firestore.v1.Value - */ -class Value extends \Google\Protobuf\Internal\Message -{ - protected $value_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $null_value - * A null value. - * @type bool $boolean_value - * A boolean value. - * @type int|string $integer_value - * An integer value. - * @type float $double_value - * A double value. - * @type \Google\Protobuf\Timestamp $timestamp_value - * A timestamp value. - * Precise only to microseconds. When stored, any additional precision is - * rounded down. - * @type string $string_value - * A string value. - * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. - * Only the first 1,500 bytes of the UTF-8 representation are considered by - * queries. - * @type string $bytes_value - * A bytes value. - * Must not exceed 1 MiB - 89 bytes. - * Only the first 1,500 bytes are considered by queries. - * @type string $reference_value - * A reference to a document. For example: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @type \Google\Type\LatLng $geo_point_value - * A geo point value representing a point on the surface of Earth. - * @type \Google\Cloud\Firestore\V1\ArrayValue $array_value - * An array value. - * Cannot directly contain another array value, though can contain an - * map which contains another array. - * @type \Google\Cloud\Firestore\V1\MapValue $map_value - * A map value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Document::initOnce(); - parent::__construct($data); - } - - /** - * A null value. - * - * Generated from protobuf field .google.protobuf.NullValue null_value = 11; - * @return int - */ - public function getNullValue() - { - return $this->readOneof(11); - } - - public function hasNullValue() - { - return $this->hasOneof(11); - } - - /** - * A null value. - * - * Generated from protobuf field .google.protobuf.NullValue null_value = 11; - * @param int $var - * @return $this - */ - public function setNullValue($var) - { - GPBUtil::checkEnum($var, \Google\Protobuf\NullValue::class); - $this->writeOneof(11, $var); - - return $this; - } - - /** - * A boolean value. - * - * Generated from protobuf field bool boolean_value = 1; - * @return bool - */ - public function getBooleanValue() - { - return $this->readOneof(1); - } - - public function hasBooleanValue() - { - return $this->hasOneof(1); - } - - /** - * A boolean value. - * - * Generated from protobuf field bool boolean_value = 1; - * @param bool $var - * @return $this - */ - public function setBooleanValue($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * An integer value. - * - * Generated from protobuf field int64 integer_value = 2; - * @return int|string - */ - public function getIntegerValue() - { - return $this->readOneof(2); - } - - public function hasIntegerValue() - { - return $this->hasOneof(2); - } - - /** - * An integer value. - * - * Generated from protobuf field int64 integer_value = 2; - * @param int|string $var - * @return $this - */ - public function setIntegerValue($var) - { - GPBUtil::checkInt64($var); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * A double value. - * - * Generated from protobuf field double double_value = 3; - * @return float - */ - public function getDoubleValue() - { - return $this->readOneof(3); - } - - public function hasDoubleValue() - { - return $this->hasOneof(3); - } - - /** - * A double value. - * - * Generated from protobuf field double double_value = 3; - * @param float $var - * @return $this - */ - public function setDoubleValue($var) - { - GPBUtil::checkDouble($var); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * A timestamp value. - * Precise only to microseconds. When stored, any additional precision is - * rounded down. - * - * Generated from protobuf field .google.protobuf.Timestamp timestamp_value = 10; - * @return \Google\Protobuf\Timestamp|null - */ - public function getTimestampValue() - { - return $this->readOneof(10); - } - - public function hasTimestampValue() - { - return $this->hasOneof(10); - } - - /** - * A timestamp value. - * Precise only to microseconds. When stored, any additional precision is - * rounded down. - * - * Generated from protobuf field .google.protobuf.Timestamp timestamp_value = 10; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setTimestampValue($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * A string value. - * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. - * Only the first 1,500 bytes of the UTF-8 representation are considered by - * queries. - * - * Generated from protobuf field string string_value = 17; - * @return string - */ - public function getStringValue() - { - return $this->readOneof(17); - } - - public function hasStringValue() - { - return $this->hasOneof(17); - } - - /** - * A string value. - * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. - * Only the first 1,500 bytes of the UTF-8 representation are considered by - * queries. - * - * Generated from protobuf field string string_value = 17; - * @param string $var - * @return $this - */ - public function setStringValue($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(17, $var); - - return $this; - } - - /** - * A bytes value. - * Must not exceed 1 MiB - 89 bytes. - * Only the first 1,500 bytes are considered by queries. - * - * Generated from protobuf field bytes bytes_value = 18; - * @return string - */ - public function getBytesValue() - { - return $this->readOneof(18); - } - - public function hasBytesValue() - { - return $this->hasOneof(18); - } - - /** - * A bytes value. - * Must not exceed 1 MiB - 89 bytes. - * Only the first 1,500 bytes are considered by queries. - * - * Generated from protobuf field bytes bytes_value = 18; - * @param string $var - * @return $this - */ - public function setBytesValue($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(18, $var); - - return $this; - } - - /** - * A reference to a document. For example: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string reference_value = 5; - * @return string - */ - public function getReferenceValue() - { - return $this->readOneof(5); - } - - public function hasReferenceValue() - { - return $this->hasOneof(5); - } - - /** - * A reference to a document. For example: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string reference_value = 5; - * @param string $var - * @return $this - */ - public function setReferenceValue($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * A geo point value representing a point on the surface of Earth. - * - * Generated from protobuf field .google.type.LatLng geo_point_value = 8; - * @return \Google\Type\LatLng|null - */ - public function getGeoPointValue() - { - return $this->readOneof(8); - } - - public function hasGeoPointValue() - { - return $this->hasOneof(8); - } - - /** - * A geo point value representing a point on the surface of Earth. - * - * Generated from protobuf field .google.type.LatLng geo_point_value = 8; - * @param \Google\Type\LatLng $var - * @return $this - */ - public function setGeoPointValue($var) - { - GPBUtil::checkMessage($var, \Google\Type\LatLng::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * An array value. - * Cannot directly contain another array value, though can contain an - * map which contains another array. - * - * Generated from protobuf field .google.firestore.v1.ArrayValue array_value = 9; - * @return \Google\Cloud\Firestore\V1\ArrayValue|null - */ - public function getArrayValue() - { - return $this->readOneof(9); - } - - public function hasArrayValue() - { - return $this->hasOneof(9); - } - - /** - * An array value. - * Cannot directly contain another array value, though can contain an - * map which contains another array. - * - * Generated from protobuf field .google.firestore.v1.ArrayValue array_value = 9; - * @param \Google\Cloud\Firestore\V1\ArrayValue $var - * @return $this - */ - public function setArrayValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ArrayValue::class); - $this->writeOneof(9, $var); - - return $this; - } - - /** - * A map value. - * - * Generated from protobuf field .google.firestore.v1.MapValue map_value = 6; - * @return \Google\Cloud\Firestore\V1\MapValue|null - */ - public function getMapValue() - { - return $this->readOneof(6); - } - - public function hasMapValue() - { - return $this->hasOneof(6); - } - - /** - * A map value. - * - * Generated from protobuf field .google.firestore.v1.MapValue map_value = 6; - * @param \Google\Cloud\Firestore\V1\MapValue $var - * @return $this - */ - public function setMapValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\MapValue::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * @return string - */ - public function getValueType() - { - return $this->whichOneof("value_type"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Write.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Write.php deleted file mode 100644 index 67920d9f8a1a..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/Write.php +++ /dev/null @@ -1,314 +0,0 @@ -google.firestore.v1.Write - */ -class Write extends \Google\Protobuf\Internal\Message -{ - /** - * The fields to update in this write. - * This field can be set only when the operation is `update`. - * If the mask is not set for an `update` and the document exists, any - * existing data will be overwritten. - * If the mask is set and the document on the server has fields not covered by - * the mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * The field paths in this mask must not contain a reserved field name. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask update_mask = 3; - */ - protected $update_mask = null; - /** - * The transforms to perform after update. - * This field can be set only when the operation is `update`. If present, this - * write is equivalent to performing `update` and `transform` to the same - * document atomically and in order. - * - * Generated from protobuf field repeated .google.firestore.v1.DocumentTransform.FieldTransform update_transforms = 7; - */ - private $update_transforms; - /** - * An optional precondition on the document. - * The write will fail if this is set and not met by the target document. - * - * Generated from protobuf field .google.firestore.v1.Precondition current_document = 4; - */ - protected $current_document = null; - protected $operation; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\Document $update - * A document to write. - * @type string $delete - * A document name to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @type \Google\Cloud\Firestore\V1\DocumentTransform $transform - * Applies a transformation to a document. - * @type \Google\Cloud\Firestore\V1\DocumentMask $update_mask - * The fields to update in this write. - * This field can be set only when the operation is `update`. - * If the mask is not set for an `update` and the document exists, any - * existing data will be overwritten. - * If the mask is set and the document on the server has fields not covered by - * the mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * The field paths in this mask must not contain a reserved field name. - * @type array<\Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform>|\Google\Protobuf\Internal\RepeatedField $update_transforms - * The transforms to perform after update. - * This field can be set only when the operation is `update`. If present, this - * write is equivalent to performing `update` and `transform` to the same - * document atomically and in order. - * @type \Google\Cloud\Firestore\V1\Precondition $current_document - * An optional precondition on the document. - * The write will fail if this is set and not met by the target document. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Write::initOnce(); - parent::__construct($data); - } - - /** - * A document to write. - * - * Generated from protobuf field .google.firestore.v1.Document update = 1; - * @return \Google\Cloud\Firestore\V1\Document|null - */ - public function getUpdate() - { - return $this->readOneof(1); - } - - public function hasUpdate() - { - return $this->hasOneof(1); - } - - /** - * A document to write. - * - * Generated from protobuf field .google.firestore.v1.Document update = 1; - * @param \Google\Cloud\Firestore\V1\Document $var - * @return $this - */ - public function setUpdate($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Document::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * A document name to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string delete = 2; - * @return string - */ - public function getDelete() - { - return $this->readOneof(2); - } - - public function hasDelete() - { - return $this->hasOneof(2); - } - - /** - * A document name to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * Generated from protobuf field string delete = 2; - * @param string $var - * @return $this - */ - public function setDelete($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Applies a transformation to a document. - * - * Generated from protobuf field .google.firestore.v1.DocumentTransform transform = 6; - * @return \Google\Cloud\Firestore\V1\DocumentTransform|null - */ - public function getTransform() - { - return $this->readOneof(6); - } - - public function hasTransform() - { - return $this->hasOneof(6); - } - - /** - * Applies a transformation to a document. - * - * Generated from protobuf field .google.firestore.v1.DocumentTransform transform = 6; - * @param \Google\Cloud\Firestore\V1\DocumentTransform $var - * @return $this - */ - public function setTransform($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentTransform::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * The fields to update in this write. - * This field can be set only when the operation is `update`. - * If the mask is not set for an `update` and the document exists, any - * existing data will be overwritten. - * If the mask is set and the document on the server has fields not covered by - * the mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * The field paths in this mask must not contain a reserved field name. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask update_mask = 3; - * @return \Google\Cloud\Firestore\V1\DocumentMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * The fields to update in this write. - * This field can be set only when the operation is `update`. - * If the mask is not set for an `update` and the document exists, any - * existing data will be overwritten. - * If the mask is set and the document on the server has fields not covered by - * the mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * The field paths in this mask must not contain a reserved field name. - * - * Generated from protobuf field .google.firestore.v1.DocumentMask update_mask = 3; - * @param \Google\Cloud\Firestore\V1\DocumentMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\DocumentMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * The transforms to perform after update. - * This field can be set only when the operation is `update`. If present, this - * write is equivalent to performing `update` and `transform` to the same - * document atomically and in order. - * - * Generated from protobuf field repeated .google.firestore.v1.DocumentTransform.FieldTransform update_transforms = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUpdateTransforms() - { - return $this->update_transforms; - } - - /** - * The transforms to perform after update. - * This field can be set only when the operation is `update`. If present, this - * write is equivalent to performing `update` and `transform` to the same - * document atomically and in order. - * - * Generated from protobuf field repeated .google.firestore.v1.DocumentTransform.FieldTransform update_transforms = 7; - * @param array<\Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setUpdateTransforms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\DocumentTransform\FieldTransform::class); - $this->update_transforms = $arr; - - return $this; - } - - /** - * An optional precondition on the document. - * The write will fail if this is set and not met by the target document. - * - * Generated from protobuf field .google.firestore.v1.Precondition current_document = 4; - * @return \Google\Cloud\Firestore\V1\Precondition|null - */ - public function getCurrentDocument() - { - return $this->current_document; - } - - public function hasCurrentDocument() - { - return isset($this->current_document); - } - - public function clearCurrentDocument() - { - unset($this->current_document); - } - - /** - * An optional precondition on the document. - * The write will fail if this is set and not met by the target document. - * - * Generated from protobuf field .google.firestore.v1.Precondition current_document = 4; - * @param \Google\Cloud\Firestore\V1\Precondition $var - * @return $this - */ - public function setCurrentDocument($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Precondition::class); - $this->current_document = $var; - - return $this; - } - - /** - * @return string - */ - public function getOperation() - { - return $this->whichOneof("operation"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteRequest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteRequest.php deleted file mode 100644 index 2bab538a188c..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteRequest.php +++ /dev/null @@ -1,277 +0,0 @@ -google.firestore.v1.WriteRequest - */ -class WriteRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * This is only required in the first message. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $database = ''; - /** - * The ID of the write stream to resume. - * This may only be set in the first message. When left empty, a new write - * stream will be created. - * - * Generated from protobuf field string stream_id = 2; - */ - protected $stream_id = ''; - /** - * The writes to apply. - * Always executed atomically and in order. - * This must be empty on the first request. - * This may be empty on the last request. - * This must not be empty on all other requests. - * - * Generated from protobuf field repeated .google.firestore.v1.Write writes = 3; - */ - private $writes; - /** - * A stream token that was previously sent by the server. - * The client should set this field to the token from the most recent - * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This - * acknowledges that the client has received responses up to this token. After - * sending this token, earlier tokens may not be used anymore. - * The server may close the stream if there are too many unacknowledged - * responses. - * Leave this field unset when creating a new stream. To resume a stream at - * a specific point, set this field and the `stream_id` field. - * Leave this field unset when creating a new stream. - * - * Generated from protobuf field bytes stream_token = 4; - */ - protected $stream_token = ''; - /** - * Labels associated with this write request. - * - * Generated from protobuf field map labels = 5; - */ - private $labels; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * This is only required in the first message. - * @type string $stream_id - * The ID of the write stream to resume. - * This may only be set in the first message. When left empty, a new write - * stream will be created. - * @type array<\Google\Cloud\Firestore\V1\Write>|\Google\Protobuf\Internal\RepeatedField $writes - * The writes to apply. - * Always executed atomically and in order. - * This must be empty on the first request. - * This may be empty on the last request. - * This must not be empty on all other requests. - * @type string $stream_token - * A stream token that was previously sent by the server. - * The client should set this field to the token from the most recent - * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This - * acknowledges that the client has received responses up to this token. After - * sending this token, earlier tokens may not be used anymore. - * The server may close the stream if there are too many unacknowledged - * responses. - * Leave this field unset when creating a new stream. To resume a stream at - * a specific point, set this field and the `stream_id` field. - * Leave this field unset when creating a new stream. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Labels associated with this write request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * This is only required in the first message. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getDatabase() - { - return $this->database; - } - - /** - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * This is only required in the first message. - * - * Generated from protobuf field string database = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkString($var, True); - $this->database = $var; - - return $this; - } - - /** - * The ID of the write stream to resume. - * This may only be set in the first message. When left empty, a new write - * stream will be created. - * - * Generated from protobuf field string stream_id = 2; - * @return string - */ - public function getStreamId() - { - return $this->stream_id; - } - - /** - * The ID of the write stream to resume. - * This may only be set in the first message. When left empty, a new write - * stream will be created. - * - * Generated from protobuf field string stream_id = 2; - * @param string $var - * @return $this - */ - public function setStreamId($var) - { - GPBUtil::checkString($var, True); - $this->stream_id = $var; - - return $this; - } - - /** - * The writes to apply. - * Always executed atomically and in order. - * This must be empty on the first request. - * This may be empty on the last request. - * This must not be empty on all other requests. - * - * Generated from protobuf field repeated .google.firestore.v1.Write writes = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWrites() - { - return $this->writes; - } - - /** - * The writes to apply. - * Always executed atomically and in order. - * This must be empty on the first request. - * This may be empty on the last request. - * This must not be empty on all other requests. - * - * Generated from protobuf field repeated .google.firestore.v1.Write writes = 3; - * @param array<\Google\Cloud\Firestore\V1\Write>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWrites($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Write::class); - $this->writes = $arr; - - return $this; - } - - /** - * A stream token that was previously sent by the server. - * The client should set this field to the token from the most recent - * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This - * acknowledges that the client has received responses up to this token. After - * sending this token, earlier tokens may not be used anymore. - * The server may close the stream if there are too many unacknowledged - * responses. - * Leave this field unset when creating a new stream. To resume a stream at - * a specific point, set this field and the `stream_id` field. - * Leave this field unset when creating a new stream. - * - * Generated from protobuf field bytes stream_token = 4; - * @return string - */ - public function getStreamToken() - { - return $this->stream_token; - } - - /** - * A stream token that was previously sent by the server. - * The client should set this field to the token from the most recent - * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This - * acknowledges that the client has received responses up to this token. After - * sending this token, earlier tokens may not be used anymore. - * The server may close the stream if there are too many unacknowledged - * responses. - * Leave this field unset when creating a new stream. To resume a stream at - * a specific point, set this field and the `stream_id` field. - * Leave this field unset when creating a new stream. - * - * Generated from protobuf field bytes stream_token = 4; - * @param string $var - * @return $this - */ - public function setStreamToken($var) - { - GPBUtil::checkString($var, False); - $this->stream_token = $var; - - return $this; - } - - /** - * Labels associated with this write request. - * - * Generated from protobuf field map labels = 5; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels associated with this write request. - * - * Generated from protobuf field map labels = 5; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResponse.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResponse.php deleted file mode 100644 index da2c8584a0fd..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResponse.php +++ /dev/null @@ -1,203 +0,0 @@ -google.firestore.v1.WriteResponse - */ -class WriteResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The ID of the stream. - * Only set on the first message, when a new stream was created. - * - * Generated from protobuf field string stream_id = 1; - */ - protected $stream_id = ''; - /** - * A token that represents the position of this response in the stream. - * This can be used by a client to resume the stream at this point. - * This field is always set. - * - * Generated from protobuf field bytes stream_token = 2; - */ - protected $stream_token = ''; - /** - * The result of applying the writes. - * This i-th write result corresponds to the i-th write in the - * request. - * - * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 3; - */ - private $write_results; - /** - * The time at which the commit occurred. Any read with an equal or greater - * `read_time` is guaranteed to see the effects of the write. - * - * Generated from protobuf field .google.protobuf.Timestamp commit_time = 4; - */ - protected $commit_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $stream_id - * The ID of the stream. - * Only set on the first message, when a new stream was created. - * @type string $stream_token - * A token that represents the position of this response in the stream. - * This can be used by a client to resume the stream at this point. - * This field is always set. - * @type array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $write_results - * The result of applying the writes. - * This i-th write result corresponds to the i-th write in the - * request. - * @type \Google\Protobuf\Timestamp $commit_time - * The time at which the commit occurred. Any read with an equal or greater - * `read_time` is guaranteed to see the effects of the write. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Firestore::initOnce(); - parent::__construct($data); - } - - /** - * The ID of the stream. - * Only set on the first message, when a new stream was created. - * - * Generated from protobuf field string stream_id = 1; - * @return string - */ - public function getStreamId() - { - return $this->stream_id; - } - - /** - * The ID of the stream. - * Only set on the first message, when a new stream was created. - * - * Generated from protobuf field string stream_id = 1; - * @param string $var - * @return $this - */ - public function setStreamId($var) - { - GPBUtil::checkString($var, True); - $this->stream_id = $var; - - return $this; - } - - /** - * A token that represents the position of this response in the stream. - * This can be used by a client to resume the stream at this point. - * This field is always set. - * - * Generated from protobuf field bytes stream_token = 2; - * @return string - */ - public function getStreamToken() - { - return $this->stream_token; - } - - /** - * A token that represents the position of this response in the stream. - * This can be used by a client to resume the stream at this point. - * This field is always set. - * - * Generated from protobuf field bytes stream_token = 2; - * @param string $var - * @return $this - */ - public function setStreamToken($var) - { - GPBUtil::checkString($var, False); - $this->stream_token = $var; - - return $this; - } - - /** - * The result of applying the writes. - * This i-th write result corresponds to the i-th write in the - * request. - * - * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWriteResults() - { - return $this->write_results; - } - - /** - * The result of applying the writes. - * This i-th write result corresponds to the i-th write in the - * request. - * - * Generated from protobuf field repeated .google.firestore.v1.WriteResult write_results = 3; - * @param array<\Google\Cloud\Firestore\V1\WriteResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWriteResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\WriteResult::class); - $this->write_results = $arr; - - return $this; - } - - /** - * The time at which the commit occurred. Any read with an equal or greater - * `read_time` is guaranteed to see the effects of the write. - * - * Generated from protobuf field .google.protobuf.Timestamp commit_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCommitTime() - { - return $this->commit_time; - } - - public function hasCommitTime() - { - return isset($this->commit_time); - } - - public function clearCommitTime() - { - unset($this->commit_time); - } - - /** - * The time at which the commit occurred. Any read with an equal or greater - * `read_time` is guaranteed to see the effects of the write. - * - * Generated from protobuf field .google.protobuf.Timestamp commit_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCommitTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->commit_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResult.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResult.php deleted file mode 100644 index f15058eb8a92..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/WriteResult.php +++ /dev/null @@ -1,131 +0,0 @@ -google.firestore.v1.WriteResult - */ -class WriteResult extends \Google\Protobuf\Internal\Message -{ - /** - * The last update time of the document after applying the write. Not set - * after a `delete`. - * If the write did not actually change the document, this will be the - * previous update_time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; - */ - protected $update_time = null; - /** - * The results of applying each - * [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], - * in the same order. - * - * Generated from protobuf field repeated .google.firestore.v1.Value transform_results = 2; - */ - private $transform_results; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $update_time - * The last update time of the document after applying the write. Not set - * after a `delete`. - * If the write did not actually change the document, this will be the - * previous update_time. - * @type array<\Google\Cloud\Firestore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $transform_results - * The results of applying each - * [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], - * in the same order. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Write::initOnce(); - parent::__construct($data); - } - - /** - * The last update time of the document after applying the write. Not set - * after a `delete`. - * If the write did not actually change the document, this will be the - * previous update_time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * The last update time of the document after applying the write. Not set - * after a `delete`. - * If the write did not actually change the document, this will be the - * previous update_time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * The results of applying each - * [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], - * in the same order. - * - * Generated from protobuf field repeated .google.firestore.v1.Value transform_results = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTransformResults() - { - return $this->transform_results; - } - - /** - * The results of applying each - * [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], - * in the same order. - * - * Generated from protobuf field repeated .google.firestore.v1.Value transform_results = 2; - * @param array<\Google\Cloud\Firestore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTransformResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\V1\Value::class); - $this->transform_results = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_get_documents.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_get_documents.php deleted file mode 100644 index 781b03696dc1..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_get_documents.php +++ /dev/null @@ -1,86 +0,0 @@ -setDatabase($database) - ->setDocuments($documents); - - // Call the API and handle any network failures. - try { - /** @var ServerStream $stream */ - $stream = $firestoreClient->batchGetDocuments($request); - - /** @var BatchGetDocumentsResponse $element */ - foreach ($stream->readAll() as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $database = '[DATABASE]'; - $documentsElement = '[DOCUMENTS]'; - - batch_get_documents_sample($database, $documentsElement); -} -// [END firestore_v1_generated_Firestore_BatchGetDocuments_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_write.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_write.php deleted file mode 100644 index a43ae1584ac0..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/batch_write.php +++ /dev/null @@ -1,66 +0,0 @@ -batchWrite($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END firestore_v1_generated_Firestore_BatchWrite_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/begin_transaction.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/begin_transaction.php deleted file mode 100644 index dc729abcdc4a..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/begin_transaction.php +++ /dev/null @@ -1,71 +0,0 @@ -setDatabase($database); - - // Call the API and handle any network failures. - try { - /** @var BeginTransactionResponse $response */ - $response = $firestoreClient->beginTransaction($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $database = '[DATABASE]'; - - begin_transaction_sample($database); -} -// [END firestore_v1_generated_Firestore_BeginTransaction_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/commit.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/commit.php deleted file mode 100644 index 08897b94984b..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/commit.php +++ /dev/null @@ -1,74 +0,0 @@ -setDatabase($database) - ->setWrites($writes); - - // Call the API and handle any network failures. - try { - /** @var CommitResponse $response */ - $response = $firestoreClient->commit($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $database = '[DATABASE]'; - - commit_sample($database); -} -// [END firestore_v1_generated_Firestore_Commit_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/create_document.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/create_document.php deleted file mode 100644 index 2a04cde30cef..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/create_document.php +++ /dev/null @@ -1,83 +0,0 @@ -setParent($parent) - ->setCollectionId($collectionId) - ->setDocumentId($documentId) - ->setDocument($document); - - // Call the API and handle any network failures. - try { - /** @var Document $response */ - $response = $firestoreClient->createDocument($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - $collectionId = '[COLLECTION_ID]'; - $documentId = '[DOCUMENT_ID]'; - - create_document_sample($parent, $collectionId, $documentId); -} -// [END firestore_v1_generated_Firestore_CreateDocument_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/delete_document.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/delete_document.php deleted file mode 100644 index db75cab94ac5..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/delete_document.php +++ /dev/null @@ -1,69 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - $firestoreClient->deleteDocument($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - delete_document_sample($name); -} -// [END firestore_v1_generated_Firestore_DeleteDocument_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/get_document.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/get_document.php deleted file mode 100644 index 787990595efd..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/get_document.php +++ /dev/null @@ -1,71 +0,0 @@ -setName($name); - - // Call the API and handle any network failures. - try { - /** @var Document $response */ - $response = $firestoreClient->getDocument($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - get_document_sample($name); -} -// [END firestore_v1_generated_Firestore_GetDocument_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_collection_ids.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_collection_ids.php deleted file mode 100644 index 92f6bd51fb17..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_collection_ids.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $firestoreClient->listCollectionIds($request); - - /** @var string $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - list_collection_ids_sample($parent); -} -// [END firestore_v1_generated_Firestore_ListCollectionIds_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_documents.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_documents.php deleted file mode 100644 index e0dd4b7e4568..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/list_documents.php +++ /dev/null @@ -1,89 +0,0 @@ -setParent($parent) - ->setCollectionId($collectionId); - - // Call the API and handle any network failures. - try { - /** @var PagedListResponse $response */ - $response = $firestoreClient->listDocuments($request); - - /** @var Document $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - $collectionId = '[COLLECTION_ID]'; - - list_documents_sample($parent, $collectionId); -} -// [END firestore_v1_generated_Firestore_ListDocuments_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/listen.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/listen.php deleted file mode 100644 index fb6754339467..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/listen.php +++ /dev/null @@ -1,78 +0,0 @@ -setDatabase($database); - - // Call the API and handle any network failures. - try { - /** @var BidiStream $stream */ - $stream = $firestoreClient->listen(); - $stream->writeAll([$request,]); - - /** @var ListenResponse $element */ - foreach ($stream->closeWriteAndReadAll() as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $database = '[DATABASE]'; - - listen_sample($database); -} -// [END firestore_v1_generated_Firestore_Listen_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/partition_query.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/partition_query.php deleted file mode 100644 index 6166c53e86e7..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/partition_query.php +++ /dev/null @@ -1,64 +0,0 @@ -partitionQuery($request); - - /** @var Cursor $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END firestore_v1_generated_Firestore_PartitionQuery_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/rollback.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/rollback.php deleted file mode 100644 index 45a9b5c8f2b5..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/rollback.php +++ /dev/null @@ -1,72 +0,0 @@ -setDatabase($database) - ->setTransaction($transaction); - - // Call the API and handle any network failures. - try { - $firestoreClient->rollback($request); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $database = '[DATABASE]'; - $transaction = '...'; - - rollback_sample($database, $transaction); -} -// [END firestore_v1_generated_Firestore_Rollback_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_aggregation_query.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_aggregation_query.php deleted file mode 100644 index 7d06d1816f7d..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_aggregation_query.php +++ /dev/null @@ -1,92 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var ServerStream $stream */ - $stream = $firestoreClient->runAggregationQuery($request); - - /** @var RunAggregationQueryResponse $element */ - foreach ($stream->readAll() as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - run_aggregation_query_sample($parent); -} -// [END firestore_v1_generated_Firestore_RunAggregationQuery_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_query.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_query.php deleted file mode 100644 index c4ebe1603da7..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/run_query.php +++ /dev/null @@ -1,80 +0,0 @@ -setParent($parent); - - // Call the API and handle any network failures. - try { - /** @var ServerStream $stream */ - $stream = $firestoreClient->runQuery($request); - - /** @var RunQueryResponse $element */ - foreach ($stream->readAll() as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $parent = '[PARENT]'; - - run_query_sample($parent); -} -// [END firestore_v1_generated_Firestore_RunQuery_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/update_document.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/update_document.php deleted file mode 100644 index 0200a86b0464..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/update_document.php +++ /dev/null @@ -1,62 +0,0 @@ -setDocument($document) - ->setUpdateMask($updateMask); - - // Call the API and handle any network failures. - try { - /** @var Document $response */ - $response = $firestoreClient->updateDocument($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END firestore_v1_generated_Firestore_UpdateDocument_sync] diff --git a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/write.php b/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/write.php deleted file mode 100644 index 19f9fba7d7dd..000000000000 --- a/owl-bot-staging/Firestore/v1/samples/V1/FirestoreClient/write.php +++ /dev/null @@ -1,79 +0,0 @@ -setDatabase($database); - - // Call the API and handle any network failures. - try { - /** @var BidiStream $stream */ - $stream = $firestoreClient->write(); - $stream->writeAll([$request,]); - - /** @var WriteResponse $element */ - foreach ($stream->closeWriteAndReadAll() as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $database = '[DATABASE]'; - - write_sample($database); -} -// [END firestore_v1_generated_Firestore_Write_sync] diff --git a/owl-bot-staging/Firestore/v1/src/V1/Client/FirestoreClient.php b/owl-bot-staging/Firestore/v1/src/V1/Client/FirestoreClient.php deleted file mode 100644 index cf0bb35375e2..000000000000 --- a/owl-bot-staging/Firestore/v1/src/V1/Client/FirestoreClient.php +++ /dev/null @@ -1,619 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/firestore_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/firestore_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/firestore_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/firestore_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'firestore.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Gets multiple documents. - * - * Documents returned by this method are not guaranteed to be returned in the - * same order that they were requested. - * - * @example samples/V1/FirestoreClient/batch_get_documents.php - * - * @param BatchGetDocumentsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return ServerStream - * - * @throws ApiException Thrown if the API call fails. - */ - public function batchGetDocuments(BatchGetDocumentsRequest $request, array $callOptions = []): ServerStream - { - return $this->startApiCall('BatchGetDocuments', $request, $callOptions); - } - - /** - * Applies a batch of write operations. - * - * The BatchWrite method does not apply the write operations atomically - * and can apply them out of order. Method does not allow more than one write - * per document. Each write succeeds or fails independently. See the - * [BatchWriteResponse][google.firestore.v1.BatchWriteResponse] for the - * success status of each write. - * - * If you require an atomically applied set of writes, use - * [Commit][google.firestore.v1.Firestore.Commit] instead. - * - * The async variant is {@see FirestoreClient::batchWriteAsync()} . - * - * @example samples/V1/FirestoreClient/batch_write.php - * - * @param BatchWriteRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return BatchWriteResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function batchWrite(BatchWriteRequest $request, array $callOptions = []): BatchWriteResponse - { - return $this->startApiCall('BatchWrite', $request, $callOptions)->wait(); - } - - /** - * Starts a new transaction. - * - * The async variant is {@see FirestoreClient::beginTransactionAsync()} . - * - * @example samples/V1/FirestoreClient/begin_transaction.php - * - * @param BeginTransactionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return BeginTransactionResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function beginTransaction(BeginTransactionRequest $request, array $callOptions = []): BeginTransactionResponse - { - return $this->startApiCall('BeginTransaction', $request, $callOptions)->wait(); - } - - /** - * Commits a transaction, while optionally updating documents. - * - * The async variant is {@see FirestoreClient::commitAsync()} . - * - * @example samples/V1/FirestoreClient/commit.php - * - * @param CommitRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return CommitResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function commit(CommitRequest $request, array $callOptions = []): CommitResponse - { - return $this->startApiCall('Commit', $request, $callOptions)->wait(); - } - - /** - * Creates a new document. - * - * The async variant is {@see FirestoreClient::createDocumentAsync()} . - * - * @example samples/V1/FirestoreClient/create_document.php - * - * @param CreateDocumentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Document - * - * @throws ApiException Thrown if the API call fails. - */ - public function createDocument(CreateDocumentRequest $request, array $callOptions = []): Document - { - return $this->startApiCall('CreateDocument', $request, $callOptions)->wait(); - } - - /** - * Deletes a document. - * - * The async variant is {@see FirestoreClient::deleteDocumentAsync()} . - * - * @example samples/V1/FirestoreClient/delete_document.php - * - * @param DeleteDocumentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteDocument(DeleteDocumentRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteDocument', $request, $callOptions)->wait(); - } - - /** - * Gets a single document. - * - * The async variant is {@see FirestoreClient::getDocumentAsync()} . - * - * @example samples/V1/FirestoreClient/get_document.php - * - * @param GetDocumentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Document - * - * @throws ApiException Thrown if the API call fails. - */ - public function getDocument(GetDocumentRequest $request, array $callOptions = []): Document - { - return $this->startApiCall('GetDocument', $request, $callOptions)->wait(); - } - - /** - * Lists all the collection IDs underneath a document. - * - * The async variant is {@see FirestoreClient::listCollectionIdsAsync()} . - * - * @example samples/V1/FirestoreClient/list_collection_ids.php - * - * @param ListCollectionIdsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listCollectionIds(ListCollectionIdsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListCollectionIds', $request, $callOptions); - } - - /** - * Lists documents. - * - * The async variant is {@see FirestoreClient::listDocumentsAsync()} . - * - * @example samples/V1/FirestoreClient/list_documents.php - * - * @param ListDocumentsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listDocuments(ListDocumentsRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListDocuments', $request, $callOptions); - } - - /** - * Listens to changes. This method is only available via gRPC or WebChannel - * (not REST). - * - * @example samples/V1/FirestoreClient/listen.php - * - * @param array $callOptions { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return BidiStream - * - * @throws ApiException Thrown if the API call fails. - */ - public function listen(array $callOptions = []): BidiStream - { - return $this->startApiCall('Listen', null, $callOptions); - } - - /** - * Partitions a query by returning partition cursors that can be used to run - * the query in parallel. The returned partition cursors are split points that - * can be used by RunQuery as starting/end points for the query results. - * - * The async variant is {@see FirestoreClient::partitionQueryAsync()} . - * - * @example samples/V1/FirestoreClient/partition_query.php - * - * @param PartitionQueryRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function partitionQuery(PartitionQueryRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('PartitionQuery', $request, $callOptions); - } - - /** - * Rolls back a transaction. - * - * The async variant is {@see FirestoreClient::rollbackAsync()} . - * - * @example samples/V1/FirestoreClient/rollback.php - * - * @param RollbackRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException Thrown if the API call fails. - */ - public function rollback(RollbackRequest $request, array $callOptions = []): void - { - $this->startApiCall('Rollback', $request, $callOptions)->wait(); - } - - /** - * Runs an aggregation query. - * - * Rather than producing [Document][google.firestore.v1.Document] results like - * [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery], this API - * allows running an aggregation to produce a series of - * [AggregationResult][google.firestore.v1.AggregationResult] server-side. - * - * High-Level Example: - * - * ``` - * -- Return the number of documents in table given a filter. - * SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); - * ``` - * - * @example samples/V1/FirestoreClient/run_aggregation_query.php - * - * @param RunAggregationQueryRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return ServerStream - * - * @throws ApiException Thrown if the API call fails. - */ - public function runAggregationQuery(RunAggregationQueryRequest $request, array $callOptions = []): ServerStream - { - return $this->startApiCall('RunAggregationQuery', $request, $callOptions); - } - - /** - * Runs a query. - * - * @example samples/V1/FirestoreClient/run_query.php - * - * @param RunQueryRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return ServerStream - * - * @throws ApiException Thrown if the API call fails. - */ - public function runQuery(RunQueryRequest $request, array $callOptions = []): ServerStream - { - return $this->startApiCall('RunQuery', $request, $callOptions); - } - - /** - * Updates or inserts a document. - * - * The async variant is {@see FirestoreClient::updateDocumentAsync()} . - * - * @example samples/V1/FirestoreClient/update_document.php - * - * @param UpdateDocumentRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return Document - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateDocument(UpdateDocumentRequest $request, array $callOptions = []): Document - { - return $this->startApiCall('UpdateDocument', $request, $callOptions)->wait(); - } - - /** - * Streams batches of document updates and deletes, in order. This method is - * only available via gRPC or WebChannel (not REST). - * - * @example samples/V1/FirestoreClient/write.php - * - * @param array $callOptions { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return BidiStream - * - * @throws ApiException Thrown if the API call fails. - */ - public function write(array $callOptions = []): BidiStream - { - return $this->startApiCall('Write', null, $callOptions); - } -} diff --git a/owl-bot-staging/Firestore/v1/src/V1/FirestoreClient.php b/owl-bot-staging/Firestore/v1/src/V1/FirestoreClient.php deleted file mode 100644 index da1c71ebe61d..000000000000 --- a/owl-bot-staging/Firestore/v1/src/V1/FirestoreClient.php +++ /dev/null @@ -1,34 +0,0 @@ -batchGetDocuments($database, $documents); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @deprecated Please use the new service client {@see \Google\Cloud\Firestore\V1\Client\FirestoreClient}. - */ -class FirestoreGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.firestore.v1.Firestore'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'firestore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'firestore.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/datastore', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/firestore_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/firestore_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/firestore_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/firestore_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'firestore.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Gets multiple documents. - * - * Documents returned by this method are not guaranteed to be returned in the - * same order that they were requested. - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $database = 'database'; - * $documents = []; - * // Read all responses until the stream is complete - * $stream = $firestoreClient->batchGetDocuments($database, $documents); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param string $database Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param string[] $documents The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of the - * given `database`. Duplicate names will be elided. - * @param array $optionalArgs { - * Optional. - * - * @type DocumentMask $mask - * The fields to return. If not set, returns all fields. - * - * If a document has a field that is not present in this mask, that field will - * not be returned in the response. - * @type string $transaction - * Reads documents in a transaction. - * @type TransactionOptions $newTransaction - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - * @type Timestamp $readTime - * Reads documents as they were at the given time. - * - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\ServerStream - * - * @throws ApiException if the remote call fails - */ - public function batchGetDocuments($database, $documents, array $optionalArgs = []) - { - $request = new BatchGetDocumentsRequest(); - $requestParamHeaders = []; - $request->setDatabase($database); - $request->setDocuments($documents); - $requestParamHeaders['database'] = $database; - if (isset($optionalArgs['mask'])) { - $request->setMask($optionalArgs['mask']); - } - - if (isset($optionalArgs['transaction'])) { - $request->setTransaction($optionalArgs['transaction']); - } - - if (isset($optionalArgs['newTransaction'])) { - $request->setNewTransaction($optionalArgs['newTransaction']); - } - - if (isset($optionalArgs['readTime'])) { - $request->setReadTime($optionalArgs['readTime']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('BatchGetDocuments', BatchGetDocumentsResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); - } - - /** - * Applies a batch of write operations. - * - * The BatchWrite method does not apply the write operations atomically - * and can apply them out of order. Method does not allow more than one write - * per document. Each write succeeds or fails independently. See the - * [BatchWriteResponse][google.firestore.v1.BatchWriteResponse] for the - * success status of each write. - * - * If you require an atomically applied set of writes, use - * [Commit][google.firestore.v1.Firestore.Commit] instead. - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $response = $firestoreClient->batchWrite(); - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $database - * Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @type Write[] $writes - * The writes to apply. - * - * Method does not apply writes atomically and does not guarantee ordering. - * Each write succeeds or fails independently. You cannot write to the same - * document more than once per request. - * @type array $labels - * Labels associated with this batch write. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Firestore\V1\BatchWriteResponse - * - * @throws ApiException if the remote call fails - */ - public function batchWrite(array $optionalArgs = []) - { - $request = new BatchWriteRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['database'])) { - $request->setDatabase($optionalArgs['database']); - $requestParamHeaders['database'] = $optionalArgs['database']; - } - - if (isset($optionalArgs['writes'])) { - $request->setWrites($optionalArgs['writes']); - } - - if (isset($optionalArgs['labels'])) { - $request->setLabels($optionalArgs['labels']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('BatchWrite', BatchWriteResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Starts a new transaction. - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $database = 'database'; - * $response = $firestoreClient->beginTransaction($database); - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param string $database Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type TransactionOptions $options - * The options for the transaction. - * Defaults to a read-write transaction. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Firestore\V1\BeginTransactionResponse - * - * @throws ApiException if the remote call fails - */ - public function beginTransaction($database, array $optionalArgs = []) - { - $request = new BeginTransactionRequest(); - $requestParamHeaders = []; - $request->setDatabase($database); - $requestParamHeaders['database'] = $database; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('BeginTransaction', BeginTransactionResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Commits a transaction, while optionally updating documents. - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $database = 'database'; - * $writes = []; - * $response = $firestoreClient->commit($database, $writes); - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param string $database Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param Write[] $writes The writes to apply. - * - * Always executed atomically and in order. - * @param array $optionalArgs { - * Optional. - * - * @type string $transaction - * If set, applies all writes in this transaction, and commits it. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Firestore\V1\CommitResponse - * - * @throws ApiException if the remote call fails - */ - public function commit($database, $writes, array $optionalArgs = []) - { - $request = new CommitRequest(); - $requestParamHeaders = []; - $request->setDatabase($database); - $request->setWrites($writes); - $requestParamHeaders['database'] = $database; - if (isset($optionalArgs['transaction'])) { - $request->setTransaction($optionalArgs['transaction']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('Commit', CommitResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a new document. - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $parent = 'parent'; - * $collectionId = 'collection_id'; - * $documentId = 'document_id'; - * $document = new Document(); - * $response = $firestoreClient->createDocument($parent, $collectionId, $documentId, $document); - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource. For example: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - * @param string $collectionId Required. The collection ID, relative to `parent`, to list. For example: - * `chatrooms`. - * @param string $documentId The client-assigned document ID to use for this document. - * - * Optional. If not specified, an ID will be assigned by the service. - * @param Document $document Required. The document to create. `name` must not be set. - * @param array $optionalArgs { - * Optional. - * - * @type DocumentMask $mask - * The fields to return. If not set, returns all fields. - * - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Firestore\V1\Document - * - * @throws ApiException if the remote call fails - */ - public function createDocument($parent, $collectionId, $documentId, $document, array $optionalArgs = []) - { - $request = new CreateDocumentRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setCollectionId($collectionId); - $request->setDocumentId($documentId); - $request->setDocument($document); - $requestParamHeaders['parent'] = $parent; - $requestParamHeaders['collection_id'] = $collectionId; - if (isset($optionalArgs['mask'])) { - $request->setMask($optionalArgs['mask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateDocument', Document::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a document. - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $name = 'name'; - * $firestoreClient->deleteDocument($name); - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Document to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @param array $optionalArgs { - * Optional. - * - * @type Precondition $currentDocument - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteDocument($name, array $optionalArgs = []) - { - $request = new DeleteDocumentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['currentDocument'])) { - $request->setCurrentDocument($optionalArgs['currentDocument']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteDocument', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets a single document. - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $name = 'name'; - * $response = $firestoreClient->getDocument($name); - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param string $name Required. The resource name of the Document to get. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @param array $optionalArgs { - * Optional. - * - * @type DocumentMask $mask - * The fields to return. If not set, returns all fields. - * - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * @type string $transaction - * Reads the document in a transaction. - * @type Timestamp $readTime - * Reads the version of the document at the given time. - * - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Firestore\V1\Document - * - * @throws ApiException if the remote call fails - */ - public function getDocument($name, array $optionalArgs = []) - { - $request = new GetDocumentRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['mask'])) { - $request->setMask($optionalArgs['mask']); - } - - if (isset($optionalArgs['transaction'])) { - $request->setTransaction($optionalArgs['transaction']); - } - - if (isset($optionalArgs['readTime'])) { - $request->setReadTime($optionalArgs['readTime']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetDocument', Document::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists all the collection IDs underneath a document. - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $parent = 'parent'; - * // Iterate over pages of elements - * $pagedResponse = $firestoreClient->listCollectionIds($parent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $firestoreClient->listCollectionIds($parent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type Timestamp $readTime - * Reads documents as they were at the given time. - * - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listCollectionIds($parent, array $optionalArgs = []) - { - $request = new ListCollectionIdsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['readTime'])) { - $request->setReadTime($optionalArgs['readTime']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListCollectionIds', $optionalArgs, ListCollectionIdsResponse::class, $request); - } - - /** - * Lists documents. - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $parent = 'parent'; - * $collectionId = 'collection_id'; - * // Iterate over pages of elements - * $pagedResponse = $firestoreClient->listDocuments($parent, $collectionId); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $firestoreClient->listDocuments($parent, $collectionId); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param string $collectionId Optional. The collection ID, relative to `parent`, to list. - * - * For example: `chatrooms` or `messages`. - * - * This is optional, and when not provided, Firestore will list documents - * from all collections under the provided `parent`. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * Optional. The optional ordering of the documents to return. - * - * For example: `priority desc, __name__ desc`. - * - * This mirrors the [`ORDER BY`][google.firestore.v1.StructuredQuery.order_by] - * used in Firestore queries but in a string representation. When absent, - * documents are ordered based on `__name__ ASC`. - * @type DocumentMask $mask - * Optional. The fields to return. If not set, returns all fields. - * - * If a document has a field that is not present in this mask, that field - * will not be returned in the response. - * @type string $transaction - * Perform the read as part of an already active transaction. - * @type Timestamp $readTime - * Perform the read at the provided time. - * - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * @type bool $showMissing - * If the list should show missing documents. - * - * A document is missing if it does not exist, but there are sub-documents - * nested underneath it. When true, such missing documents will be returned - * with a key but will not have fields, - * [`create_time`][google.firestore.v1.Document.create_time], or - * [`update_time`][google.firestore.v1.Document.update_time] set. - * - * Requests with `show_missing` may not specify `where` or `order_by`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listDocuments($parent, $collectionId, array $optionalArgs = []) - { - $request = new ListDocumentsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setCollectionId($collectionId); - $requestParamHeaders['parent'] = $parent; - $requestParamHeaders['collection_id'] = $collectionId; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - if (isset($optionalArgs['mask'])) { - $request->setMask($optionalArgs['mask']); - } - - if (isset($optionalArgs['transaction'])) { - $request->setTransaction($optionalArgs['transaction']); - } - - if (isset($optionalArgs['readTime'])) { - $request->setReadTime($optionalArgs['readTime']); - } - - if (isset($optionalArgs['showMissing'])) { - $request->setShowMissing($optionalArgs['showMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListDocuments', $optionalArgs, ListDocumentsResponse::class, $request); - } - - /** - * Listens to changes. This method is only available via gRPC or WebChannel - * (not REST). - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $database = 'database'; - * $request = new ListenRequest(); - * $request->setDatabase($database); - * // Write all requests to the server, then read all responses until the - * // stream is complete - * $requests = [ - * $request, - * ]; - * $stream = $firestoreClient->listen(); - * $stream->writeAll($requests); - * foreach ($stream->closeWriteAndReadAll() as $element) { - * // doSomethingWith($element); - * } - * // Alternatively: - * // Write requests individually, making read() calls if - * // required. Call closeWrite() once writes are complete, and read the - * // remaining responses from the server. - * $requests = [ - * $request, - * ]; - * $stream = $firestoreClient->listen(); - * foreach ($requests as $request) { - * $stream->write($request); - * // if required, read a single response from the stream - * $element = $stream->read(); - * // doSomethingWith($element) - * } - * $stream->closeWrite(); - * $element = $stream->read(); - * while (!is_null($element)) { - * // doSomethingWith($element) - * $element = $stream->read(); - * } - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\BidiStream - * - * @throws ApiException if the remote call fails - */ - public function listen(array $optionalArgs = []) - { - return $this->startCall('Listen', ListenResponse::class, $optionalArgs, null, Call::BIDI_STREAMING_CALL); - } - - /** - * Partitions a query by returning partition cursors that can be used to run - * the query in parallel. The returned partition cursors are split points that - * can be used by RunQuery as starting/end points for the query results. - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $firestoreClient->partitionQuery(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $firestoreClient->partitionQuery(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents`. - * Document resource names are not supported; only database resource names - * can be specified. - * @type StructuredQuery $structuredQuery - * A structured query. - * Query must specify collection with all descendants and be ordered by name - * ascending. Other filters, order bys, limits, offsets, and start/end - * cursors are not supported. - * @type int $partitionCount - * The desired maximum number of partition points. - * The partitions may be returned across multiple pages of results. - * The number must be positive. The actual number of partitions - * returned may be fewer. - * - * For example, this may be set to one fewer than the number of parallel - * queries to be run, or in running a data pipeline job, one fewer than the - * number of workers or compute instances available. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type Timestamp $readTime - * Reads documents as they were at the given time. - * - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function partitionQuery(array $optionalArgs = []) - { - $request = new PartitionQueryRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['parent'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['structuredQuery'])) { - $request->setStructuredQuery($optionalArgs['structuredQuery']); - } - - if (isset($optionalArgs['partitionCount'])) { - $request->setPartitionCount($optionalArgs['partitionCount']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['readTime'])) { - $request->setReadTime($optionalArgs['readTime']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('PartitionQuery', $optionalArgs, PartitionQueryResponse::class, $request); - } - - /** - * Rolls back a transaction. - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $database = 'database'; - * $transaction = '...'; - * $firestoreClient->rollback($database, $transaction); - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param string $database Required. The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * @param string $transaction Required. The transaction to roll back. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function rollback($database, $transaction, array $optionalArgs = []) - { - $request = new RollbackRequest(); - $requestParamHeaders = []; - $request->setDatabase($database); - $request->setTransaction($transaction); - $requestParamHeaders['database'] = $database; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('Rollback', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Runs an aggregation query. - * - * Rather than producing [Document][google.firestore.v1.Document] results like - * [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery], this API - * allows running an aggregation to produce a series of - * [AggregationResult][google.firestore.v1.AggregationResult] server-side. - * - * High-Level Example: - * - * ``` - * -- Return the number of documents in table given a filter. - * SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); - * ``` - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $parent = 'parent'; - * // Read all responses until the stream is complete - * $stream = $firestoreClient->runAggregationQuery($parent); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param array $optionalArgs { - * Optional. - * - * @type StructuredAggregationQuery $structuredAggregationQuery - * An aggregation query. - * @type string $transaction - * Run the aggregation within an already active transaction. - * - * The value here is the opaque transaction ID to execute the query in. - * @type TransactionOptions $newTransaction - * Starts a new transaction as part of the query, defaulting to read-only. - * - * The new transaction ID will be returned as the first response in the - * stream. - * @type Timestamp $readTime - * Executes the query at the given timestamp. - * - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\ServerStream - * - * @throws ApiException if the remote call fails - */ - public function runAggregationQuery($parent, array $optionalArgs = []) - { - $request = new RunAggregationQueryRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['structuredAggregationQuery'])) { - $request->setStructuredAggregationQuery($optionalArgs['structuredAggregationQuery']); - } - - if (isset($optionalArgs['transaction'])) { - $request->setTransaction($optionalArgs['transaction']); - } - - if (isset($optionalArgs['newTransaction'])) { - $request->setNewTransaction($optionalArgs['newTransaction']); - } - - if (isset($optionalArgs['readTime'])) { - $request->setReadTime($optionalArgs['readTime']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RunAggregationQuery', RunAggregationQueryResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); - } - - /** - * Runs a query. - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $parent = 'parent'; - * // Read all responses until the stream is complete - * $stream = $firestoreClient->runQuery($parent); - * foreach ($stream->readAll() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param array $optionalArgs { - * Optional. - * - * @type StructuredQuery $structuredQuery - * A structured query. - * @type string $transaction - * Run the query within an already active transaction. - * - * The value here is the opaque transaction ID to execute the query in. - * @type TransactionOptions $newTransaction - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - * @type Timestamp $readTime - * Reads documents as they were at the given time. - * - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\ServerStream - * - * @throws ApiException if the remote call fails - */ - public function runQuery($parent, array $optionalArgs = []) - { - $request = new RunQueryRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['structuredQuery'])) { - $request->setStructuredQuery($optionalArgs['structuredQuery']); - } - - if (isset($optionalArgs['transaction'])) { - $request->setTransaction($optionalArgs['transaction']); - } - - if (isset($optionalArgs['newTransaction'])) { - $request->setNewTransaction($optionalArgs['newTransaction']); - } - - if (isset($optionalArgs['readTime'])) { - $request->setReadTime($optionalArgs['readTime']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RunQuery', RunQueryResponse::class, $optionalArgs, $request, Call::SERVER_STREAMING_CALL); - } - - /** - * Updates or inserts a document. - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $document = new Document(); - * $updateMask = new DocumentMask(); - * $response = $firestoreClient->updateDocument($document, $updateMask); - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param Document $document Required. The updated document. - * Creates the document if it does not already exist. - * @param DocumentMask $updateMask The fields to update. - * None of the field paths in the mask may contain a reserved name. - * - * If the document exists on the server and has fields not referenced in the - * mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * @param array $optionalArgs { - * Optional. - * - * @type DocumentMask $mask - * The fields to return. If not set, returns all fields. - * - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - * @type Precondition $currentDocument - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Firestore\V1\Document - * - * @throws ApiException if the remote call fails - */ - public function updateDocument($document, $updateMask, array $optionalArgs = []) - { - $request = new UpdateDocumentRequest(); - $requestParamHeaders = []; - $request->setDocument($document); - $request->setUpdateMask($updateMask); - $requestParamHeaders['document.name'] = $document->getName(); - if (isset($optionalArgs['mask'])) { - $request->setMask($optionalArgs['mask']); - } - - if (isset($optionalArgs['currentDocument'])) { - $request->setCurrentDocument($optionalArgs['currentDocument']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateDocument', Document::class, $optionalArgs, $request)->wait(); - } - - /** - * Streams batches of document updates and deletes, in order. This method is - * only available via gRPC or WebChannel (not REST). - * - * Sample code: - * ``` - * $firestoreClient = new FirestoreClient(); - * try { - * $database = 'database'; - * $request = new WriteRequest(); - * $request->setDatabase($database); - * // Write all requests to the server, then read all responses until the - * // stream is complete - * $requests = [ - * $request, - * ]; - * $stream = $firestoreClient->write(); - * $stream->writeAll($requests); - * foreach ($stream->closeWriteAndReadAll() as $element) { - * // doSomethingWith($element); - * } - * // Alternatively: - * // Write requests individually, making read() calls if - * // required. Call closeWrite() once writes are complete, and read the - * // remaining responses from the server. - * $requests = [ - * $request, - * ]; - * $stream = $firestoreClient->write(); - * foreach ($requests as $request) { - * $stream->write($request); - * // if required, read a single response from the stream - * $element = $stream->read(); - * // doSomethingWith($element) - * } - * $stream->closeWrite(); - * $element = $stream->read(); - * while (!is_null($element)) { - * // doSomethingWith($element) - * $element = $stream->read(); - * } - * } finally { - * $firestoreClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type int $timeoutMillis - * Timeout to use for this call. - * } - * - * @return \Google\ApiCore\BidiStream - * - * @throws ApiException if the remote call fails - */ - public function write(array $optionalArgs = []) - { - return $this->startCall('Write', WriteResponse::class, $optionalArgs, null, Call::BIDI_STREAMING_CALL); - } -} diff --git a/owl-bot-staging/Firestore/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Firestore/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 16969eb8ec78..000000000000 --- a/owl-bot-staging/Firestore/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.firestore.v1", - "libraryPackage": "Google\\Cloud\\Firestore\\V1", - "services": { - "Firestore": { - "clients": { - "grpc": { - "libraryClient": "FirestoreGapicClient", - "rpcs": { - "BatchGetDocuments": { - "methods": [ - "batchGetDocuments" - ] - }, - "BatchWrite": { - "methods": [ - "batchWrite" - ] - }, - "BeginTransaction": { - "methods": [ - "beginTransaction" - ] - }, - "Commit": { - "methods": [ - "commit" - ] - }, - "CreateDocument": { - "methods": [ - "createDocument" - ] - }, - "DeleteDocument": { - "methods": [ - "deleteDocument" - ] - }, - "GetDocument": { - "methods": [ - "getDocument" - ] - }, - "ListCollectionIds": { - "methods": [ - "listCollectionIds" - ] - }, - "ListDocuments": { - "methods": [ - "listDocuments" - ] - }, - "Listen": { - "methods": [ - "listen" - ] - }, - "PartitionQuery": { - "methods": [ - "partitionQuery" - ] - }, - "Rollback": { - "methods": [ - "rollback" - ] - }, - "RunAggregationQuery": { - "methods": [ - "runAggregationQuery" - ] - }, - "RunQuery": { - "methods": [ - "runQuery" - ] - }, - "UpdateDocument": { - "methods": [ - "updateDocument" - ] - }, - "Write": { - "methods": [ - "write" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_client_config.json b/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_client_config.json deleted file mode 100644 index 0fb2c36f7df8..000000000000 --- a/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_client_config.json +++ /dev/null @@ -1,174 +0,0 @@ -{ - "interfaces": { - "google.firestore.v1.Firestore": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "RESOURCE_EXHAUSTED", - "UNAVAILABLE" - ], - "retry_policy_2_codes": [ - "RESOURCE_EXHAUSTED", - "UNAVAILABLE", - "INTERNAL", - "DEADLINE_EXCEEDED" - ], - "retry_policy_3_codes": [ - "RESOURCE_EXHAUSTED", - "UNAVAILABLE", - "INTERNAL", - "DEADLINE_EXCEEDED" - ], - "no_retry_1_codes": [], - "retry_policy_4_codes": [ - "RESOURCE_EXHAUSTED", - "UNAVAILABLE", - "INTERNAL", - "DEADLINE_EXCEEDED" - ], - "retry_policy_5_codes": [ - "RESOURCE_EXHAUSTED", - "UNAVAILABLE", - "ABORTED" - ] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "retry_policy_2_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 300000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 300000, - "total_timeout_millis": 300000 - }, - "retry_policy_3_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 86400000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 86400000, - "total_timeout_millis": 86400000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 86400000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 86400000, - "total_timeout_millis": 86400000 - }, - "retry_policy_4_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "retry_policy_5_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - } - }, - "methods": { - "BatchGetDocuments": { - "timeout_millis": 300000 - }, - "BatchWrite": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_5_codes", - "retry_params_name": "retry_policy_5_params" - }, - "BeginTransaction": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "Commit": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "CreateDocument": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteDocument": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "GetDocument": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "ListCollectionIds": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "ListDocuments": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "Listen": { - "timeout_millis": 86400000 - }, - "PartitionQuery": { - "timeout_millis": 300000, - "retry_codes_name": "retry_policy_2_codes", - "retry_params_name": "retry_policy_2_params" - }, - "Rollback": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_4_codes", - "retry_params_name": "retry_policy_4_params" - }, - "RunAggregationQuery": { - "timeout_millis": 300000 - }, - "RunQuery": { - "timeout_millis": 300000 - }, - "UpdateDocument": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "Write": { - "timeout_millis": 86400000 - } - } - } - } -} diff --git a/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_descriptor_config.php b/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_descriptor_config.php deleted file mode 100644 index 7d2b1c57c94f..000000000000 --- a/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_descriptor_config.php +++ /dev/null @@ -1,252 +0,0 @@ - [ - 'google.firestore.v1.Firestore' => [ - 'BatchGetDocuments' => [ - 'grpcStreaming' => [ - 'grpcStreamingType' => 'ServerStreaming', - ], - 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\BatchGetDocumentsResponse', - 'headerParams' => [ - [ - 'keyName' => 'database', - 'fieldAccessors' => [ - 'getDatabase', - ], - ], - ], - ], - 'BatchWrite' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\BatchWriteResponse', - 'headerParams' => [ - [ - 'keyName' => 'database', - 'fieldAccessors' => [ - 'getDatabase', - ], - ], - ], - ], - 'BeginTransaction' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\BeginTransactionResponse', - 'headerParams' => [ - [ - 'keyName' => 'database', - 'fieldAccessors' => [ - 'getDatabase', - ], - ], - ], - ], - 'Commit' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\CommitResponse', - 'headerParams' => [ - [ - 'keyName' => 'database', - 'fieldAccessors' => [ - 'getDatabase', - ], - ], - ], - ], - 'CreateDocument' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\Document', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - [ - 'keyName' => 'collection_id', - 'fieldAccessors' => [ - 'getCollectionId', - ], - ], - ], - ], - 'DeleteDocument' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetDocument' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\Document', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'ListCollectionIds' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getCollectionIds', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\ListCollectionIdsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListDocuments' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getDocuments', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\ListDocumentsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - [ - 'keyName' => 'collection_id', - 'fieldAccessors' => [ - 'getCollectionId', - ], - ], - ], - ], - 'Listen' => [ - 'grpcStreaming' => [ - 'grpcStreamingType' => 'BidiStreaming', - ], - 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\ListenResponse', - 'headerParams' => [ - [ - 'keyName' => 'database', - 'fieldAccessors' => [ - 'getDatabase', - ], - ], - ], - ], - 'PartitionQuery' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getPartitions', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\PartitionQueryResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'Rollback' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'database', - 'fieldAccessors' => [ - 'getDatabase', - ], - ], - ], - ], - 'RunAggregationQuery' => [ - 'grpcStreaming' => [ - 'grpcStreamingType' => 'ServerStreaming', - ], - 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\RunAggregationQueryResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'RunQuery' => [ - 'grpcStreaming' => [ - 'grpcStreamingType' => 'ServerStreaming', - ], - 'callType' => \Google\ApiCore\Call::SERVER_STREAMING_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\RunQueryResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateDocument' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\Document', - 'headerParams' => [ - [ - 'keyName' => 'document.name', - 'fieldAccessors' => [ - 'getDocument', - 'getName', - ], - ], - ], - ], - 'Write' => [ - 'grpcStreaming' => [ - 'grpcStreamingType' => 'BidiStreaming', - ], - 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, - 'responseType' => 'Google\Cloud\Firestore\V1\WriteResponse', - 'headerParams' => [ - [ - 'keyName' => 'database', - 'fieldAccessors' => [ - 'getDatabase', - ], - ], - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_rest_client_config.php b/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_rest_client_config.php deleted file mode 100644 index 984cef14a450..000000000000 --- a/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_rest_client_config.php +++ /dev/null @@ -1,272 +0,0 @@ - [ - 'google.firestore.v1.Firestore' => [ - 'BatchGetDocuments' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{database=projects/*/databases/*}/documents:batchGet', - 'body' => '*', - 'placeholders' => [ - 'database' => [ - 'getters' => [ - 'getDatabase', - ], - ], - ], - ], - 'BatchWrite' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{database=projects/*/databases/*}/documents:batchWrite', - 'body' => '*', - 'placeholders' => [ - 'database' => [ - 'getters' => [ - 'getDatabase', - ], - ], - ], - ], - 'BeginTransaction' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{database=projects/*/databases/*}/documents:beginTransaction', - 'body' => '*', - 'placeholders' => [ - 'database' => [ - 'getters' => [ - 'getDatabase', - ], - ], - ], - ], - 'Commit' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{database=projects/*/databases/*}/documents:commit', - 'body' => '*', - 'placeholders' => [ - 'database' => [ - 'getters' => [ - 'getDatabase', - ], - ], - ], - ], - 'CreateDocument' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents/**}/{collection_id}', - 'body' => 'document', - 'placeholders' => [ - 'collection_id' => [ - 'getters' => [ - 'getCollectionId', - ], - ], - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'document_id', - ], - ], - 'DeleteDocument' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/databases/*/documents/*/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetDocument' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/databases/*/documents/*/**}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListCollectionIds' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents}:listCollectionIds', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents/*/**}:listCollectionIds', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListDocuments' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents}/{collection_id}', - ], - ], - 'placeholders' => [ - 'collection_id' => [ - 'getters' => [ - 'getCollectionId', - ], - ], - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'PartitionQuery' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents}:partitionQuery', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents/*/**}:partitionQuery', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'Rollback' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{database=projects/*/databases/*}/documents:rollback', - 'body' => '*', - 'placeholders' => [ - 'database' => [ - 'getters' => [ - 'getDatabase', - ], - ], - ], - ], - 'RunAggregationQuery' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents}:runAggregationQuery', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents/*/**}:runAggregationQuery', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'RunQuery' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents}:runQuery', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*/documents/*/**}:runQuery', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateDocument' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{document.name=projects/*/databases/*/documents/*/**}', - 'body' => 'document', - 'placeholders' => [ - 'document.name' => [ - 'getters' => [ - 'getDocument', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'update_mask', - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/databases/*/operations/*}:cancel', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/databases/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/databases/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/databases/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Firestore/v1/tests/Unit/V1/Client/FirestoreClientTest.php b/owl-bot-staging/Firestore/v1/tests/Unit/V1/Client/FirestoreClientTest.php deleted file mode 100644 index e071d92d5b47..000000000000 --- a/owl-bot-staging/Firestore/v1/tests/Unit/V1/Client/FirestoreClientTest.php +++ /dev/null @@ -1,1323 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return FirestoreClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new FirestoreClient($options); - } - - /** @test */ - public function batchGetDocumentsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $missing = 'missing1069449574'; - $transaction2 = '17'; - $expectedResponse = new BatchGetDocumentsResponse(); - $expectedResponse->setMissing($missing); - $expectedResponse->setTransaction($transaction2); - $transport->addResponse($expectedResponse); - $missing2 = 'missing21243859865'; - $transaction3 = '18'; - $expectedResponse2 = new BatchGetDocumentsResponse(); - $expectedResponse2->setMissing($missing2); - $expectedResponse2->setTransaction($transaction3); - $transport->addResponse($expectedResponse2); - $missing3 = 'missing31243859866'; - $transaction4 = '19'; - $expectedResponse3 = new BatchGetDocumentsResponse(); - $expectedResponse3->setMissing($missing3); - $expectedResponse3->setTransaction($transaction4); - $transport->addResponse($expectedResponse3); - // Mock request - $database = 'database1789464955'; - $documents = []; - $request = (new BatchGetDocumentsRequest()) - ->setDatabase($database) - ->setDocuments($documents); - $serverStream = $gapicClient->batchGetDocuments($request); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/BatchGetDocuments', $actualFuncCall); - $actualValue = $actualRequestObject->getDatabase(); - $this->assertProtobufEquals($database, $actualValue); - $actualValue = $actualRequestObject->getDocuments(); - $this->assertProtobufEquals($documents, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchGetDocumentsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $database = 'database1789464955'; - $documents = []; - $request = (new BatchGetDocumentsRequest()) - ->setDatabase($database) - ->setDocuments($documents); - $serverStream = $gapicClient->batchGetDocuments($request); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchWriteTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new BatchWriteResponse(); - $transport->addResponse($expectedResponse); - $request = new BatchWriteRequest(); - $response = $gapicClient->batchWrite($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/BatchWrite', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchWriteExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new BatchWriteRequest(); - try { - $gapicClient->batchWrite($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function beginTransactionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction = '-34'; - $expectedResponse = new BeginTransactionResponse(); - $expectedResponse->setTransaction($transaction); - $transport->addResponse($expectedResponse); - // Mock request - $database = 'database1789464955'; - $request = (new BeginTransactionRequest()) - ->setDatabase($database); - $response = $gapicClient->beginTransaction($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/BeginTransaction', $actualFuncCall); - $actualValue = $actualRequestObject->getDatabase(); - $this->assertProtobufEquals($database, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function beginTransactionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $database = 'database1789464955'; - $request = (new BeginTransactionRequest()) - ->setDatabase($database); - try { - $gapicClient->beginTransaction($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function commitTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new CommitResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $database = 'database1789464955'; - $writes = []; - $request = (new CommitRequest()) - ->setDatabase($database) - ->setWrites($writes); - $response = $gapicClient->commit($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/Commit', $actualFuncCall); - $actualValue = $actualRequestObject->getDatabase(); - $this->assertProtobufEquals($database, $actualValue); - $actualValue = $actualRequestObject->getWrites(); - $this->assertProtobufEquals($writes, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function commitExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $database = 'database1789464955'; - $writes = []; - $request = (new CommitRequest()) - ->setDatabase($database) - ->setWrites($writes); - try { - $gapicClient->commit($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createDocumentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Document(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $collectionId = 'collectionId-821242276'; - $documentId = 'documentId506676927'; - $document = new Document(); - $request = (new CreateDocumentRequest()) - ->setParent($parent) - ->setCollectionId($collectionId) - ->setDocumentId($documentId) - ->setDocument($document); - $response = $gapicClient->createDocument($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/CreateDocument', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getCollectionId(); - $this->assertProtobufEquals($collectionId, $actualValue); - $actualValue = $actualRequestObject->getDocumentId(); - $this->assertProtobufEquals($documentId, $actualValue); - $actualValue = $actualRequestObject->getDocument(); - $this->assertProtobufEquals($document, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createDocumentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $collectionId = 'collectionId-821242276'; - $documentId = 'documentId506676927'; - $document = new Document(); - $request = (new CreateDocumentRequest()) - ->setParent($parent) - ->setCollectionId($collectionId) - ->setDocumentId($documentId) - ->setDocument($document); - try { - $gapicClient->createDocument($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteDocumentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $request = (new DeleteDocumentRequest()) - ->setName($name); - $gapicClient->deleteDocument($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/DeleteDocument', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteDocumentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $request = (new DeleteDocumentRequest()) - ->setName($name); - try { - $gapicClient->deleteDocument($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDocumentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Document(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $request = (new GetDocumentRequest()) - ->setName($name); - $response = $gapicClient->getDocument($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/GetDocument', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDocumentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - $request = (new GetDocumentRequest()) - ->setName($name); - try { - $gapicClient->getDocument($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCollectionIdsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $collectionIdsElement = 'collectionIdsElement1368994900'; - $collectionIds = [ - $collectionIdsElement, - ]; - $expectedResponse = new ListCollectionIdsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCollectionIds($collectionIds); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $request = (new ListCollectionIdsRequest()) - ->setParent($parent); - $response = $gapicClient->listCollectionIds($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCollectionIds()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/ListCollectionIds', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCollectionIdsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $request = (new ListCollectionIdsRequest()) - ->setParent($parent); - try { - $gapicClient->listCollectionIds($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDocumentsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $documentsElement = new Document(); - $documents = [ - $documentsElement, - ]; - $expectedResponse = new ListDocumentsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDocuments($documents); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $collectionId = 'collectionId-821242276'; - $request = (new ListDocumentsRequest()) - ->setParent($parent) - ->setCollectionId($collectionId); - $response = $gapicClient->listDocuments($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDocuments()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/ListDocuments', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getCollectionId(); - $this->assertProtobufEquals($collectionId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDocumentsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $collectionId = 'collectionId-821242276'; - $request = (new ListDocumentsRequest()) - ->setParent($parent) - ->setCollectionId($collectionId); - try { - $gapicClient->listDocuments($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listenTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListenResponse(); - $transport->addResponse($expectedResponse); - $expectedResponse2 = new ListenResponse(); - $transport->addResponse($expectedResponse2); - $expectedResponse3 = new ListenResponse(); - $transport->addResponse($expectedResponse3); - // Mock request - $database = 'database1789464955'; - $request = new ListenRequest(); - $request->setDatabase($database); - $database2 = 'database21688906350'; - $request2 = new ListenRequest(); - $request2->setDatabase($database2); - $database3 = 'database31688906351'; - $request3 = new ListenRequest(); - $request3->setDatabase($database3); - $bidi = $gapicClient->listen(); - $this->assertInstanceOf(BidiStream::class, $bidi); - $bidi->write($request); - $responses = []; - $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); - foreach ($bidi->closeWriteAndReadAll() as $response) { - $responses[] = $response; - } - - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $createStreamRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($createStreamRequests)); - $streamFuncCall = $createStreamRequests[0]->getFuncCall(); - $streamRequestObject = $createStreamRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/Listen', $streamFuncCall); - $this->assertNull($streamRequestObject); - $callObjects = $transport->popCallObjects(); - $this->assertSame(1, count($callObjects)); - $bidiCall = $callObjects[0]; - $writeRequests = $bidiCall->popReceivedCalls(); - $expectedRequests = []; - $expectedRequests[] = $request; - $expectedRequests[] = $request2; - $expectedRequests[] = $request3; - $this->assertEquals($expectedRequests, $writeRequests); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listenExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - $bidi = $gapicClient->listen(); - $results = $bidi->closeWriteAndReadAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function partitionQueryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $partitionsElement = new Cursor(); - $partitions = [ - $partitionsElement, - ]; - $expectedResponse = new PartitionQueryResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setPartitions($partitions); - $transport->addResponse($expectedResponse); - $request = new PartitionQueryRequest(); - $response = $gapicClient->partitionQuery($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getPartitions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/PartitionQuery', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function partitionQueryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - $request = new PartitionQueryRequest(); - try { - $gapicClient->partitionQuery($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rollbackTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $database = 'database1789464955'; - $transaction = '-34'; - $request = (new RollbackRequest()) - ->setDatabase($database) - ->setTransaction($transaction); - $gapicClient->rollback($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/Rollback', $actualFuncCall); - $actualValue = $actualRequestObject->getDatabase(); - $this->assertProtobufEquals($database, $actualValue); - $actualValue = $actualRequestObject->getTransaction(); - $this->assertProtobufEquals($transaction, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rollbackExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $database = 'database1789464955'; - $transaction = '-34'; - $request = (new RollbackRequest()) - ->setDatabase($database) - ->setTransaction($transaction); - try { - $gapicClient->rollback($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runAggregationQueryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction2 = '17'; - $expectedResponse = new RunAggregationQueryResponse(); - $expectedResponse->setTransaction($transaction2); - $transport->addResponse($expectedResponse); - $transaction3 = '18'; - $expectedResponse2 = new RunAggregationQueryResponse(); - $expectedResponse2->setTransaction($transaction3); - $transport->addResponse($expectedResponse2); - $transaction4 = '19'; - $expectedResponse3 = new RunAggregationQueryResponse(); - $expectedResponse3->setTransaction($transaction4); - $transport->addResponse($expectedResponse3); - // Mock request - $parent = 'parent-995424086'; - $request = (new RunAggregationQueryRequest()) - ->setParent($parent); - $serverStream = $gapicClient->runAggregationQuery($request); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/RunAggregationQuery', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runAggregationQueryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $parent = 'parent-995424086'; - $request = (new RunAggregationQueryRequest()) - ->setParent($parent); - $serverStream = $gapicClient->runAggregationQuery($request); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runQueryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction2 = '17'; - $skippedResults = 880286183; - $done = true; - $expectedResponse = new RunQueryResponse(); - $expectedResponse->setTransaction($transaction2); - $expectedResponse->setSkippedResults($skippedResults); - $expectedResponse->setDone($done); - $transport->addResponse($expectedResponse); - $transaction3 = '18'; - $skippedResults2 = 153532454; - $done2 = false; - $expectedResponse2 = new RunQueryResponse(); - $expectedResponse2->setTransaction($transaction3); - $expectedResponse2->setSkippedResults($skippedResults2); - $expectedResponse2->setDone($done2); - $transport->addResponse($expectedResponse2); - $transaction4 = '19'; - $skippedResults3 = 153532453; - $done3 = true; - $expectedResponse3 = new RunQueryResponse(); - $expectedResponse3->setTransaction($transaction4); - $expectedResponse3->setSkippedResults($skippedResults3); - $expectedResponse3->setDone($done3); - $transport->addResponse($expectedResponse3); - // Mock request - $parent = 'parent-995424086'; - $request = (new RunQueryRequest()) - ->setParent($parent); - $serverStream = $gapicClient->runQuery($request); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/RunQuery', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runQueryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $parent = 'parent-995424086'; - $request = (new RunQueryRequest()) - ->setParent($parent); - $serverStream = $gapicClient->runQuery($request); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateDocumentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Document(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $document = new Document(); - $updateMask = new DocumentMask(); - $request = (new UpdateDocumentRequest()) - ->setDocument($document) - ->setUpdateMask($updateMask); - $response = $gapicClient->updateDocument($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/UpdateDocument', $actualFuncCall); - $actualValue = $actualRequestObject->getDocument(); - $this->assertProtobufEquals($document, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateDocumentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $document = new Document(); - $updateMask = new DocumentMask(); - $request = (new UpdateDocumentRequest()) - ->setDocument($document) - ->setUpdateMask($updateMask); - try { - $gapicClient->updateDocument($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function writeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $streamId = 'streamId-315624902'; - $streamToken = '122'; - $expectedResponse = new WriteResponse(); - $expectedResponse->setStreamId($streamId); - $expectedResponse->setStreamToken($streamToken); - $transport->addResponse($expectedResponse); - $streamId2 = 'streamId21627150189'; - $streamToken2 = '-83'; - $expectedResponse2 = new WriteResponse(); - $expectedResponse2->setStreamId($streamId2); - $expectedResponse2->setStreamToken($streamToken2); - $transport->addResponse($expectedResponse2); - $streamId3 = 'streamId31627150190'; - $streamToken3 = '-82'; - $expectedResponse3 = new WriteResponse(); - $expectedResponse3->setStreamId($streamId3); - $expectedResponse3->setStreamToken($streamToken3); - $transport->addResponse($expectedResponse3); - // Mock request - $database = 'database1789464955'; - $request = new WriteRequest(); - $request->setDatabase($database); - $database2 = 'database21688906350'; - $request2 = new WriteRequest(); - $request2->setDatabase($database2); - $database3 = 'database31688906351'; - $request3 = new WriteRequest(); - $request3->setDatabase($database3); - $bidi = $gapicClient->write(); - $this->assertInstanceOf(BidiStream::class, $bidi); - $bidi->write($request); - $responses = []; - $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); - foreach ($bidi->closeWriteAndReadAll() as $response) { - $responses[] = $response; - } - - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $createStreamRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($createStreamRequests)); - $streamFuncCall = $createStreamRequests[0]->getFuncCall(); - $streamRequestObject = $createStreamRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/Write', $streamFuncCall); - $this->assertNull($streamRequestObject); - $callObjects = $transport->popCallObjects(); - $this->assertSame(1, count($callObjects)); - $bidiCall = $callObjects[0]; - $writeRequests = $bidiCall->popReceivedCalls(); - $expectedRequests = []; - $expectedRequests[] = $request; - $expectedRequests[] = $request2; - $expectedRequests[] = $request3; - $this->assertEquals($expectedRequests, $writeRequests); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function writeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - $bidi = $gapicClient->write(); - $results = $bidi->closeWriteAndReadAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchWriteAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new BatchWriteResponse(); - $transport->addResponse($expectedResponse); - $request = new BatchWriteRequest(); - $response = $gapicClient->batchWriteAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/BatchWrite', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Firestore/v1/tests/Unit/V1/FirestoreClientTest.php b/owl-bot-staging/Firestore/v1/tests/Unit/V1/FirestoreClientTest.php deleted file mode 100644 index e328eb47242a..000000000000 --- a/owl-bot-staging/Firestore/v1/tests/Unit/V1/FirestoreClientTest.php +++ /dev/null @@ -1,1219 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return FirestoreClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new FirestoreClient($options); - } - - /** @test */ - public function batchGetDocumentsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $missing = 'missing1069449574'; - $transaction2 = '17'; - $expectedResponse = new BatchGetDocumentsResponse(); - $expectedResponse->setMissing($missing); - $expectedResponse->setTransaction($transaction2); - $transport->addResponse($expectedResponse); - $missing2 = 'missing21243859865'; - $transaction3 = '18'; - $expectedResponse2 = new BatchGetDocumentsResponse(); - $expectedResponse2->setMissing($missing2); - $expectedResponse2->setTransaction($transaction3); - $transport->addResponse($expectedResponse2); - $missing3 = 'missing31243859866'; - $transaction4 = '19'; - $expectedResponse3 = new BatchGetDocumentsResponse(); - $expectedResponse3->setMissing($missing3); - $expectedResponse3->setTransaction($transaction4); - $transport->addResponse($expectedResponse3); - // Mock request - $database = 'database1789464955'; - $documents = []; - $serverStream = $gapicClient->batchGetDocuments($database, $documents); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/BatchGetDocuments', $actualFuncCall); - $actualValue = $actualRequestObject->getDatabase(); - $this->assertProtobufEquals($database, $actualValue); - $actualValue = $actualRequestObject->getDocuments(); - $this->assertProtobufEquals($documents, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchGetDocumentsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $database = 'database1789464955'; - $documents = []; - $serverStream = $gapicClient->batchGetDocuments($database, $documents); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchWriteTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new BatchWriteResponse(); - $transport->addResponse($expectedResponse); - $response = $gapicClient->batchWrite(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/BatchWrite', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function batchWriteExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->batchWrite(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function beginTransactionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction = '-34'; - $expectedResponse = new BeginTransactionResponse(); - $expectedResponse->setTransaction($transaction); - $transport->addResponse($expectedResponse); - // Mock request - $database = 'database1789464955'; - $response = $gapicClient->beginTransaction($database); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/BeginTransaction', $actualFuncCall); - $actualValue = $actualRequestObject->getDatabase(); - $this->assertProtobufEquals($database, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function beginTransactionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $database = 'database1789464955'; - try { - $gapicClient->beginTransaction($database); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function commitTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new CommitResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $database = 'database1789464955'; - $writes = []; - $response = $gapicClient->commit($database, $writes); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/Commit', $actualFuncCall); - $actualValue = $actualRequestObject->getDatabase(); - $this->assertProtobufEquals($database, $actualValue); - $actualValue = $actualRequestObject->getWrites(); - $this->assertProtobufEquals($writes, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function commitExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $database = 'database1789464955'; - $writes = []; - try { - $gapicClient->commit($database, $writes); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createDocumentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Document(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $collectionId = 'collectionId-821242276'; - $documentId = 'documentId506676927'; - $document = new Document(); - $response = $gapicClient->createDocument($parent, $collectionId, $documentId, $document); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/CreateDocument', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getCollectionId(); - $this->assertProtobufEquals($collectionId, $actualValue); - $actualValue = $actualRequestObject->getDocumentId(); - $this->assertProtobufEquals($documentId, $actualValue); - $actualValue = $actualRequestObject->getDocument(); - $this->assertProtobufEquals($document, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createDocumentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $collectionId = 'collectionId-821242276'; - $documentId = 'documentId506676927'; - $document = new Document(); - try { - $gapicClient->createDocument($parent, $collectionId, $documentId, $document); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteDocumentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $gapicClient->deleteDocument($name); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/DeleteDocument', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteDocumentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $gapicClient->deleteDocument($name); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDocumentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new Document(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->getDocument($name); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/GetDocument', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getDocumentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $name = 'name3373707'; - try { - $gapicClient->getDocument($name); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCollectionIdsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $collectionIdsElement = 'collectionIdsElement1368994900'; - $collectionIds = [ - $collectionIdsElement, - ]; - $expectedResponse = new ListCollectionIdsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setCollectionIds($collectionIds); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $response = $gapicClient->listCollectionIds($parent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getCollectionIds()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/ListCollectionIds', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listCollectionIdsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - try { - $gapicClient->listCollectionIds($parent); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDocumentsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $documentsElement = new Document(); - $documents = [ - $documentsElement, - ]; - $expectedResponse = new ListDocumentsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDocuments($documents); - $transport->addResponse($expectedResponse); - // Mock request - $parent = 'parent-995424086'; - $collectionId = 'collectionId-821242276'; - $response = $gapicClient->listDocuments($parent, $collectionId); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDocuments()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/ListDocuments', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $actualValue = $actualRequestObject->getCollectionId(); - $this->assertProtobufEquals($collectionId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listDocumentsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $parent = 'parent-995424086'; - $collectionId = 'collectionId-821242276'; - try { - $gapicClient->listDocuments($parent, $collectionId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listenTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListenResponse(); - $transport->addResponse($expectedResponse); - $expectedResponse2 = new ListenResponse(); - $transport->addResponse($expectedResponse2); - $expectedResponse3 = new ListenResponse(); - $transport->addResponse($expectedResponse3); - // Mock request - $database = 'database1789464955'; - $request = new ListenRequest(); - $request->setDatabase($database); - $database2 = 'database21688906350'; - $request2 = new ListenRequest(); - $request2->setDatabase($database2); - $database3 = 'database31688906351'; - $request3 = new ListenRequest(); - $request3->setDatabase($database3); - $bidi = $gapicClient->listen(); - $this->assertInstanceOf(BidiStream::class, $bidi); - $bidi->write($request); - $responses = []; - $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); - foreach ($bidi->closeWriteAndReadAll() as $response) { - $responses[] = $response; - } - - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $createStreamRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($createStreamRequests)); - $streamFuncCall = $createStreamRequests[0]->getFuncCall(); - $streamRequestObject = $createStreamRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/Listen', $streamFuncCall); - $this->assertNull($streamRequestObject); - $callObjects = $transport->popCallObjects(); - $this->assertSame(1, count($callObjects)); - $bidiCall = $callObjects[0]; - $writeRequests = $bidiCall->popReceivedCalls(); - $expectedRequests = []; - $expectedRequests[] = $request; - $expectedRequests[] = $request2; - $expectedRequests[] = $request3; - $this->assertEquals($expectedRequests, $writeRequests); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listenExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - $bidi = $gapicClient->listen(); - $results = $bidi->closeWriteAndReadAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function partitionQueryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $partitionsElement = new Cursor(); - $partitions = [ - $partitionsElement, - ]; - $expectedResponse = new PartitionQueryResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setPartitions($partitions); - $transport->addResponse($expectedResponse); - $response = $gapicClient->partitionQuery(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getPartitions()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/PartitionQuery', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function partitionQueryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->partitionQuery(); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rollbackTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $database = 'database1789464955'; - $transaction = '-34'; - $gapicClient->rollback($database, $transaction); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/Rollback', $actualFuncCall); - $actualValue = $actualRequestObject->getDatabase(); - $this->assertProtobufEquals($database, $actualValue); - $actualValue = $actualRequestObject->getTransaction(); - $this->assertProtobufEquals($transaction, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rollbackExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $database = 'database1789464955'; - $transaction = '-34'; - try { - $gapicClient->rollback($database, $transaction); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runAggregationQueryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction2 = '17'; - $expectedResponse = new RunAggregationQueryResponse(); - $expectedResponse->setTransaction($transaction2); - $transport->addResponse($expectedResponse); - $transaction3 = '18'; - $expectedResponse2 = new RunAggregationQueryResponse(); - $expectedResponse2->setTransaction($transaction3); - $transport->addResponse($expectedResponse2); - $transaction4 = '19'; - $expectedResponse3 = new RunAggregationQueryResponse(); - $expectedResponse3->setTransaction($transaction4); - $transport->addResponse($expectedResponse3); - // Mock request - $parent = 'parent-995424086'; - $serverStream = $gapicClient->runAggregationQuery($parent); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/RunAggregationQuery', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runAggregationQueryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $parent = 'parent-995424086'; - $serverStream = $gapicClient->runAggregationQuery($parent); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runQueryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction2 = '17'; - $skippedResults = 880286183; - $done = true; - $expectedResponse = new RunQueryResponse(); - $expectedResponse->setTransaction($transaction2); - $expectedResponse->setSkippedResults($skippedResults); - $expectedResponse->setDone($done); - $transport->addResponse($expectedResponse); - $transaction3 = '18'; - $skippedResults2 = 153532454; - $done2 = false; - $expectedResponse2 = new RunQueryResponse(); - $expectedResponse2->setTransaction($transaction3); - $expectedResponse2->setSkippedResults($skippedResults2); - $expectedResponse2->setDone($done2); - $transport->addResponse($expectedResponse2); - $transaction4 = '19'; - $skippedResults3 = 153532453; - $done3 = true; - $expectedResponse3 = new RunQueryResponse(); - $expectedResponse3->setTransaction($transaction4); - $expectedResponse3->setSkippedResults($skippedResults3); - $expectedResponse3->setDone($done3); - $transport->addResponse($expectedResponse3); - // Mock request - $parent = 'parent-995424086'; - $serverStream = $gapicClient->runQuery($parent); - $this->assertInstanceOf(ServerStream::class, $serverStream); - $responses = iterator_to_array($serverStream->readAll()); - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/RunQuery', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($parent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runQueryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - // Mock request - $parent = 'parent-995424086'; - $serverStream = $gapicClient->runQuery($parent); - $results = $serverStream->readAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateDocumentTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new Document(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $document = new Document(); - $updateMask = new DocumentMask(); - $response = $gapicClient->updateDocument($document, $updateMask); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/UpdateDocument', $actualFuncCall); - $actualValue = $actualRequestObject->getDocument(); - $this->assertProtobufEquals($document, $actualValue); - $actualValue = $actualRequestObject->getUpdateMask(); - $this->assertProtobufEquals($updateMask, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateDocumentExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $document = new Document(); - $updateMask = new DocumentMask(); - try { - $gapicClient->updateDocument($document, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function writeTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $streamId = 'streamId-315624902'; - $streamToken = '122'; - $expectedResponse = new WriteResponse(); - $expectedResponse->setStreamId($streamId); - $expectedResponse->setStreamToken($streamToken); - $transport->addResponse($expectedResponse); - $streamId2 = 'streamId21627150189'; - $streamToken2 = '-83'; - $expectedResponse2 = new WriteResponse(); - $expectedResponse2->setStreamId($streamId2); - $expectedResponse2->setStreamToken($streamToken2); - $transport->addResponse($expectedResponse2); - $streamId3 = 'streamId31627150190'; - $streamToken3 = '-82'; - $expectedResponse3 = new WriteResponse(); - $expectedResponse3->setStreamId($streamId3); - $expectedResponse3->setStreamToken($streamToken3); - $transport->addResponse($expectedResponse3); - // Mock request - $database = 'database1789464955'; - $request = new WriteRequest(); - $request->setDatabase($database); - $database2 = 'database21688906350'; - $request2 = new WriteRequest(); - $request2->setDatabase($database2); - $database3 = 'database31688906351'; - $request3 = new WriteRequest(); - $request3->setDatabase($database3); - $bidi = $gapicClient->write(); - $this->assertInstanceOf(BidiStream::class, $bidi); - $bidi->write($request); - $responses = []; - $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); - foreach ($bidi->closeWriteAndReadAll() as $response) { - $responses[] = $response; - } - - $expectedResponses = []; - $expectedResponses[] = $expectedResponse; - $expectedResponses[] = $expectedResponse2; - $expectedResponses[] = $expectedResponse3; - $this->assertEquals($expectedResponses, $responses); - $createStreamRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($createStreamRequests)); - $streamFuncCall = $createStreamRequests[0]->getFuncCall(); - $streamRequestObject = $createStreamRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.v1.Firestore/Write', $streamFuncCall); - $this->assertNull($streamRequestObject); - $callObjects = $transport->popCallObjects(); - $this->assertSame(1, count($callObjects)); - $bidiCall = $callObjects[0]; - $writeRequests = $bidiCall->popReceivedCalls(); - $expectedRequests = []; - $expectedRequests[] = $request; - $expectedRequests[] = $request2; - $expectedRequests[] = $request3; - $this->assertEquals($expectedRequests, $writeRequests); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function writeExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->setStreamingStatus($status); - $this->assertTrue($transport->isExhausted()); - $bidi = $gapicClient->write(); - $results = $bidi->closeWriteAndReadAll(); - try { - iterator_to_array($results); - // If the close stream method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}