From 9ac4e41e764d6341d9c31d426f0b918f1335f3b1 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 8 Aug 2024 01:01:11 +0000 Subject: [PATCH 1/2] feat: Expose the `FindNearest.distance_result_field` parameter feat: Expose the `FindNearest.distance_threshold` parameter PiperOrigin-RevId: 660557033 Source-Link: https://github.com/googleapis/googleapis/commit/28685f723d37bea3115876d423e7dbf70819e3ed Source-Link: https://github.com/googleapis/googleapis-gen/commit/38f25b0bcf54613758ed55a6390bc84e40368dc2 Copy-Tag: eyJwIjoiRmlyZXN0b3JlLy5Pd2xCb3QueWFtbCIsImgiOiIzOGYyNWIwYmNmNTQ2MTM3NThlZDU1YTYzOTBiYzg0ZTQwMzY4ZGMyIn0= --- .../Google/Firestore/Admin/V1/Backup.php | Bin 0 -> 1690 bytes .../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 | 191 ++ .../Google/Firestore/Admin/V1/Index.php | Bin 0 -> 2152 bytes .../Google/Firestore/Admin/V1/Location.php | 28 + .../Google/Firestore/Admin/V1/Operation.php | Bin 0 -> 4243 bytes .../Google/Firestore/Admin/V1/Schedule.php | Bin 0 -> 1811 bytes .../Cloud/Firestore/Admin/V1/Backup.php | 327 +++ .../Cloud/Firestore/Admin/V1/Backup/State.php | 72 + .../Cloud/Firestore/Admin/V1/Backup/Stats.php | 142 + .../Firestore/Admin/V1/BackupSchedule.php | 312 +++ .../Admin/V1/BulkDeleteDocumentsMetadata.php | 373 +++ .../Admin/V1/BulkDeleteDocumentsRequest.php | 193 ++ .../Admin/V1/BulkDeleteDocumentsResponse.php | 34 + .../Admin/V1/CreateBackupScheduleRequest.php | 134 + .../Admin/V1/CreateDatabaseMetadata.php | 33 + .../Admin/V1/CreateDatabaseRequest.php | 196 ++ .../Firestore/Admin/V1/CreateIndexRequest.php | 133 + .../Firestore/Admin/V1/DailyRecurrence.php | 34 + .../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/DeleteBackupRequest.php | 88 + .../Admin/V1/DeleteBackupScheduleRequest.php | 92 + .../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 | 305 +++ .../Admin/V1/ExportDocumentsResponse.php | 76 + .../Google/Cloud/Firestore/Admin/V1/Field.php | 253 ++ .../Firestore/Admin/V1/Field/IndexConfig.php | 208 ++ .../Firestore/Admin/V1/Field/TtlConfig.php | 76 + .../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/GetBackupRequest.php | 88 + .../Admin/V1/GetBackupScheduleRequest.php | 93 + .../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 | 194 ++ .../Admin/V1/Index/IndexField/ArrayConfig.php | 57 + .../Admin/V1/Index/IndexField/Order.php | 64 + .../V1/Index/IndexField/VectorConfig.php | 120 + .../IndexField/VectorConfig/FlatIndex.php | 37 + .../Firestore/Admin/V1/Index/QueryScope.php | 77 + .../Cloud/Firestore/Admin/V1/Index/State.php | 86 + .../Admin/V1/IndexOperationMetadata.php | 287 ++ .../Admin/V1/ListBackupSchedulesRequest.php | 88 + .../Admin/V1/ListBackupSchedulesResponse.php | 68 + .../Firestore/Admin/V1/ListBackupsRequest.php | 103 + .../Admin/V1/ListBackupsResponse.php | 118 + .../Admin/V1/ListDatabasesRequest.php | 120 + .../Admin/V1/ListDatabasesResponse.php | 129 + .../Firestore/Admin/V1/ListFieldsRequest.php | 221 ++ .../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/RestoreDatabaseMetadata.php | 268 ++ .../Admin/V1/RestoreDatabaseRequest.php | 172 ++ .../Admin/V1/UpdateBackupScheduleRequest.php | 137 + .../Admin/V1/UpdateDatabaseMetadata.php | 33 + .../Admin/V1/UpdateDatabaseRequest.php | 137 + .../Firestore/Admin/V1/UpdateFieldRequest.php | 139 + .../Firestore/Admin/V1/WeeklyRecurrence.php | 72 + .../bulk_delete_documents.php | 91 + .../create_backup_schedule.php | 77 + .../FirestoreAdminClient/create_database.php | 96 + .../V1/FirestoreAdminClient/create_index.php | 94 + .../V1/FirestoreAdminClient/delete_backup.php | 71 + .../delete_backup_schedule.php | 76 + .../FirestoreAdminClient/delete_database.php | 84 + .../V1/FirestoreAdminClient/delete_index.php | 75 + .../FirestoreAdminClient/export_documents.php | 94 + .../V1/FirestoreAdminClient/get_backup.php | 73 + .../get_backup_schedule.php | 78 + .../V1/FirestoreAdminClient/get_database.php | 72 + .../V1/FirestoreAdminClient/get_field.php | 77 + .../V1/FirestoreAdminClient/get_index.php | 77 + .../FirestoreAdminClient/import_documents.php | 85 + .../list_backup_schedules.php | 73 + .../V1/FirestoreAdminClient/list_backups.php | 76 + .../FirestoreAdminClient/list_databases.php | 72 + .../V1/FirestoreAdminClient/list_fields.php | 89 + .../V1/FirestoreAdminClient/list_indexes.php | 81 + .../FirestoreAdminClient/restore_database.php | 121 + .../update_backup_schedule.php | 59 + .../FirestoreAdminClient/update_database.php | 71 + .../V1/FirestoreAdminClient/update_field.php | 122 + .../src/V1/Client/FirestoreAdminClient.php | 1153 ++++++++ .../v1/Admin/src/V1/FirestoreAdminClient.php | 34 + .../V1/Gapic/FirestoreAdminGapicClient.php | 2091 +++++++++++++++ .../v1/Admin/src/V1/gapic_metadata.json | 138 + .../firestore_admin_client_config.json | 166 ++ .../firestore_admin_descriptor_config.php | 408 +++ .../firestore_admin_rest_client_config.php | 356 +++ .../V1/Client/FirestoreAdminClientTest.php | 2313 +++++++++++++++++ .../Unit/V1/FirestoreAdminClientTest.php | 2117 +++++++++++++++ .../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 -> 2019 bytes .../Google/Firestore/V1/Firestore.php | Bin 0 -> 11259 bytes .../GPBMetadata/Google/Firestore/V1/Query.php | Bin 0 -> 4365 bytes .../Google/Firestore/V1/QueryProfile.php | 42 + .../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/ExecutionStats.php | 237 ++ .../Cloud/Firestore/V1/ExistenceFilter.php | 209 ++ .../Cloud/Firestore/V1/ExplainMetrics.php | 129 + .../Cloud/Firestore/V1/ExplainOptions.php | 83 + .../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 ++ .../Google/Cloud/Firestore/V1/PlanSummary.php | 83 + .../Cloud/Firestore/V1/Precondition.php | 114 + .../Cloud/Firestore/V1/RollbackRequest.php | 121 + .../V1/RunAggregationQueryRequest.php | 304 +++ .../V1/RunAggregationQueryResponse.php | 244 ++ .../Cloud/Firestore/V1/RunQueryRequest.php | 306 +++ .../Cloud/Firestore/V1/RunQueryResponse.php | 327 +++ .../V1/StructuredAggregationQuery.php | 122 + .../Aggregation.php | 290 +++ .../Aggregation/Avg.php | 86 + .../Aggregation/Count.php | 169 ++ .../Aggregation/Sum.php | 95 + .../Cloud/Firestore/V1/StructuredQuery.php | 651 +++++ .../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 + .../V1/StructuredQuery/FindNearest.php | 399 +++ .../FindNearest/DistanceMeasure.php | 83 + .../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 | 1372 ++++++++++ .../Firestore/v1/src/V1/gapic_metadata.json | 98 + .../V1/resources/firestore_client_config.json | 174 ++ .../resources/firestore_descriptor_config.php | 272 ++ .../firestore_rest_client_config.php | 292 +++ .../Unit/V1/Client/FirestoreClientTest.php | 1323 ++++++++++ .../v1/tests/Unit/V1/FirestoreClientTest.php | 1219 +++++++++ 225 files changed, 41824 insertions(+) create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Backup.php 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/GPBMetadata/Google/Firestore/Admin/V1/Schedule.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/State.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/Stats.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BackupSchedule.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsMetadata.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsResponse.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateBackupScheduleRequest.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/DailyRecurrence.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/DeleteBackupRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteBackupScheduleRequest.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/GetBackupRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetBackupScheduleRequest.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/IndexField/VectorConfig.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/VectorConfig/FlatIndex.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/ListBackupSchedulesRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupSchedulesResponse.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsResponse.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/RestoreDatabaseMetadata.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/RestoreDatabaseRequest.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateBackupScheduleRequest.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/proto/src/Google/Cloud/Firestore/Admin/V1/WeeklyRecurrence.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/bulk_delete_documents.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_backup_schedule.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_backup.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_backup_schedule.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_backup.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_backup_schedule.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_backup_schedules.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_backups.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/restore_database.php create mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_backup_schedule.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/QueryProfile.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/ExecutionStats.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/ExplainMetrics.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExplainOptions.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/PlanSummary.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/FindNearest.php create mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FindNearest/DistanceMeasure.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/Backup.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Backup.php new file mode 100644 index 0000000000000000000000000000000000000000..fe3fbc3e94b33464bce598d86d3797c9fb7cb1ce GIT binary patch literal 1690 zcma)6-EPw`7^UqtHV@EBs~aY8xu zX$ZY^G{On=={P1KPD}_}J8*kv0NbtJ;JSb^nkGKB;Q^%wA+|;&!Hm-cTPPTl$U3T9 z9`fI(v8gBlh|n0b82K1>`_1Q=qX2Q_b`{#~ghL#m`N`h9n}KppbkLGi<^U3KZ>k8A5tbIRJAF%>g!!n~ip zltD<~_9Bjx2!(D7Ge04*n6NKOZTkT8LOi)rThES_bYui;x<}jor^!volN2969l`|j zG>ICjZ%HsIp4=1Ea$+JB!(q_Ghv*TA>4;MVEvV_ea7W??f^*~~nuFK1g8iissWsBEcCx4e?E zD+`M2w0PdXF1Yb?2Fz)L85hBfv}m;iOSOe&<)>3I8em?U)I$tc%W8RDEdO>^!S!h$ z`Ur72GsVkdwK9Nl1)R&l!;}Qovs2#t;5>^^%nm6Z%8sfPvA4LfY-U5|?V5$$x}SSs z5r2rqtD;der$aTstn?zQ&Z&BLEk9;DL$0N%wJ`T&eXfB*U}dVtUpJ~XF&>Cpd53+@tk2og#0se|f`~?9Eq|P3u_u;1m0XkNj}o{h ztnq)@n~VC4zD%8d>GeZDq-l`XOIIDx;{h8Jk*+#s)pzVQvfnS|neJ9+?`wIbtAf?s zQcRsZUQI{FtGQqQo>#c8DshiRaF)R$gnyM+HIHqpD%&oYY+F&;_I}-)Q--~}R=nP~ Xb;KP@MCm}{pOA*CQfJl#OaS-;i7+3V literal 0 HcmV?d00001 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..222bef39e37d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/FirestoreAdmin.php @@ -0,0 +1,191 @@ +internalAddGeneratedFile( + ' +©H +/google/firestore/admin/v1/firestore_admin.protogoogle.firestore.admin.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto&google/firestore/admin/v1/backup.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/firestore/admin/v1/schedule.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"g +ListDatabasesRequest9 +parent ( B)àAúA#!firestore.googleapis.com/Database + show_deleted ("¨ +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"¡ +CreateBackupScheduleRequest9 +parent ( B)àAúA# +!firestore.googleapis.com/DatabaseG +backup_schedule ( 2).google.firestore.admin.v1.BackupScheduleBàA"Y +GetBackupScheduleRequest= +name ( B/àAúA) +\'firestore.googleapis.com/BackupSchedule"— +UpdateBackupScheduleRequestG +backup_schedule ( 2).google.firestore.admin.v1.BackupScheduleBàA/ + update_mask ( 2.google.protobuf.FieldMask"W +ListBackupSchedulesRequest9 +parent ( B)àAúA# +!firestore.googleapis.com/Database"b +ListBackupSchedulesResponseC +backup_schedules ( 2).google.firestore.admin.v1.BackupSchedule"\\ +DeleteBackupScheduleRequest= +name ( B/àAúA) +\'firestore.googleapis.com/BackupSchedule"Œ +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 ( "Ž +BulkDeleteDocumentsRequest7 +name ( B)àAúA# +!firestore.googleapis.com/Database +collection_ids ( BàA + namespace_ids ( BàA" +BulkDeleteDocumentsResponse"I +GetBackupRequest5 +name ( B\'àAúA! +firestore.googleapis.com/Backup"O +ListBackupsRequest9 +parent ( B)àAúA# +!firestore.googleapis.com/Location"^ +ListBackupsResponse2 +backups ( 2!.google.firestore.admin.v1.Backup + unreachable ( "L +DeleteBackupRequest5 +name ( B\'àAúA! +firestore.googleapis.com/Backup"¦ +RestoreDatabaseRequest9 +parent ( B)àAúA#!firestore.googleapis.com/Database + database_id ( BàA7 +backup ( B\'àAúA! +firestore.googleapis.com/Backup2Ë% +FirestoreAdminÛ + CreateIndex-.google.firestore.admin.v1.CreateIndexRequest.google.longrunning.Operation"~ÊA +IndexIndexOperationMetadataÚA parent,index‚Óä“G">/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes:index½ + ListIndexes-.google.firestore.admin.v1.ListIndexesRequest..google.firestore.admin.v1.ListIndexesResponse"OÚAparent‚Óä“@>/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes§ +GetIndex*.google.firestore.admin.v1.GetIndexRequest .google.firestore.admin.v1.Index"MÚAname‚Óä“@>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}£ + DeleteIndex-.google.firestore.admin.v1.DeleteIndexRequest.google.protobuf.Empty"MÚAname‚Óä“@*>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}¦ +GetField*.google.firestore.admin.v1.GetFieldRequest .google.firestore.admin.v1.Field"LÚAname‚Óä“?=/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}Ù + UpdateField-.google.firestore.admin.v1.UpdateFieldRequest.google.longrunning.Operation"|ÊA +FieldFieldOperationMetadataÚAfield‚Óä“L2C/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}:field¹ + +ListFields,.google.firestore.admin.v1.ListFieldsRequest-.google.firestore.admin.v1.ListFieldsResponse"NÚAparent‚Óä“?=/v1/{parent=projects/*/databases/*/collectionGroups/*}/fieldsÝ +ExportDocuments1.google.firestore.admin.v1.ExportDocumentsRequest.google.longrunning.Operation"xÊA2 +ExportDocumentsResponseExportDocumentsMetadataÚAname‚Óä“6"1/v1/{name=projects/*/databases/*}:exportDocuments:*Û +ImportDocuments1.google.firestore.admin.v1.ImportDocumentsRequest.google.longrunning.Operation"vÊA0 +google.protobuf.EmptyImportDocumentsMetadataÚAname‚Óä“6"1/v1/{name=projects/*/databases/*}:importDocuments:*ò +BulkDeleteDocuments5.google.firestore.admin.v1.BulkDeleteDocumentsRequest.google.longrunning.Operation"„ÊA: +BulkDeleteDocumentsResponseBulkDeleteDocumentsMetadataÚAname‚Óä“:"5/v1/{name=projects/*/databases/*}:bulkDeleteDocuments:*Ù +CreateDatabase0.google.firestore.admin.v1.CreateDatabaseRequest.google.longrunning.Operation"vÊA" +DatabaseCreateDatabaseMetadataÚAparent,database,database_id‚Óä“-"!/v1/{parent=projects/*}/databases:database“ + GetDatabase-.google.firestore.admin.v1.GetDatabaseRequest#.google.firestore.admin.v1.Database"0ÚAname‚Óä“#!/v1/{name=projects/*/databases/*}¦ + ListDatabases/.google.firestore.admin.v1.ListDatabasesRequest0.google.firestore.admin.v1.ListDatabasesResponse"2ÚAparent‚Óä“#!/v1/{parent=projects/*}/databasesÛ +UpdateDatabase0.google.firestore.admin.v1.UpdateDatabaseRequest.google.longrunning.Operation"xÊA" +DatabaseUpdateDatabaseMetadataÚAdatabase,update_mask‚Óä“62*/v1/{database.name=projects/*/databases/*}:database¸ +DeleteDatabase0.google.firestore.admin.v1.DeleteDatabaseRequest.google.longrunning.Operation"UÊA" +DatabaseDeleteDatabaseMetadataÚAname‚Óä“#*!/v1/{name=projects/*/databases/*}— + GetBackup+.google.firestore.admin.v1.GetBackupRequest!.google.firestore.admin.v1.Backup":ÚAname‚Óä“-+/v1/{name=projects/*/locations/*/backups/*}ª + ListBackups-.google.firestore.admin.v1.ListBackupsRequest..google.firestore.admin.v1.ListBackupsResponse"<ÚAparent‚Óä“-+/v1/{parent=projects/*/locations/*}/backups’ + DeleteBackup..google.firestore.admin.v1.DeleteBackupRequest.google.protobuf.Empty":ÚAname‚Óä“-*+/v1/{name=projects/*/locations/*/backups/*}¿ +RestoreDatabase1.google.firestore.admin.v1.RestoreDatabaseRequest.google.longrunning.Operation"ZÊA# +DatabaseRestoreDatabaseMetadata‚Óä“.")/v1/{parent=projects/*}/databases:restore:*à +CreateBackupSchedule6.google.firestore.admin.v1.CreateBackupScheduleRequest).google.firestore.admin.v1.BackupSchedule"eÚAparent,backup_schedule‚Óä“F"3/v1/{parent=projects/*/databases/*}/backupSchedules:backup_schedule· +GetBackupSchedule3.google.firestore.admin.v1.GetBackupScheduleRequest).google.firestore.admin.v1.BackupSchedule"BÚAname‚Óä“53/v1/{name=projects/*/databases/*/backupSchedules/*}Ê +ListBackupSchedules5.google.firestore.admin.v1.ListBackupSchedulesRequest6.google.firestore.admin.v1.ListBackupSchedulesResponse"DÚAparent‚Óä“53/v1/{parent=projects/*/databases/*}/backupSchedulesõ +UpdateBackupSchedule6.google.firestore.admin.v1.UpdateBackupScheduleRequest).google.firestore.admin.v1.BackupSchedule"zÚAbackup_schedule,update_mask‚Óä“V2C/v1/{backup_schedule.name=projects/*/databases/*/backupSchedules/*}:backup_scheduleª +DeleteBackupSchedule6.google.firestore.admin.v1.DeleteBackupScheduleRequest.google.protobuf.Empty"BÚAname‚Óä“5*3/v1/{name=projects/*/databases/*/backupSchedules/*}vÊ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..9c0e6c1657d3a9ca99495b73a5c780a61a705412 GIT binary patch literal 2152 zcmbVN-*4Mg6mHU_EGO9%tT96Qb(am63b2(T1anuwiJi>S7N>SvsVI`=*f;G(u5E0m z&`tRp5dXp+`BQl3fj6G_S8(rj;zZr5ZsZ~My*}S}&iQ<x#K*CSkZPcTF+!TEkM2@v63${5%jhHwPkby*NsN;; zjIrc+XC#o$+Y$*p{F}%b0Rra?Cz0b~)E{=9;?(h+)EW0Vc-&ip#|i_FkJ@_xuJ0rX z(isUn2Sk6-Y~m9aC8?9r%YBmABp@kqeDaKTu#cvWpJ0l7HFi1++?0d?VgMs>acc)< zoGkW!6w;3O(XyN&6M+ga)`Jwsf#Z)=oVYQGXn#W*D$6H0&81^It(`?$Mn|TomDMQA zuN1kD(s+i~vm+GabQTADylzG?&+o>s5le{(6%6}c2cJ6UB#dQw)zymRDyWGUZ|=1y zF2z^hlSSi-=jDC&=p3~2%2=Hb;O{DY_C^CBe2|5S`J9M+PQ>%}_TrJ`L`0%P#OEp- zo8})CDDw#rYEWV$)F_}rt0Mde)n8^fzOWNFjBuk!H*f8JAzqn7|l|Do7!Pb<$f~2vDHe1y18PnjI~TSa22*lE8)Vvk`!-Yx!*@BH z5+1=+pqt z9e;-Hv(Up$0zG)l|>qVgf zx7T(}t$S!%`jJ-OY)Wt=KMz%SM;RR3%221h-T^^XMv65uOwE33s2bldG<7KRNoE>Z zBV}~CAl8?uDWgmxdh+Q)J*G9(p*GMo)v`@(sOV;WQ-1bR`4v7{eM_=~PY-k=Qpb|` zs}c^W_54f+Cy|~n?&cD6or#lRy0^TYOVsat8b@cRABVGuK3na~GaF+7!mMcC`KJIM z(D7S|WWQoq}?{w#jl=RPTR zIaBVIqQcx#JZk^7j2Mr3$au|B7nVvr^=0v1#v{u-N|tjbS>{x-eAJ$7QL)nS>j(L# V{>#j=)*S9icjJ+n2hCv)@E=1ZqRs#S 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..2bba74bd463fcd9fdb5f07d51fe5551371e5605a GIT binary patch literal 4243 zcmeHKOK%%h6vlS*@F@vqDpEHQ%B>S<7?+CLl;(1 z72DV|DDI-pF`|bUxt>EE)3Hz|==HFNOlRN{3wts`r8=tBTc}*pT6dYM?*yKS71Vc} zzJ>EW;$fdU9?l!x0kQMXHu8?kv58~L0u{hE2H1BE6QgRQu!E`5HK@_93V?Pc0%)ro zpuNAb1z=i+@1uGI1YZMUKW@;mh>3j4&`q>Te4W^Y62l^2F;5<$o?-czX^+eH0^8&k zA+AujO}w^_LQF2Z>N?ExM<_C>!O37mv^ASz&o-=f3Hzo;T;^wki7HAT)0jg3m$mib zXE_|{p|#LPMHw^l5u#pzN577chiTy1Tf%M*a1#HoJ%KRQCGA~241;p&(5e0;t#O)} zcU}Bkximt|N{g^?Qe)sw))j1i_?Qg2Q@h=mstQY~wb(iC>OJ^*3Dz&2OVXWCRF2b5 z7HKCx+gN<>d=$bx4YP4^c_=1wlLa|XBX>f9+^`zn2!NE#}xb7=}Rl;zMX-E3c*%4w(8aK z*W=$E@~6WsL8opyc8~P+F1D!QGd5E!YK04Em~6Z(a-t}(N*wAmK%CiY2+-v@o)Dm! zO9x0gfDEP98CtTlLjCF0S!q#ggpV=w1ItB$ z+G3zmJ}RED&d>$u0w(tuU_^ZhZWljQYt^#e`n*xr_iD{Xxu{jNaw+qMGy^HMRLUeI zfa%@xPJO?eNiP1Bfcdk|OJ7X#^Ro*qIVaQ3!j5?PUyaWFl7idi=dR;(lfw!H2x&hS#kLa$4 zd*peRmt$Ib2j=44M`+9njSZOdZNv2so#7-&3l}b!B)M-`;IzT(z_E!I4y0=cToy9K zzCzq`-=|=y5Lid7{bPz>SCH5Yt|1U(Wim6lOu`{`QJFj#Yj12*b{*TtlgpH^aOvD% zNx04A_!U!Pmr2L)@&BkRK7?6*PjRcos+cak|3Y1XyQh0%xS$#?@nv?`*yw1E{#4OZV;Dg!#M?J<5iP&RmMCS@MBc} z((#VOTAh+aw;i~=(1w5KgFW@ZcWms&i)Fa(F2hp2QQlQsTD_(>TWag&`JI6`wVKw_ z)NSoRt5w+`p9g5{){Et4lfRSvT~uqu^7b}=r}(>~)gt*D{N3Cua{0>Mc4mq%0u@!; zX4}EEGzaOSE_==teow%=jOFvEe&N)9#sYO3iGz<#%L%%X3Xf6W8NIAs!p`dOz83$w zovq>TACfn!#Y*$XR{2pa?{EATNwnKSq&;$Y4=-}LaOPX z@zI~c5AewcpZyiyncdk|K+`^SH#_&7nS1V;^Xg4}7?UO1h7bgk;L~oO%0r;Bh-BnN z0qv%}9ti41M==jTSd=!m==-f*`nI{bdmo`mlnM_VdJshi0oXk*Ad!&(oB2mPw2y0c z;vIsY24HDYLPB-~Nz6Q;?M~wzNai!i+_uKMErWOK3h(aKRtfO}mLzm1=OJGS#b2Cu z1Mbm8GKr66p6v6GOU?rR1^ZZ|Jr*Q@;PbV;H1s5oLaG2;p$F9mG~-mY%W;H#uTgWN zj*Np1=3jx)a>Vte+MaO%znw`;c&K+`%N|D0o?vx6U zsR&o~xfQ{ncylk%s~&UI3_1m&(t{j3)pu_r4;plyGI{>4KH_V@_rjGbvDM zj2AOUk?~NE$yKy3gvu9{DUG>xZYN`$a*NFQj0gRF0bVKu;7zPdYtTajIxn}?RFLfg zv2m%qLFSby{wBJji5~rj=!3?LGC3!|>yo%D!(B6#aI%So5on)LdlS|B1fERnuld^m zha_2-C4k?|>%i{*H6>iiKJ1%l95k*GGE`x4p4>Ro=Hd%7clN;LB~n69R3@?2*{3&6 ztI8{=Qh%$b0F9p$r8xn=><{h8-!~7AR0~fm}9JG`L6%t z?rQ%0HhHt;#AG81WrQDGKU*m-_~R^BM`HM&5v(h-pd63^A%6g&+Ftem literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup.php new file mode 100644 index 000000000000..2ff6e412fa0e --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup.php @@ -0,0 +1,327 @@ +google.firestore.admin.v1.Backup + */ +class Backup extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique resource name of the Backup. + * Format is `projects/{project}/locations/{location}/backups/{backup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. Name of the Firestore database that the backup is from. + * Format is `projects/{project}/databases/{database}`. + * + * Generated from protobuf field string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + protected $database = ''; + /** + * Output only. The system-generated UUID4 for the Firestore database that the + * backup is from. + * + * Generated from protobuf field string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $database_uid = ''; + /** + * Output only. The backup contains an externally consistent copy of the + * database at this time. + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $snapshot_time = null; + /** + * Output only. The timestamp at which this backup expires. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * Output only. Statistics about the backup. + * This data only becomes available after the backup is fully materialized to + * secondary storage. This field will be empty till then. + * + * Generated from protobuf field .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $stats = null; + /** + * Output only. The current state of the backup. + * + * Generated from protobuf field .google.firestore.admin.v1.Backup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique resource name of the Backup. + * Format is `projects/{project}/locations/{location}/backups/{backup}`. + * @type string $database + * Output only. Name of the Firestore database that the backup is from. + * Format is `projects/{project}/databases/{database}`. + * @type string $database_uid + * Output only. The system-generated UUID4 for the Firestore database that the + * backup is from. + * @type \Google\Protobuf\Timestamp $snapshot_time + * Output only. The backup contains an externally consistent copy of the + * database at this time. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. The timestamp at which this backup expires. + * @type \Google\Cloud\Firestore\Admin\V1\Backup\Stats $stats + * Output only. Statistics about the backup. + * This data only becomes available after the backup is fully materialized to + * secondary storage. This field will be empty till then. + * @type int $state + * Output only. The current state of the backup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Backup::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique resource name of the Backup. + * Format is `projects/{project}/locations/{location}/backups/{backup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique resource name of the Backup. + * Format is `projects/{project}/locations/{location}/backups/{backup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Name of the Firestore database that the backup is from. + * Format is `projects/{project}/databases/{database}`. + * + * Generated from protobuf field string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Output only. Name of the Firestore database that the backup is from. + * Format is `projects/{project}/databases/{database}`. + * + * Generated from protobuf field string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * Output only. The system-generated UUID4 for the Firestore database that the + * backup is from. + * + * Generated from protobuf field string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDatabaseUid() + { + return $this->database_uid; + } + + /** + * Output only. The system-generated UUID4 for the Firestore database that the + * backup is from. + * + * Generated from protobuf field string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDatabaseUid($var) + { + GPBUtil::checkString($var, True); + $this->database_uid = $var; + + return $this; + } + + /** + * Output only. The backup contains an externally consistent copy of the + * database at this time. + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @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); + } + + /** + * Output only. The backup contains an externally consistent copy of the + * database at this time. + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setSnapshotTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->snapshot_time = $var; + + return $this; + } + + /** + * Output only. The timestamp at which this backup expires. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. The timestamp at which this backup expires. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. Statistics about the backup. + * This data only becomes available after the backup is fully materialized to + * secondary storage. This field will be empty till then. + * + * Generated from protobuf field .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Firestore\Admin\V1\Backup\Stats|null + */ + public function getStats() + { + return $this->stats; + } + + public function hasStats() + { + return isset($this->stats); + } + + public function clearStats() + { + unset($this->stats); + } + + /** + * Output only. Statistics about the backup. + * This data only becomes available after the backup is fully materialized to + * secondary storage. This field will be empty till then. + * + * Generated from protobuf field .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Firestore\Admin\V1\Backup\Stats $var + * @return $this + */ + public function setStats($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Backup\Stats::class); + $this->stats = $var; + + return $this; + } + + /** + * Output only. The current state of the backup. + * + * Generated from protobuf field .google.firestore.admin.v1.Backup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the backup. + * + * Generated from protobuf field .google.firestore.admin.v1.Backup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Backup\State::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/State.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/State.php new file mode 100644 index 000000000000..b868abc36995 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/State.php @@ -0,0 +1,72 @@ +google.firestore.admin.v1.Backup.State + */ +class State +{ + /** + * The state is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The pending backup is still being created. Operations on the + * backup will be rejected in this state. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The backup is complete and ready to use. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The backup is not available at this moment. + * + * Generated from protobuf enum NOT_AVAILABLE = 3; + */ + const NOT_AVAILABLE = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + self::NOT_AVAILABLE => 'NOT_AVAILABLE', + ]; + + 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\Backup_State::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/Stats.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/Stats.php new file mode 100644 index 000000000000..8e69131d5215 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/Stats.php @@ -0,0 +1,142 @@ +google.firestore.admin.v1.Backup.Stats + */ +class Stats extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Summation of the size of all documents and index entries in + * the backup, measured in bytes. + * + * Generated from protobuf field int64 size_bytes = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $size_bytes = 0; + /** + * Output only. The total number of documents contained in the backup. + * + * Generated from protobuf field int64 document_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $document_count = 0; + /** + * Output only. The total number of index entries contained in the backup. + * + * Generated from protobuf field int64 index_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $index_count = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $size_bytes + * Output only. Summation of the size of all documents and index entries in + * the backup, measured in bytes. + * @type int|string $document_count + * Output only. The total number of documents contained in the backup. + * @type int|string $index_count + * Output only. The total number of index entries contained in the backup. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Backup::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Summation of the size of all documents and index entries in + * the backup, measured in bytes. + * + * Generated from protobuf field int64 size_bytes = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getSizeBytes() + { + return $this->size_bytes; + } + + /** + * Output only. Summation of the size of all documents and index entries in + * the backup, measured in bytes. + * + * Generated from protobuf field int64 size_bytes = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->size_bytes = $var; + + return $this; + } + + /** + * Output only. The total number of documents contained in the backup. + * + * Generated from protobuf field int64 document_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getDocumentCount() + { + return $this->document_count; + } + + /** + * Output only. The total number of documents contained in the backup. + * + * Generated from protobuf field int64 document_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setDocumentCount($var) + { + GPBUtil::checkInt64($var); + $this->document_count = $var; + + return $this; + } + + /** + * Output only. The total number of index entries contained in the backup. + * + * Generated from protobuf field int64 index_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getIndexCount() + { + return $this->index_count; + } + + /** + * Output only. The total number of index entries contained in the backup. + * + * Generated from protobuf field int64 index_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setIndexCount($var) + { + GPBUtil::checkInt64($var); + $this->index_count = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Stats::class, \Google\Cloud\Firestore\Admin\V1\Backup_Stats::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BackupSchedule.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BackupSchedule.php new file mode 100644 index 000000000000..bac0b213b8bc --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BackupSchedule.php @@ -0,0 +1,312 @@ +google.firestore.admin.v1.BackupSchedule + */ +class BackupSchedule extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The unique backup schedule identifier across all locations and + * databases for the given project. + * This will be auto-assigned. + * Format is + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The timestamp at which this backup schedule was created and + * effective since. + * No backups will be created for this schedule before this time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The timestamp at which this backup schedule was most recently + * updated. When a backup schedule is first created, this is the same as + * create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * At what relative time in the future, compared to its creation time, + * the backup should be deleted, e.g. keep backups for 7 days. + * + * Generated from protobuf field .google.protobuf.Duration retention = 6; + */ + protected $retention = null; + protected $recurrence; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. The unique backup schedule identifier across all locations and + * databases for the given project. + * This will be auto-assigned. + * Format is + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The timestamp at which this backup schedule was created and + * effective since. + * No backups will be created for this schedule before this time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp at which this backup schedule was most recently + * updated. When a backup schedule is first created, this is the same as + * create_time. + * @type \Google\Protobuf\Duration $retention + * At what relative time in the future, compared to its creation time, + * the backup should be deleted, e.g. keep backups for 7 days. + * @type \Google\Cloud\Firestore\Admin\V1\DailyRecurrence $daily_recurrence + * For a schedule that runs daily. + * @type \Google\Cloud\Firestore\Admin\V1\WeeklyRecurrence $weekly_recurrence + * For a schedule that runs weekly on a specific day. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Schedule::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The unique backup schedule identifier across all locations and + * databases for the given project. + * This will be auto-assigned. + * Format is + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The unique backup schedule identifier across all locations and + * databases for the given project. + * This will be auto-assigned. + * Format is + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The timestamp at which this backup schedule was created and + * effective since. + * No backups will be created for this schedule before this time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.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 backup schedule was created and + * effective since. + * No backups will be created for this schedule before this time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.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 backup schedule was most recently + * updated. When a backup schedule is first created, this is the same as + * create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.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 backup schedule was most recently + * updated. When a backup schedule is first created, this is the same as + * create_time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.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; + } + + /** + * At what relative time in the future, compared to its creation time, + * the backup should be deleted, e.g. keep backups for 7 days. + * + * Generated from protobuf field .google.protobuf.Duration retention = 6; + * @return \Google\Protobuf\Duration|null + */ + public function getRetention() + { + return $this->retention; + } + + public function hasRetention() + { + return isset($this->retention); + } + + public function clearRetention() + { + unset($this->retention); + } + + /** + * At what relative time in the future, compared to its creation time, + * the backup should be deleted, e.g. keep backups for 7 days. + * + * Generated from protobuf field .google.protobuf.Duration retention = 6; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setRetention($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->retention = $var; + + return $this; + } + + /** + * For a schedule that runs daily. + * + * Generated from protobuf field .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + * @return \Google\Cloud\Firestore\Admin\V1\DailyRecurrence|null + */ + public function getDailyRecurrence() + { + return $this->readOneof(7); + } + + public function hasDailyRecurrence() + { + return $this->hasOneof(7); + } + + /** + * For a schedule that runs daily. + * + * Generated from protobuf field .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; + * @param \Google\Cloud\Firestore\Admin\V1\DailyRecurrence $var + * @return $this + */ + public function setDailyRecurrence($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\DailyRecurrence::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * For a schedule that runs weekly on a specific day. + * + * Generated from protobuf field .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + * @return \Google\Cloud\Firestore\Admin\V1\WeeklyRecurrence|null + */ + public function getWeeklyRecurrence() + { + return $this->readOneof(8); + } + + public function hasWeeklyRecurrence() + { + return $this->hasOneof(8); + } + + /** + * For a schedule that runs weekly on a specific day. + * + * Generated from protobuf field .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; + * @param \Google\Cloud\Firestore\Admin\V1\WeeklyRecurrence $var + * @return $this + */ + public function setWeeklyRecurrence($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\WeeklyRecurrence::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * @return string + */ + public function getRecurrence() + { + return $this->whichOneof("recurrence"); + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsMetadata.php new file mode 100644 index 000000000000..ed6b4ce088a7 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsMetadata.php @@ -0,0 +1,373 @@ +google.firestore.admin.v1.BulkDeleteDocumentsMetadata + */ +class BulkDeleteDocumentsMetadata 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 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; + /** + * The ids of the collection groups that are being deleted. + * + * Generated from protobuf field repeated string collection_ids = 6; + */ + private $collection_ids; + /** + * Which namespace ids are being deleted. + * + * Generated from protobuf field repeated string namespace_ids = 7; + */ + private $namespace_ids; + /** + * The timestamp that corresponds to the version of the database that is being + * read to get the list of documents to delete. This time can also be used as + * the timestamp of PITR in case of disaster recovery (subject to PITR window + * limit). + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 8; + */ + 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 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 + * The ids of the collection groups that are being deleted. + * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids + * Which namespace ids are being deleted. + * @type \Google\Protobuf\Timestamp $snapshot_time + * The timestamp that corresponds to the version of the database that is being + * read to get the list of documents to delete. This time can also be used as + * the timestamp of PITR in case of disaster recovery (subject to PITR window + * limit). + * } + */ + 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 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 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; + } + + /** + * The ids of the collection groups that are being deleted. + * + * Generated from protobuf field repeated string collection_ids = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCollectionIds() + { + return $this->collection_ids; + } + + /** + * The ids of the collection groups that are being deleted. + * + * 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; + } + + /** + * Which namespace ids are being deleted. + * + * Generated from protobuf field repeated string namespace_ids = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamespaceIds() + { + return $this->namespace_ids; + } + + /** + * Which namespace ids are being deleted. + * + * Generated from protobuf field repeated string namespace_ids = 7; + * @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 + * read to get the list of documents to delete. This time can also be used as + * the timestamp of PITR in case of disaster recovery (subject to PITR window + * limit). + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 8; + * @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 + * read to get the list of documents to delete. This time can also be used as + * the timestamp of PITR in case of disaster recovery (subject to PITR window + * limit). + * + * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 8; + * @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/BulkDeleteDocumentsRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsRequest.php new file mode 100644 index 000000000000..0d14c82fb131 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsRequest.php @@ -0,0 +1,193 @@ +google.firestore.admin.v1.BulkDeleteDocumentsRequest + */ +class BulkDeleteDocumentsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Database to operate. 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 = ''; + /** + * Optional. IDs of the collection groups to delete. Unspecified means all + * collection groups. + * Each collection group in this list must be unique. + * + * Generated from protobuf field repeated string collection_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $collection_ids; + /** + * Optional. Namespaces to delete. + * An empty list means all namespaces. This is the recommended + * 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 delete from them. + * Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $namespace_ids; + + /** + * @param string $name Required. Database to operate. 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\BulkDeleteDocumentsRequest + * + * @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 operate. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids + * Optional. IDs of the collection groups to delete. Unspecified means all + * collection groups. + * Each collection group in this list must be unique. + * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids + * Optional. Namespaces to delete. + * An empty list means all namespaces. This is the recommended + * 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 delete from 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 operate. 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 operate. 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; + } + + /** + * Optional. IDs of the collection groups to delete. Unspecified means all + * collection groups. + * Each collection group in this list must be unique. + * + * Generated from protobuf field repeated string collection_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCollectionIds() + { + return $this->collection_ids; + } + + /** + * Optional. IDs of the collection groups to delete. Unspecified means all + * collection groups. + * Each collection group in this list must be unique. + * + * Generated from protobuf field repeated string collection_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @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; + } + + /** + * Optional. Namespaces to delete. + * An empty list means all namespaces. This is the recommended + * 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 delete from them. + * Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamespaceIds() + { + return $this->namespace_ids; + } + + /** + * Optional. Namespaces to delete. + * An empty list means all namespaces. This is the recommended + * 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 delete from them. + * Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @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/BulkDeleteDocumentsResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsResponse.php new file mode 100644 index 000000000000..a1d244d022c1 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsResponse.php @@ -0,0 +1,34 @@ +google.firestore.admin.v1.BulkDeleteDocumentsResponse + */ +class BulkDeleteDocumentsResponse 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/CreateBackupScheduleRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateBackupScheduleRequest.php new file mode 100644 index 000000000000..bebd307d5f85 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateBackupScheduleRequest.php @@ -0,0 +1,134 @@ +google.firestore.admin.v1.CreateBackupScheduleRequest + */ +class CreateBackupScheduleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent database. + * Format `projects/{project}/databases/{database}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The backup schedule to create. + * + * Generated from protobuf field .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_schedule = null; + + /** + * @param string $parent Required. The parent database. + * + * Format `projects/{project}/databases/{database}` + * Please see {@see FirestoreAdminClient::databaseName()} for help formatting this field. + * @param \Google\Cloud\Firestore\Admin\V1\BackupSchedule $backupSchedule Required. The backup schedule to create. + * + * @return \Google\Cloud\Firestore\Admin\V1\CreateBackupScheduleRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Firestore\Admin\V1\BackupSchedule $backupSchedule): self + { + return (new self()) + ->setParent($parent) + ->setBackupSchedule($backupSchedule); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent database. + * Format `projects/{project}/databases/{database}` + * @type \Google\Cloud\Firestore\Admin\V1\BackupSchedule $backup_schedule + * Required. The backup schedule to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent database. + * Format `projects/{project}/databases/{database}` + * + * 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. The parent database. + * Format `projects/{project}/databases/{database}` + * + * 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 backup schedule to create. + * + * Generated from protobuf field .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Firestore\Admin\V1\BackupSchedule|null + */ + public function getBackupSchedule() + { + return $this->backup_schedule; + } + + public function hasBackupSchedule() + { + return isset($this->backup_schedule); + } + + public function clearBackupSchedule() + { + unset($this->backup_schedule); + } + + /** + * Required. The backup schedule to create. + * + * Generated from protobuf field .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Firestore\Admin\V1\BackupSchedule $var + * @return $this + */ + public function setBackupSchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\BackupSchedule::class); + $this->backup_schedule = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseMetadata.php new file mode 100644 index 000000000000..3a33d72e60b6 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseMetadata.php @@ -0,0 +1,33 @@ +google.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/DailyRecurrence.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DailyRecurrence.php new file mode 100644 index 000000000000..c5e9a366080a --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DailyRecurrence.php @@ -0,0 +1,34 @@ +google.firestore.admin.v1.DailyRecurrence + */ +class DailyRecurrence 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\Schedule::initOnce(); + parent::__construct($data); + } + +} + 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/DeleteBackupRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteBackupRequest.php new file mode 100644 index 000000000000..b1c17f2db7ce --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteBackupRequest.php @@ -0,0 +1,88 @@ +google.firestore.admin.v1.DeleteBackupRequest + */ +class DeleteBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the backup to delete. + * format is `projects/{project}/locations/{location}/backups/{backup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the backup to delete. + * + * format is `projects/{project}/locations/{location}/backups/{backup}`. Please see + * {@see FirestoreAdminClient::backupName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\DeleteBackupRequest + * + * @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. Name of the backup to delete. + * format is `projects/{project}/locations/{location}/backups/{backup}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the backup to delete. + * format is `projects/{project}/locations/{location}/backups/{backup}`. + * + * 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. Name of the backup to delete. + * format is `projects/{project}/locations/{location}/backups/{backup}`. + * + * 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/DeleteBackupScheduleRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteBackupScheduleRequest.php new file mode 100644 index 000000000000..9d3bc056d176 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteBackupScheduleRequest.php @@ -0,0 +1,92 @@ +google.firestore.admin.v1.DeleteBackupScheduleRequest + */ +class DeleteBackupScheduleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the backup schedule. + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the backup schedule. + * + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * Please see {@see FirestoreAdminClient::backupScheduleName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\DeleteBackupScheduleRequest + * + * @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 name of the backup schedule. + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the backup schedule. + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * + * 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. The name of the backup schedule. + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * + * 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/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..bc67604f4e15 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsRequest.php @@ -0,0 +1,305 @@ +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. Each + * collection id in this list must be unique. + * + * 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. Each + * collection id in this list must be unique. + * @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. Each + * collection id in this list must be unique. + * + * 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. Each + * collection id in this list must be unique. + * + * 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..944cecc3000e --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field.php @@ -0,0 +1,253 @@ +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 can 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 can be quoted using `` ` `` (backtick). The only character that + * must 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: + * `` `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 can 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 can be quoted using `` ` `` (backtick). The only character that + * must 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: + * `` `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 can 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 can be quoted using `` ` `` (backtick). The only character that + * must 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: + * `` `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 can 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 can be quoted using `` ` `` (backtick). The only character that + * must 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: + * `` `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..42a4d5ce8fd3 --- /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..7bb0a4304ab4 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig.php @@ -0,0 +1,76 @@ +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/GetBackupRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetBackupRequest.php new file mode 100644 index 000000000000..9663203b71d3 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetBackupRequest.php @@ -0,0 +1,88 @@ +google.firestore.admin.v1.GetBackupRequest + */ +class GetBackupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the backup to fetch. + * Format is `projects/{project}/locations/{location}/backups/{backup}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the backup to fetch. + * + * Format is `projects/{project}/locations/{location}/backups/{backup}`. Please see + * {@see FirestoreAdminClient::backupName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\GetBackupRequest + * + * @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. Name of the backup to fetch. + * Format is `projects/{project}/locations/{location}/backups/{backup}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the backup to fetch. + * Format is `projects/{project}/locations/{location}/backups/{backup}`. + * + * 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. Name of the backup to fetch. + * Format is `projects/{project}/locations/{location}/backups/{backup}`. + * + * 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/GetBackupScheduleRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetBackupScheduleRequest.php new file mode 100644 index 000000000000..ce2dfbc7e39f --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetBackupScheduleRequest.php @@ -0,0 +1,93 @@ +google.firestore.admin.v1.GetBackupScheduleRequest + */ +class GetBackupScheduleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the backup schedule. + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the backup schedule. + * + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * Please see {@see FirestoreAdminClient::backupScheduleName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\GetBackupScheduleRequest + * + * @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 name of the backup schedule. + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the backup schedule. + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * + * 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. The name of the backup schedule. + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * + * 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/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..6d01ac819ead --- /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. Each collection id in this list must be unique. + * + * 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. Each collection id in this list must be unique. + * @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. Each collection id in this list must be unique. + * + * 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. Each collection id in this list must be unique. + * + * 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..0f49391e6a9f --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField.php @@ -0,0 +1,194 @@ +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. + * @type \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig $vector_config + * Indicates that this field supports nearest neighbor and distance + * operations on vector. + * } + */ + 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; + } + + /** + * Indicates that this field supports nearest neighbor and distance + * operations on vector. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.VectorConfig vector_config = 4; + * @return \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig|null + */ + public function getVectorConfig() + { + return $this->readOneof(4); + } + + public function hasVectorConfig() + { + return $this->hasOneof(4); + } + + /** + * Indicates that this field supports nearest neighbor and distance + * operations on vector. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.VectorConfig vector_config = 4; + * @param \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig $var + * @return $this + */ + public function setVectorConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig::class); + $this->writeOneof(4, $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/IndexField/VectorConfig.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/VectorConfig.php new file mode 100644 index 000000000000..7f7d1a63104c --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/VectorConfig.php @@ -0,0 +1,120 @@ +google.firestore.admin.v1.Index.IndexField.VectorConfig + */ +class VectorConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The vector dimension this configuration applies to. + * The resulting index will only include vectors of this dimension, and + * can be used for vector search with the same dimension. + * + * Generated from protobuf field int32 dimension = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $dimension = 0; + protected $type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $dimension + * Required. The vector dimension this configuration applies to. + * The resulting index will only include vectors of this dimension, and + * can be used for vector search with the same dimension. + * @type \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig\FlatIndex $flat + * Indicates the vector index is a flat index. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Index::initOnce(); + parent::__construct($data); + } + + /** + * Required. The vector dimension this configuration applies to. + * The resulting index will only include vectors of this dimension, and + * can be used for vector search with the same dimension. + * + * Generated from protobuf field int32 dimension = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDimension() + { + return $this->dimension; + } + + /** + * Required. The vector dimension this configuration applies to. + * The resulting index will only include vectors of this dimension, and + * can be used for vector search with the same dimension. + * + * Generated from protobuf field int32 dimension = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDimension($var) + { + GPBUtil::checkInt32($var); + $this->dimension = $var; + + return $this; + } + + /** + * Indicates the vector index is a flat index. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex flat = 2; + * @return \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig\FlatIndex|null + */ + public function getFlat() + { + return $this->readOneof(2); + } + + public function hasFlat() + { + return $this->hasOneof(2); + } + + /** + * Indicates the vector index is a flat index. + * + * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex flat = 2; + * @param \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig\FlatIndex $var + * @return $this + */ + public function setFlat($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig\FlatIndex::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getType() + { + return $this->whichOneof("type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(VectorConfig::class, \Google\Cloud\Firestore\Admin\V1\Index_IndexField_VectorConfig::class); + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/VectorConfig/FlatIndex.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/VectorConfig/FlatIndex.php new file mode 100644 index 000000000000..b2321214c64d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/VectorConfig/FlatIndex.php @@ -0,0 +1,37 @@ +google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex + */ +class FlatIndex 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\Index::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FlatIndex::class, \Google\Cloud\Firestore\Admin\V1\Index_IndexField_VectorConfig_FlatIndex::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/ListBackupSchedulesRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupSchedulesRequest.php new file mode 100644 index 000000000000..ad8c349dacd6 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupSchedulesRequest.php @@ -0,0 +1,88 @@ +google.firestore.admin.v1.ListBackupSchedulesRequest + */ +class ListBackupSchedulesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent database. + * Format is `projects/{project}/databases/{database}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. The parent database. + * + * Format is `projects/{project}/databases/{database}`. Please see + * {@see FirestoreAdminClient::databaseName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\ListBackupSchedulesRequest + * + * @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 database. + * Format is `projects/{project}/databases/{database}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent database. + * Format is `projects/{project}/databases/{database}`. + * + * 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. The parent database. + * Format is `projects/{project}/databases/{database}`. + * + * 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/ListBackupSchedulesResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupSchedulesResponse.php new file mode 100644 index 000000000000..bda082e013e8 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupSchedulesResponse.php @@ -0,0 +1,68 @@ +google.firestore.admin.v1.ListBackupSchedulesResponse + */ +class ListBackupSchedulesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of all backup schedules. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + */ + private $backup_schedules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Firestore\Admin\V1\BackupSchedule>|\Google\Protobuf\Internal\RepeatedField $backup_schedules + * List of all backup schedules. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * List of all backup schedules. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackupSchedules() + { + return $this->backup_schedules; + } + + /** + * List of all backup schedules. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; + * @param array<\Google\Cloud\Firestore\Admin\V1\BackupSchedule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackupSchedules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\BackupSchedule::class); + $this->backup_schedules = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsRequest.php new file mode 100644 index 000000000000..fa8525ee48bc --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsRequest.php @@ -0,0 +1,103 @@ +google.firestore.admin.v1.ListBackupsRequest + */ +class ListBackupsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The location to list backups from. + * Format is `projects/{project}/locations/{location}`. + * Use `{location} = '-'` to list backups from all locations for the given + * project. This allows listing backups from a single location or from all + * locations. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + + /** + * @param string $parent Required. The location to list backups from. + * + * Format is `projects/{project}/locations/{location}`. + * Use `{location} = '-'` to list backups from all locations for the given + * project. This allows listing backups from a single location or from all + * locations. Please see + * {@see FirestoreAdminClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\Firestore\Admin\V1\ListBackupsRequest + * + * @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 location to list backups from. + * Format is `projects/{project}/locations/{location}`. + * Use `{location} = '-'` to list backups from all locations for the given + * project. This allows listing backups from a single location or from all + * locations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The location to list backups from. + * Format is `projects/{project}/locations/{location}`. + * Use `{location} = '-'` to list backups from all locations for the given + * project. This allows listing backups from a single location or from all + * locations. + * + * 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. The location to list backups from. + * Format is `projects/{project}/locations/{location}`. + * Use `{location} = '-'` to list backups from all locations for the given + * project. This allows listing backups from a single location or from all + * locations. + * + * 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/ListBackupsResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsResponse.php new file mode 100644 index 000000000000..b3fa74286dcb --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsResponse.php @@ -0,0 +1,118 @@ +google.firestore.admin.v1.ListBackupsResponse + */ +class ListBackupsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of all backups for the project. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Backup backups = 1; + */ + private $backups; + /** + * List of locations that existing backups were not able to be fetched from. + * Instead of failing the entire requests when a single location is + * unreachable, this response returns a partial result set and list of + * locations unable to be reached here. The request can be retried against a + * single location to get a concrete error. + * + * 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\Backup>|\Google\Protobuf\Internal\RepeatedField $backups + * List of all backups for the project. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * List of locations that existing backups were not able to be fetched from. + * Instead of failing the entire requests when a single location is + * unreachable, this response returns a partial result set and list of + * locations unable to be reached here. The request can be retried against a + * single location to get a concrete error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * List of all backups for the project. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Backup backups = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackups() + { + return $this->backups; + } + + /** + * List of all backups for the project. + * + * Generated from protobuf field repeated .google.firestore.admin.v1.Backup backups = 1; + * @param array<\Google\Cloud\Firestore\Admin\V1\Backup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\Backup::class); + $this->backups = $arr; + + return $this; + } + + /** + * List of locations that existing backups were not able to be fetched from. + * Instead of failing the entire requests when a single location is + * unreachable, this response returns a partial result set and list of + * locations unable to be reached here. The request can be retried against a + * single location to get a concrete error. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * List of locations that existing backups were not able to be fetched from. + * Instead of failing the entire requests when a single location is + * unreachable, this response returns a partial result set and list of + * locations unable to be reached here. The request can be retried against a + * single location to get a concrete error. + * + * 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/ListDatabasesRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesRequest.php new file mode 100644 index 000000000000..afeeb262a56b --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesRequest.php @@ -0,0 +1,120 @@ +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 = ''; + /** + * If true, also returns deleted resources. + * + * Generated from protobuf field bool show_deleted = 4; + */ + protected $show_deleted = false; + + /** + * @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}` + * @type bool $show_deleted + * If true, also returns deleted resources. + * } + */ + 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; + } + + /** + * If true, also returns deleted resources. + * + * Generated from protobuf field bool show_deleted = 4; + * @return bool + */ + public function getShowDeleted() + { + return $this->show_deleted; + } + + /** + * If true, also returns deleted resources. + * + * Generated from protobuf field bool show_deleted = 4; + * @param bool $var + * @return $this + */ + public function setShowDeleted($var) + { + GPBUtil::checkBool($var); + $this->show_deleted = $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..c027afa975ac --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsRequest.php @@ -0,0 +1,221 @@ +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` or + * `ttlConfig:*`. + * + * 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` or + * `ttlConfig:*`. + * @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` or + * `ttlConfig:*`. + * + * 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` or + * `ttlConfig:*`. + * + * 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/RestoreDatabaseMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/RestoreDatabaseMetadata.php new file mode 100644 index 000000000000..526f1cacab72 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/RestoreDatabaseMetadata.php @@ -0,0 +1,268 @@ +google.firestore.admin.v1.RestoreDatabaseMetadata + */ +class RestoreDatabaseMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The time the restore was started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * The time the restore finished, unset for ongoing restores. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * The operation state of the restore. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; + */ + protected $operation_state = 0; + /** + * The name of the database being restored to. + * + * Generated from protobuf field string database = 4 [(.google.api.resource_reference) = { + */ + protected $database = ''; + /** + * The name of the backup restoring from. + * + * Generated from protobuf field string backup = 5 [(.google.api.resource_reference) = { + */ + protected $backup = ''; + /** + * How far along the restore is as an estimated percentage of remaining time. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_percentage = 8; + */ + protected $progress_percentage = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * The time the restore was started. + * @type \Google\Protobuf\Timestamp $end_time + * The time the restore finished, unset for ongoing restores. + * @type int $operation_state + * The operation state of the restore. + * @type string $database + * The name of the database being restored to. + * @type string $backup + * The name of the backup restoring from. + * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_percentage + * How far along the restore is as an estimated percentage of remaining time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); + parent::__construct($data); + } + + /** + * The time the restore was 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 the restore was 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 the restore finished, unset for ongoing restores. + * + * 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 the restore finished, unset for ongoing restores. + * + * 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 operation state of the restore. + * + * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; + * @return int + */ + public function getOperationState() + { + return $this->operation_state; + } + + /** + * The operation state of the restore. + * + * 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 name of the database being restored to. + * + * Generated from protobuf field string database = 4 [(.google.api.resource_reference) = { + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * The name of the database being restored to. + * + * Generated from protobuf field string database = 4 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * The name of the backup restoring from. + * + * Generated from protobuf field string backup = 5 [(.google.api.resource_reference) = { + * @return string + */ + public function getBackup() + { + return $this->backup; + } + + /** + * The name of the backup restoring from. + * + * Generated from protobuf field string backup = 5 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkString($var, True); + $this->backup = $var; + + return $this; + } + + /** + * How far along the restore is as an estimated percentage of remaining time. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_percentage = 8; + * @return \Google\Cloud\Firestore\Admin\V1\Progress|null + */ + public function getProgressPercentage() + { + return $this->progress_percentage; + } + + public function hasProgressPercentage() + { + return isset($this->progress_percentage); + } + + public function clearProgressPercentage() + { + unset($this->progress_percentage); + } + + /** + * How far along the restore is as an estimated percentage of remaining time. + * + * Generated from protobuf field .google.firestore.admin.v1.Progress progress_percentage = 8; + * @param \Google\Cloud\Firestore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressPercentage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); + $this->progress_percentage = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/RestoreDatabaseRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/RestoreDatabaseRequest.php new file mode 100644 index 000000000000..81e97c650b37 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/RestoreDatabaseRequest.php @@ -0,0 +1,172 @@ +google.firestore.admin.v1.RestoreDatabaseRequest + */ +class RestoreDatabaseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project to restore the database in. Format is + * `projects/{project_id}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The ID to use for the database, which will become the final + * component of the database's resource name. This database id must not be + * associated with an existing database. + * 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 = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $database_id = ''; + /** + * Required. Backup to restore from. Must be from the same project as the + * parent. + * Format is: `projects/{project_id}/locations/{location}/backups/{backup}` + * + * Generated from protobuf field string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $backup = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project to restore the database in. Format is + * `projects/{project_id}`. + * @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 database id must not be + * associated with an existing database. + * 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. + * @type string $backup + * Required. Backup to restore from. Must be from the same project as the + * parent. + * Format is: `projects/{project_id}/locations/{location}/backups/{backup}` + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project to restore the database in. Format is + * `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. The project to restore the database in. Format is + * `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 ID to use for the database, which will become the final + * component of the database's resource name. This database id must not be + * associated with an existing database. + * 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 = 2 [(.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 database id must not be + * associated with an existing database. + * 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 = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDatabaseId($var) + { + GPBUtil::checkString($var, True); + $this->database_id = $var; + + return $this; + } + + /** + * Required. Backup to restore from. Must be from the same project as the + * parent. + * Format is: `projects/{project_id}/locations/{location}/backups/{backup}` + * + * Generated from protobuf field string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getBackup() + { + return $this->backup; + } + + /** + * Required. Backup to restore from. Must be from the same project as the + * parent. + * Format is: `projects/{project_id}/locations/{location}/backups/{backup}` + * + * Generated from protobuf field string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setBackup($var) + { + GPBUtil::checkString($var, True); + $this->backup = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateBackupScheduleRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateBackupScheduleRequest.php new file mode 100644 index 000000000000..cdc9e8b0e306 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateBackupScheduleRequest.php @@ -0,0 +1,137 @@ +google.firestore.admin.v1.UpdateBackupScheduleRequest + */ +class UpdateBackupScheduleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The backup schedule to update. + * + * Generated from protobuf field .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backup_schedule = 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\BackupSchedule $backupSchedule Required. The backup schedule to update. + * @param \Google\Protobuf\FieldMask $updateMask The list of fields to be updated. + * + * @return \Google\Cloud\Firestore\Admin\V1\UpdateBackupScheduleRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Firestore\Admin\V1\BackupSchedule $backupSchedule, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setBackupSchedule($backupSchedule) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\Admin\V1\BackupSchedule $backup_schedule + * Required. The backup schedule 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 backup schedule to update. + * + * Generated from protobuf field .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Firestore\Admin\V1\BackupSchedule|null + */ + public function getBackupSchedule() + { + return $this->backup_schedule; + } + + public function hasBackupSchedule() + { + return isset($this->backup_schedule); + } + + public function clearBackupSchedule() + { + unset($this->backup_schedule); + } + + /** + * Required. The backup schedule to update. + * + * Generated from protobuf field .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Firestore\Admin\V1\BackupSchedule $var + * @return $this + */ + public function setBackupSchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\BackupSchedule::class); + $this->backup_schedule = $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/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/proto/src/Google/Cloud/Firestore/Admin/V1/WeeklyRecurrence.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/WeeklyRecurrence.php new file mode 100644 index 000000000000..e7c64ebae899 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/WeeklyRecurrence.php @@ -0,0 +1,72 @@ +google.firestore.admin.v1.WeeklyRecurrence + */ +class WeeklyRecurrence extends \Google\Protobuf\Internal\Message +{ + /** + * The day of week to run. + * DAY_OF_WEEK_UNSPECIFIED is not allowed. + * + * Generated from protobuf field .google.type.DayOfWeek day = 2; + */ + protected $day = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $day + * The day of week to run. + * DAY_OF_WEEK_UNSPECIFIED is not allowed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\Admin\V1\Schedule::initOnce(); + parent::__construct($data); + } + + /** + * The day of week to run. + * DAY_OF_WEEK_UNSPECIFIED is not allowed. + * + * Generated from protobuf field .google.type.DayOfWeek day = 2; + * @return int + */ + public function getDay() + { + return $this->day; + } + + /** + * The day of week to run. + * DAY_OF_WEEK_UNSPECIFIED is not allowed. + * + * Generated from protobuf field .google.type.DayOfWeek day = 2; + * @param int $var + * @return $this + */ + public function setDay($var) + { + GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class); + $this->day = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/bulk_delete_documents.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/bulk_delete_documents.php new file mode 100644 index 000000000000..68aeec0bfc87 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/bulk_delete_documents.php @@ -0,0 +1,91 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firestoreAdminClient->bulkDeleteDocuments($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var BulkDeleteDocumentsResponse $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]'); + + bulk_delete_documents_sample($formattedName); +} +// [END firestore_v1_generated_FirestoreAdmin_BulkDeleteDocuments_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_backup_schedule.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_backup_schedule.php new file mode 100644 index 000000000000..0e83e8d00dee --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_backup_schedule.php @@ -0,0 +1,77 @@ +setParent($formattedParent) + ->setBackupSchedule($backupSchedule); + + // Call the API and handle any network failures. + try { + /** @var BackupSchedule $response */ + $response = $firestoreAdminClient->createBackupSchedule($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::databaseName('[PROJECT]', '[DATABASE]'); + + create_backup_schedule_sample($formattedParent); +} +// [END firestore_v1_generated_FirestoreAdmin_CreateBackupSchedule_sync] 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_backup.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_backup.php new file mode 100644 index 000000000000..fe41a64237fc --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_backup.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $firestoreAdminClient->deleteBackup($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::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + + delete_backup_sample($formattedName); +} +// [END firestore_v1_generated_FirestoreAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_backup_schedule.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_backup_schedule.php new file mode 100644 index 000000000000..53a4b98405a4 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_backup_schedule.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $firestoreAdminClient->deleteBackupSchedule($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::backupScheduleName( + '[PROJECT]', + '[DATABASE]', + '[BACKUP_SCHEDULE]' + ); + + delete_backup_schedule_sample($formattedName); +} +// [END firestore_v1_generated_FirestoreAdmin_DeleteBackupSchedule_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_backup.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_backup.php new file mode 100644 index 000000000000..a6be739032e1 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_backup.php @@ -0,0 +1,73 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Backup $response */ + $response = $firestoreAdminClient->getBackup($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::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + + get_backup_sample($formattedName); +} +// [END firestore_v1_generated_FirestoreAdmin_GetBackup_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_backup_schedule.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_backup_schedule.php new file mode 100644 index 000000000000..d3912a59df7d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_backup_schedule.php @@ -0,0 +1,78 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var BackupSchedule $response */ + $response = $firestoreAdminClient->getBackupSchedule($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::backupScheduleName( + '[PROJECT]', + '[DATABASE]', + '[BACKUP_SCHEDULE]' + ); + + get_backup_schedule_sample($formattedName); +} +// [END firestore_v1_generated_FirestoreAdmin_GetBackupSchedule_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_backup_schedules.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_backup_schedules.php new file mode 100644 index 000000000000..fc8d6552d54d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_backup_schedules.php @@ -0,0 +1,73 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var ListBackupSchedulesResponse $response */ + $response = $firestoreAdminClient->listBackupSchedules($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::databaseName('[PROJECT]', '[DATABASE]'); + + list_backup_schedules_sample($formattedParent); +} +// [END firestore_v1_generated_FirestoreAdmin_ListBackupSchedules_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_backups.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_backups.php new file mode 100644 index 000000000000..79980c681c3e --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_backups.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var ListBackupsResponse $response */ + $response = $firestoreAdminClient->listBackups($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::locationName('[PROJECT]', '[LOCATION]'); + + list_backups_sample($formattedParent); +} +// [END firestore_v1_generated_FirestoreAdmin_ListBackups_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/restore_database.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/restore_database.php new file mode 100644 index 000000000000..0df0f62ea545 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/restore_database.php @@ -0,0 +1,121 @@ +setParent($formattedParent) + ->setDatabaseId($databaseId) + ->setBackup($formattedBackup); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firestoreAdminClient->restoreDatabase($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]'; + $formattedBackup = FirestoreAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + + restore_database_sample($formattedParent, $databaseId, $formattedBackup); +} +// [END firestore_v1_generated_FirestoreAdmin_RestoreDatabase_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_backup_schedule.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_backup_schedule.php new file mode 100644 index 000000000000..eaa50535ba29 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_backup_schedule.php @@ -0,0 +1,59 @@ +setBackupSchedule($backupSchedule); + + // Call the API and handle any network failures. + try { + /** @var BackupSchedule $response */ + $response = $firestoreAdminClient->updateBackupSchedule($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_FirestoreAdmin_UpdateBackupSchedule_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..9b249c701a51 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_field.php @@ -0,0 +1,122 @@ +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..9b15de33b4d3 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/src/V1/Client/FirestoreAdminClient.php @@ -0,0 +1,1153 @@ + 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 backup + * resource. + * + * @param string $project + * @param string $location + * @param string $backup + * + * @return string The formatted backup resource. + */ + public static function backupName(string $project, string $location, string $backup): string + { + return self::getPathTemplate('backup')->render([ + 'project' => $project, + 'location' => $location, + 'backup' => $backup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * backup_schedule resource. + * + * @param string $project + * @param string $database + * @param string $backupSchedule + * + * @return string The formatted backup_schedule resource. + */ + public static function backupScheduleName(string $project, string $database, string $backupSchedule): string + { + return self::getPathTemplate('backupSchedule')->render([ + 'project' => $project, + 'database' => $database, + 'backup_schedule' => $backupSchedule, + ]); + } + + /** + * 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 location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * 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 + * - backup: projects/{project}/locations/{location}/backups/{backup} + * - backupSchedule: projects/{project}/databases/{database}/backupSchedules/{backup_schedule} + * - 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} + * - location: projects/{project}/locations/{location} + * - 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); + } + + /** + * Bulk deletes a subset of documents from Google Cloud Firestore. + * Documents created or updated after the underlying system starts to process + * the request will not be deleted. The bulk delete occurs in the background + * and its progress can be monitored and managed via the Operation resource + * that is created. + * + * For more details on bulk delete behavior, refer to: + * https://cloud.google.com/firestore/docs/manage-data/bulk-delete + * + * The async variant is {@see FirestoreAdminClient::bulkDeleteDocumentsAsync()} . + * + * @example samples/V1/FirestoreAdminClient/bulk_delete_documents.php + * + * @param BulkDeleteDocumentsRequest $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 bulkDeleteDocuments(BulkDeleteDocumentsRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BulkDeleteDocuments', $request, $callOptions)->wait(); + } + + /** + * Creates a backup schedule on a database. + * At most two backup schedules can be configured on a database, one daily + * backup schedule and one weekly backup schedule. + * + * The async variant is {@see FirestoreAdminClient::createBackupScheduleAsync()} . + * + * @example samples/V1/FirestoreAdminClient/create_backup_schedule.php + * + * @param CreateBackupScheduleRequest $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 BackupSchedule + * + * @throws ApiException Thrown if the API call fails. + */ + public function createBackupSchedule(CreateBackupScheduleRequest $request, array $callOptions = []): BackupSchedule + { + return $this->startApiCall('CreateBackupSchedule', $request, $callOptions)->wait(); + } + + /** + * 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 backup. + * + * The async variant is {@see FirestoreAdminClient::deleteBackupAsync()} . + * + * @example samples/V1/FirestoreAdminClient/delete_backup.php + * + * @param DeleteBackupRequest $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 deleteBackup(DeleteBackupRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteBackup', $request, $callOptions)->wait(); + } + + /** + * Deletes a backup schedule. + * + * The async variant is {@see FirestoreAdminClient::deleteBackupScheduleAsync()} . + * + * @example samples/V1/FirestoreAdminClient/delete_backup_schedule.php + * + * @param DeleteBackupScheduleRequest $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 deleteBackupSchedule(DeleteBackupScheduleRequest $request, array $callOptions = []): void + { + $this->startApiCall('DeleteBackupSchedule', $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 backup. + * + * The async variant is {@see FirestoreAdminClient::getBackupAsync()} . + * + * @example samples/V1/FirestoreAdminClient/get_backup.php + * + * @param GetBackupRequest $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 Backup + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackup(GetBackupRequest $request, array $callOptions = []): Backup + { + return $this->startApiCall('GetBackup', $request, $callOptions)->wait(); + } + + /** + * Gets information about a backup schedule. + * + * The async variant is {@see FirestoreAdminClient::getBackupScheduleAsync()} . + * + * @example samples/V1/FirestoreAdminClient/get_backup_schedule.php + * + * @param GetBackupScheduleRequest $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 BackupSchedule + * + * @throws ApiException Thrown if the API call fails. + */ + public function getBackupSchedule(GetBackupScheduleRequest $request, array $callOptions = []): BackupSchedule + { + return $this->startApiCall('GetBackupSchedule', $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 backup schedules. + * + * The async variant is {@see FirestoreAdminClient::listBackupSchedulesAsync()} . + * + * @example samples/V1/FirestoreAdminClient/list_backup_schedules.php + * + * @param ListBackupSchedulesRequest $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 ListBackupSchedulesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackupSchedules(ListBackupSchedulesRequest $request, array $callOptions = []): ListBackupSchedulesResponse + { + return $this->startApiCall('ListBackupSchedules', $request, $callOptions)->wait(); + } + + /** + * Lists all the backups. + * + * The async variant is {@see FirestoreAdminClient::listBackupsAsync()} . + * + * @example samples/V1/FirestoreAdminClient/list_backups.php + * + * @param ListBackupsRequest $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 ListBackupsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listBackups(ListBackupsRequest $request, array $callOptions = []): ListBackupsResponse + { + return $this->startApiCall('ListBackups', $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); + } + + /** + * Creates a new database by restoring from an existing backup. + * + * The new database must be in the same cloud region or multi-region location + * as the existing backup. This behaves similar to + * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase] + * except instead of creating a new empty database, a new database is created + * with the database type, index configuration, and documents from an existing + * backup. + * + * The [long-running operation][google.longrunning.Operation] can be used to + * track the progress of the restore, with the Operation's + * [metadata][google.longrunning.Operation.metadata] field type being the + * [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata]. + * The [response][google.longrunning.Operation.response] type is the + * [Database][google.firestore.admin.v1.Database] if the restore was + * successful. The new database is not readable or writeable until the LRO has + * completed. + * + * The async variant is {@see FirestoreAdminClient::restoreDatabaseAsync()} . + * + * @example samples/V1/FirestoreAdminClient/restore_database.php + * + * @param RestoreDatabaseRequest $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 restoreDatabase(RestoreDatabaseRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RestoreDatabase', $request, $callOptions)->wait(); + } + + /** + * Updates a backup schedule. + * + * The async variant is {@see FirestoreAdminClient::updateBackupScheduleAsync()} . + * + * @example samples/V1/FirestoreAdminClient/update_backup_schedule.php + * + * @param UpdateBackupScheduleRequest $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 BackupSchedule + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateBackupSchedule(UpdateBackupScheduleRequest $request, array $callOptions = []): BackupSchedule + { + return $this->startApiCall('UpdateBackupSchedule', $request, $callOptions)->wait(); + } + + /** + * 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 @@ +databaseName('[PROJECT]', '[DATABASE]'); + * $operationResponse = $firestoreAdminClient->bulkDeleteDocuments($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->bulkDeleteDocuments($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'bulkDeleteDocuments'); + * 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 $backupNameTemplate; + + private static $backupScheduleNameTemplate; + + private static $collectionGroupNameTemplate; + + private static $databaseNameTemplate; + + private static $fieldNameTemplate; + + private static $indexNameTemplate; + + private static $locationNameTemplate; + + 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 getBackupNameTemplate() + { + if (self::$backupNameTemplate == null) { + self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/backups/{backup}'); + } + + return self::$backupNameTemplate; + } + + private static function getBackupScheduleNameTemplate() + { + if (self::$backupScheduleNameTemplate == null) { + self::$backupScheduleNameTemplate = new PathTemplate('projects/{project}/databases/{database}/backupSchedules/{backup_schedule}'); + } + + return self::$backupScheduleNameTemplate; + } + + 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 getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + 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 = [ + 'backup' => self::getBackupNameTemplate(), + 'backupSchedule' => self::getBackupScheduleNameTemplate(), + 'collectionGroup' => self::getCollectionGroupNameTemplate(), + 'database' => self::getDatabaseNameTemplate(), + 'field' => self::getFieldNameTemplate(), + 'index' => self::getIndexNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'project' => self::getProjectNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a backup + * resource. + * + * @param string $project + * @param string $location + * @param string $backup + * + * @return string The formatted backup resource. + */ + public static function backupName($project, $location, $backup) + { + return self::getBackupNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'backup' => $backup, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * backup_schedule resource. + * + * @param string $project + * @param string $database + * @param string $backupSchedule + * + * @return string The formatted backup_schedule resource. + */ + public static function backupScheduleName($project, $database, $backupSchedule) + { + return self::getBackupScheduleNameTemplate()->render([ + 'project' => $project, + 'database' => $database, + 'backup_schedule' => $backupSchedule, + ]); + } + + /** + * 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 location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * 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 + * - backup: projects/{project}/locations/{location}/backups/{backup} + * - backupSchedule: projects/{project}/databases/{database}/backupSchedules/{backup_schedule} + * - 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} + * - location: projects/{project}/locations/{location} + * - 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); + } + + /** + * Bulk deletes a subset of documents from Google Cloud Firestore. + * Documents created or updated after the underlying system starts to process + * the request will not be deleted. The bulk delete occurs in the background + * and its progress can be monitored and managed via the Operation resource + * that is created. + * + * For more details on bulk delete behavior, refer to: + * https://cloud.google.com/firestore/docs/manage-data/bulk-delete + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedName = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); + * $operationResponse = $firestoreAdminClient->bulkDeleteDocuments($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->bulkDeleteDocuments($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'bulkDeleteDocuments'); + * 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 operate. Should be of the form: + * `projects/{project_id}/databases/{database_id}`. + * @param array $optionalArgs { + * Optional. + * + * @type string[] $collectionIds + * Optional. IDs of the collection groups to delete. Unspecified means all + * collection groups. + * + * Each collection group in this list must be unique. + * @type string[] $namespaceIds + * Optional. Namespaces to delete. + * + * An empty list means all namespaces. This is the recommended + * 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 delete from 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 bulkDeleteDocuments($name, array $optionalArgs = []) + { + $request = new BulkDeleteDocumentsRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['collectionIds'])) { + $request->setCollectionIds($optionalArgs['collectionIds']); + } + + 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('BulkDeleteDocuments', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Creates a backup schedule on a database. + * At most two backup schedules can be configured on a database, one daily + * backup schedule and one weekly backup schedule. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedParent = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); + * $backupSchedule = new BackupSchedule(); + * $response = $firestoreAdminClient->createBackupSchedule($formattedParent, $backupSchedule); + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent database. + * + * Format `projects/{project}/databases/{database}` + * @param BackupSchedule $backupSchedule Required. The backup schedule 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\Cloud\Firestore\Admin\V1\BackupSchedule + * + * @throws ApiException if the remote call fails + */ + public function createBackupSchedule($parent, $backupSchedule, array $optionalArgs = []) + { + $request = new CreateBackupScheduleRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setBackupSchedule($backupSchedule); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateBackupSchedule', BackupSchedule::class, $optionalArgs, $request)->wait(); + } + + /** + * 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 backup. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedName = $firestoreAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + * $firestoreAdminClient->deleteBackup($formattedName); + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the backup to delete. + * + * format is `projects/{project}/locations/{location}/backups/{backup}`. + * @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 deleteBackup($name, array $optionalArgs = []) + { + $request = new DeleteBackupRequest(); + $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('DeleteBackup', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes a backup schedule. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedName = $firestoreAdminClient->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); + * $firestoreAdminClient->deleteBackupSchedule($formattedName); + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the backup schedule. + * + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * @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 deleteBackupSchedule($name, array $optionalArgs = []) + { + $request = new DeleteBackupScheduleRequest(); + $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('DeleteBackupSchedule', GPBEmpty::class, $optionalArgs, $request)->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. Each + * collection id in this list must be unique. + * @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 backup. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedName = $firestoreAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + * $response = $firestoreAdminClient->getBackup($formattedName); + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the backup to fetch. + * + * Format is `projects/{project}/locations/{location}/backups/{backup}`. + * @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\Backup + * + * @throws ApiException if the remote call fails + */ + public function getBackup($name, array $optionalArgs = []) + { + $request = new GetBackupRequest(); + $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('GetBackup', Backup::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets information about a backup schedule. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedName = $firestoreAdminClient->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); + * $response = $firestoreAdminClient->getBackupSchedule($formattedName); + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the backup schedule. + * + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * @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\BackupSchedule + * + * @throws ApiException if the remote call fails + */ + public function getBackupSchedule($name, array $optionalArgs = []) + { + $request = new GetBackupScheduleRequest(); + $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('GetBackupSchedule', BackupSchedule::class, $optionalArgs, $request)->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. Each collection id in this list must be unique. + * @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 backup schedules. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedParent = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); + * $response = $firestoreAdminClient->listBackupSchedules($formattedParent); + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent database. + * + * Format is `projects/{project}/databases/{database}`. + * @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\ListBackupSchedulesResponse + * + * @throws ApiException if the remote call fails + */ + public function listBackupSchedules($parent, array $optionalArgs = []) + { + $request = new ListBackupSchedulesRequest(); + $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('ListBackupSchedules', ListBackupSchedulesResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists all the backups. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedParent = $firestoreAdminClient->locationName('[PROJECT]', '[LOCATION]'); + * $response = $firestoreAdminClient->listBackups($formattedParent); + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The location to list backups from. + * + * Format is `projects/{project}/locations/{location}`. + * Use `{location} = '-'` to list backups from all locations for the given + * project. This allows listing backups from a single location or from all + * locations. + * @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\ListBackupsResponse + * + * @throws ApiException if the remote call fails + */ + public function listBackups($parent, array $optionalArgs = []) + { + $request = new ListBackupsRequest(); + $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('ListBackups', ListBackupsResponse::class, $optionalArgs, $request)->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 bool $showDeleted + * If true, also returns deleted resources. + * @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; + if (isset($optionalArgs['showDeleted'])) { + $request->setShowDeleted($optionalArgs['showDeleted']); + } + + $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` or + * `ttlConfig:*`. + * @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); + } + + /** + * Creates a new database by restoring from an existing backup. + * + * The new database must be in the same cloud region or multi-region location + * as the existing backup. This behaves similar to + * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase] + * except instead of creating a new empty database, a new database is created + * with the database type, index configuration, and documents from an existing + * backup. + * + * The [long-running operation][google.longrunning.Operation] can be used to + * track the progress of the restore, with the Operation's + * [metadata][google.longrunning.Operation.metadata] field type being the + * [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata]. + * The [response][google.longrunning.Operation.response] type is the + * [Database][google.firestore.admin.v1.Database] if the restore was + * successful. The new database is not readable or writeable until the LRO has + * completed. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $formattedParent = $firestoreAdminClient->projectName('[PROJECT]'); + * $databaseId = 'database_id'; + * $formattedBackup = $firestoreAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + * $operationResponse = $firestoreAdminClient->restoreDatabase($formattedParent, $databaseId, $formattedBackup); + * $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->restoreDatabase($formattedParent, $databaseId, $formattedBackup); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'restoreDatabase'); + * 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. The project to restore the database in. Format is + * `projects/{project_id}`. + * @param string $databaseId Required. The ID to use for the database, which will become the final + * component of the database's resource name. This database id must not be + * associated with an existing database. + * + * 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 string $backup Required. Backup to restore from. Must be from the same project as the + * parent. + * + * Format is: `projects/{project_id}/locations/{location}/backups/{backup}` + * @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 restoreDatabase($parent, $databaseId, $backup, array $optionalArgs = []) + { + $request = new RestoreDatabaseRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setDatabaseId($databaseId); + $request->setBackup($backup); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('RestoreDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Updates a backup schedule. + * + * Sample code: + * ``` + * $firestoreAdminClient = new FirestoreAdminClient(); + * try { + * $backupSchedule = new BackupSchedule(); + * $response = $firestoreAdminClient->updateBackupSchedule($backupSchedule); + * } finally { + * $firestoreAdminClient->close(); + * } + * ``` + * + * @param BackupSchedule $backupSchedule Required. The backup schedule 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\Cloud\Firestore\Admin\V1\BackupSchedule + * + * @throws ApiException if the remote call fails + */ + public function updateBackupSchedule($backupSchedule, array $optionalArgs = []) + { + $request = new UpdateBackupScheduleRequest(); + $requestParamHeaders = []; + $request->setBackupSchedule($backupSchedule); + $requestParamHeaders['backup_schedule.name'] = $backupSchedule->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->startCall('UpdateBackupSchedule', BackupSchedule::class, $optionalArgs, $request)->wait(); + } + + /** + * 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..9b70c2e17bb1 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/src/V1/gapic_metadata.json @@ -0,0 +1,138 @@ +{ + "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": { + "BulkDeleteDocuments": { + "methods": [ + "bulkDeleteDocuments" + ] + }, + "CreateBackupSchedule": { + "methods": [ + "createBackupSchedule" + ] + }, + "CreateDatabase": { + "methods": [ + "createDatabase" + ] + }, + "CreateIndex": { + "methods": [ + "createIndex" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "DeleteBackupSchedule": { + "methods": [ + "deleteBackupSchedule" + ] + }, + "DeleteDatabase": { + "methods": [ + "deleteDatabase" + ] + }, + "DeleteIndex": { + "methods": [ + "deleteIndex" + ] + }, + "ExportDocuments": { + "methods": [ + "exportDocuments" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetBackupSchedule": { + "methods": [ + "getBackupSchedule" + ] + }, + "GetDatabase": { + "methods": [ + "getDatabase" + ] + }, + "GetField": { + "methods": [ + "getField" + ] + }, + "GetIndex": { + "methods": [ + "getIndex" + ] + }, + "ImportDocuments": { + "methods": [ + "importDocuments" + ] + }, + "ListBackupSchedules": { + "methods": [ + "listBackupSchedules" + ] + }, + "ListBackups": { + "methods": [ + "listBackups" + ] + }, + "ListDatabases": { + "methods": [ + "listDatabases" + ] + }, + "ListFields": { + "methods": [ + "listFields" + ] + }, + "ListIndexes": { + "methods": [ + "listIndexes" + ] + }, + "RestoreDatabase": { + "methods": [ + "restoreDatabase" + ] + }, + "UpdateBackupSchedule": { + "methods": [ + "updateBackupSchedule" + ] + }, + "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..d9d11f0e1967 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_client_config.json @@ -0,0 +1,166 @@ +{ + "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": { + "BulkDeleteDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateBackupSchedule": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "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" + }, + "DeleteBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteBackupSchedule": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_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" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetBackupSchedule": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_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" + }, + "ListBackupSchedules": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_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" + }, + "RestoreDatabase": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateBackupSchedule": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_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..8aa9b9991fc1 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_descriptor_config.php @@ -0,0 +1,408 @@ + [ + 'google.firestore.admin.v1.FirestoreAdmin' => [ + 'BulkDeleteDocuments' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\BulkDeleteDocumentsResponse', + 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\BulkDeleteDocumentsMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + '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', + ], + ], + ], + ], + 'RestoreDatabase' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\Database', + 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\RestoreDatabaseMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + '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', + ], + ], + ], + ], + 'CreateBackupSchedule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\Admin\V1\BackupSchedule', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteBackup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupSchedule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteIndex' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetBackup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\Admin\V1\Backup', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupSchedule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\Admin\V1\BackupSchedule', + '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', + ], + ], + ], + ], + 'ListBackupSchedules' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\Admin\V1\ListBackupSchedulesResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackups' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\Admin\V1\ListBackupsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + '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', + ], + ], + ], + ], + 'UpdateBackupSchedule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Firestore\Admin\V1\BackupSchedule', + 'headerParams' => [ + [ + 'keyName' => 'backup_schedule.name', + 'fieldAccessors' => [ + 'getBackupSchedule', + 'getName', + ], + ], + ], + ], + 'templateMap' => [ + 'backup' => 'projects/{project}/locations/{location}/backups/{backup}', + 'backupSchedule' => 'projects/{project}/databases/{database}/backupSchedules/{backup_schedule}', + '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}', + 'location' => 'projects/{project}/locations/{location}', + '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..f5062d72f11e --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_rest_client_config.php @@ -0,0 +1,356 @@ + [ + 'google.firestore.admin.v1.FirestoreAdmin' => [ + 'BulkDeleteDocuments' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/databases/*}:bulkDeleteDocuments', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CreateBackupSchedule' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*}/backupSchedules', + 'body' => 'backup_schedule', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + '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', + ], + ], + ], + ], + 'DeleteBackup' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteBackupSchedule' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/databases/*/backupSchedules/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + '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', + ], + ], + ], + ], + 'GetBackup' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/backups/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetBackupSchedule' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/databases/*/backupSchedules/*}', + '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', + ], + ], + ], + ], + 'ListBackupSchedules' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/databases/*}/backupSchedules', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListBackups' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backups', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + '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', + ], + ], + ], + ], + 'RestoreDatabase' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*}/databases:restore', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateBackupSchedule' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{backup_schedule.name=projects/*/databases/*/backupSchedules/*}', + 'body' => 'backup_schedule', + 'placeholders' => [ + 'backup_schedule.name' => [ + 'getters' => [ + 'getBackupSchedule', + 'getName', + ], + ], + ], + ], + '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..7e117f18afd9 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/Client/FirestoreAdminClientTest.php @@ -0,0 +1,2313 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return FirestoreAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new FirestoreAdminClient($options); + } + + /** @test */ + public function bulkDeleteDocumentsTest() + { + $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/bulkDeleteDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BulkDeleteDocumentsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/bulkDeleteDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new BulkDeleteDocumentsRequest()) + ->setName($formattedName); + $response = $gapicClient->bulkDeleteDocuments($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/BulkDeleteDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); + $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 bulkDeleteDocumentsExceptionTest() + { + $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/bulkDeleteDocumentsTest'); + $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 BulkDeleteDocumentsRequest()) + ->setName($formattedName); + $response = $gapicClient->bulkDeleteDocuments($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); + 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 createBackupScheduleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new BackupSchedule(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $backupSchedule = new BackupSchedule(); + $request = (new CreateBackupScheduleRequest()) + ->setParent($formattedParent) + ->setBackupSchedule($backupSchedule); + $response = $gapicClient->createBackupSchedule($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/CreateBackupSchedule', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getBackupSchedule(); + $this->assertProtobufEquals($backupSchedule, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createBackupScheduleExceptionTest() + { + $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->databaseName('[PROJECT]', '[DATABASE]'); + $backupSchedule = new BackupSchedule(); + $request = (new CreateBackupScheduleRequest()) + ->setParent($formattedParent) + ->setBackupSchedule($backupSchedule); + try { + $gapicClient->createBackupSchedule($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 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 deleteBackupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + $request = (new DeleteBackupRequest()) + ->setName($formattedName); + $gapicClient->deleteBackup($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteBackup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteBackupExceptionTest() + { + $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->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + $request = (new DeleteBackupRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteBackup($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 deleteBackupScheduleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); + $request = (new DeleteBackupScheduleRequest()) + ->setName($formattedName); + $gapicClient->deleteBackupSchedule($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteBackupSchedule', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteBackupScheduleExceptionTest() + { + $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->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); + $request = (new DeleteBackupScheduleRequest()) + ->setName($formattedName); + try { + $gapicClient->deleteBackupSchedule($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 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 getBackupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $database = 'database1789464955'; + $databaseUid = 'databaseUid-458567796'; + $expectedResponse = new Backup(); + $expectedResponse->setName($name2); + $expectedResponse->setDatabase($database); + $expectedResponse->setDatabaseUid($databaseUid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + $request = (new GetBackupRequest()) + ->setName($formattedName); + $response = $gapicClient->getBackup($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/GetBackup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupExceptionTest() + { + $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->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + $request = (new GetBackupRequest()) + ->setName($formattedName); + try { + $gapicClient->getBackup($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 getBackupScheduleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new BackupSchedule(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); + $request = (new GetBackupScheduleRequest()) + ->setName($formattedName); + $response = $gapicClient->getBackupSchedule($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/GetBackupSchedule', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupScheduleExceptionTest() + { + $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->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); + $request = (new GetBackupScheduleRequest()) + ->setName($formattedName); + try { + $gapicClient->getBackupSchedule($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 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 listBackupSchedulesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListBackupSchedulesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new ListBackupSchedulesRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listBackupSchedules($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/ListBackupSchedules', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupSchedulesExceptionTest() + { + $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->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new ListBackupSchedulesRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listBackupSchedules($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 listBackupsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListBackupsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listBackups($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/ListBackups', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupsExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + $request = (new ListBackupsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listBackups($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 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 restoreDatabaseTest() + { + $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/restoreDatabaseTest'); + $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/restoreDatabaseTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $databaseId = 'databaseId816491103'; + $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + $request = (new RestoreDatabaseRequest()) + ->setParent($formattedParent) + ->setDatabaseId($databaseId) + ->setBackup($formattedBackup); + $response = $gapicClient->restoreDatabase($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/RestoreDatabase', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDatabaseId(); + $this->assertProtobufEquals($databaseId, $actualValue); + $actualValue = $actualApiRequestObject->getBackup(); + $this->assertProtobufEquals($formattedBackup, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreDatabaseTest'); + $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 restoreDatabaseExceptionTest() + { + $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/restoreDatabaseTest'); + $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]'); + $databaseId = 'databaseId816491103'; + $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + $request = (new RestoreDatabaseRequest()) + ->setParent($formattedParent) + ->setDatabaseId($databaseId) + ->setBackup($formattedBackup); + $response = $gapicClient->restoreDatabase($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreDatabaseTest'); + 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 updateBackupScheduleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new BackupSchedule(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $backupSchedule = new BackupSchedule(); + $request = (new UpdateBackupScheduleRequest()) + ->setBackupSchedule($backupSchedule); + $response = $gapicClient->updateBackupSchedule($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/UpdateBackupSchedule', $actualFuncCall); + $actualValue = $actualRequestObject->getBackupSchedule(); + $this->assertProtobufEquals($backupSchedule, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateBackupScheduleExceptionTest() + { + $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 + $backupSchedule = new BackupSchedule(); + $request = (new UpdateBackupScheduleRequest()) + ->setBackupSchedule($backupSchedule); + try { + $gapicClient->updateBackupSchedule($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 bulkDeleteDocumentsAsyncTest() + { + $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/bulkDeleteDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BulkDeleteDocumentsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/bulkDeleteDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $request = (new BulkDeleteDocumentsRequest()) + ->setName($formattedName); + $response = $gapicClient->bulkDeleteDocumentsAsync($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/BulkDeleteDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); + $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..fa3cd071f07c --- /dev/null +++ b/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/FirestoreAdminClientTest.php @@ -0,0 +1,2117 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return FirestoreAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new FirestoreAdminClient($options); + } + + /** @test */ + public function bulkDeleteDocumentsTest() + { + $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/bulkDeleteDocumentsTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new BulkDeleteDocumentsResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/bulkDeleteDocumentsTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $response = $gapicClient->bulkDeleteDocuments($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/BulkDeleteDocuments', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); + $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 bulkDeleteDocumentsExceptionTest() + { + $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/bulkDeleteDocumentsTest'); + $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->bulkDeleteDocuments($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); + 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 createBackupScheduleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new BackupSchedule(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $backupSchedule = new BackupSchedule(); + $response = $gapicClient->createBackupSchedule($formattedParent, $backupSchedule); + $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/CreateBackupSchedule', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getBackupSchedule(); + $this->assertProtobufEquals($backupSchedule, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createBackupScheduleExceptionTest() + { + $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->databaseName('[PROJECT]', '[DATABASE]'); + $backupSchedule = new BackupSchedule(); + try { + $gapicClient->createBackupSchedule($formattedParent, $backupSchedule); + // 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 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 deleteBackupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + $gapicClient->deleteBackup($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteBackup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteBackupExceptionTest() + { + $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->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + try { + $gapicClient->deleteBackup($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 deleteBackupScheduleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); + $gapicClient->deleteBackupSchedule($formattedName); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteBackupSchedule', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteBackupScheduleExceptionTest() + { + $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->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); + try { + $gapicClient->deleteBackupSchedule($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 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 getBackupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $database = 'database1789464955'; + $databaseUid = 'databaseUid-458567796'; + $expectedResponse = new Backup(); + $expectedResponse->setName($name2); + $expectedResponse->setDatabase($database); + $expectedResponse->setDatabaseUid($databaseUid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + $response = $gapicClient->getBackup($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/GetBackup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupExceptionTest() + { + $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->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + try { + $gapicClient->getBackup($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 getBackupScheduleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new BackupSchedule(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); + $response = $gapicClient->getBackupSchedule($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/GetBackupSchedule', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getBackupScheduleExceptionTest() + { + $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->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); + try { + $gapicClient->getBackupSchedule($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 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 listBackupSchedulesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListBackupSchedulesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); + $response = $gapicClient->listBackupSchedules($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/ListBackupSchedules', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupSchedulesExceptionTest() + { + $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->databaseName('[PROJECT]', '[DATABASE]'); + try { + $gapicClient->listBackupSchedules($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 listBackupsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ListBackupsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->listBackups($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/ListBackups', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listBackupsExceptionTest() + { + $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->locationName('[PROJECT]', '[LOCATION]'); + try { + $gapicClient->listBackups($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 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 restoreDatabaseTest() + { + $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/restoreDatabaseTest'); + $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/restoreDatabaseTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->projectName('[PROJECT]'); + $databaseId = 'databaseId816491103'; + $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + $response = $gapicClient->restoreDatabase($formattedParent, $databaseId, $formattedBackup); + $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/RestoreDatabase', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getDatabaseId(); + $this->assertProtobufEquals($databaseId, $actualValue); + $actualValue = $actualApiRequestObject->getBackup(); + $this->assertProtobufEquals($formattedBackup, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreDatabaseTest'); + $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 restoreDatabaseExceptionTest() + { + $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/restoreDatabaseTest'); + $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]'); + $databaseId = 'databaseId816491103'; + $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); + $response = $gapicClient->restoreDatabase($formattedParent, $databaseId, $formattedBackup); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/restoreDatabaseTest'); + 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 updateBackupScheduleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $expectedResponse = new BackupSchedule(); + $expectedResponse->setName($name); + $transport->addResponse($expectedResponse); + // Mock request + $backupSchedule = new BackupSchedule(); + $response = $gapicClient->updateBackupSchedule($backupSchedule); + $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/UpdateBackupSchedule', $actualFuncCall); + $actualValue = $actualRequestObject->getBackupSchedule(); + $this->assertProtobufEquals($backupSchedule, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateBackupScheduleExceptionTest() + { + $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 + $backupSchedule = new BackupSchedule(); + try { + $gapicClient->updateBackupSchedule($backupSchedule); + // 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..fdb899ded9b7106d59917d9eb948fea2c359104b GIT binary patch literal 2019 zcmb_d-EJF26vlQE#m8wQT(wQ3qE1bvI#s)_gFt0NsN$wEk=iCwqggBT@-1LJ^a3Hk~p>LNSv(X38UE|A@RfIw3Fj4^QqRH5Hi(nNK1iqL}rjT(MLO z#d_!c-b94ij3wH$?f?=xW2vMeBg5mtYo_UhY8nhJGdL)i!D)X7AdG36l6~g^egJ|W znT=x}l2lWTUk`XX;tAKB#{7HKzDuSwP8pKl$4;{()LbOQ5RQ_Nb+<_F(_kM+fwAtA zLd&rUA43lg6U|gY<6xhqq2dxFJ4UGQM@*MVGbi0Gcdc>9r=*)}^!@il?h>ssR=u4N z#dM~U9jn_oxF~-G3o^AQIcAH+lL0%U=Ugb?zl`eA$s%eQ*jp44>i5FCB5_h=3Pg$ z9f=k0r8W_Hhi=|`*Q$$X9bm%&G=|iRZAiJL^J5)Wi*9YN!IJ6qjT)(So9!=QWopWm zZq!Mm+uGjp7AW%yvS&-1zD%^5w|meE6~oCK86_JH^w-+nEcitbURe}F$Rv)HBP@N0 zuz3ir>V++6e8=Wa_!cam(>PSy<{yD6dRdXgl z(?6yycZaROlgM#CMotsYZ$fK4*DQ6%Z9HDX<2$gf7`}`QpAu(Ub_@^JBPK>tpl)Yc zwE}Jwbu-=L;Xu4fB6Rfyw5U>a?yyaZy;oqbi)>P0k=BbuWp`1@aeb9>%kfU-_s{jE;fsT}ztryx?dI}c zSYHRl{_;-yzZbS3u*RUW-Eh7AS-+c8eczgWza;zqX@9(82m7;!<-7Md-x-w^^SA58 MBJ(A10T%#&0eZ52a{vGU literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Firestore.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Firestore.php new file mode 100644 index 0000000000000000000000000000000000000000..88ea9ca5afc8b0c1a1b888cee89ff07a687adf14 GIT binary patch literal 11259 zcmbtaTWlLy8QyW?G&xSv^z@c`7nn{9Z9{6e=~9Zb+15_ni|8e!*%nontg(HP%+{Wn zof$WqUF8L|LP$u9w7cT+vJyf(tdMvG@xTib+I<88QY8crJRlxHydlAVZsQsIj4x?l z8hifppa1gxSI=wL-5nR5(Qgr(cxFHvdTmb+c8KnJPTtAk+MUhQaMX9&UY!*5ZO7SelKhtC5kGJ|l7Du&^C8FhA!M5^;=5*@=(pBO z_efwi%)qSNVn-`C<a<#peLx}BoO-)8lKQc`ztJY%-T|*>X8~7R5J(4P@z}G15zdAn z1_+f~ZZLx6;n7VCLN+j4?(iaqXCHf}>k@ASd~Ue)%0obPJK+oq(~GZLA}EWEMi_%P z!K~-QsG%`*4t;tLof#rA;iH@=w$4fhlFhT0kP|QRi89T9V&+L>l8Y6 z7rvF3`cn9#Xu>r;NJvrfvuFltFFgv`y=pa>9!xb2pFmTtxlO7*6g(zpnyReflL)cz z1LrBR=f|ZjG*E5Q@fyUd*7oKnI$yskOmv88HP}S_mM%L@!r>k}A;z(Os9&ClUG$?AnlG6_eJ7HK!dQk#qy22n^kd2BNED&STO?0wEwk;E${HWx#H{h=;3TdcK-_}%7 zNDFOdX=r!=lUS=UI0`jfM2E@SZqu~vsstskyl0f!lsT;kdsfX$(+Dv$RD(U2B!=~O zQfRJYU^Ql$KR}00jT@%K#ABBy!#;4K#oK>s!AQ{vp-BTijc3t#!?6kLZzjP}uXSwG zB7tYs{rL>@NMGB)LV}W(PNL&bS^~>%vthN<#r-dZvS5kGAUha!kI^d;)J2DYC<60J zpLGz}ePu5gc}Y-$anzE~1xAkLK7Il8D!@p4!^~1&gC78lf7Z~;N*4%RUX|%xl$kFn z4I441NL^hynBzHCS_Z>Yfx00gQlQRwFNKb;n_j>=n!&hw@oWas1fvJPuUd!F9I#e( z4CCHW0;+Lj?4W>3$1~OtAQ>{<)X<4;GYH@2sa!%}S(IK@`ggVM`Hq*|?EgbU)1q)e z6v7OdQ1C%(2wq~g!XXTI>h0LTdP}Dqe!Mf4P2&|b(KKtM>BB@xEA~aD3Q_TLcNu-z z4!phWMU;tr#2Ga9lk_kW>00Ce{l$qI4L|aIvfP9n;<>#vfB?R&o~zFLcoe4b>A6*Kn0FW9l51 zgOj*{g>zC0UK8sh<@p91ro^18PT}%ApS!y5=LToxc+mYD%r|fzGB<2SVc9MgE$XJM z{5IdM5LovCEv#I?uF%jkXtO@X_|q7g;I_fnP&!&=lln0Rl^n~tA#83$r#7DZzpMlZ zKM`&i{E)*5G)*Us7632Y$S^yo3-RC#JG3l!@2{8m-v63cqj_ z>M9B|(B^YhSxX8Zr3s-!H9kq9X>MMQT6`a2LC#}}0f6Pg*`=jE-r~n|QC^#H0j+$3 zpVi(sK}C$rjd=Ilii<=~If?@pQbo9atZY`)IC5o*6WC|3P*2cJcnL z^4v@K5E?74t<7m5=EO$%-h)TwxfB$DL#uCWY?SYB&W+(Il-?*mEN{+@8y{bd#_YK8F@!cl(0Bt7+*Z#)OrV*^d_MLN_I z+Hoi_y!8AOnz|`}{=n~RC=*$6;e^Z?ArXZ;+kgLRT>I7^{{BH~316Z=PrOU__A8K_ z-h|xc=NIyFea8M41&aQ?u&|H+BYK1|Y2gbp6l1Fn3aOArO0_TyDL1q6J&nou9?Viq zNa#6XD>mk{~yNzY5_h0DlA;#MiS48pMgD1}CKN!Yamo%QUV(FR~wgIHDFtN7S!m#)!b! z$Le-mvDajiLss22D#!)8R++df#x-tPu`fwv7wY-ZYR0D)!nG15k`La zym(mVlEq#6%cajmUN)|dDl%VaQbB*Jp-H)|#Om%;K9(jSIkV)))GToKS*P{u$zQ2T_}(^br^Rxa3Sk#*mXbB ziBA6kAAI)NNB;t!_02c^3w-XIZ@xI=xpzOH6kBYXm$2;l{qFfb=W_R+b!5SN!VVo# zTXSh&I6M{HBPv+7>6$&$5DvY;fZ9UOJhpU$+9g4d8iLa32(nb~yo*rB^z0t32t(5x z8gzZ2+thJQo35X1tbgrM`?SQl07lv|bu6t%g`H;g0d=*$=4#y?4(o1*uChTan#S99^-s_v-zNOyJ3(7!>gw}gRaI24i3%MQFz&(+P5zyOU= zkFH%4d`>32YME%|mJlk^WQL>B-TKI-_DD0j5_NjEZlO(06s=T-)Q#N5zFE5#9LwnR zfw1Q5SgAaxbYJv;R*gw! zK_@-jmCT-ZOh@kg@W?Np+nQxj+nEjJ?!5V_9ym|z_ak3zWB#l~)-hYJ!mn50otGpI zx!?z#*Gz*QiSRZ*+q6jql8=w5 zP4fw^#*Mjn(8HLst8slUc!Pn+O<2MNwp~?o^NalOw`QVip6#Hb zHy}kveI~s0a^Wnb%)!8+Za#&=Npc;MhJLKO`Q)?MFk&Sv!dvA7&G0Ds43-Bvo;0Ew z>oEB=hkP(ox9Rw7BT(^i)x@7-tRMlI;q;4e9$Q`z3RUl85Myg;atT&6!%+L!2hdb) zgdA&;rlY%59q>2=8FYIt4QnCT=i5C;cA33c=^-1_B~zZ)UIb1u zc_Ym}4VnCunvZFp0Yj$hdC2&-sqU#o3%|!;WlC{Uhq!5R)3fERS24ZR!0w`9x5YeO z^iOkwYWhD_P`m?65mO%CXf)-P*lD!XeWl%$YxV8AEalFTMM#K>l#7uR#2c+#yzoN; zGQ7k3Mw2Qec^HCd-kQrKPSBz_I4RB>>

#EP&baC-W2d8jSsM4U#9U6oQ^mn90P8 zrT9l|F6+-jdQWb*)y}S{pby>z5PQA84E9v zG$egok{~^93IR=u5Xg$HmiS1mHI$B6SK7Hn=JvXhTVh8)`%V>=N4YcsNHGeOfx>rj z$V}v8;8xbB=XL7@dhAvyjIdu}uM*+ibHy*`ayXh(Z>tJ=J5DmN$Ug7y?d1|A3&0-G zRQ7U#tUxAwW&+7-7M4v`7}x=M?R_7Eq~EY#M}~@!?&Ai=XHbx+rJ3n9-C3m&Rak}W zRN78`2;O7ZR~g02G3BqY*xg{ z9a!djtm?CJLo($TRG$x1A=lS&l41i;kE!P1j=>8zTfRS+XD4P>NeYM__&ojr>*4TR z;FBSm(ldsq4=BRLNFyAfp5X=_V$(OxWMX6sNF?JPq12IyE@aa>Q@#@F9i1SVxRq1h zayY!G!pfAcM1U(&z1*Nwe8PZY8u`VRlTXL;aZz#`mitU=LNOffgI~$glBuCHj;?GGaj8j=04sANb zi-kGzx4`?5bE3si<g<6$0=K=Lju)&9dn*hp@y%6stUNn2YXO;8NhEq ztnn8mEDwM6z78qA4>)Km%dQu+BrJf`AsyhgoQHL(`b!Kh;lesAxK-dqfNk0}o3Sr8 zdxq)tLqWu>56y{NzGmro(T}RZI^3N2{9}A!r?%bxDSml}U-L^f&b1w0_DcsFzlHC* zUH-B=@lyc)7VtEF#fMfZ{B@-gfh(1Rjl&f0MYpa-_saMEJNCqt{6DYbT++WZKY=Fz F{{n>+YQX>i literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/QueryProfile.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/QueryProfile.php new file mode 100644 index 000000000000..515fe852eabe --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/QueryProfile.php @@ -0,0 +1,42 @@ +internalAddGeneratedFile( + ' +ê +\'google/firestore/v1/query_profile.protogoogle.firestore.v1google/protobuf/duration.protogoogle/protobuf/struct.proto"& +ExplainOptions +analyze (BàA"† +ExplainMetrics6 + plan_summary ( 2 .google.firestore.v1.PlanSummary< +execution_stats ( 2#.google.firestore.v1.ExecutionStats"< + PlanSummary- + indexes_used ( 2.google.protobuf.Struct"¨ +ExecutionStats +results_returned (5 +execution_duration ( 2.google.protobuf.Duration +read_operations (, + debug_stats ( 2.google.protobuf.StructBÉ +com.google.firestore.v1BQueryProfileProtoPZ;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/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/ExecutionStats.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExecutionStats.php new file mode 100644 index 000000000000..bed2e60fbdcf --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExecutionStats.php @@ -0,0 +1,237 @@ +google.firestore.v1.ExecutionStats + */ +class ExecutionStats extends \Google\Protobuf\Internal\Message +{ + /** + * Total number of results returned, including documents, projections, + * aggregation results, keys. + * + * Generated from protobuf field int64 results_returned = 1; + */ + protected $results_returned = 0; + /** + * Total time to execute the query in the backend. + * + * Generated from protobuf field .google.protobuf.Duration execution_duration = 3; + */ + protected $execution_duration = null; + /** + * Total billable read operations. + * + * Generated from protobuf field int64 read_operations = 4; + */ + protected $read_operations = 0; + /** + * Debugging statistics from the execution of the query. Note that the + * debugging stats are subject to change as Firestore evolves. It could + * include: + * { + * "indexes_entries_scanned": "1000", + * "documents_scanned": "20", + * "billing_details" : { + * "documents_billable": "20", + * "index_entries_billable": "1000", + * "min_query_cost": "0" + * } + * } + * + * Generated from protobuf field .google.protobuf.Struct debug_stats = 5; + */ + protected $debug_stats = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $results_returned + * Total number of results returned, including documents, projections, + * aggregation results, keys. + * @type \Google\Protobuf\Duration $execution_duration + * Total time to execute the query in the backend. + * @type int|string $read_operations + * Total billable read operations. + * @type \Google\Protobuf\Struct $debug_stats + * Debugging statistics from the execution of the query. Note that the + * debugging stats are subject to change as Firestore evolves. It could + * include: + * { + * "indexes_entries_scanned": "1000", + * "documents_scanned": "20", + * "billing_details" : { + * "documents_billable": "20", + * "index_entries_billable": "1000", + * "min_query_cost": "0" + * } + * } + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\QueryProfile::initOnce(); + parent::__construct($data); + } + + /** + * Total number of results returned, including documents, projections, + * aggregation results, keys. + * + * Generated from protobuf field int64 results_returned = 1; + * @return int|string + */ + public function getResultsReturned() + { + return $this->results_returned; + } + + /** + * Total number of results returned, including documents, projections, + * aggregation results, keys. + * + * Generated from protobuf field int64 results_returned = 1; + * @param int|string $var + * @return $this + */ + public function setResultsReturned($var) + { + GPBUtil::checkInt64($var); + $this->results_returned = $var; + + return $this; + } + + /** + * Total time to execute the query in the backend. + * + * Generated from protobuf field .google.protobuf.Duration execution_duration = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getExecutionDuration() + { + return $this->execution_duration; + } + + public function hasExecutionDuration() + { + return isset($this->execution_duration); + } + + public function clearExecutionDuration() + { + unset($this->execution_duration); + } + + /** + * Total time to execute the query in the backend. + * + * Generated from protobuf field .google.protobuf.Duration execution_duration = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setExecutionDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->execution_duration = $var; + + return $this; + } + + /** + * Total billable read operations. + * + * Generated from protobuf field int64 read_operations = 4; + * @return int|string + */ + public function getReadOperations() + { + return $this->read_operations; + } + + /** + * Total billable read operations. + * + * Generated from protobuf field int64 read_operations = 4; + * @param int|string $var + * @return $this + */ + public function setReadOperations($var) + { + GPBUtil::checkInt64($var); + $this->read_operations = $var; + + return $this; + } + + /** + * Debugging statistics from the execution of the query. Note that the + * debugging stats are subject to change as Firestore evolves. It could + * include: + * { + * "indexes_entries_scanned": "1000", + * "documents_scanned": "20", + * "billing_details" : { + * "documents_billable": "20", + * "index_entries_billable": "1000", + * "min_query_cost": "0" + * } + * } + * + * Generated from protobuf field .google.protobuf.Struct debug_stats = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getDebugStats() + { + return $this->debug_stats; + } + + public function hasDebugStats() + { + return isset($this->debug_stats); + } + + public function clearDebugStats() + { + unset($this->debug_stats); + } + + /** + * Debugging statistics from the execution of the query. Note that the + * debugging stats are subject to change as Firestore evolves. It could + * include: + * { + * "indexes_entries_scanned": "1000", + * "documents_scanned": "20", + * "billing_details" : { + * "documents_billable": "20", + * "index_entries_billable": "1000", + * "min_query_cost": "0" + * } + * } + * + * Generated from protobuf field .google.protobuf.Struct debug_stats = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setDebugStats($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->debug_stats = $var; + + return $this; + } + +} + 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/ExplainMetrics.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExplainMetrics.php new file mode 100644 index 000000000000..393a0963761d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExplainMetrics.php @@ -0,0 +1,129 @@ +google.firestore.v1.ExplainMetrics + */ +class ExplainMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Planning phase information for the query. + * + * Generated from protobuf field .google.firestore.v1.PlanSummary plan_summary = 1; + */ + protected $plan_summary = null; + /** + * Aggregated stats from the execution of the query. Only present when + * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set + * to true. + * + * Generated from protobuf field .google.firestore.v1.ExecutionStats execution_stats = 2; + */ + protected $execution_stats = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\PlanSummary $plan_summary + * Planning phase information for the query. + * @type \Google\Cloud\Firestore\V1\ExecutionStats $execution_stats + * Aggregated stats from the execution of the query. Only present when + * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set + * to true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\QueryProfile::initOnce(); + parent::__construct($data); + } + + /** + * Planning phase information for the query. + * + * Generated from protobuf field .google.firestore.v1.PlanSummary plan_summary = 1; + * @return \Google\Cloud\Firestore\V1\PlanSummary|null + */ + public function getPlanSummary() + { + return $this->plan_summary; + } + + public function hasPlanSummary() + { + return isset($this->plan_summary); + } + + public function clearPlanSummary() + { + unset($this->plan_summary); + } + + /** + * Planning phase information for the query. + * + * Generated from protobuf field .google.firestore.v1.PlanSummary plan_summary = 1; + * @param \Google\Cloud\Firestore\V1\PlanSummary $var + * @return $this + */ + public function setPlanSummary($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\PlanSummary::class); + $this->plan_summary = $var; + + return $this; + } + + /** + * Aggregated stats from the execution of the query. Only present when + * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set + * to true. + * + * Generated from protobuf field .google.firestore.v1.ExecutionStats execution_stats = 2; + * @return \Google\Cloud\Firestore\V1\ExecutionStats|null + */ + public function getExecutionStats() + { + return $this->execution_stats; + } + + public function hasExecutionStats() + { + return isset($this->execution_stats); + } + + public function clearExecutionStats() + { + unset($this->execution_stats); + } + + /** + * Aggregated stats from the execution of the query. Only present when + * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set + * to true. + * + * Generated from protobuf field .google.firestore.v1.ExecutionStats execution_stats = 2; + * @param \Google\Cloud\Firestore\V1\ExecutionStats $var + * @return $this + */ + public function setExecutionStats($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ExecutionStats::class); + $this->execution_stats = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExplainOptions.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExplainOptions.php new file mode 100644 index 000000000000..cb6e2384de90 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExplainOptions.php @@ -0,0 +1,83 @@ +google.firestore.v1.ExplainOptions + */ +class ExplainOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Whether to execute this query. + * When false (the default), the query will be planned, returning only + * metrics from the planning stages. + * When true, the query will be planned and executed, returning the full + * query results along with both planning and execution stage metrics. + * + * Generated from protobuf field bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $analyze = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $analyze + * Optional. Whether to execute this query. + * When false (the default), the query will be planned, returning only + * metrics from the planning stages. + * When true, the query will be planned and executed, returning the full + * query results along with both planning and execution stage metrics. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\QueryProfile::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Whether to execute this query. + * When false (the default), the query will be planned, returning only + * metrics from the planning stages. + * When true, the query will be planned and executed, returning the full + * query results along with both planning and execution stage metrics. + * + * Generated from protobuf field bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAnalyze() + { + return $this->analyze; + } + + /** + * Optional. Whether to execute this query. + * When false (the default), the query will be planned, returning only + * metrics from the planning stages. + * When true, the query will be planned and executed, returning the full + * query results along with both planning and execution stage metrics. + * + * Generated from protobuf field bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAnalyze($var) + { + GPBUtil::checkBool($var); + $this->analyze = $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/PlanSummary.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PlanSummary.php new file mode 100644 index 000000000000..5e86c432c547 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PlanSummary.php @@ -0,0 +1,83 @@ +google.firestore.v1.PlanSummary + */ +class PlanSummary extends \Google\Protobuf\Internal\Message +{ + /** + * The indexes selected for the query. For example: + * [ + * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + * ] + * + * Generated from protobuf field repeated .google.protobuf.Struct indexes_used = 1; + */ + private $indexes_used; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Protobuf\Struct>|\Google\Protobuf\Internal\RepeatedField $indexes_used + * The indexes selected for the query. For example: + * [ + * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + * ] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\QueryProfile::initOnce(); + parent::__construct($data); + } + + /** + * The indexes selected for the query. For example: + * [ + * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + * ] + * + * Generated from protobuf field repeated .google.protobuf.Struct indexes_used = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIndexesUsed() + { + return $this->indexes_used; + } + + /** + * The indexes selected for the query. For example: + * [ + * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + * ] + * + * Generated from protobuf field repeated .google.protobuf.Struct indexes_used = 1; + * @param array<\Google\Protobuf\Struct>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIndexesUsed($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Struct::class); + $this->indexes_used = $arr; + + 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..680ac9b7b108 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryRequest.php @@ -0,0 +1,304 @@ +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 = ''; + /** + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * + * Generated from protobuf field .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $explain_options = null; + 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. + * @type \Google\Cloud\Firestore\V1\ExplainOptions $explain_options + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * } + */ + 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; + } + + /** + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * + * Generated from protobuf field .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Firestore\V1\ExplainOptions|null + */ + public function getExplainOptions() + { + return $this->explain_options; + } + + public function hasExplainOptions() + { + return isset($this->explain_options); + } + + public function clearExplainOptions() + { + unset($this->explain_options); + } + + /** + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * + * Generated from protobuf field .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Firestore\V1\ExplainOptions $var + * @return $this + */ + public function setExplainOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ExplainOptions::class); + $this->explain_options = $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..de42b0043172 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryResponse.php @@ -0,0 +1,244 @@ +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; + /** + * Query explain metrics. This is only present when the + * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * + * Generated from protobuf field .google.firestore.v1.ExplainMetrics explain_metrics = 10; + */ + protected $explain_metrics = 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. + * @type \Google\Cloud\Firestore\V1\ExplainMetrics $explain_metrics + * Query explain metrics. This is only present when the + * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * } + */ + 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; + } + + /** + * Query explain metrics. This is only present when the + * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * + * Generated from protobuf field .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * @return \Google\Cloud\Firestore\V1\ExplainMetrics|null + */ + public function getExplainMetrics() + { + return $this->explain_metrics; + } + + public function hasExplainMetrics() + { + return isset($this->explain_metrics); + } + + public function clearExplainMetrics() + { + unset($this->explain_metrics); + } + + /** + * Query explain metrics. This is only present when the + * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * + * Generated from protobuf field .google.firestore.v1.ExplainMetrics explain_metrics = 10; + * @param \Google\Cloud\Firestore\V1\ExplainMetrics $var + * @return $this + */ + public function setExplainMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ExplainMetrics::class); + $this->explain_metrics = $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..37c2314ca5fa --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryRequest.php @@ -0,0 +1,306 @@ +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 = ''; + /** + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * + * Generated from protobuf field .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $explain_options = null; + 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. + * @type \Google\Cloud\Firestore\V1\ExplainOptions $explain_options + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * } + */ + 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; + } + + /** + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * + * Generated from protobuf field .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Firestore\V1\ExplainOptions|null + */ + public function getExplainOptions() + { + return $this->explain_options; + } + + public function hasExplainOptions() + { + return isset($this->explain_options); + } + + public function clearExplainOptions() + { + unset($this->explain_options); + } + + /** + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * + * Generated from protobuf field .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Firestore\V1\ExplainOptions $var + * @return $this + */ + public function setExplainOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ExplainOptions::class); + $this->explain_options = $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..1d32089587e3 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryResponse.php @@ -0,0 +1,327 @@ +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; + /** + * Query explain metrics. This is only present when the + * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * + * Generated from protobuf field .google.firestore.v1.ExplainMetrics explain_metrics = 11; + */ + protected $explain_metrics = null; + 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. + * @type \Google\Cloud\Firestore\V1\ExplainMetrics $explain_metrics + * Query explain metrics. This is only present when the + * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * } + */ + 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; + } + + /** + * Query explain metrics. This is only present when the + * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * + * Generated from protobuf field .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * @return \Google\Cloud\Firestore\V1\ExplainMetrics|null + */ + public function getExplainMetrics() + { + return $this->explain_metrics; + } + + public function hasExplainMetrics() + { + return isset($this->explain_metrics); + } + + public function clearExplainMetrics() + { + unset($this->explain_metrics); + } + + /** + * Query explain metrics. This is only present when the + * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * + * Generated from protobuf field .google.firestore.v1.ExplainMetrics explain_metrics = 11; + * @param \Google\Cloud\Firestore\V1\ExplainMetrics $var + * @return $this + */ + public function setExplainMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ExplainMetrics::class); + $this->explain_metrics = $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..fc6fd5d1504a --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery.php @@ -0,0 +1,651 @@ +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; + /** + * Optional. A potential nearest neighbors search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FindNearest find_nearest = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $find_nearest = 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. + * @type \Google\Cloud\Firestore\V1\StructuredQuery\FindNearest $find_nearest + * Optional. A potential nearest neighbors search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * } + */ + 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;} + + /** + * Optional. A potential nearest neighbors search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FindNearest find_nearest = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Firestore\V1\StructuredQuery\FindNearest|null + */ + public function getFindNearest() + { + return $this->find_nearest; + } + + public function hasFindNearest() + { + return isset($this->find_nearest); + } + + public function clearFindNearest() + { + unset($this->find_nearest); + } + + /** + * Optional. A potential nearest neighbors search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FindNearest find_nearest = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Firestore\V1\StructuredQuery\FindNearest $var + * @return $this + */ + public function setFindNearest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FindNearest::class); + $this->find_nearest = $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/FindNearest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FindNearest.php new file mode 100644 index 000000000000..3e32c9a7be8d --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FindNearest.php @@ -0,0 +1,399 @@ +google.firestore.v1.StructuredQuery.FindNearest + */ +class FindNearest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. An indexed vector field to search upon. Only documents which + * contain vectors whose dimensionality match the query_vector can be + * returned. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference vector_field = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vector_field = null; + /** + * Required. The query vector that we are searching on. Must be a vector of + * no more than 2048 dimensions. + * + * Generated from protobuf field .google.firestore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query_vector = null; + /** + * Required. The distance measure to use, required. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $distance_measure = 0; + /** + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 1000. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $limit = null; + /** + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [document field + * name][google.firestore.v1.Document.fields] limitations. + * + * Generated from protobuf field string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $distance_result_field = ''; + /** + * Optional. Option to specify a threshold for which no less similar + * documents will be returned. The behavior of the specified + * `distance_measure` will affect the meaning of the distance threshold. + * Since DOT_PRODUCT distances increase when the vectors are more similar, + * the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $distance_threshold = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $vector_field + * Required. An indexed vector field to search upon. Only documents which + * contain vectors whose dimensionality match the query_vector can be + * returned. + * @type \Google\Cloud\Firestore\V1\Value $query_vector + * Required. The query vector that we are searching on. Must be a vector of + * no more than 2048 dimensions. + * @type int $distance_measure + * Required. The distance measure to use, required. + * @type \Google\Protobuf\Int32Value $limit + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 1000. + * @type string $distance_result_field + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [document field + * name][google.firestore.v1.Document.fields] limitations. + * @type \Google\Protobuf\DoubleValue $distance_threshold + * Optional. Option to specify a threshold for which no less similar + * documents will be returned. The behavior of the specified + * `distance_measure` will affect the meaning of the distance threshold. + * Since DOT_PRODUCT distances increase when the vectors are more similar, + * the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Firestore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * Required. An indexed vector field to search upon. Only documents which + * contain vectors whose dimensionality match the query_vector can be + * returned. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference vector_field = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference|null + */ + public function getVectorField() + { + return $this->vector_field; + } + + public function hasVectorField() + { + return isset($this->vector_field); + } + + public function clearVectorField() + { + unset($this->vector_field); + } + + /** + * Required. An indexed vector field to search upon. Only documents which + * contain vectors whose dimensionality match the query_vector can be + * returned. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference vector_field = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $var + * @return $this + */ + public function setVectorField($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); + $this->vector_field = $var; + + return $this; + } + + /** + * Required. The query vector that we are searching on. Must be a vector of + * no more than 2048 dimensions. + * + * Generated from protobuf field .google.firestore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Firestore\V1\Value|null + */ + public function getQueryVector() + { + return $this->query_vector; + } + + public function hasQueryVector() + { + return isset($this->query_vector); + } + + public function clearQueryVector() + { + unset($this->query_vector); + } + + /** + * Required. The query vector that we are searching on. Must be a vector of + * no more than 2048 dimensions. + * + * Generated from protobuf field .google.firestore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Firestore\V1\Value $var + * @return $this + */ + public function setQueryVector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Value::class); + $this->query_vector = $var; + + return $this; + } + + /** + * Required. The distance measure to use, required. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDistanceMeasure() + { + return $this->distance_measure; + } + + /** + * Required. The distance measure to use, required. + * + * Generated from protobuf field .google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDistanceMeasure($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\StructuredQuery\FindNearest\DistanceMeasure::class); + $this->distance_measure = $var; + + return $this; + } + + /** + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 1000. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + * @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() + + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 1000. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return int|null + */ + public function getLimitUnwrapped() + { + return $this->readWrapperValue("limit"); + } + + /** + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 1000. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + * @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. + + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 1000. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param int|null $var + * @return $this + */ + public function setLimitUnwrapped($var) + { + $this->writeWrapperValue("limit", $var); + return $this;} + + /** + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [document field + * name][google.firestore.v1.Document.fields] limitations. + * + * Generated from protobuf field string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDistanceResultField() + { + return $this->distance_result_field; + } + + /** + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [document field + * name][google.firestore.v1.Document.fields] limitations. + * + * Generated from protobuf field string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDistanceResultField($var) + { + GPBUtil::checkString($var, True); + $this->distance_result_field = $var; + + return $this; + } + + /** + * Optional. Option to specify a threshold for which no less similar + * documents will be returned. The behavior of the specified + * `distance_measure` will affect the meaning of the distance threshold. + * Since DOT_PRODUCT distances increase when the vectors are more similar, + * the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getDistanceThreshold() + { + return $this->distance_threshold; + } + + public function hasDistanceThreshold() + { + return isset($this->distance_threshold); + } + + public function clearDistanceThreshold() + { + unset($this->distance_threshold); + } + + /** + * Returns the unboxed value from getDistanceThreshold() + + * Optional. Option to specify a threshold for which no less similar + * documents will be returned. The behavior of the specified + * `distance_measure` will affect the meaning of the distance threshold. + * Since DOT_PRODUCT distances increase when the vectors are more similar, + * the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return float|null + */ + public function getDistanceThresholdUnwrapped() + { + return $this->readWrapperValue("distance_threshold"); + } + + /** + * Optional. Option to specify a threshold for which no less similar + * documents will be returned. The behavior of the specified + * `distance_measure` will affect the meaning of the distance threshold. + * Since DOT_PRODUCT distances increase when the vectors are more similar, + * the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setDistanceThreshold($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->distance_threshold = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Optional. Option to specify a threshold for which no less similar + * documents will be returned. The behavior of the specified + * `distance_measure` will affect the meaning of the distance threshold. + * Since DOT_PRODUCT distances increase when the vectors are more similar, + * the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param float|null $var + * @return $this + */ + public function setDistanceThresholdUnwrapped($var) + { + $this->writeWrapperValue("distance_threshold", $var); + return $this;} + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FindNearest::class, \Google\Cloud\Firestore\V1\StructuredQuery_FindNearest::class); + diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FindNearest/DistanceMeasure.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FindNearest/DistanceMeasure.php new file mode 100644 index 000000000000..f50ed905abcd --- /dev/null +++ b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FindNearest/DistanceMeasure.php @@ -0,0 +1,83 @@ +google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure + */ +class DistanceMeasure +{ + /** + * Should not be set. + * + * Generated from protobuf enum DISTANCE_MEASURE_UNSPECIFIED = 0; + */ + const DISTANCE_MEASURE_UNSPECIFIED = 0; + /** + * Measures the EUCLIDEAN distance between the vectors. See + * [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn + * more. The resulting distance decreases the more similar two vectors + * are. + * + * Generated from protobuf enum EUCLIDEAN = 1; + */ + const EUCLIDEAN = 1; + /** + * COSINE distance compares vectors based on the angle between them, which + * allows you to measure similarity that isn't based on the vectors + * magnitude. We recommend using DOT_PRODUCT with unit normalized vectors + * instead of COSINE distance, which is mathematically equivalent with + * better performance. See [Cosine + * Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) to learn + * more about COSINE similarity and COSINE distance. The resulting + * COSINE distance decreases the more similar two vectors are. + * + * Generated from protobuf enum COSINE = 2; + */ + const COSINE = 2; + /** + * Similar to cosine but is affected by the magnitude of the vectors. See + * [Dot Product](https://en.wikipedia.org/wiki/Dot_product) to learn more. + * The resulting distance increases the more similar two vectors are. + * + * Generated from protobuf enum DOT_PRODUCT = 3; + */ + const DOT_PRODUCT = 3; + + private static $valueToName = [ + self::DISTANCE_MEASURE_UNSPECIFIED => 'DISTANCE_MEASURE_UNSPECIFIED', + self::EUCLIDEAN => 'EUCLIDEAN', + self::COSINE => 'COSINE', + self::DOT_PRODUCT => 'DOT_PRODUCT', + ]; + + 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(DistanceMeasure::class, \Google\Cloud\Firestore\V1\StructuredQuery_FindNearest_DistanceMeasure::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..fbfb290bbe78 --- /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 a + * 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 a + * 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 a + * 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 ExplainOptions $explainOptions + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * @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']); + } + + if (isset($optionalArgs['explainOptions'])) { + $request->setExplainOptions($optionalArgs['explainOptions']); + } + + $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 ExplainOptions $explainOptions + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * @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']); + } + + if (isset($optionalArgs['explainOptions'])) { + $request->setExplainOptions($optionalArgs['explainOptions']); + } + + $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..4fff43f18ee9 --- /dev/null +++ b/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_descriptor_config.php @@ -0,0 +1,272 @@ + [ + '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..054730f1901a --- /dev/null +++ b/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_rest_client_config.php @@ -0,0 +1,292 @@ + [ + '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 ac3f979d03317ec75e60b14f9a2f7ae8c4ab921f Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 8 Aug 2024 01:04:25 +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/Query.php | Bin 4266 -> 4365 bytes .../src/V1/StructuredQuery/FindNearest.php | 149 ++ .../Google/Firestore/Admin/V1/Backup.php | Bin 1690 -> 0 bytes .../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 | 191 -- .../Google/Firestore/Admin/V1/Index.php | Bin 2152 -> 0 bytes .../Google/Firestore/Admin/V1/Location.php | 28 - .../Google/Firestore/Admin/V1/Operation.php | Bin 4243 -> 0 bytes .../Google/Firestore/Admin/V1/Schedule.php | Bin 1811 -> 0 bytes .../Cloud/Firestore/Admin/V1/Backup.php | 327 --- .../Cloud/Firestore/Admin/V1/Backup/State.php | 72 - .../Cloud/Firestore/Admin/V1/Backup/Stats.php | 142 - .../Firestore/Admin/V1/BackupSchedule.php | 312 --- .../Admin/V1/BulkDeleteDocumentsMetadata.php | 373 --- .../Admin/V1/BulkDeleteDocumentsRequest.php | 193 -- .../Admin/V1/BulkDeleteDocumentsResponse.php | 34 - .../Admin/V1/CreateBackupScheduleRequest.php | 134 - .../Admin/V1/CreateDatabaseMetadata.php | 33 - .../Admin/V1/CreateDatabaseRequest.php | 196 -- .../Firestore/Admin/V1/CreateIndexRequest.php | 133 - .../Firestore/Admin/V1/DailyRecurrence.php | 34 - .../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/DeleteBackupRequest.php | 88 - .../Admin/V1/DeleteBackupScheduleRequest.php | 92 - .../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 | 305 --- .../Admin/V1/ExportDocumentsResponse.php | 76 - .../Google/Cloud/Firestore/Admin/V1/Field.php | 253 -- .../Firestore/Admin/V1/Field/IndexConfig.php | 208 -- .../Firestore/Admin/V1/Field/TtlConfig.php | 76 - .../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/GetBackupRequest.php | 88 - .../Admin/V1/GetBackupScheduleRequest.php | 93 - .../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 | 194 -- .../Admin/V1/Index/IndexField/ArrayConfig.php | 57 - .../Admin/V1/Index/IndexField/Order.php | 64 - .../V1/Index/IndexField/VectorConfig.php | 120 - .../IndexField/VectorConfig/FlatIndex.php | 37 - .../Firestore/Admin/V1/Index/QueryScope.php | 77 - .../Cloud/Firestore/Admin/V1/Index/State.php | 86 - .../Admin/V1/IndexOperationMetadata.php | 287 -- .../Admin/V1/ListBackupSchedulesRequest.php | 88 - .../Admin/V1/ListBackupSchedulesResponse.php | 68 - .../Firestore/Admin/V1/ListBackupsRequest.php | 103 - .../Admin/V1/ListBackupsResponse.php | 118 - .../Admin/V1/ListDatabasesRequest.php | 120 - .../Admin/V1/ListDatabasesResponse.php | 129 - .../Firestore/Admin/V1/ListFieldsRequest.php | 221 -- .../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/RestoreDatabaseMetadata.php | 268 -- .../Admin/V1/RestoreDatabaseRequest.php | 172 -- .../Admin/V1/UpdateBackupScheduleRequest.php | 137 - .../Admin/V1/UpdateDatabaseMetadata.php | 33 - .../Admin/V1/UpdateDatabaseRequest.php | 137 - .../Firestore/Admin/V1/UpdateFieldRequest.php | 139 - .../Firestore/Admin/V1/WeeklyRecurrence.php | 72 - .../bulk_delete_documents.php | 91 - .../create_backup_schedule.php | 77 - .../FirestoreAdminClient/create_database.php | 96 - .../V1/FirestoreAdminClient/create_index.php | 94 - .../V1/FirestoreAdminClient/delete_backup.php | 71 - .../delete_backup_schedule.php | 76 - .../FirestoreAdminClient/delete_database.php | 84 - .../V1/FirestoreAdminClient/delete_index.php | 75 - .../FirestoreAdminClient/export_documents.php | 94 - .../V1/FirestoreAdminClient/get_backup.php | 73 - .../get_backup_schedule.php | 78 - .../V1/FirestoreAdminClient/get_database.php | 72 - .../V1/FirestoreAdminClient/get_field.php | 77 - .../V1/FirestoreAdminClient/get_index.php | 77 - .../FirestoreAdminClient/import_documents.php | 85 - .../list_backup_schedules.php | 73 - .../V1/FirestoreAdminClient/list_backups.php | 76 - .../FirestoreAdminClient/list_databases.php | 72 - .../V1/FirestoreAdminClient/list_fields.php | 89 - .../V1/FirestoreAdminClient/list_indexes.php | 81 - .../FirestoreAdminClient/restore_database.php | 121 - .../update_backup_schedule.php | 59 - .../FirestoreAdminClient/update_database.php | 71 - .../V1/FirestoreAdminClient/update_field.php | 122 - .../src/V1/Client/FirestoreAdminClient.php | 1153 -------- .../v1/Admin/src/V1/FirestoreAdminClient.php | 34 - .../V1/Gapic/FirestoreAdminGapicClient.php | 2091 --------------- .../v1/Admin/src/V1/gapic_metadata.json | 138 - .../firestore_admin_client_config.json | 166 -- .../firestore_admin_descriptor_config.php | 408 --- .../firestore_admin_rest_client_config.php | 356 --- .../V1/Client/FirestoreAdminClientTest.php | 2313 ----------------- .../Unit/V1/FirestoreAdminClientTest.php | 2117 --------------- .../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 2019 -> 0 bytes .../Google/Firestore/V1/Firestore.php | Bin 11259 -> 0 bytes .../GPBMetadata/Google/Firestore/V1/Query.php | Bin 4365 -> 0 bytes .../Google/Firestore/V1/QueryProfile.php | 42 - .../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/ExecutionStats.php | 237 -- .../Cloud/Firestore/V1/ExistenceFilter.php | 209 -- .../Cloud/Firestore/V1/ExplainMetrics.php | 129 - .../Cloud/Firestore/V1/ExplainOptions.php | 83 - .../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 -- .../Google/Cloud/Firestore/V1/PlanSummary.php | 83 - .../Cloud/Firestore/V1/Precondition.php | 114 - .../Cloud/Firestore/V1/RollbackRequest.php | 121 - .../V1/RunAggregationQueryRequest.php | 304 --- .../V1/RunAggregationQueryResponse.php | 244 -- .../Cloud/Firestore/V1/RunQueryRequest.php | 306 --- .../Cloud/Firestore/V1/RunQueryResponse.php | 327 --- .../V1/StructuredAggregationQuery.php | 122 - .../Aggregation.php | 290 --- .../Aggregation/Avg.php | 86 - .../Aggregation/Count.php | 169 -- .../Aggregation/Sum.php | 95 - .../Cloud/Firestore/V1/StructuredQuery.php | 651 ----- .../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 - .../V1/StructuredQuery/FindNearest.php | 399 --- .../FindNearest/DistanceMeasure.php | 83 - .../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 | 1372 ---------- .../Firestore/v1/src/V1/gapic_metadata.json | 98 - .../V1/resources/firestore_client_config.json | 174 -- .../resources/firestore_descriptor_config.php | 272 -- .../firestore_rest_client_config.php | 292 --- .../Unit/V1/Client/FirestoreClientTest.php | 1323 ---------- .../v1/tests/Unit/V1/FirestoreClientTest.php | 1219 --------- 227 files changed, 149 insertions(+), 41824 deletions(-) delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Backup.php 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/GPBMetadata/Google/Firestore/Admin/V1/Schedule.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/State.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/Stats.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BackupSchedule.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsMetadata.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateBackupScheduleRequest.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/DailyRecurrence.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/DeleteBackupRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteBackupScheduleRequest.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/GetBackupRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetBackupScheduleRequest.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/IndexField/VectorConfig.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/VectorConfig/FlatIndex.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/ListBackupSchedulesRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupSchedulesResponse.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsResponse.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/RestoreDatabaseMetadata.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/RestoreDatabaseRequest.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateBackupScheduleRequest.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/proto/src/Google/Cloud/Firestore/Admin/V1/WeeklyRecurrence.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/bulk_delete_documents.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_backup_schedule.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_backup.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_backup_schedule.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_backup.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_backup_schedule.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_backup_schedules.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_backups.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/restore_database.php delete mode 100644 owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_backup_schedule.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/QueryProfile.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/ExecutionStats.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/ExplainMetrics.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExplainOptions.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/PlanSummary.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/FindNearest.php delete mode 100644 owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FindNearest/DistanceMeasure.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/Query.php b/Firestore/metadata/V1/Query.php index 82262c56f263abb3b900e0f1ac1abba74f021e39..5e45bd4eea7ec380f75e0c629b61eac65bf144f7 100644 GIT binary patch delta 138 zcmZ3b*sHXmfr;g?443>wZ~4iKnW7kfZ2re|jGgh-=A&HdjLAYuT%swN#U+V($*J*0 zsl}x^CGlyQsW~YUtO|@8oKDOS92tddxrE?qN-}_|GV*~6*nkSSjb!xF^YhblQuPXo e@=NlQO4IaQ@=KF)Qo|B+N>jnwH^1TD#{vMXh%V6p delta 38 ucmeBGTBW$5fr;gTG?)BDZ~4iKnW7k{ZvMw~jGeK4^HDB!#?Agb`&a-8MGblY diff --git a/Firestore/src/V1/StructuredQuery/FindNearest.php b/Firestore/src/V1/StructuredQuery/FindNearest.php index 2688ef227d10..89c14d2d6907 100644 --- a/Firestore/src/V1/StructuredQuery/FindNearest.php +++ b/Firestore/src/V1/StructuredQuery/FindNearest.php @@ -46,6 +46,26 @@ class FindNearest extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; */ private $limit = null; + /** + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [document field + * name][google.firestore.v1.Document.fields] limitations. + * + * Generated from protobuf field string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $distance_result_field = ''; + /** + * Optional. Option to specify a threshold for which no less similar + * documents will be returned. The behavior of the specified + * `distance_measure` will affect the meaning of the distance threshold. + * Since DOT_PRODUCT distances increase when the vectors are more similar, + * the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $distance_threshold = null; /** * Constructor. @@ -65,6 +85,18 @@ class FindNearest extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Int32Value $limit * Required. The number of nearest neighbors to return. Must be a positive * integer of no more than 1000. + * @type string $distance_result_field + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [document field + * name][google.firestore.v1.Document.fields] limitations. + * @type \Google\Protobuf\DoubleValue $distance_threshold + * Optional. Option to specify a threshold for which no less similar + * documents will be returned. The behavior of the specified + * `distance_measure` will affect the meaning of the distance threshold. + * Since DOT_PRODUCT distances increase when the vectors are more similar, + * the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold * } */ public function __construct($data = NULL) { @@ -243,6 +275,123 @@ public function setLimitValue($var) $this->writeWrapperValue("limit", $var); return $this;} + /** + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [document field + * name][google.firestore.v1.Document.fields] limitations. + * + * Generated from protobuf field string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDistanceResultField() + { + return $this->distance_result_field; + } + + /** + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [document field + * name][google.firestore.v1.Document.fields] limitations. + * + * Generated from protobuf field string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDistanceResultField($var) + { + GPBUtil::checkString($var, True); + $this->distance_result_field = $var; + + return $this; + } + + /** + * Optional. Option to specify a threshold for which no less similar + * documents will be returned. The behavior of the specified + * `distance_measure` will affect the meaning of the distance threshold. + * Since DOT_PRODUCT distances increase when the vectors are more similar, + * the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getDistanceThreshold() + { + return $this->distance_threshold; + } + + public function hasDistanceThreshold() + { + return isset($this->distance_threshold); + } + + public function clearDistanceThreshold() + { + unset($this->distance_threshold); + } + + /** + * Returns the unboxed value from getDistanceThreshold() + + * Optional. Option to specify a threshold for which no less similar + * documents will be returned. The behavior of the specified + * `distance_measure` will affect the meaning of the distance threshold. + * Since DOT_PRODUCT distances increase when the vectors are more similar, + * the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return float|null + */ + public function getDistanceThresholdValue() + { + return $this->readWrapperValue("distance_threshold"); + } + + /** + * Optional. Option to specify a threshold for which no less similar + * documents will be returned. The behavior of the specified + * `distance_measure` will affect the meaning of the distance threshold. + * Since DOT_PRODUCT distances increase when the vectors are more similar, + * the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setDistanceThreshold($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->distance_threshold = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Optional. Option to specify a threshold for which no less similar + * documents will be returned. The behavior of the specified + * `distance_measure` will affect the meaning of the distance threshold. + * Since DOT_PRODUCT distances increase when the vectors are more similar, + * the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param float|null $var + * @return $this + */ + public function setDistanceThresholdValue($var) + { + $this->writeWrapperValue("distance_threshold", $var); + return $this;} + } // Adding a class alias for backwards compatibility with the previous class name. diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Backup.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/Backup.php deleted file mode 100644 index fe3fbc3e94b33464bce598d86d3797c9fb7cb1ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1690 zcma)6-EPw`7^UqtHV@EBs~aY8xu zX$ZY^G{On=={P1KPD}_}J8*kv0NbtJ;JSb^nkGKB;Q^%wA+|;&!Hm-cTPPTl$U3T9 z9`fI(v8gBlh|n0b82K1>`_1Q=qX2Q_b`{#~ghL#m`N`h9n}KppbkLGi<^U3KZ>k8A5tbIRJAF%>g!!n~ip zltD<~_9Bjx2!(D7Ge04*n6NKOZTkT8LOi)rThES_bYui;x<}jor^!volN2969l`|j zG>ICjZ%HsIp4=1Ea$+JB!(q_Ghv*TA>4;MVEvV_ea7W??f^*~~nuFK1g8iissWsBEcCx4e?E zD+`M2w0PdXF1Yb?2Fz)L85hBfv}m;iOSOe&<)>3I8em?U)I$tc%W8RDEdO>^!S!h$ z`Ur72GsVkdwK9Nl1)R&l!;}Qovs2#t;5>^^%nm6Z%8sfPvA4LfY-U5|?V5$$x}SSs z5r2rqtD;der$aTstn?zQ&Z&BLEk9;DL$0N%wJ`T&eXfB*U}dVtUpJ~XF&>Cpd53+@tk2og#0se|f`~?9Eq|P3u_u;1m0XkNj}o{h ztnq)@n~VC4zD%8d>GeZDq-l`XOIIDx;{h8Jk*+#s)pzVQvfnS|neJ9+?`wIbtAf?s zQcRsZUQI{FtGQqQo>#c8DshiRaF)R$gnyM+HIHqpD%&oYY+F&;_I}-)Q--~}R=nP~ Xb;KP@MCm}{pOA*CQfJl#OaS-;i7+3V 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 222bef39e37d..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/GPBMetadata/Google/Firestore/Admin/V1/FirestoreAdmin.php +++ /dev/null @@ -1,191 +0,0 @@ -internalAddGeneratedFile( - ' -©H -/google/firestore/admin/v1/firestore_admin.protogoogle.firestore.admin.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto&google/firestore/admin/v1/backup.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/firestore/admin/v1/schedule.proto#google/longrunning/operations.protogoogle/protobuf/empty.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"g -ListDatabasesRequest9 -parent ( B)àAúA#!firestore.googleapis.com/Database - show_deleted ("¨ -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"¡ -CreateBackupScheduleRequest9 -parent ( B)àAúA# -!firestore.googleapis.com/DatabaseG -backup_schedule ( 2).google.firestore.admin.v1.BackupScheduleBàA"Y -GetBackupScheduleRequest= -name ( B/àAúA) -\'firestore.googleapis.com/BackupSchedule"— -UpdateBackupScheduleRequestG -backup_schedule ( 2).google.firestore.admin.v1.BackupScheduleBàA/ - update_mask ( 2.google.protobuf.FieldMask"W -ListBackupSchedulesRequest9 -parent ( B)àAúA# -!firestore.googleapis.com/Database"b -ListBackupSchedulesResponseC -backup_schedules ( 2).google.firestore.admin.v1.BackupSchedule"\\ -DeleteBackupScheduleRequest= -name ( B/àAúA) -\'firestore.googleapis.com/BackupSchedule"Œ -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 ( "Ž -BulkDeleteDocumentsRequest7 -name ( B)àAúA# -!firestore.googleapis.com/Database -collection_ids ( BàA - namespace_ids ( BàA" -BulkDeleteDocumentsResponse"I -GetBackupRequest5 -name ( B\'àAúA! -firestore.googleapis.com/Backup"O -ListBackupsRequest9 -parent ( B)àAúA# -!firestore.googleapis.com/Location"^ -ListBackupsResponse2 -backups ( 2!.google.firestore.admin.v1.Backup - unreachable ( "L -DeleteBackupRequest5 -name ( B\'àAúA! -firestore.googleapis.com/Backup"¦ -RestoreDatabaseRequest9 -parent ( B)àAúA#!firestore.googleapis.com/Database - database_id ( BàA7 -backup ( B\'àAúA! -firestore.googleapis.com/Backup2Ë% -FirestoreAdminÛ - CreateIndex-.google.firestore.admin.v1.CreateIndexRequest.google.longrunning.Operation"~ÊA -IndexIndexOperationMetadataÚA parent,index‚Óä“G">/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes:index½ - ListIndexes-.google.firestore.admin.v1.ListIndexesRequest..google.firestore.admin.v1.ListIndexesResponse"OÚAparent‚Óä“@>/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes§ -GetIndex*.google.firestore.admin.v1.GetIndexRequest .google.firestore.admin.v1.Index"MÚAname‚Óä“@>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}£ - DeleteIndex-.google.firestore.admin.v1.DeleteIndexRequest.google.protobuf.Empty"MÚAname‚Óä“@*>/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}¦ -GetField*.google.firestore.admin.v1.GetFieldRequest .google.firestore.admin.v1.Field"LÚAname‚Óä“?=/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}Ù - UpdateField-.google.firestore.admin.v1.UpdateFieldRequest.google.longrunning.Operation"|ÊA -FieldFieldOperationMetadataÚAfield‚Óä“L2C/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}:field¹ - -ListFields,.google.firestore.admin.v1.ListFieldsRequest-.google.firestore.admin.v1.ListFieldsResponse"NÚAparent‚Óä“?=/v1/{parent=projects/*/databases/*/collectionGroups/*}/fieldsÝ -ExportDocuments1.google.firestore.admin.v1.ExportDocumentsRequest.google.longrunning.Operation"xÊA2 -ExportDocumentsResponseExportDocumentsMetadataÚAname‚Óä“6"1/v1/{name=projects/*/databases/*}:exportDocuments:*Û -ImportDocuments1.google.firestore.admin.v1.ImportDocumentsRequest.google.longrunning.Operation"vÊA0 -google.protobuf.EmptyImportDocumentsMetadataÚAname‚Óä“6"1/v1/{name=projects/*/databases/*}:importDocuments:*ò -BulkDeleteDocuments5.google.firestore.admin.v1.BulkDeleteDocumentsRequest.google.longrunning.Operation"„ÊA: -BulkDeleteDocumentsResponseBulkDeleteDocumentsMetadataÚAname‚Óä“:"5/v1/{name=projects/*/databases/*}:bulkDeleteDocuments:*Ù -CreateDatabase0.google.firestore.admin.v1.CreateDatabaseRequest.google.longrunning.Operation"vÊA" -DatabaseCreateDatabaseMetadataÚAparent,database,database_id‚Óä“-"!/v1/{parent=projects/*}/databases:database“ - GetDatabase-.google.firestore.admin.v1.GetDatabaseRequest#.google.firestore.admin.v1.Database"0ÚAname‚Óä“#!/v1/{name=projects/*/databases/*}¦ - ListDatabases/.google.firestore.admin.v1.ListDatabasesRequest0.google.firestore.admin.v1.ListDatabasesResponse"2ÚAparent‚Óä“#!/v1/{parent=projects/*}/databasesÛ -UpdateDatabase0.google.firestore.admin.v1.UpdateDatabaseRequest.google.longrunning.Operation"xÊA" -DatabaseUpdateDatabaseMetadataÚAdatabase,update_mask‚Óä“62*/v1/{database.name=projects/*/databases/*}:database¸ -DeleteDatabase0.google.firestore.admin.v1.DeleteDatabaseRequest.google.longrunning.Operation"UÊA" -DatabaseDeleteDatabaseMetadataÚAname‚Óä“#*!/v1/{name=projects/*/databases/*}— - GetBackup+.google.firestore.admin.v1.GetBackupRequest!.google.firestore.admin.v1.Backup":ÚAname‚Óä“-+/v1/{name=projects/*/locations/*/backups/*}ª - ListBackups-.google.firestore.admin.v1.ListBackupsRequest..google.firestore.admin.v1.ListBackupsResponse"<ÚAparent‚Óä“-+/v1/{parent=projects/*/locations/*}/backups’ - DeleteBackup..google.firestore.admin.v1.DeleteBackupRequest.google.protobuf.Empty":ÚAname‚Óä“-*+/v1/{name=projects/*/locations/*/backups/*}¿ -RestoreDatabase1.google.firestore.admin.v1.RestoreDatabaseRequest.google.longrunning.Operation"ZÊA# -DatabaseRestoreDatabaseMetadata‚Óä“.")/v1/{parent=projects/*}/databases:restore:*à -CreateBackupSchedule6.google.firestore.admin.v1.CreateBackupScheduleRequest).google.firestore.admin.v1.BackupSchedule"eÚAparent,backup_schedule‚Óä“F"3/v1/{parent=projects/*/databases/*}/backupSchedules:backup_schedule· -GetBackupSchedule3.google.firestore.admin.v1.GetBackupScheduleRequest).google.firestore.admin.v1.BackupSchedule"BÚAname‚Óä“53/v1/{name=projects/*/databases/*/backupSchedules/*}Ê -ListBackupSchedules5.google.firestore.admin.v1.ListBackupSchedulesRequest6.google.firestore.admin.v1.ListBackupSchedulesResponse"DÚAparent‚Óä“53/v1/{parent=projects/*/databases/*}/backupSchedulesõ -UpdateBackupSchedule6.google.firestore.admin.v1.UpdateBackupScheduleRequest).google.firestore.admin.v1.BackupSchedule"zÚAbackup_schedule,update_mask‚Óä“V2C/v1/{backup_schedule.name=projects/*/databases/*/backupSchedules/*}:backup_scheduleª -DeleteBackupSchedule6.google.firestore.admin.v1.DeleteBackupScheduleRequest.google.protobuf.Empty"BÚAname‚Óä“5*3/v1/{name=projects/*/databases/*/backupSchedules/*}vÊ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 9c0e6c1657d3a9ca99495b73a5c780a61a705412..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2152 zcmbVN-*4Mg6mHU_EGO9%tT96Qb(am63b2(T1anuwiJi>S7N>SvsVI`=*f;G(u5E0m z&`tRp5dXp+`BQl3fj6G_S8(rj;zZr5ZsZ~My*}S}&iQ<x#K*CSkZPcTF+!TEkM2@v63${5%jhHwPkby*NsN;; zjIrc+XC#o$+Y$*p{F}%b0Rra?Cz0b~)E{=9;?(h+)EW0Vc-&ip#|i_FkJ@_xuJ0rX z(isUn2Sk6-Y~m9aC8?9r%YBmABp@kqeDaKTu#cvWpJ0l7HFi1++?0d?VgMs>acc)< zoGkW!6w;3O(XyN&6M+ga)`Jwsf#Z)=oVYQGXn#W*D$6H0&81^It(`?$Mn|TomDMQA zuN1kD(s+i~vm+GabQTADylzG?&+o>s5le{(6%6}c2cJ6UB#dQw)zymRDyWGUZ|=1y zF2z^hlSSi-=jDC&=p3~2%2=Hb;O{DY_C^CBe2|5S`J9M+PQ>%}_TrJ`L`0%P#OEp- zo8})CDDw#rYEWV$)F_}rt0Mde)n8^fzOWNFjBuk!H*f8JAzqn7|l|Do7!Pb<$f~2vDHe1y18PnjI~TSa22*lE8)Vvk`!-Yx!*@BH z5+1=+pqt z9e;-Hv(Up$0zG)l|>qVgf zx7T(}t$S!%`jJ-OY)Wt=KMz%SM;RR3%221h-T^^XMv65uOwE33s2bldG<7KRNoE>Z zBV}~CAl8?uDWgmxdh+Q)J*G9(p*GMo)v`@(sOV;WQ-1bR`4v7{eM_=~PY-k=Qpb|` zs}c^W_54f+Cy|~n?&cD6or#lRy0^TYOVsat8b@cRABVGuK3na~GaF+7!mMcC`KJIM z(D7S|WWQoq}?{w#jl=RPTR zIaBVIqQcx#JZk^7j2Mr3$au|B7nVvr^=0v1#v{u-N|tjbS>{x-eAJ$7QL)nS>j(L# V{>#j=)*S9icjJ+n2hCv)@E=1ZqRs#S 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 2bba74bd463fcd9fdb5f07d51fe5551371e5605a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4243 zcmeHKOK%%h6vlS*@F@vqDpEHQ%B>S<7?+CLl;(1 z72DV|DDI-pF`|bUxt>EE)3Hz|==HFNOlRN{3wts`r8=tBTc}*pT6dYM?*yKS71Vc} zzJ>EW;$fdU9?l!x0kQMXHu8?kv58~L0u{hE2H1BE6QgRQu!E`5HK@_93V?Pc0%)ro zpuNAb1z=i+@1uGI1YZMUKW@;mh>3j4&`q>Te4W^Y62l^2F;5<$o?-czX^+eH0^8&k zA+AujO}w^_LQF2Z>N?ExM<_C>!O37mv^ASz&o-=f3Hzo;T;^wki7HAT)0jg3m$mib zXE_|{p|#LPMHw^l5u#pzN577chiTy1Tf%M*a1#HoJ%KRQCGA~241;p&(5e0;t#O)} zcU}Bkximt|N{g^?Qe)sw))j1i_?Qg2Q@h=mstQY~wb(iC>OJ^*3Dz&2OVXWCRF2b5 z7HKCx+gN<>d=$bx4YP4^c_=1wlLa|XBX>f9+^`zn2!NE#}xb7=}Rl;zMX-E3c*%4w(8aK z*W=$E@~6WsL8opyc8~P+F1D!QGd5E!YK04Em~6Z(a-t}(N*wAmK%CiY2+-v@o)Dm! zO9x0gfDEP98CtTlLjCF0S!q#ggpV=w1ItB$ z+G3zmJ}RED&d>$u0w(tuU_^ZhZWljQYt^#e`n*xr_iD{Xxu{jNaw+qMGy^HMRLUeI zfa%@xPJO?eNiP1Bfcdk|OJ7X#^Ro*qIVaQ3!j5?PUyaWFl7idi=dR;(lfw!H2x&hS#kLa$4 zd*peRmt$Ib2j=44M`+9njSZOdZNv2so#7-&3l}b!B)M-`;IzT(z_E!I4y0=cToy9K zzCzq`-=|=y5Lid7{bPz>SCH5Yt|1U(Wim6lOu`{`QJFj#Yj12*b{*TtlgpH^aOvD% zNx04A_!U!Pmr2L)@&BkRK7?6*PjRcos+cak|3Y1XyQh0%xS$#?@nv?`*yw1E{#4OZV;Dg!#M?J<5iP&RmMCS@MBc} z((#VOTAh+aw;i~=(1w5KgFW@ZcWms&i)Fa(F2hp2QQlQsTD_(>TWag&`JI6`wVKw_ z)NSoRt5w+`p9g5{){Et4lfRSvT~uqu^7b}=r}(>~)gt*D{N3Cua{0>Mc4mq%0u@!; zX4}EEGzaOSE_==teow%=jOFvEe&N)9#sYO3iGz<#%L%%X3Xf6W8NIAs!p`dOz83$w zovq>TACfn!#Y*$XR{2pa?{EATNwnKSq&;$Y4=-}LaOPX z@zI~c5AewcpZyiyncdk|K+`^SH#_&7nS1V;^Xg4}7?UO1h7bgk;L~oO%0r;Bh-BnN z0qv%}9ti41M==jTSd=!m==-f*`nI{bdmo`mlnM_VdJshi0oXk*Ad!&(oB2mPw2y0c z;vIsY24HDYLPB-~Nz6Q;?M~wzNai!i+_uKMErWOK3h(aKRtfO}mLzm1=OJGS#b2Cu z1Mbm8GKr66p6v6GOU?rR1^ZZ|Jr*Q@;PbV;H1s5oLaG2;p$F9mG~-mY%W;H#uTgWN zj*Np1=3jx)a>Vte+MaO%znw`;c&K+`%N|D0o?vx6U zsR&o~xfQ{ncylk%s~&UI3_1m&(t{j3)pu_r4;plyGI{>4KH_V@_rjGbvDM zj2AOUk?~NE$yKy3gvu9{DUG>xZYN`$a*NFQj0gRF0bVKu;7zPdYtTajIxn}?RFLfg zv2m%qLFSby{wBJji5~rj=!3?LGC3!|>yo%D!(B6#aI%So5on)LdlS|B1fERnuld^m zha_2-C4k?|>%i{*H6>iiKJ1%l95k*GGE`x4p4>Ro=Hd%7clN;LB~n69R3@?2*{3&6 ztI8{=Qh%$b0F9p$r8xn=><{h8-!~7AR0~fm}9JG`L6%t z?rQ%0HhHt;#AG81WrQDGKU*m-_~R^BM`HM&5v(h-pd63^A%6g&+Ftem diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup.php deleted file mode 100644 index 2ff6e412fa0e..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup.php +++ /dev/null @@ -1,327 +0,0 @@ -google.firestore.admin.v1.Backup - */ -class Backup extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The unique resource name of the Backup. - * Format is `projects/{project}/locations/{location}/backups/{backup}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. Name of the Firestore database that the backup is from. - * Format is `projects/{project}/databases/{database}`. - * - * Generated from protobuf field string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - protected $database = ''; - /** - * Output only. The system-generated UUID4 for the Firestore database that the - * backup is from. - * - * Generated from protobuf field string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $database_uid = ''; - /** - * Output only. The backup contains an externally consistent copy of the - * database at this time. - * - * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $snapshot_time = null; - /** - * Output only. The timestamp at which this backup expires. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $expire_time = null; - /** - * Output only. Statistics about the backup. - * This data only becomes available after the backup is fully materialized to - * secondary storage. This field will be empty till then. - * - * Generated from protobuf field .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $stats = null; - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.firestore.admin.v1.Backup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The unique resource name of the Backup. - * Format is `projects/{project}/locations/{location}/backups/{backup}`. - * @type string $database - * Output only. Name of the Firestore database that the backup is from. - * Format is `projects/{project}/databases/{database}`. - * @type string $database_uid - * Output only. The system-generated UUID4 for the Firestore database that the - * backup is from. - * @type \Google\Protobuf\Timestamp $snapshot_time - * Output only. The backup contains an externally consistent copy of the - * database at this time. - * @type \Google\Protobuf\Timestamp $expire_time - * Output only. The timestamp at which this backup expires. - * @type \Google\Cloud\Firestore\Admin\V1\Backup\Stats $stats - * Output only. Statistics about the backup. - * This data only becomes available after the backup is fully materialized to - * secondary storage. This field will be empty till then. - * @type int $state - * Output only. The current state of the backup. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Backup::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The unique resource name of the Backup. - * Format is `projects/{project}/locations/{location}/backups/{backup}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The unique resource name of the Backup. - * Format is `projects/{project}/locations/{location}/backups/{backup}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Name of the Firestore database that the backup is from. - * Format is `projects/{project}/databases/{database}`. - * - * Generated from protobuf field string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getDatabase() - { - return $this->database; - } - - /** - * Output only. Name of the Firestore database that the backup is from. - * Format is `projects/{project}/databases/{database}`. - * - * Generated from protobuf field string database = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkString($var, True); - $this->database = $var; - - return $this; - } - - /** - * Output only. The system-generated UUID4 for the Firestore database that the - * backup is from. - * - * Generated from protobuf field string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getDatabaseUid() - { - return $this->database_uid; - } - - /** - * Output only. The system-generated UUID4 for the Firestore database that the - * backup is from. - * - * Generated from protobuf field string database_uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setDatabaseUid($var) - { - GPBUtil::checkString($var, True); - $this->database_uid = $var; - - return $this; - } - - /** - * Output only. The backup contains an externally consistent copy of the - * database at this time. - * - * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @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); - } - - /** - * Output only. The backup contains an externally consistent copy of the - * database at this time. - * - * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setSnapshotTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->snapshot_time = $var; - - return $this; - } - - /** - * Output only. The timestamp at which this backup expires. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getExpireTime() - { - return $this->expire_time; - } - - public function hasExpireTime() - { - return isset($this->expire_time); - } - - public function clearExpireTime() - { - unset($this->expire_time); - } - - /** - * Output only. The timestamp at which this backup expires. - * - * Generated from protobuf field .google.protobuf.Timestamp expire_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setExpireTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->expire_time = $var; - - return $this; - } - - /** - * Output only. Statistics about the backup. - * This data only becomes available after the backup is fully materialized to - * secondary storage. This field will be empty till then. - * - * Generated from protobuf field .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Firestore\Admin\V1\Backup\Stats|null - */ - public function getStats() - { - return $this->stats; - } - - public function hasStats() - { - return isset($this->stats); - } - - public function clearStats() - { - unset($this->stats); - } - - /** - * Output only. Statistics about the backup. - * This data only becomes available after the backup is fully materialized to - * secondary storage. This field will be empty till then. - * - * Generated from protobuf field .google.firestore.admin.v1.Backup.Stats stats = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Firestore\Admin\V1\Backup\Stats $var - * @return $this - */ - public function setStats($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Backup\Stats::class); - $this->stats = $var; - - return $this; - } - - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.firestore.admin.v1.Backup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The current state of the backup. - * - * Generated from protobuf field .google.firestore.admin.v1.Backup.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\Admin\V1\Backup\State::class); - $this->state = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/State.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/State.php deleted file mode 100644 index b868abc36995..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/State.php +++ /dev/null @@ -1,72 +0,0 @@ -google.firestore.admin.v1.Backup.State - */ -class State -{ - /** - * The state is unspecified. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The pending backup is still being created. Operations on the - * backup will be rejected in this state. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The backup is complete and ready to use. - * - * Generated from protobuf enum READY = 2; - */ - const READY = 2; - /** - * The backup is not available at this moment. - * - * Generated from protobuf enum NOT_AVAILABLE = 3; - */ - const NOT_AVAILABLE = 3; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::READY => 'READY', - self::NOT_AVAILABLE => 'NOT_AVAILABLE', - ]; - - 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\Backup_State::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/Stats.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/Stats.php deleted file mode 100644 index 8e69131d5215..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Backup/Stats.php +++ /dev/null @@ -1,142 +0,0 @@ -google.firestore.admin.v1.Backup.Stats - */ -class Stats extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Summation of the size of all documents and index entries in - * the backup, measured in bytes. - * - * Generated from protobuf field int64 size_bytes = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $size_bytes = 0; - /** - * Output only. The total number of documents contained in the backup. - * - * Generated from protobuf field int64 document_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $document_count = 0; - /** - * Output only. The total number of index entries contained in the backup. - * - * Generated from protobuf field int64 index_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $index_count = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $size_bytes - * Output only. Summation of the size of all documents and index entries in - * the backup, measured in bytes. - * @type int|string $document_count - * Output only. The total number of documents contained in the backup. - * @type int|string $index_count - * Output only. The total number of index entries contained in the backup. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Backup::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Summation of the size of all documents and index entries in - * the backup, measured in bytes. - * - * Generated from protobuf field int64 size_bytes = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getSizeBytes() - { - return $this->size_bytes; - } - - /** - * Output only. Summation of the size of all documents and index entries in - * the backup, measured in bytes. - * - * Generated from protobuf field int64 size_bytes = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setSizeBytes($var) - { - GPBUtil::checkInt64($var); - $this->size_bytes = $var; - - return $this; - } - - /** - * Output only. The total number of documents contained in the backup. - * - * Generated from protobuf field int64 document_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getDocumentCount() - { - return $this->document_count; - } - - /** - * Output only. The total number of documents contained in the backup. - * - * Generated from protobuf field int64 document_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setDocumentCount($var) - { - GPBUtil::checkInt64($var); - $this->document_count = $var; - - return $this; - } - - /** - * Output only. The total number of index entries contained in the backup. - * - * Generated from protobuf field int64 index_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int|string - */ - public function getIndexCount() - { - return $this->index_count; - } - - /** - * Output only. The total number of index entries contained in the backup. - * - * Generated from protobuf field int64 index_count = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int|string $var - * @return $this - */ - public function setIndexCount($var) - { - GPBUtil::checkInt64($var); - $this->index_count = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Stats::class, \Google\Cloud\Firestore\Admin\V1\Backup_Stats::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BackupSchedule.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BackupSchedule.php deleted file mode 100644 index bac0b213b8bc..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BackupSchedule.php +++ /dev/null @@ -1,312 +0,0 @@ -google.firestore.admin.v1.BackupSchedule - */ -class BackupSchedule extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The unique backup schedule identifier across all locations and - * databases for the given project. - * This will be auto-assigned. - * Format is - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $name = ''; - /** - * Output only. The timestamp at which this backup schedule was created and - * effective since. - * No backups will be created for this schedule before this time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The timestamp at which this backup schedule was most recently - * updated. When a backup schedule is first created, this is the same as - * create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * At what relative time in the future, compared to its creation time, - * the backup should be deleted, e.g. keep backups for 7 days. - * - * Generated from protobuf field .google.protobuf.Duration retention = 6; - */ - protected $retention = null; - protected $recurrence; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The unique backup schedule identifier across all locations and - * databases for the given project. - * This will be auto-assigned. - * Format is - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The timestamp at which this backup schedule was created and - * effective since. - * No backups will be created for this schedule before this time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The timestamp at which this backup schedule was most recently - * updated. When a backup schedule is first created, this is the same as - * create_time. - * @type \Google\Protobuf\Duration $retention - * At what relative time in the future, compared to its creation time, - * the backup should be deleted, e.g. keep backups for 7 days. - * @type \Google\Cloud\Firestore\Admin\V1\DailyRecurrence $daily_recurrence - * For a schedule that runs daily. - * @type \Google\Cloud\Firestore\Admin\V1\WeeklyRecurrence $weekly_recurrence - * For a schedule that runs weekly on a specific day. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Schedule::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The unique backup schedule identifier across all locations and - * databases for the given project. - * This will be auto-assigned. - * Format is - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The unique backup schedule identifier across all locations and - * databases for the given project. - * This will be auto-assigned. - * Format is - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. The timestamp at which this backup schedule was created and - * effective since. - * No backups will be created for this schedule before this time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.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 backup schedule was created and - * effective since. - * No backups will be created for this schedule before this time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.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 backup schedule was most recently - * updated. When a backup schedule is first created, this is the same as - * create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.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 backup schedule was most recently - * updated. When a backup schedule is first created, this is the same as - * create_time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 10 [(.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; - } - - /** - * At what relative time in the future, compared to its creation time, - * the backup should be deleted, e.g. keep backups for 7 days. - * - * Generated from protobuf field .google.protobuf.Duration retention = 6; - * @return \Google\Protobuf\Duration|null - */ - public function getRetention() - { - return $this->retention; - } - - public function hasRetention() - { - return isset($this->retention); - } - - public function clearRetention() - { - unset($this->retention); - } - - /** - * At what relative time in the future, compared to its creation time, - * the backup should be deleted, e.g. keep backups for 7 days. - * - * Generated from protobuf field .google.protobuf.Duration retention = 6; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setRetention($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->retention = $var; - - return $this; - } - - /** - * For a schedule that runs daily. - * - * Generated from protobuf field .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; - * @return \Google\Cloud\Firestore\Admin\V1\DailyRecurrence|null - */ - public function getDailyRecurrence() - { - return $this->readOneof(7); - } - - public function hasDailyRecurrence() - { - return $this->hasOneof(7); - } - - /** - * For a schedule that runs daily. - * - * Generated from protobuf field .google.firestore.admin.v1.DailyRecurrence daily_recurrence = 7; - * @param \Google\Cloud\Firestore\Admin\V1\DailyRecurrence $var - * @return $this - */ - public function setDailyRecurrence($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\DailyRecurrence::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * For a schedule that runs weekly on a specific day. - * - * Generated from protobuf field .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; - * @return \Google\Cloud\Firestore\Admin\V1\WeeklyRecurrence|null - */ - public function getWeeklyRecurrence() - { - return $this->readOneof(8); - } - - public function hasWeeklyRecurrence() - { - return $this->hasOneof(8); - } - - /** - * For a schedule that runs weekly on a specific day. - * - * Generated from protobuf field .google.firestore.admin.v1.WeeklyRecurrence weekly_recurrence = 8; - * @param \Google\Cloud\Firestore\Admin\V1\WeeklyRecurrence $var - * @return $this - */ - public function setWeeklyRecurrence($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\WeeklyRecurrence::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * @return string - */ - public function getRecurrence() - { - return $this->whichOneof("recurrence"); - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsMetadata.php deleted file mode 100644 index ed6b4ce088a7..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsMetadata.php +++ /dev/null @@ -1,373 +0,0 @@ -google.firestore.admin.v1.BulkDeleteDocumentsMetadata - */ -class BulkDeleteDocumentsMetadata 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 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; - /** - * The ids of the collection groups that are being deleted. - * - * Generated from protobuf field repeated string collection_ids = 6; - */ - private $collection_ids; - /** - * Which namespace ids are being deleted. - * - * Generated from protobuf field repeated string namespace_ids = 7; - */ - private $namespace_ids; - /** - * The timestamp that corresponds to the version of the database that is being - * read to get the list of documents to delete. This time can also be used as - * the timestamp of PITR in case of disaster recovery (subject to PITR window - * limit). - * - * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 8; - */ - 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 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 - * The ids of the collection groups that are being deleted. - * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids - * Which namespace ids are being deleted. - * @type \Google\Protobuf\Timestamp $snapshot_time - * The timestamp that corresponds to the version of the database that is being - * read to get the list of documents to delete. This time can also be used as - * the timestamp of PITR in case of disaster recovery (subject to PITR window - * limit). - * } - */ - 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 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 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; - } - - /** - * The ids of the collection groups that are being deleted. - * - * Generated from protobuf field repeated string collection_ids = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCollectionIds() - { - return $this->collection_ids; - } - - /** - * The ids of the collection groups that are being deleted. - * - * 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; - } - - /** - * Which namespace ids are being deleted. - * - * Generated from protobuf field repeated string namespace_ids = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNamespaceIds() - { - return $this->namespace_ids; - } - - /** - * Which namespace ids are being deleted. - * - * Generated from protobuf field repeated string namespace_ids = 7; - * @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 - * read to get the list of documents to delete. This time can also be used as - * the timestamp of PITR in case of disaster recovery (subject to PITR window - * limit). - * - * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 8; - * @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 - * read to get the list of documents to delete. This time can also be used as - * the timestamp of PITR in case of disaster recovery (subject to PITR window - * limit). - * - * Generated from protobuf field .google.protobuf.Timestamp snapshot_time = 8; - * @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/BulkDeleteDocumentsRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsRequest.php deleted file mode 100644 index 0d14c82fb131..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsRequest.php +++ /dev/null @@ -1,193 +0,0 @@ -google.firestore.admin.v1.BulkDeleteDocumentsRequest - */ -class BulkDeleteDocumentsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Database to operate. 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 = ''; - /** - * Optional. IDs of the collection groups to delete. Unspecified means all - * collection groups. - * Each collection group in this list must be unique. - * - * Generated from protobuf field repeated string collection_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $collection_ids; - /** - * Optional. Namespaces to delete. - * An empty list means all namespaces. This is the recommended - * 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 delete from them. - * Each namespace in this list must be unique. - * - * Generated from protobuf field repeated string namespace_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $namespace_ids; - - /** - * @param string $name Required. Database to operate. 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\BulkDeleteDocumentsRequest - * - * @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 operate. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * @type array|\Google\Protobuf\Internal\RepeatedField $collection_ids - * Optional. IDs of the collection groups to delete. Unspecified means all - * collection groups. - * Each collection group in this list must be unique. - * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids - * Optional. Namespaces to delete. - * An empty list means all namespaces. This is the recommended - * 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 delete from 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 operate. 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 operate. 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; - } - - /** - * Optional. IDs of the collection groups to delete. Unspecified means all - * collection groups. - * Each collection group in this list must be unique. - * - * Generated from protobuf field repeated string collection_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCollectionIds() - { - return $this->collection_ids; - } - - /** - * Optional. IDs of the collection groups to delete. Unspecified means all - * collection groups. - * Each collection group in this list must be unique. - * - * Generated from protobuf field repeated string collection_ids = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @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; - } - - /** - * Optional. Namespaces to delete. - * An empty list means all namespaces. This is the recommended - * 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 delete from them. - * Each namespace in this list must be unique. - * - * Generated from protobuf field repeated string namespace_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNamespaceIds() - { - return $this->namespace_ids; - } - - /** - * Optional. Namespaces to delete. - * An empty list means all namespaces. This is the recommended - * 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 delete from them. - * Each namespace in this list must be unique. - * - * Generated from protobuf field repeated string namespace_ids = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @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/BulkDeleteDocumentsResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsResponse.php deleted file mode 100644 index a1d244d022c1..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/BulkDeleteDocumentsResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.firestore.admin.v1.BulkDeleteDocumentsResponse - */ -class BulkDeleteDocumentsResponse 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/CreateBackupScheduleRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateBackupScheduleRequest.php deleted file mode 100644 index bebd307d5f85..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateBackupScheduleRequest.php +++ /dev/null @@ -1,134 +0,0 @@ -google.firestore.admin.v1.CreateBackupScheduleRequest - */ -class CreateBackupScheduleRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent database. - * Format `projects/{project}/databases/{database}` - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The backup schedule to create. - * - * Generated from protobuf field .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $backup_schedule = null; - - /** - * @param string $parent Required. The parent database. - * - * Format `projects/{project}/databases/{database}` - * Please see {@see FirestoreAdminClient::databaseName()} for help formatting this field. - * @param \Google\Cloud\Firestore\Admin\V1\BackupSchedule $backupSchedule Required. The backup schedule to create. - * - * @return \Google\Cloud\Firestore\Admin\V1\CreateBackupScheduleRequest - * - * @experimental - */ - public static function build(string $parent, \Google\Cloud\Firestore\Admin\V1\BackupSchedule $backupSchedule): self - { - return (new self()) - ->setParent($parent) - ->setBackupSchedule($backupSchedule); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent database. - * Format `projects/{project}/databases/{database}` - * @type \Google\Cloud\Firestore\Admin\V1\BackupSchedule $backup_schedule - * Required. The backup schedule to create. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent database. - * Format `projects/{project}/databases/{database}` - * - * 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. The parent database. - * Format `projects/{project}/databases/{database}` - * - * 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 backup schedule to create. - * - * Generated from protobuf field .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Firestore\Admin\V1\BackupSchedule|null - */ - public function getBackupSchedule() - { - return $this->backup_schedule; - } - - public function hasBackupSchedule() - { - return isset($this->backup_schedule); - } - - public function clearBackupSchedule() - { - unset($this->backup_schedule); - } - - /** - * Required. The backup schedule to create. - * - * Generated from protobuf field .google.firestore.admin.v1.BackupSchedule backup_schedule = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Firestore\Admin\V1\BackupSchedule $var - * @return $this - */ - public function setBackupSchedule($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\BackupSchedule::class); - $this->backup_schedule = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseMetadata.php deleted file mode 100644 index 3a33d72e60b6..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/CreateDatabaseMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -google.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/DailyRecurrence.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DailyRecurrence.php deleted file mode 100644 index c5e9a366080a..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DailyRecurrence.php +++ /dev/null @@ -1,34 +0,0 @@ -google.firestore.admin.v1.DailyRecurrence - */ -class DailyRecurrence 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\Schedule::initOnce(); - parent::__construct($data); - } - -} - 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/DeleteBackupRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteBackupRequest.php deleted file mode 100644 index b1c17f2db7ce..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteBackupRequest.php +++ /dev/null @@ -1,88 +0,0 @@ -google.firestore.admin.v1.DeleteBackupRequest - */ -class DeleteBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the backup to delete. - * format is `projects/{project}/locations/{location}/backups/{backup}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the backup to delete. - * - * format is `projects/{project}/locations/{location}/backups/{backup}`. Please see - * {@see FirestoreAdminClient::backupName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\DeleteBackupRequest - * - * @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. Name of the backup to delete. - * format is `projects/{project}/locations/{location}/backups/{backup}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the backup to delete. - * format is `projects/{project}/locations/{location}/backups/{backup}`. - * - * 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. Name of the backup to delete. - * format is `projects/{project}/locations/{location}/backups/{backup}`. - * - * 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/DeleteBackupScheduleRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteBackupScheduleRequest.php deleted file mode 100644 index 9d3bc056d176..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/DeleteBackupScheduleRequest.php +++ /dev/null @@ -1,92 +0,0 @@ -google.firestore.admin.v1.DeleteBackupScheduleRequest - */ -class DeleteBackupScheduleRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the backup schedule. - * Format - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the backup schedule. - * - * Format - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * Please see {@see FirestoreAdminClient::backupScheduleName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\DeleteBackupScheduleRequest - * - * @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 name of the backup schedule. - * Format - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the backup schedule. - * Format - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * - * 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. The name of the backup schedule. - * Format - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * - * 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/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 bc67604f4e15..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ExportDocumentsRequest.php +++ /dev/null @@ -1,305 +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. Each - * collection id in this list must be unique. - * - * 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. Each - * collection id in this list must be unique. - * @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. Each - * collection id in this list must be unique. - * - * 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. Each - * collection id in this list must be unique. - * - * 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 944cecc3000e..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field.php +++ /dev/null @@ -1,253 +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 can 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 can be quoted using `` ` `` (backtick). The only character that - * must 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: - * `` `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 can 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 can be quoted using `` ` `` (backtick). The only character that - * must 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: - * `` `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 can 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 can be quoted using `` ` `` (backtick). The only character that - * must 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: - * `` `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 can 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 can be quoted using `` ` `` (backtick). The only character that - * must 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: - * `` `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 42a4d5ce8fd3..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 7bb0a4304ab4..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Field/TtlConfig.php +++ /dev/null @@ -1,76 +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/GetBackupRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetBackupRequest.php deleted file mode 100644 index 9663203b71d3..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetBackupRequest.php +++ /dev/null @@ -1,88 +0,0 @@ -google.firestore.admin.v1.GetBackupRequest - */ -class GetBackupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the backup to fetch. - * Format is `projects/{project}/locations/{location}/backups/{backup}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. Name of the backup to fetch. - * - * Format is `projects/{project}/locations/{location}/backups/{backup}`. Please see - * {@see FirestoreAdminClient::backupName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\GetBackupRequest - * - * @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. Name of the backup to fetch. - * Format is `projects/{project}/locations/{location}/backups/{backup}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the backup to fetch. - * Format is `projects/{project}/locations/{location}/backups/{backup}`. - * - * 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. Name of the backup to fetch. - * Format is `projects/{project}/locations/{location}/backups/{backup}`. - * - * 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/GetBackupScheduleRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetBackupScheduleRequest.php deleted file mode 100644 index ce2dfbc7e39f..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/GetBackupScheduleRequest.php +++ /dev/null @@ -1,93 +0,0 @@ -google.firestore.admin.v1.GetBackupScheduleRequest - */ -class GetBackupScheduleRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the backup schedule. - * Format - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * @param string $name Required. The name of the backup schedule. - * - * Format - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * Please see {@see FirestoreAdminClient::backupScheduleName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\GetBackupScheduleRequest - * - * @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 name of the backup schedule. - * Format - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the backup schedule. - * Format - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * - * 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. The name of the backup schedule. - * Format - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * - * 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/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 6d01ac819ead..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. Each collection id in this list must be unique. - * - * 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. Each collection id in this list must be unique. - * @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. Each collection id in this list must be unique. - * - * 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. Each collection id in this list must be unique. - * - * 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 0f49391e6a9f..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField.php +++ /dev/null @@ -1,194 +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. - * @type \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig $vector_config - * Indicates that this field supports nearest neighbor and distance - * operations on vector. - * } - */ - 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; - } - - /** - * Indicates that this field supports nearest neighbor and distance - * operations on vector. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.VectorConfig vector_config = 4; - * @return \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig|null - */ - public function getVectorConfig() - { - return $this->readOneof(4); - } - - public function hasVectorConfig() - { - return $this->hasOneof(4); - } - - /** - * Indicates that this field supports nearest neighbor and distance - * operations on vector. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.VectorConfig vector_config = 4; - * @param \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig $var - * @return $this - */ - public function setVectorConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig::class); - $this->writeOneof(4, $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/IndexField/VectorConfig.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/VectorConfig.php deleted file mode 100644 index 7f7d1a63104c..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/VectorConfig.php +++ /dev/null @@ -1,120 +0,0 @@ -google.firestore.admin.v1.Index.IndexField.VectorConfig - */ -class VectorConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The vector dimension this configuration applies to. - * The resulting index will only include vectors of this dimension, and - * can be used for vector search with the same dimension. - * - * Generated from protobuf field int32 dimension = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $dimension = 0; - protected $type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $dimension - * Required. The vector dimension this configuration applies to. - * The resulting index will only include vectors of this dimension, and - * can be used for vector search with the same dimension. - * @type \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig\FlatIndex $flat - * Indicates the vector index is a flat index. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Index::initOnce(); - parent::__construct($data); - } - - /** - * Required. The vector dimension this configuration applies to. - * The resulting index will only include vectors of this dimension, and - * can be used for vector search with the same dimension. - * - * Generated from protobuf field int32 dimension = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getDimension() - { - return $this->dimension; - } - - /** - * Required. The vector dimension this configuration applies to. - * The resulting index will only include vectors of this dimension, and - * can be used for vector search with the same dimension. - * - * Generated from protobuf field int32 dimension = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setDimension($var) - { - GPBUtil::checkInt32($var); - $this->dimension = $var; - - return $this; - } - - /** - * Indicates the vector index is a flat index. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex flat = 2; - * @return \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig\FlatIndex|null - */ - public function getFlat() - { - return $this->readOneof(2); - } - - public function hasFlat() - { - return $this->hasOneof(2); - } - - /** - * Indicates the vector index is a flat index. - * - * Generated from protobuf field .google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex flat = 2; - * @param \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig\FlatIndex $var - * @return $this - */ - public function setFlat($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Index\IndexField\VectorConfig\FlatIndex::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getType() - { - return $this->whichOneof("type"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(VectorConfig::class, \Google\Cloud\Firestore\Admin\V1\Index_IndexField_VectorConfig::class); - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/VectorConfig/FlatIndex.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/VectorConfig/FlatIndex.php deleted file mode 100644 index b2321214c64d..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/Index/IndexField/VectorConfig/FlatIndex.php +++ /dev/null @@ -1,37 +0,0 @@ -google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex - */ -class FlatIndex 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\Index::initOnce(); - parent::__construct($data); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FlatIndex::class, \Google\Cloud\Firestore\Admin\V1\Index_IndexField_VectorConfig_FlatIndex::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/ListBackupSchedulesRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupSchedulesRequest.php deleted file mode 100644 index ad8c349dacd6..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupSchedulesRequest.php +++ /dev/null @@ -1,88 +0,0 @@ -google.firestore.admin.v1.ListBackupSchedulesRequest - */ -class ListBackupSchedulesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent database. - * Format is `projects/{project}/databases/{database}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - - /** - * @param string $parent Required. The parent database. - * - * Format is `projects/{project}/databases/{database}`. Please see - * {@see FirestoreAdminClient::databaseName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\ListBackupSchedulesRequest - * - * @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 database. - * Format is `projects/{project}/databases/{database}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent database. - * Format is `projects/{project}/databases/{database}`. - * - * 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. The parent database. - * Format is `projects/{project}/databases/{database}`. - * - * 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/ListBackupSchedulesResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupSchedulesResponse.php deleted file mode 100644 index bda082e013e8..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupSchedulesResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -google.firestore.admin.v1.ListBackupSchedulesResponse - */ -class ListBackupSchedulesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * List of all backup schedules. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; - */ - private $backup_schedules; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Firestore\Admin\V1\BackupSchedule>|\Google\Protobuf\Internal\RepeatedField $backup_schedules - * List of all backup schedules. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * List of all backup schedules. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBackupSchedules() - { - return $this->backup_schedules; - } - - /** - * List of all backup schedules. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.BackupSchedule backup_schedules = 1; - * @param array<\Google\Cloud\Firestore\Admin\V1\BackupSchedule>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBackupSchedules($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\BackupSchedule::class); - $this->backup_schedules = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsRequest.php deleted file mode 100644 index fa8525ee48bc..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsRequest.php +++ /dev/null @@ -1,103 +0,0 @@ -google.firestore.admin.v1.ListBackupsRequest - */ -class ListBackupsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The location to list backups from. - * Format is `projects/{project}/locations/{location}`. - * Use `{location} = '-'` to list backups from all locations for the given - * project. This allows listing backups from a single location or from all - * locations. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - - /** - * @param string $parent Required. The location to list backups from. - * - * Format is `projects/{project}/locations/{location}`. - * Use `{location} = '-'` to list backups from all locations for the given - * project. This allows listing backups from a single location or from all - * locations. Please see - * {@see FirestoreAdminClient::locationName()} for help formatting this field. - * - * @return \Google\Cloud\Firestore\Admin\V1\ListBackupsRequest - * - * @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 location to list backups from. - * Format is `projects/{project}/locations/{location}`. - * Use `{location} = '-'` to list backups from all locations for the given - * project. This allows listing backups from a single location or from all - * locations. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. The location to list backups from. - * Format is `projects/{project}/locations/{location}`. - * Use `{location} = '-'` to list backups from all locations for the given - * project. This allows listing backups from a single location or from all - * locations. - * - * 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. The location to list backups from. - * Format is `projects/{project}/locations/{location}`. - * Use `{location} = '-'` to list backups from all locations for the given - * project. This allows listing backups from a single location or from all - * locations. - * - * 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/ListBackupsResponse.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsResponse.php deleted file mode 100644 index b3fa74286dcb..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListBackupsResponse.php +++ /dev/null @@ -1,118 +0,0 @@ -google.firestore.admin.v1.ListBackupsResponse - */ -class ListBackupsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * List of all backups for the project. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Backup backups = 1; - */ - private $backups; - /** - * List of locations that existing backups were not able to be fetched from. - * Instead of failing the entire requests when a single location is - * unreachable, this response returns a partial result set and list of - * locations unable to be reached here. The request can be retried against a - * single location to get a concrete error. - * - * 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\Backup>|\Google\Protobuf\Internal\RepeatedField $backups - * List of all backups for the project. - * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable - * List of locations that existing backups were not able to be fetched from. - * Instead of failing the entire requests when a single location is - * unreachable, this response returns a partial result set and list of - * locations unable to be reached here. The request can be retried against a - * single location to get a concrete error. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * List of all backups for the project. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Backup backups = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBackups() - { - return $this->backups; - } - - /** - * List of all backups for the project. - * - * Generated from protobuf field repeated .google.firestore.admin.v1.Backup backups = 1; - * @param array<\Google\Cloud\Firestore\Admin\V1\Backup>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBackups($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Firestore\Admin\V1\Backup::class); - $this->backups = $arr; - - return $this; - } - - /** - * List of locations that existing backups were not able to be fetched from. - * Instead of failing the entire requests when a single location is - * unreachable, this response returns a partial result set and list of - * locations unable to be reached here. The request can be retried against a - * single location to get a concrete error. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * List of locations that existing backups were not able to be fetched from. - * Instead of failing the entire requests when a single location is - * unreachable, this response returns a partial result set and list of - * locations unable to be reached here. The request can be retried against a - * single location to get a concrete error. - * - * 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/ListDatabasesRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesRequest.php deleted file mode 100644 index afeeb262a56b..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListDatabasesRequest.php +++ /dev/null @@ -1,120 +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 = ''; - /** - * If true, also returns deleted resources. - * - * Generated from protobuf field bool show_deleted = 4; - */ - protected $show_deleted = false; - - /** - * @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}` - * @type bool $show_deleted - * If true, also returns deleted resources. - * } - */ - 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; - } - - /** - * If true, also returns deleted resources. - * - * Generated from protobuf field bool show_deleted = 4; - * @return bool - */ - public function getShowDeleted() - { - return $this->show_deleted; - } - - /** - * If true, also returns deleted resources. - * - * Generated from protobuf field bool show_deleted = 4; - * @param bool $var - * @return $this - */ - public function setShowDeleted($var) - { - GPBUtil::checkBool($var); - $this->show_deleted = $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 c027afa975ac..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/ListFieldsRequest.php +++ /dev/null @@ -1,221 +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` or - * `ttlConfig:*`. - * - * 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` or - * `ttlConfig:*`. - * @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` or - * `ttlConfig:*`. - * - * 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` or - * `ttlConfig:*`. - * - * 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/RestoreDatabaseMetadata.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/RestoreDatabaseMetadata.php deleted file mode 100644 index 526f1cacab72..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/RestoreDatabaseMetadata.php +++ /dev/null @@ -1,268 +0,0 @@ -google.firestore.admin.v1.RestoreDatabaseMetadata - */ -class RestoreDatabaseMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The time the restore was started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - protected $start_time = null; - /** - * The time the restore finished, unset for ongoing restores. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - protected $end_time = null; - /** - * The operation state of the restore. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; - */ - protected $operation_state = 0; - /** - * The name of the database being restored to. - * - * Generated from protobuf field string database = 4 [(.google.api.resource_reference) = { - */ - protected $database = ''; - /** - * The name of the backup restoring from. - * - * Generated from protobuf field string backup = 5 [(.google.api.resource_reference) = { - */ - protected $backup = ''; - /** - * How far along the restore is as an estimated percentage of remaining time. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_percentage = 8; - */ - protected $progress_percentage = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * The time the restore was started. - * @type \Google\Protobuf\Timestamp $end_time - * The time the restore finished, unset for ongoing restores. - * @type int $operation_state - * The operation state of the restore. - * @type string $database - * The name of the database being restored to. - * @type string $backup - * The name of the backup restoring from. - * @type \Google\Cloud\Firestore\Admin\V1\Progress $progress_percentage - * How far along the restore is as an estimated percentage of remaining time. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Operation::initOnce(); - parent::__construct($data); - } - - /** - * The time the restore was 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 the restore was 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 the restore finished, unset for ongoing restores. - * - * 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 the restore finished, unset for ongoing restores. - * - * 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 operation state of the restore. - * - * Generated from protobuf field .google.firestore.admin.v1.OperationState operation_state = 3; - * @return int - */ - public function getOperationState() - { - return $this->operation_state; - } - - /** - * The operation state of the restore. - * - * 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 name of the database being restored to. - * - * Generated from protobuf field string database = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getDatabase() - { - return $this->database; - } - - /** - * The name of the database being restored to. - * - * Generated from protobuf field string database = 4 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkString($var, True); - $this->database = $var; - - return $this; - } - - /** - * The name of the backup restoring from. - * - * Generated from protobuf field string backup = 5 [(.google.api.resource_reference) = { - * @return string - */ - public function getBackup() - { - return $this->backup; - } - - /** - * The name of the backup restoring from. - * - * Generated from protobuf field string backup = 5 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkString($var, True); - $this->backup = $var; - - return $this; - } - - /** - * How far along the restore is as an estimated percentage of remaining time. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_percentage = 8; - * @return \Google\Cloud\Firestore\Admin\V1\Progress|null - */ - public function getProgressPercentage() - { - return $this->progress_percentage; - } - - public function hasProgressPercentage() - { - return isset($this->progress_percentage); - } - - public function clearProgressPercentage() - { - unset($this->progress_percentage); - } - - /** - * How far along the restore is as an estimated percentage of remaining time. - * - * Generated from protobuf field .google.firestore.admin.v1.Progress progress_percentage = 8; - * @param \Google\Cloud\Firestore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressPercentage($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Progress::class); - $this->progress_percentage = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/RestoreDatabaseRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/RestoreDatabaseRequest.php deleted file mode 100644 index 81e97c650b37..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/RestoreDatabaseRequest.php +++ /dev/null @@ -1,172 +0,0 @@ -google.firestore.admin.v1.RestoreDatabaseRequest - */ -class RestoreDatabaseRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The project to restore the database in. Format is - * `projects/{project_id}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The ID to use for the database, which will become the final - * component of the database's resource name. This database id must not be - * associated with an existing database. - * 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 = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $database_id = ''; - /** - * Required. Backup to restore from. Must be from the same project as the - * parent. - * Format is: `projects/{project_id}/locations/{location}/backups/{backup}` - * - * Generated from protobuf field string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $backup = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The project to restore the database in. Format is - * `projects/{project_id}`. - * @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 database id must not be - * associated with an existing database. - * 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. - * @type string $backup - * Required. Backup to restore from. Must be from the same project as the - * parent. - * Format is: `projects/{project_id}/locations/{location}/backups/{backup}` - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. The project to restore the database in. Format is - * `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. The project to restore the database in. Format is - * `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 ID to use for the database, which will become the final - * component of the database's resource name. This database id must not be - * associated with an existing database. - * 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 = 2 [(.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 database id must not be - * associated with an existing database. - * 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 = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setDatabaseId($var) - { - GPBUtil::checkString($var, True); - $this->database_id = $var; - - return $this; - } - - /** - * Required. Backup to restore from. Must be from the same project as the - * parent. - * Format is: `projects/{project_id}/locations/{location}/backups/{backup}` - * - * Generated from protobuf field string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getBackup() - { - return $this->backup; - } - - /** - * Required. Backup to restore from. Must be from the same project as the - * parent. - * Format is: `projects/{project_id}/locations/{location}/backups/{backup}` - * - * Generated from protobuf field string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setBackup($var) - { - GPBUtil::checkString($var, True); - $this->backup = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateBackupScheduleRequest.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateBackupScheduleRequest.php deleted file mode 100644 index cdc9e8b0e306..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/UpdateBackupScheduleRequest.php +++ /dev/null @@ -1,137 +0,0 @@ -google.firestore.admin.v1.UpdateBackupScheduleRequest - */ -class UpdateBackupScheduleRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The backup schedule to update. - * - * Generated from protobuf field .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $backup_schedule = 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\BackupSchedule $backupSchedule Required. The backup schedule to update. - * @param \Google\Protobuf\FieldMask $updateMask The list of fields to be updated. - * - * @return \Google\Cloud\Firestore\Admin\V1\UpdateBackupScheduleRequest - * - * @experimental - */ - public static function build(\Google\Cloud\Firestore\Admin\V1\BackupSchedule $backupSchedule, \Google\Protobuf\FieldMask $updateMask): self - { - return (new self()) - ->setBackupSchedule($backupSchedule) - ->setUpdateMask($updateMask); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\Admin\V1\BackupSchedule $backup_schedule - * Required. The backup schedule 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 backup schedule to update. - * - * Generated from protobuf field .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Firestore\Admin\V1\BackupSchedule|null - */ - public function getBackupSchedule() - { - return $this->backup_schedule; - } - - public function hasBackupSchedule() - { - return isset($this->backup_schedule); - } - - public function clearBackupSchedule() - { - unset($this->backup_schedule); - } - - /** - * Required. The backup schedule to update. - * - * Generated from protobuf field .google.firestore.admin.v1.BackupSchedule backup_schedule = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Firestore\Admin\V1\BackupSchedule $var - * @return $this - */ - public function setBackupSchedule($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\BackupSchedule::class); - $this->backup_schedule = $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/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/proto/src/Google/Cloud/Firestore/Admin/V1/WeeklyRecurrence.php b/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/WeeklyRecurrence.php deleted file mode 100644 index e7c64ebae899..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/proto/src/Google/Cloud/Firestore/Admin/V1/WeeklyRecurrence.php +++ /dev/null @@ -1,72 +0,0 @@ -google.firestore.admin.v1.WeeklyRecurrence - */ -class WeeklyRecurrence extends \Google\Protobuf\Internal\Message -{ - /** - * The day of week to run. - * DAY_OF_WEEK_UNSPECIFIED is not allowed. - * - * Generated from protobuf field .google.type.DayOfWeek day = 2; - */ - protected $day = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $day - * The day of week to run. - * DAY_OF_WEEK_UNSPECIFIED is not allowed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\Admin\V1\Schedule::initOnce(); - parent::__construct($data); - } - - /** - * The day of week to run. - * DAY_OF_WEEK_UNSPECIFIED is not allowed. - * - * Generated from protobuf field .google.type.DayOfWeek day = 2; - * @return int - */ - public function getDay() - { - return $this->day; - } - - /** - * The day of week to run. - * DAY_OF_WEEK_UNSPECIFIED is not allowed. - * - * Generated from protobuf field .google.type.DayOfWeek day = 2; - * @param int $var - * @return $this - */ - public function setDay($var) - { - GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class); - $this->day = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/bulk_delete_documents.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/bulk_delete_documents.php deleted file mode 100644 index 68aeec0bfc87..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/bulk_delete_documents.php +++ /dev/null @@ -1,91 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $firestoreAdminClient->bulkDeleteDocuments($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var BulkDeleteDocumentsResponse $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]'); - - bulk_delete_documents_sample($formattedName); -} -// [END firestore_v1_generated_FirestoreAdmin_BulkDeleteDocuments_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_backup_schedule.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_backup_schedule.php deleted file mode 100644 index 0e83e8d00dee..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/create_backup_schedule.php +++ /dev/null @@ -1,77 +0,0 @@ -setParent($formattedParent) - ->setBackupSchedule($backupSchedule); - - // Call the API and handle any network failures. - try { - /** @var BackupSchedule $response */ - $response = $firestoreAdminClient->createBackupSchedule($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::databaseName('[PROJECT]', '[DATABASE]'); - - create_backup_schedule_sample($formattedParent); -} -// [END firestore_v1_generated_FirestoreAdmin_CreateBackupSchedule_sync] 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_backup.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_backup.php deleted file mode 100644 index fe41a64237fc..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_backup.php +++ /dev/null @@ -1,71 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $firestoreAdminClient->deleteBackup($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::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - - delete_backup_sample($formattedName); -} -// [END firestore_v1_generated_FirestoreAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_backup_schedule.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_backup_schedule.php deleted file mode 100644 index 53a4b98405a4..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/delete_backup_schedule.php +++ /dev/null @@ -1,76 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - $firestoreAdminClient->deleteBackupSchedule($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::backupScheduleName( - '[PROJECT]', - '[DATABASE]', - '[BACKUP_SCHEDULE]' - ); - - delete_backup_schedule_sample($formattedName); -} -// [END firestore_v1_generated_FirestoreAdmin_DeleteBackupSchedule_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_backup.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_backup.php deleted file mode 100644 index a6be739032e1..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_backup.php +++ /dev/null @@ -1,73 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var Backup $response */ - $response = $firestoreAdminClient->getBackup($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::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - - get_backup_sample($formattedName); -} -// [END firestore_v1_generated_FirestoreAdmin_GetBackup_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_backup_schedule.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_backup_schedule.php deleted file mode 100644 index d3912a59df7d..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/get_backup_schedule.php +++ /dev/null @@ -1,78 +0,0 @@ -setName($formattedName); - - // Call the API and handle any network failures. - try { - /** @var BackupSchedule $response */ - $response = $firestoreAdminClient->getBackupSchedule($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::backupScheduleName( - '[PROJECT]', - '[DATABASE]', - '[BACKUP_SCHEDULE]' - ); - - get_backup_schedule_sample($formattedName); -} -// [END firestore_v1_generated_FirestoreAdmin_GetBackupSchedule_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_backup_schedules.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_backup_schedules.php deleted file mode 100644 index fc8d6552d54d..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_backup_schedules.php +++ /dev/null @@ -1,73 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var ListBackupSchedulesResponse $response */ - $response = $firestoreAdminClient->listBackupSchedules($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::databaseName('[PROJECT]', '[DATABASE]'); - - list_backup_schedules_sample($formattedParent); -} -// [END firestore_v1_generated_FirestoreAdmin_ListBackupSchedules_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_backups.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_backups.php deleted file mode 100644 index 79980c681c3e..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/list_backups.php +++ /dev/null @@ -1,76 +0,0 @@ -setParent($formattedParent); - - // Call the API and handle any network failures. - try { - /** @var ListBackupsResponse $response */ - $response = $firestoreAdminClient->listBackups($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::locationName('[PROJECT]', '[LOCATION]'); - - list_backups_sample($formattedParent); -} -// [END firestore_v1_generated_FirestoreAdmin_ListBackups_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/restore_database.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/restore_database.php deleted file mode 100644 index 0df0f62ea545..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/restore_database.php +++ /dev/null @@ -1,121 +0,0 @@ -setParent($formattedParent) - ->setDatabaseId($databaseId) - ->setBackup($formattedBackup); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $firestoreAdminClient->restoreDatabase($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]'; - $formattedBackup = FirestoreAdminClient::backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - - restore_database_sample($formattedParent, $databaseId, $formattedBackup); -} -// [END firestore_v1_generated_FirestoreAdmin_RestoreDatabase_sync] diff --git a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_backup_schedule.php b/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_backup_schedule.php deleted file mode 100644 index eaa50535ba29..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_backup_schedule.php +++ /dev/null @@ -1,59 +0,0 @@ -setBackupSchedule($backupSchedule); - - // Call the API and handle any network failures. - try { - /** @var BackupSchedule $response */ - $response = $firestoreAdminClient->updateBackupSchedule($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_FirestoreAdmin_UpdateBackupSchedule_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 9b249c701a51..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/samples/V1/FirestoreAdminClient/update_field.php +++ /dev/null @@ -1,122 +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 9b15de33b4d3..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/src/V1/Client/FirestoreAdminClient.php +++ /dev/null @@ -1,1153 +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 backup - * resource. - * - * @param string $project - * @param string $location - * @param string $backup - * - * @return string The formatted backup resource. - */ - public static function backupName(string $project, string $location, string $backup): string - { - return self::getPathTemplate('backup')->render([ - 'project' => $project, - 'location' => $location, - 'backup' => $backup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * backup_schedule resource. - * - * @param string $project - * @param string $database - * @param string $backupSchedule - * - * @return string The formatted backup_schedule resource. - */ - public static function backupScheduleName(string $project, string $database, string $backupSchedule): string - { - return self::getPathTemplate('backupSchedule')->render([ - 'project' => $project, - 'database' => $database, - 'backup_schedule' => $backupSchedule, - ]); - } - - /** - * 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 location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName(string $project, string $location): string - { - return self::getPathTemplate('location')->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * 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 - * - backup: projects/{project}/locations/{location}/backups/{backup} - * - backupSchedule: projects/{project}/databases/{database}/backupSchedules/{backup_schedule} - * - 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} - * - location: projects/{project}/locations/{location} - * - 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); - } - - /** - * Bulk deletes a subset of documents from Google Cloud Firestore. - * Documents created or updated after the underlying system starts to process - * the request will not be deleted. The bulk delete occurs in the background - * and its progress can be monitored and managed via the Operation resource - * that is created. - * - * For more details on bulk delete behavior, refer to: - * https://cloud.google.com/firestore/docs/manage-data/bulk-delete - * - * The async variant is {@see FirestoreAdminClient::bulkDeleteDocumentsAsync()} . - * - * @example samples/V1/FirestoreAdminClient/bulk_delete_documents.php - * - * @param BulkDeleteDocumentsRequest $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 bulkDeleteDocuments(BulkDeleteDocumentsRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('BulkDeleteDocuments', $request, $callOptions)->wait(); - } - - /** - * Creates a backup schedule on a database. - * At most two backup schedules can be configured on a database, one daily - * backup schedule and one weekly backup schedule. - * - * The async variant is {@see FirestoreAdminClient::createBackupScheduleAsync()} . - * - * @example samples/V1/FirestoreAdminClient/create_backup_schedule.php - * - * @param CreateBackupScheduleRequest $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 BackupSchedule - * - * @throws ApiException Thrown if the API call fails. - */ - public function createBackupSchedule(CreateBackupScheduleRequest $request, array $callOptions = []): BackupSchedule - { - return $this->startApiCall('CreateBackupSchedule', $request, $callOptions)->wait(); - } - - /** - * 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 backup. - * - * The async variant is {@see FirestoreAdminClient::deleteBackupAsync()} . - * - * @example samples/V1/FirestoreAdminClient/delete_backup.php - * - * @param DeleteBackupRequest $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 deleteBackup(DeleteBackupRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteBackup', $request, $callOptions)->wait(); - } - - /** - * Deletes a backup schedule. - * - * The async variant is {@see FirestoreAdminClient::deleteBackupScheduleAsync()} . - * - * @example samples/V1/FirestoreAdminClient/delete_backup_schedule.php - * - * @param DeleteBackupScheduleRequest $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 deleteBackupSchedule(DeleteBackupScheduleRequest $request, array $callOptions = []): void - { - $this->startApiCall('DeleteBackupSchedule', $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 backup. - * - * The async variant is {@see FirestoreAdminClient::getBackupAsync()} . - * - * @example samples/V1/FirestoreAdminClient/get_backup.php - * - * @param GetBackupRequest $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 Backup - * - * @throws ApiException Thrown if the API call fails. - */ - public function getBackup(GetBackupRequest $request, array $callOptions = []): Backup - { - return $this->startApiCall('GetBackup', $request, $callOptions)->wait(); - } - - /** - * Gets information about a backup schedule. - * - * The async variant is {@see FirestoreAdminClient::getBackupScheduleAsync()} . - * - * @example samples/V1/FirestoreAdminClient/get_backup_schedule.php - * - * @param GetBackupScheduleRequest $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 BackupSchedule - * - * @throws ApiException Thrown if the API call fails. - */ - public function getBackupSchedule(GetBackupScheduleRequest $request, array $callOptions = []): BackupSchedule - { - return $this->startApiCall('GetBackupSchedule', $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 backup schedules. - * - * The async variant is {@see FirestoreAdminClient::listBackupSchedulesAsync()} . - * - * @example samples/V1/FirestoreAdminClient/list_backup_schedules.php - * - * @param ListBackupSchedulesRequest $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 ListBackupSchedulesResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listBackupSchedules(ListBackupSchedulesRequest $request, array $callOptions = []): ListBackupSchedulesResponse - { - return $this->startApiCall('ListBackupSchedules', $request, $callOptions)->wait(); - } - - /** - * Lists all the backups. - * - * The async variant is {@see FirestoreAdminClient::listBackupsAsync()} . - * - * @example samples/V1/FirestoreAdminClient/list_backups.php - * - * @param ListBackupsRequest $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 ListBackupsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listBackups(ListBackupsRequest $request, array $callOptions = []): ListBackupsResponse - { - return $this->startApiCall('ListBackups', $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); - } - - /** - * Creates a new database by restoring from an existing backup. - * - * The new database must be in the same cloud region or multi-region location - * as the existing backup. This behaves similar to - * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase] - * except instead of creating a new empty database, a new database is created - * with the database type, index configuration, and documents from an existing - * backup. - * - * The [long-running operation][google.longrunning.Operation] can be used to - * track the progress of the restore, with the Operation's - * [metadata][google.longrunning.Operation.metadata] field type being the - * [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata]. - * The [response][google.longrunning.Operation.response] type is the - * [Database][google.firestore.admin.v1.Database] if the restore was - * successful. The new database is not readable or writeable until the LRO has - * completed. - * - * The async variant is {@see FirestoreAdminClient::restoreDatabaseAsync()} . - * - * @example samples/V1/FirestoreAdminClient/restore_database.php - * - * @param RestoreDatabaseRequest $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 restoreDatabase(RestoreDatabaseRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('RestoreDatabase', $request, $callOptions)->wait(); - } - - /** - * Updates a backup schedule. - * - * The async variant is {@see FirestoreAdminClient::updateBackupScheduleAsync()} . - * - * @example samples/V1/FirestoreAdminClient/update_backup_schedule.php - * - * @param UpdateBackupScheduleRequest $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 BackupSchedule - * - * @throws ApiException Thrown if the API call fails. - */ - public function updateBackupSchedule(UpdateBackupScheduleRequest $request, array $callOptions = []): BackupSchedule - { - return $this->startApiCall('UpdateBackupSchedule', $request, $callOptions)->wait(); - } - - /** - * 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 @@ -databaseName('[PROJECT]', '[DATABASE]'); - * $operationResponse = $firestoreAdminClient->bulkDeleteDocuments($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->bulkDeleteDocuments($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'bulkDeleteDocuments'); - * 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 $backupNameTemplate; - - private static $backupScheduleNameTemplate; - - private static $collectionGroupNameTemplate; - - private static $databaseNameTemplate; - - private static $fieldNameTemplate; - - private static $indexNameTemplate; - - private static $locationNameTemplate; - - 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 getBackupNameTemplate() - { - if (self::$backupNameTemplate == null) { - self::$backupNameTemplate = new PathTemplate('projects/{project}/locations/{location}/backups/{backup}'); - } - - return self::$backupNameTemplate; - } - - private static function getBackupScheduleNameTemplate() - { - if (self::$backupScheduleNameTemplate == null) { - self::$backupScheduleNameTemplate = new PathTemplate('projects/{project}/databases/{database}/backupSchedules/{backup_schedule}'); - } - - return self::$backupScheduleNameTemplate; - } - - 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 getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - 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 = [ - 'backup' => self::getBackupNameTemplate(), - 'backupSchedule' => self::getBackupScheduleNameTemplate(), - 'collectionGroup' => self::getCollectionGroupNameTemplate(), - 'database' => self::getDatabaseNameTemplate(), - 'field' => self::getFieldNameTemplate(), - 'index' => self::getIndexNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'project' => self::getProjectNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a backup - * resource. - * - * @param string $project - * @param string $location - * @param string $backup - * - * @return string The formatted backup resource. - */ - public static function backupName($project, $location, $backup) - { - return self::getBackupNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'backup' => $backup, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * backup_schedule resource. - * - * @param string $project - * @param string $database - * @param string $backupSchedule - * - * @return string The formatted backup_schedule resource. - */ - public static function backupScheduleName($project, $database, $backupSchedule) - { - return self::getBackupScheduleNameTemplate()->render([ - 'project' => $project, - 'database' => $database, - 'backup_schedule' => $backupSchedule, - ]); - } - - /** - * 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 location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * 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 - * - backup: projects/{project}/locations/{location}/backups/{backup} - * - backupSchedule: projects/{project}/databases/{database}/backupSchedules/{backup_schedule} - * - 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} - * - location: projects/{project}/locations/{location} - * - 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); - } - - /** - * Bulk deletes a subset of documents from Google Cloud Firestore. - * Documents created or updated after the underlying system starts to process - * the request will not be deleted. The bulk delete occurs in the background - * and its progress can be monitored and managed via the Operation resource - * that is created. - * - * For more details on bulk delete behavior, refer to: - * https://cloud.google.com/firestore/docs/manage-data/bulk-delete - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedName = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); - * $operationResponse = $firestoreAdminClient->bulkDeleteDocuments($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->bulkDeleteDocuments($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'bulkDeleteDocuments'); - * 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 operate. Should be of the form: - * `projects/{project_id}/databases/{database_id}`. - * @param array $optionalArgs { - * Optional. - * - * @type string[] $collectionIds - * Optional. IDs of the collection groups to delete. Unspecified means all - * collection groups. - * - * Each collection group in this list must be unique. - * @type string[] $namespaceIds - * Optional. Namespaces to delete. - * - * An empty list means all namespaces. This is the recommended - * 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 delete from 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 bulkDeleteDocuments($name, array $optionalArgs = []) - { - $request = new BulkDeleteDocumentsRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['collectionIds'])) { - $request->setCollectionIds($optionalArgs['collectionIds']); - } - - 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('BulkDeleteDocuments', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a backup schedule on a database. - * At most two backup schedules can be configured on a database, one daily - * backup schedule and one weekly backup schedule. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedParent = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); - * $backupSchedule = new BackupSchedule(); - * $response = $firestoreAdminClient->createBackupSchedule($formattedParent, $backupSchedule); - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent database. - * - * Format `projects/{project}/databases/{database}` - * @param BackupSchedule $backupSchedule Required. The backup schedule 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\Cloud\Firestore\Admin\V1\BackupSchedule - * - * @throws ApiException if the remote call fails - */ - public function createBackupSchedule($parent, $backupSchedule, array $optionalArgs = []) - { - $request = new CreateBackupScheduleRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setBackupSchedule($backupSchedule); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateBackupSchedule', BackupSchedule::class, $optionalArgs, $request)->wait(); - } - - /** - * 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 backup. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedName = $firestoreAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - * $firestoreAdminClient->deleteBackup($formattedName); - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the backup to delete. - * - * format is `projects/{project}/locations/{location}/backups/{backup}`. - * @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 deleteBackup($name, array $optionalArgs = []) - { - $request = new DeleteBackupRequest(); - $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('DeleteBackup', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a backup schedule. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedName = $firestoreAdminClient->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); - * $firestoreAdminClient->deleteBackupSchedule($formattedName); - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the backup schedule. - * - * Format - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * @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 deleteBackupSchedule($name, array $optionalArgs = []) - { - $request = new DeleteBackupScheduleRequest(); - $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('DeleteBackupSchedule', GPBEmpty::class, $optionalArgs, $request)->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. Each - * collection id in this list must be unique. - * @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 backup. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedName = $firestoreAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - * $response = $firestoreAdminClient->getBackup($formattedName); - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the backup to fetch. - * - * Format is `projects/{project}/locations/{location}/backups/{backup}`. - * @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\Backup - * - * @throws ApiException if the remote call fails - */ - public function getBackup($name, array $optionalArgs = []) - { - $request = new GetBackupRequest(); - $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('GetBackup', Backup::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets information about a backup schedule. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedName = $firestoreAdminClient->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); - * $response = $firestoreAdminClient->getBackupSchedule($formattedName); - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the backup schedule. - * - * Format - * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` - * @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\BackupSchedule - * - * @throws ApiException if the remote call fails - */ - public function getBackupSchedule($name, array $optionalArgs = []) - { - $request = new GetBackupScheduleRequest(); - $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('GetBackupSchedule', BackupSchedule::class, $optionalArgs, $request)->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. Each collection id in this list must be unique. - * @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 backup schedules. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedParent = $firestoreAdminClient->databaseName('[PROJECT]', '[DATABASE]'); - * $response = $firestoreAdminClient->listBackupSchedules($formattedParent); - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent database. - * - * Format is `projects/{project}/databases/{database}`. - * @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\ListBackupSchedulesResponse - * - * @throws ApiException if the remote call fails - */ - public function listBackupSchedules($parent, array $optionalArgs = []) - { - $request = new ListBackupSchedulesRequest(); - $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('ListBackupSchedules', ListBackupSchedulesResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists all the backups. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedParent = $firestoreAdminClient->locationName('[PROJECT]', '[LOCATION]'); - * $response = $firestoreAdminClient->listBackups($formattedParent); - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The location to list backups from. - * - * Format is `projects/{project}/locations/{location}`. - * Use `{location} = '-'` to list backups from all locations for the given - * project. This allows listing backups from a single location or from all - * locations. - * @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\ListBackupsResponse - * - * @throws ApiException if the remote call fails - */ - public function listBackups($parent, array $optionalArgs = []) - { - $request = new ListBackupsRequest(); - $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('ListBackups', ListBackupsResponse::class, $optionalArgs, $request)->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 bool $showDeleted - * If true, also returns deleted resources. - * @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; - if (isset($optionalArgs['showDeleted'])) { - $request->setShowDeleted($optionalArgs['showDeleted']); - } - - $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` or - * `ttlConfig:*`. - * @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); - } - - /** - * Creates a new database by restoring from an existing backup. - * - * The new database must be in the same cloud region or multi-region location - * as the existing backup. This behaves similar to - * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase] - * except instead of creating a new empty database, a new database is created - * with the database type, index configuration, and documents from an existing - * backup. - * - * The [long-running operation][google.longrunning.Operation] can be used to - * track the progress of the restore, with the Operation's - * [metadata][google.longrunning.Operation.metadata] field type being the - * [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata]. - * The [response][google.longrunning.Operation.response] type is the - * [Database][google.firestore.admin.v1.Database] if the restore was - * successful. The new database is not readable or writeable until the LRO has - * completed. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $formattedParent = $firestoreAdminClient->projectName('[PROJECT]'); - * $databaseId = 'database_id'; - * $formattedBackup = $firestoreAdminClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - * $operationResponse = $firestoreAdminClient->restoreDatabase($formattedParent, $databaseId, $formattedBackup); - * $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->restoreDatabase($formattedParent, $databaseId, $formattedBackup); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $firestoreAdminClient->resumeOperation($operationName, 'restoreDatabase'); - * 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. The project to restore the database in. Format is - * `projects/{project_id}`. - * @param string $databaseId Required. The ID to use for the database, which will become the final - * component of the database's resource name. This database id must not be - * associated with an existing database. - * - * 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 string $backup Required. Backup to restore from. Must be from the same project as the - * parent. - * - * Format is: `projects/{project_id}/locations/{location}/backups/{backup}` - * @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 restoreDatabase($parent, $databaseId, $backup, array $optionalArgs = []) - { - $request = new RestoreDatabaseRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setDatabaseId($databaseId); - $request->setBackup($backup); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RestoreDatabase', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates a backup schedule. - * - * Sample code: - * ``` - * $firestoreAdminClient = new FirestoreAdminClient(); - * try { - * $backupSchedule = new BackupSchedule(); - * $response = $firestoreAdminClient->updateBackupSchedule($backupSchedule); - * } finally { - * $firestoreAdminClient->close(); - * } - * ``` - * - * @param BackupSchedule $backupSchedule Required. The backup schedule 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\Cloud\Firestore\Admin\V1\BackupSchedule - * - * @throws ApiException if the remote call fails - */ - public function updateBackupSchedule($backupSchedule, array $optionalArgs = []) - { - $request = new UpdateBackupScheduleRequest(); - $requestParamHeaders = []; - $request->setBackupSchedule($backupSchedule); - $requestParamHeaders['backup_schedule.name'] = $backupSchedule->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->startCall('UpdateBackupSchedule', BackupSchedule::class, $optionalArgs, $request)->wait(); - } - - /** - * 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 9b70c2e17bb1..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/src/V1/gapic_metadata.json +++ /dev/null @@ -1,138 +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": { - "BulkDeleteDocuments": { - "methods": [ - "bulkDeleteDocuments" - ] - }, - "CreateBackupSchedule": { - "methods": [ - "createBackupSchedule" - ] - }, - "CreateDatabase": { - "methods": [ - "createDatabase" - ] - }, - "CreateIndex": { - "methods": [ - "createIndex" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "DeleteBackupSchedule": { - "methods": [ - "deleteBackupSchedule" - ] - }, - "DeleteDatabase": { - "methods": [ - "deleteDatabase" - ] - }, - "DeleteIndex": { - "methods": [ - "deleteIndex" - ] - }, - "ExportDocuments": { - "methods": [ - "exportDocuments" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GetBackupSchedule": { - "methods": [ - "getBackupSchedule" - ] - }, - "GetDatabase": { - "methods": [ - "getDatabase" - ] - }, - "GetField": { - "methods": [ - "getField" - ] - }, - "GetIndex": { - "methods": [ - "getIndex" - ] - }, - "ImportDocuments": { - "methods": [ - "importDocuments" - ] - }, - "ListBackupSchedules": { - "methods": [ - "listBackupSchedules" - ] - }, - "ListBackups": { - "methods": [ - "listBackups" - ] - }, - "ListDatabases": { - "methods": [ - "listDatabases" - ] - }, - "ListFields": { - "methods": [ - "listFields" - ] - }, - "ListIndexes": { - "methods": [ - "listIndexes" - ] - }, - "RestoreDatabase": { - "methods": [ - "restoreDatabase" - ] - }, - "UpdateBackupSchedule": { - "methods": [ - "updateBackupSchedule" - ] - }, - "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 d9d11f0e1967..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_client_config.json +++ /dev/null @@ -1,166 +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": { - "BulkDeleteDocuments": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateBackupSchedule": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "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" - }, - "DeleteBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteBackupSchedule": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_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" - }, - "GetBackup": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetBackupSchedule": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_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" - }, - "ListBackupSchedules": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_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" - }, - "RestoreDatabase": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateBackupSchedule": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_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 8aa9b9991fc1..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_descriptor_config.php +++ /dev/null @@ -1,408 +0,0 @@ - [ - 'google.firestore.admin.v1.FirestoreAdmin' => [ - 'BulkDeleteDocuments' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\BulkDeleteDocumentsResponse', - 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\BulkDeleteDocumentsMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - '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', - ], - ], - ], - ], - 'RestoreDatabase' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Firestore\Admin\V1\Database', - 'metadataReturnType' => '\Google\Cloud\Firestore\Admin\V1\RestoreDatabaseMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - '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', - ], - ], - ], - ], - 'CreateBackupSchedule' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\Admin\V1\BackupSchedule', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'DeleteBackup' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteBackupSchedule' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'DeleteIndex' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Protobuf\GPBEmpty', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetBackup' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\Admin\V1\Backup', - 'headerParams' => [ - [ - 'keyName' => 'name', - 'fieldAccessors' => [ - 'getName', - ], - ], - ], - ], - 'GetBackupSchedule' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\Admin\V1\BackupSchedule', - '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', - ], - ], - ], - ], - 'ListBackupSchedules' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\Admin\V1\ListBackupSchedulesResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - 'ListBackups' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\Admin\V1\ListBackupsResponse', - 'headerParams' => [ - [ - 'keyName' => 'parent', - 'fieldAccessors' => [ - 'getParent', - ], - ], - ], - ], - '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', - ], - ], - ], - ], - 'UpdateBackupSchedule' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Firestore\Admin\V1\BackupSchedule', - 'headerParams' => [ - [ - 'keyName' => 'backup_schedule.name', - 'fieldAccessors' => [ - 'getBackupSchedule', - 'getName', - ], - ], - ], - ], - 'templateMap' => [ - 'backup' => 'projects/{project}/locations/{location}/backups/{backup}', - 'backupSchedule' => 'projects/{project}/databases/{database}/backupSchedules/{backup_schedule}', - '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}', - 'location' => 'projects/{project}/locations/{location}', - '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 f5062d72f11e..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/src/V1/resources/firestore_admin_rest_client_config.php +++ /dev/null @@ -1,356 +0,0 @@ - [ - 'google.firestore.admin.v1.FirestoreAdmin' => [ - 'BulkDeleteDocuments' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/databases/*}:bulkDeleteDocuments', - 'body' => '*', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CreateBackupSchedule' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*}/backupSchedules', - 'body' => 'backup_schedule', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - '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', - ], - ], - ], - ], - 'DeleteBackup' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteBackupSchedule' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/databases/*/backupSchedules/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - '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', - ], - ], - ], - ], - 'GetBackup' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/backups/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetBackupSchedule' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/databases/*/backupSchedules/*}', - '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', - ], - ], - ], - ], - 'ListBackupSchedules' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/databases/*}/backupSchedules', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListBackups' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/backups', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - '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', - ], - ], - ], - ], - 'RestoreDatabase' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*}/databases:restore', - 'body' => '*', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateBackupSchedule' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{backup_schedule.name=projects/*/databases/*/backupSchedules/*}', - 'body' => 'backup_schedule', - 'placeholders' => [ - 'backup_schedule.name' => [ - 'getters' => [ - 'getBackupSchedule', - 'getName', - ], - ], - ], - ], - '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 7e117f18afd9..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/Client/FirestoreAdminClientTest.php +++ /dev/null @@ -1,2313 +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 bulkDeleteDocumentsTest() - { - $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/bulkDeleteDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BulkDeleteDocumentsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/bulkDeleteDocumentsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $request = (new BulkDeleteDocumentsRequest()) - ->setName($formattedName); - $response = $gapicClient->bulkDeleteDocuments($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/BulkDeleteDocuments', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); - $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 bulkDeleteDocumentsExceptionTest() - { - $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/bulkDeleteDocumentsTest'); - $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 BulkDeleteDocumentsRequest()) - ->setName($formattedName); - $response = $gapicClient->bulkDeleteDocuments($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); - 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 createBackupScheduleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new BackupSchedule(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $backupSchedule = new BackupSchedule(); - $request = (new CreateBackupScheduleRequest()) - ->setParent($formattedParent) - ->setBackupSchedule($backupSchedule); - $response = $gapicClient->createBackupSchedule($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/CreateBackupSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getBackupSchedule(); - $this->assertProtobufEquals($backupSchedule, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createBackupScheduleExceptionTest() - { - $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->databaseName('[PROJECT]', '[DATABASE]'); - $backupSchedule = new BackupSchedule(); - $request = (new CreateBackupScheduleRequest()) - ->setParent($formattedParent) - ->setBackupSchedule($backupSchedule); - try { - $gapicClient->createBackupSchedule($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 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 deleteBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - $request = (new DeleteBackupRequest()) - ->setName($formattedName); - $gapicClient->deleteBackup($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteBackupExceptionTest() - { - $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->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - $request = (new DeleteBackupRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteBackup($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 deleteBackupScheduleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); - $request = (new DeleteBackupScheduleRequest()) - ->setName($formattedName); - $gapicClient->deleteBackupSchedule($request); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteBackupSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteBackupScheduleExceptionTest() - { - $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->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); - $request = (new DeleteBackupScheduleRequest()) - ->setName($formattedName); - try { - $gapicClient->deleteBackupSchedule($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 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 getBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $database = 'database1789464955'; - $databaseUid = 'databaseUid-458567796'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDatabase($database); - $expectedResponse->setDatabaseUid($databaseUid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - $request = (new GetBackupRequest()) - ->setName($formattedName); - $response = $gapicClient->getBackup($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/GetBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupExceptionTest() - { - $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->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - $request = (new GetBackupRequest()) - ->setName($formattedName); - try { - $gapicClient->getBackup($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 getBackupScheduleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new BackupSchedule(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); - $request = (new GetBackupScheduleRequest()) - ->setName($formattedName); - $response = $gapicClient->getBackupSchedule($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/GetBackupSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupScheduleExceptionTest() - { - $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->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); - $request = (new GetBackupScheduleRequest()) - ->setName($formattedName); - try { - $gapicClient->getBackupSchedule($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 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 listBackupSchedulesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListBackupSchedulesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $request = (new ListBackupSchedulesRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listBackupSchedules($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/ListBackupSchedules', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupSchedulesExceptionTest() - { - $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->databaseName('[PROJECT]', '[DATABASE]'); - $request = (new ListBackupSchedulesRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listBackupSchedules($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 listBackupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListBackupsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListBackupsRequest()) - ->setParent($formattedParent); - $response = $gapicClient->listBackups($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/ListBackups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListBackupsRequest()) - ->setParent($formattedParent); - try { - $gapicClient->listBackups($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 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 restoreDatabaseTest() - { - $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/restoreDatabaseTest'); - $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/restoreDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $databaseId = 'databaseId816491103'; - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - $request = (new RestoreDatabaseRequest()) - ->setParent($formattedParent) - ->setDatabaseId($databaseId) - ->setBackup($formattedBackup); - $response = $gapicClient->restoreDatabase($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/RestoreDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDatabaseId(); - $this->assertProtobufEquals($databaseId, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($formattedBackup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreDatabaseTest'); - $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 restoreDatabaseExceptionTest() - { - $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/restoreDatabaseTest'); - $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]'); - $databaseId = 'databaseId816491103'; - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - $request = (new RestoreDatabaseRequest()) - ->setParent($formattedParent) - ->setDatabaseId($databaseId) - ->setBackup($formattedBackup); - $response = $gapicClient->restoreDatabase($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreDatabaseTest'); - 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 updateBackupScheduleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new BackupSchedule(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $backupSchedule = new BackupSchedule(); - $request = (new UpdateBackupScheduleRequest()) - ->setBackupSchedule($backupSchedule); - $response = $gapicClient->updateBackupSchedule($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/UpdateBackupSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getBackupSchedule(); - $this->assertProtobufEquals($backupSchedule, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateBackupScheduleExceptionTest() - { - $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 - $backupSchedule = new BackupSchedule(); - $request = (new UpdateBackupScheduleRequest()) - ->setBackupSchedule($backupSchedule); - try { - $gapicClient->updateBackupSchedule($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 bulkDeleteDocumentsAsyncTest() - { - $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/bulkDeleteDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BulkDeleteDocumentsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/bulkDeleteDocumentsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $request = (new BulkDeleteDocumentsRequest()) - ->setName($formattedName); - $response = $gapicClient->bulkDeleteDocumentsAsync($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/BulkDeleteDocuments', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); - $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 fa3cd071f07c..000000000000 --- a/owl-bot-staging/Firestore/v1/Admin/tests/Unit/V1/FirestoreAdminClientTest.php +++ /dev/null @@ -1,2117 +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 bulkDeleteDocumentsTest() - { - $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/bulkDeleteDocumentsTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BulkDeleteDocumentsResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/bulkDeleteDocumentsTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $response = $gapicClient->bulkDeleteDocuments($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/BulkDeleteDocuments', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); - $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 bulkDeleteDocumentsExceptionTest() - { - $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/bulkDeleteDocumentsTest'); - $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->bulkDeleteDocuments($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/bulkDeleteDocumentsTest'); - 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 createBackupScheduleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new BackupSchedule(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $backupSchedule = new BackupSchedule(); - $response = $gapicClient->createBackupSchedule($formattedParent, $backupSchedule); - $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/CreateBackupSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getBackupSchedule(); - $this->assertProtobufEquals($backupSchedule, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createBackupScheduleExceptionTest() - { - $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->databaseName('[PROJECT]', '[DATABASE]'); - $backupSchedule = new BackupSchedule(); - try { - $gapicClient->createBackupSchedule($formattedParent, $backupSchedule); - // 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 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 deleteBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - $gapicClient->deleteBackup($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteBackupExceptionTest() - { - $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->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - try { - $gapicClient->deleteBackup($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 deleteBackupScheduleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); - $gapicClient->deleteBackupSchedule($formattedName); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.firestore.admin.v1.FirestoreAdmin/DeleteBackupSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteBackupScheduleExceptionTest() - { - $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->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); - try { - $gapicClient->deleteBackupSchedule($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 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 getBackupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $database = 'database1789464955'; - $databaseUid = 'databaseUid-458567796'; - $expectedResponse = new Backup(); - $expectedResponse->setName($name2); - $expectedResponse->setDatabase($database); - $expectedResponse->setDatabaseUid($databaseUid); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - $response = $gapicClient->getBackup($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/GetBackup', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupExceptionTest() - { - $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->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - try { - $gapicClient->getBackup($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 getBackupScheduleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new BackupSchedule(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); - $response = $gapicClient->getBackupSchedule($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/GetBackupSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBackupScheduleExceptionTest() - { - $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->backupScheduleName('[PROJECT]', '[DATABASE]', '[BACKUP_SCHEDULE]'); - try { - $gapicClient->getBackupSchedule($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 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 listBackupSchedulesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListBackupSchedulesResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->databaseName('[PROJECT]', '[DATABASE]'); - $response = $gapicClient->listBackupSchedules($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/ListBackupSchedules', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupSchedulesExceptionTest() - { - $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->databaseName('[PROJECT]', '[DATABASE]'); - try { - $gapicClient->listBackupSchedules($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 listBackupsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ListBackupsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listBackups($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/ListBackups', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBackupsExceptionTest() - { - $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->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listBackups($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 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 restoreDatabaseTest() - { - $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/restoreDatabaseTest'); - $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/restoreDatabaseTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->projectName('[PROJECT]'); - $databaseId = 'databaseId816491103'; - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - $response = $gapicClient->restoreDatabase($formattedParent, $databaseId, $formattedBackup); - $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/RestoreDatabase', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getDatabaseId(); - $this->assertProtobufEquals($databaseId, $actualValue); - $actualValue = $actualApiRequestObject->getBackup(); - $this->assertProtobufEquals($formattedBackup, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreDatabaseTest'); - $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 restoreDatabaseExceptionTest() - { - $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/restoreDatabaseTest'); - $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]'); - $databaseId = 'databaseId816491103'; - $formattedBackup = $gapicClient->backupName('[PROJECT]', '[LOCATION]', '[BACKUP]'); - $response = $gapicClient->restoreDatabase($formattedParent, $databaseId, $formattedBackup); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/restoreDatabaseTest'); - 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 updateBackupScheduleTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $expectedResponse = new BackupSchedule(); - $expectedResponse->setName($name); - $transport->addResponse($expectedResponse); - // Mock request - $backupSchedule = new BackupSchedule(); - $response = $gapicClient->updateBackupSchedule($backupSchedule); - $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/UpdateBackupSchedule', $actualFuncCall); - $actualValue = $actualRequestObject->getBackupSchedule(); - $this->assertProtobufEquals($backupSchedule, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateBackupScheduleExceptionTest() - { - $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 - $backupSchedule = new BackupSchedule(); - try { - $gapicClient->updateBackupSchedule($backupSchedule); - // 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 fdb899ded9b7106d59917d9eb948fea2c359104b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2019 zcmb_d-EJF26vlQE#m8wQT(wQ3qE1bvI#s)_gFt0NsN$wEk=iCwqggBT@-1LJ^a3Hk~p>LNSv(X38UE|A@RfIw3Fj4^QqRH5Hi(nNK1iqL}rjT(MLO z#d_!c-b94ij3wH$?f?=xW2vMeBg5mtYo_UhY8nhJGdL)i!D)X7AdG36l6~g^egJ|W znT=x}l2lWTUk`XX;tAKB#{7HKzDuSwP8pKl$4;{()LbOQ5RQ_Nb+<_F(_kM+fwAtA zLd&rUA43lg6U|gY<6xhqq2dxFJ4UGQM@*MVGbi0Gcdc>9r=*)}^!@il?h>ssR=u4N z#dM~U9jn_oxF~-G3o^AQIcAH+lL0%U=Ugb?zl`eA$s%eQ*jp44>i5FCB5_h=3Pg$ z9f=k0r8W_Hhi=|`*Q$$X9bm%&G=|iRZAiJL^J5)Wi*9YN!IJ6qjT)(So9!=QWopWm zZq!Mm+uGjp7AW%yvS&-1zD%^5w|meE6~oCK86_JH^w-+nEcitbURe}F$Rv)HBP@N0 zuz3ir>V++6e8=Wa_!cam(>PSy<{yD6dRdXgl z(?6yycZaROlgM#CMotsYZ$fK4*DQ6%Z9HDX<2$gf7`}`QpAu(Ub_@^JBPK>tpl)Yc zwE}Jwbu-=L;Xu4fB6Rfyw5U>a?yyaZy;oqbi)>P0k=BbuWp`1@aeb9>%kfU-_s{jE;fsT}ztryx?dI}c zSYHRl{_;-yzZbS3u*RUW-Eh7AS-+c8eczgWza;zqX@9(82m7;!<-7Md-x-w^^SA58 MBJ(A10T%#&0eZ52a{vGU diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Firestore.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/Firestore.php deleted file mode 100644 index 88ea9ca5afc8b0c1a1b888cee89ff07a687adf14..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11259 zcmbtaTWlLy8QyW?G&xSv^z@c`7nn{9Z9{6e=~9Zb+15_ni|8e!*%nontg(HP%+{Wn zof$WqUF8L|LP$u9w7cT+vJyf(tdMvG@xTib+I<88QY8crJRlxHydlAVZsQsIj4x?l z8hifppa1gxSI=wL-5nR5(Qgr(cxFHvdTmb+c8KnJPTtAk+MUhQaMX9&UY!*5ZO7SelKhtC5kGJ|l7Du&^C8FhA!M5^;=5*@=(pBO z_efwi%)qSNVn-`C<a<#peLx}BoO-)8lKQc`ztJY%-T|*>X8~7R5J(4P@z}G15zdAn z1_+f~ZZLx6;n7VCLN+j4?(iaqXCHf}>k@ASd~Ue)%0obPJK+oq(~GZLA}EWEMi_%P z!K~-QsG%`*4t;tLof#rA;iH@=w$4fhlFhT0kP|QRi89T9V&+L>l8Y6 z7rvF3`cn9#Xu>r;NJvrfvuFltFFgv`y=pa>9!xb2pFmTtxlO7*6g(zpnyReflL)cz z1LrBR=f|ZjG*E5Q@fyUd*7oKnI$yskOmv88HP}S_mM%L@!r>k}A;z(Os9&ClUG$?AnlG6_eJ7HK!dQk#qy22n^kd2BNED&STO?0wEwk;E${HWx#H{h=;3TdcK-_}%7 zNDFOdX=r!=lUS=UI0`jfM2E@SZqu~vsstskyl0f!lsT;kdsfX$(+Dv$RD(U2B!=~O zQfRJYU^Ql$KR}00jT@%K#ABBy!#;4K#oK>s!AQ{vp-BTijc3t#!?6kLZzjP}uXSwG zB7tYs{rL>@NMGB)LV}W(PNL&bS^~>%vthN<#r-dZvS5kGAUha!kI^d;)J2DYC<60J zpLGz}ePu5gc}Y-$anzE~1xAkLK7Il8D!@p4!^~1&gC78lf7Z~;N*4%RUX|%xl$kFn z4I441NL^hynBzHCS_Z>Yfx00gQlQRwFNKb;n_j>=n!&hw@oWas1fvJPuUd!F9I#e( z4CCHW0;+Lj?4W>3$1~OtAQ>{<)X<4;GYH@2sa!%}S(IK@`ggVM`Hq*|?EgbU)1q)e z6v7OdQ1C%(2wq~g!XXTI>h0LTdP}Dqe!Mf4P2&|b(KKtM>BB@xEA~aD3Q_TLcNu-z z4!phWMU;tr#2Ga9lk_kW>00Ce{l$qI4L|aIvfP9n;<>#vfB?R&o~zFLcoe4b>A6*Kn0FW9l51 zgOj*{g>zC0UK8sh<@p91ro^18PT}%ApS!y5=LToxc+mYD%r|fzGB<2SVc9MgE$XJM z{5IdM5LovCEv#I?uF%jkXtO@X_|q7g;I_fnP&!&=lln0Rl^n~tA#83$r#7DZzpMlZ zKM`&i{E)*5G)*Us7632Y$S^yo3-RC#JG3l!@2{8m-v63cqj_ z>M9B|(B^YhSxX8Zr3s-!H9kq9X>MMQT6`a2LC#}}0f6Pg*`=jE-r~n|QC^#H0j+$3 zpVi(sK}C$rjd=Ilii<=~If?@pQbo9atZY`)IC5o*6WC|3P*2cJcnL z^4v@K5E?74t<7m5=EO$%-h)TwxfB$DL#uCWY?SYB&W+(Il-?*mEN{+@8y{bd#_YK8F@!cl(0Bt7+*Z#)OrV*^d_MLN_I z+Hoi_y!8AOnz|`}{=n~RC=*$6;e^Z?ArXZ;+kgLRT>I7^{{BH~316Z=PrOU__A8K_ z-h|xc=NIyFea8M41&aQ?u&|H+BYK1|Y2gbp6l1Fn3aOArO0_TyDL1q6J&nou9?Viq zNa#6XD>mk{~yNzY5_h0DlA;#MiS48pMgD1}CKN!Yamo%QUV(FR~wgIHDFtN7S!m#)!b! z$Le-mvDajiLss22D#!)8R++df#x-tPu`fwv7wY-ZYR0D)!nG15k`La zym(mVlEq#6%cajmUN)|dDl%VaQbB*Jp-H)|#Om%;K9(jSIkV)))GToKS*P{u$zQ2T_}(^br^Rxa3Sk#*mXbB ziBA6kAAI)NNB;t!_02c^3w-XIZ@xI=xpzOH6kBYXm$2;l{qFfb=W_R+b!5SN!VVo# zTXSh&I6M{HBPv+7>6$&$5DvY;fZ9UOJhpU$+9g4d8iLa32(nb~yo*rB^z0t32t(5x z8gzZ2+thJQo35X1tbgrM`?SQl07lv|bu6t%g`H;g0d=*$=4#y?4(o1*uChTan#S99^-s_v-zNOyJ3(7!>gw}gRaI24i3%MQFz&(+P5zyOU= zkFH%4d`>32YME%|mJlk^WQL>B-TKI-_DD0j5_NjEZlO(06s=T-)Q#N5zFE5#9LwnR zfw1Q5SgAaxbYJv;R*gw! zK_@-jmCT-ZOh@kg@W?Np+nQxj+nEjJ?!5V_9ym|z_ak3zWB#l~)-hYJ!mn50otGpI zx!?z#*Gz*QiSRZ*+q6jql8=w5 zP4fw^#*Mjn(8HLst8slUc!Pn+O<2MNwp~?o^NalOw`QVip6#Hb zHy}kveI~s0a^Wnb%)!8+Za#&=Npc;MhJLKO`Q)?MFk&Sv!dvA7&G0Ds43-Bvo;0Ew z>oEB=hkP(ox9Rw7BT(^i)x@7-tRMlI;q;4e9$Q`z3RUl85Myg;atT&6!%+L!2hdb) zgdA&;rlY%59q>2=8FYIt4QnCT=i5C;cA33c=^-1_B~zZ)UIb1u zc_Ym}4VnCunvZFp0Yj$hdC2&-sqU#o3%|!;WlC{Uhq!5R)3fERS24ZR!0w`9x5YeO z^iOkwYWhD_P`m?65mO%CXf)-P*lD!XeWl%$YxV8AEalFTMM#K>l#7uR#2c+#yzoN; zGQ7k3Mw2Qec^HCd-kQrKPSBz_I4RB>>

#EP&baC-W2d8jSsM4U#9U6oQ^mn90P8 zrT9l|F6+-jdQWb*)y}S{pby>z5PQA84E9v zG$egok{~^93IR=u5Xg$HmiS1mHI$B6SK7Hn=JvXhTVh8)`%V>=N4YcsNHGeOfx>rj z$V}v8;8xbB=XL7@dhAvyjIdu}uM*+ibHy*`ayXh(Z>tJ=J5DmN$Ug7y?d1|A3&0-G zRQ7U#tUxAwW&+7-7M4v`7}x=M?R_7Eq~EY#M}~@!?&Ai=XHbx+rJ3n9-C3m&Rak}W zRN78`2;O7ZR~g02G3BqY*xg{ z9a!djtm?CJLo($TRG$x1A=lS&l41i;kE!P1j=>8zTfRS+XD4P>NeYM__&ojr>*4TR z;FBSm(ldsq4=BRLNFyAfp5X=_V$(OxWMX6sNF?JPq12IyE@aa>Q@#@F9i1SVxRq1h zayY!G!pfAcM1U(&z1*Nwe8PZY8u`VRlTXL;aZz#`mitU=LNOffgI~$glBuCHj;?GGaj8j=04sANb zi-kGzx4`?5bE3si<g<6$0=K=Lju)&9dn*hp@y%6stUNn2YXO;8NhEq ztnn8mEDwM6z78qA4>)Km%dQu+BrJf`AsyhgoQHL(`b!Kh;lesAxK-dqfNk0}o3Sr8 zdxq)tLqWu>56y{NzGmro(T}RZI^3N2{9}A!r?%bxDSml}U-L^f&b1w0_DcsFzlHC* zUH-B=@lyc)7VtEF#fMfZ{B@-gfh(1Rjl&f0MYpa-_saMEJNCqt{6DYbT++WZKY=Fz F{{n>+YQX>i diff --git a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/QueryProfile.php b/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/QueryProfile.php deleted file mode 100644 index 515fe852eabe..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/GPBMetadata/Google/Firestore/V1/QueryProfile.php +++ /dev/null @@ -1,42 +0,0 @@ -internalAddGeneratedFile( - ' -ê -\'google/firestore/v1/query_profile.protogoogle.firestore.v1google/protobuf/duration.protogoogle/protobuf/struct.proto"& -ExplainOptions -analyze (BàA"† -ExplainMetrics6 - plan_summary ( 2 .google.firestore.v1.PlanSummary< -execution_stats ( 2#.google.firestore.v1.ExecutionStats"< - PlanSummary- - indexes_used ( 2.google.protobuf.Struct"¨ -ExecutionStats -results_returned (5 -execution_duration ( 2.google.protobuf.Duration -read_operations (, - debug_stats ( 2.google.protobuf.StructBÉ -com.google.firestore.v1BQueryProfileProtoPZ;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/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/ExecutionStats.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExecutionStats.php deleted file mode 100644 index bed2e60fbdcf..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExecutionStats.php +++ /dev/null @@ -1,237 +0,0 @@ -google.firestore.v1.ExecutionStats - */ -class ExecutionStats extends \Google\Protobuf\Internal\Message -{ - /** - * Total number of results returned, including documents, projections, - * aggregation results, keys. - * - * Generated from protobuf field int64 results_returned = 1; - */ - protected $results_returned = 0; - /** - * Total time to execute the query in the backend. - * - * Generated from protobuf field .google.protobuf.Duration execution_duration = 3; - */ - protected $execution_duration = null; - /** - * Total billable read operations. - * - * Generated from protobuf field int64 read_operations = 4; - */ - protected $read_operations = 0; - /** - * Debugging statistics from the execution of the query. Note that the - * debugging stats are subject to change as Firestore evolves. It could - * include: - * { - * "indexes_entries_scanned": "1000", - * "documents_scanned": "20", - * "billing_details" : { - * "documents_billable": "20", - * "index_entries_billable": "1000", - * "min_query_cost": "0" - * } - * } - * - * Generated from protobuf field .google.protobuf.Struct debug_stats = 5; - */ - protected $debug_stats = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $results_returned - * Total number of results returned, including documents, projections, - * aggregation results, keys. - * @type \Google\Protobuf\Duration $execution_duration - * Total time to execute the query in the backend. - * @type int|string $read_operations - * Total billable read operations. - * @type \Google\Protobuf\Struct $debug_stats - * Debugging statistics from the execution of the query. Note that the - * debugging stats are subject to change as Firestore evolves. It could - * include: - * { - * "indexes_entries_scanned": "1000", - * "documents_scanned": "20", - * "billing_details" : { - * "documents_billable": "20", - * "index_entries_billable": "1000", - * "min_query_cost": "0" - * } - * } - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\QueryProfile::initOnce(); - parent::__construct($data); - } - - /** - * Total number of results returned, including documents, projections, - * aggregation results, keys. - * - * Generated from protobuf field int64 results_returned = 1; - * @return int|string - */ - public function getResultsReturned() - { - return $this->results_returned; - } - - /** - * Total number of results returned, including documents, projections, - * aggregation results, keys. - * - * Generated from protobuf field int64 results_returned = 1; - * @param int|string $var - * @return $this - */ - public function setResultsReturned($var) - { - GPBUtil::checkInt64($var); - $this->results_returned = $var; - - return $this; - } - - /** - * Total time to execute the query in the backend. - * - * Generated from protobuf field .google.protobuf.Duration execution_duration = 3; - * @return \Google\Protobuf\Duration|null - */ - public function getExecutionDuration() - { - return $this->execution_duration; - } - - public function hasExecutionDuration() - { - return isset($this->execution_duration); - } - - public function clearExecutionDuration() - { - unset($this->execution_duration); - } - - /** - * Total time to execute the query in the backend. - * - * Generated from protobuf field .google.protobuf.Duration execution_duration = 3; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setExecutionDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->execution_duration = $var; - - return $this; - } - - /** - * Total billable read operations. - * - * Generated from protobuf field int64 read_operations = 4; - * @return int|string - */ - public function getReadOperations() - { - return $this->read_operations; - } - - /** - * Total billable read operations. - * - * Generated from protobuf field int64 read_operations = 4; - * @param int|string $var - * @return $this - */ - public function setReadOperations($var) - { - GPBUtil::checkInt64($var); - $this->read_operations = $var; - - return $this; - } - - /** - * Debugging statistics from the execution of the query. Note that the - * debugging stats are subject to change as Firestore evolves. It could - * include: - * { - * "indexes_entries_scanned": "1000", - * "documents_scanned": "20", - * "billing_details" : { - * "documents_billable": "20", - * "index_entries_billable": "1000", - * "min_query_cost": "0" - * } - * } - * - * Generated from protobuf field .google.protobuf.Struct debug_stats = 5; - * @return \Google\Protobuf\Struct|null - */ - public function getDebugStats() - { - return $this->debug_stats; - } - - public function hasDebugStats() - { - return isset($this->debug_stats); - } - - public function clearDebugStats() - { - unset($this->debug_stats); - } - - /** - * Debugging statistics from the execution of the query. Note that the - * debugging stats are subject to change as Firestore evolves. It could - * include: - * { - * "indexes_entries_scanned": "1000", - * "documents_scanned": "20", - * "billing_details" : { - * "documents_billable": "20", - * "index_entries_billable": "1000", - * "min_query_cost": "0" - * } - * } - * - * Generated from protobuf field .google.protobuf.Struct debug_stats = 5; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setDebugStats($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->debug_stats = $var; - - return $this; - } - -} - 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/ExplainMetrics.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExplainMetrics.php deleted file mode 100644 index 393a0963761d..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExplainMetrics.php +++ /dev/null @@ -1,129 +0,0 @@ -google.firestore.v1.ExplainMetrics - */ -class ExplainMetrics extends \Google\Protobuf\Internal\Message -{ - /** - * Planning phase information for the query. - * - * Generated from protobuf field .google.firestore.v1.PlanSummary plan_summary = 1; - */ - protected $plan_summary = null; - /** - * Aggregated stats from the execution of the query. Only present when - * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set - * to true. - * - * Generated from protobuf field .google.firestore.v1.ExecutionStats execution_stats = 2; - */ - protected $execution_stats = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\PlanSummary $plan_summary - * Planning phase information for the query. - * @type \Google\Cloud\Firestore\V1\ExecutionStats $execution_stats - * Aggregated stats from the execution of the query. Only present when - * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set - * to true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\QueryProfile::initOnce(); - parent::__construct($data); - } - - /** - * Planning phase information for the query. - * - * Generated from protobuf field .google.firestore.v1.PlanSummary plan_summary = 1; - * @return \Google\Cloud\Firestore\V1\PlanSummary|null - */ - public function getPlanSummary() - { - return $this->plan_summary; - } - - public function hasPlanSummary() - { - return isset($this->plan_summary); - } - - public function clearPlanSummary() - { - unset($this->plan_summary); - } - - /** - * Planning phase information for the query. - * - * Generated from protobuf field .google.firestore.v1.PlanSummary plan_summary = 1; - * @param \Google\Cloud\Firestore\V1\PlanSummary $var - * @return $this - */ - public function setPlanSummary($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\PlanSummary::class); - $this->plan_summary = $var; - - return $this; - } - - /** - * Aggregated stats from the execution of the query. Only present when - * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set - * to true. - * - * Generated from protobuf field .google.firestore.v1.ExecutionStats execution_stats = 2; - * @return \Google\Cloud\Firestore\V1\ExecutionStats|null - */ - public function getExecutionStats() - { - return $this->execution_stats; - } - - public function hasExecutionStats() - { - return isset($this->execution_stats); - } - - public function clearExecutionStats() - { - unset($this->execution_stats); - } - - /** - * Aggregated stats from the execution of the query. Only present when - * [ExplainOptions.analyze][google.firestore.v1.ExplainOptions.analyze] is set - * to true. - * - * Generated from protobuf field .google.firestore.v1.ExecutionStats execution_stats = 2; - * @param \Google\Cloud\Firestore\V1\ExecutionStats $var - * @return $this - */ - public function setExecutionStats($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ExecutionStats::class); - $this->execution_stats = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExplainOptions.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExplainOptions.php deleted file mode 100644 index cb6e2384de90..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/ExplainOptions.php +++ /dev/null @@ -1,83 +0,0 @@ -google.firestore.v1.ExplainOptions - */ -class ExplainOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Whether to execute this query. - * When false (the default), the query will be planned, returning only - * metrics from the planning stages. - * When true, the query will be planned and executed, returning the full - * query results along with both planning and execution stage metrics. - * - * Generated from protobuf field bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $analyze = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $analyze - * Optional. Whether to execute this query. - * When false (the default), the query will be planned, returning only - * metrics from the planning stages. - * When true, the query will be planned and executed, returning the full - * query results along with both planning and execution stage metrics. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\QueryProfile::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Whether to execute this query. - * When false (the default), the query will be planned, returning only - * metrics from the planning stages. - * When true, the query will be planned and executed, returning the full - * query results along with both planning and execution stage metrics. - * - * Generated from protobuf field bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAnalyze() - { - return $this->analyze; - } - - /** - * Optional. Whether to execute this query. - * When false (the default), the query will be planned, returning only - * metrics from the planning stages. - * When true, the query will be planned and executed, returning the full - * query results along with both planning and execution stage metrics. - * - * Generated from protobuf field bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAnalyze($var) - { - GPBUtil::checkBool($var); - $this->analyze = $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/PlanSummary.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PlanSummary.php deleted file mode 100644 index 5e86c432c547..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/PlanSummary.php +++ /dev/null @@ -1,83 +0,0 @@ -google.firestore.v1.PlanSummary - */ -class PlanSummary extends \Google\Protobuf\Internal\Message -{ - /** - * The indexes selected for the query. For example: - * [ - * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, - * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} - * ] - * - * Generated from protobuf field repeated .google.protobuf.Struct indexes_used = 1; - */ - private $indexes_used; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Protobuf\Struct>|\Google\Protobuf\Internal\RepeatedField $indexes_used - * The indexes selected for the query. For example: - * [ - * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, - * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} - * ] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\QueryProfile::initOnce(); - parent::__construct($data); - } - - /** - * The indexes selected for the query. For example: - * [ - * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, - * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} - * ] - * - * Generated from protobuf field repeated .google.protobuf.Struct indexes_used = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIndexesUsed() - { - return $this->indexes_used; - } - - /** - * The indexes selected for the query. For example: - * [ - * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, - * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} - * ] - * - * Generated from protobuf field repeated .google.protobuf.Struct indexes_used = 1; - * @param array<\Google\Protobuf\Struct>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIndexesUsed($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Struct::class); - $this->indexes_used = $arr; - - 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 680ac9b7b108..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryRequest.php +++ /dev/null @@ -1,304 +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 = ''; - /** - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * - * Generated from protobuf field .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $explain_options = null; - 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. - * @type \Google\Cloud\Firestore\V1\ExplainOptions $explain_options - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * } - */ - 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; - } - - /** - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * - * Generated from protobuf field .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Firestore\V1\ExplainOptions|null - */ - public function getExplainOptions() - { - return $this->explain_options; - } - - public function hasExplainOptions() - { - return isset($this->explain_options); - } - - public function clearExplainOptions() - { - unset($this->explain_options); - } - - /** - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * - * Generated from protobuf field .google.firestore.v1.ExplainOptions explain_options = 8 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Firestore\V1\ExplainOptions $var - * @return $this - */ - public function setExplainOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ExplainOptions::class); - $this->explain_options = $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 de42b0043172..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunAggregationQueryResponse.php +++ /dev/null @@ -1,244 +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; - /** - * Query explain metrics. This is only present when the - * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.firestore.v1.ExplainMetrics explain_metrics = 10; - */ - protected $explain_metrics = 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. - * @type \Google\Cloud\Firestore\V1\ExplainMetrics $explain_metrics - * Query explain metrics. This is only present when the - * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * } - */ - 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; - } - - /** - * Query explain metrics. This is only present when the - * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.firestore.v1.ExplainMetrics explain_metrics = 10; - * @return \Google\Cloud\Firestore\V1\ExplainMetrics|null - */ - public function getExplainMetrics() - { - return $this->explain_metrics; - } - - public function hasExplainMetrics() - { - return isset($this->explain_metrics); - } - - public function clearExplainMetrics() - { - unset($this->explain_metrics); - } - - /** - * Query explain metrics. This is only present when the - * [RunAggregationQueryRequest.explain_options][google.firestore.v1.RunAggregationQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.firestore.v1.ExplainMetrics explain_metrics = 10; - * @param \Google\Cloud\Firestore\V1\ExplainMetrics $var - * @return $this - */ - public function setExplainMetrics($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ExplainMetrics::class); - $this->explain_metrics = $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 37c2314ca5fa..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryRequest.php +++ /dev/null @@ -1,306 +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 = ''; - /** - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * - * Generated from protobuf field .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $explain_options = null; - 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. - * @type \Google\Cloud\Firestore\V1\ExplainOptions $explain_options - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * } - */ - 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; - } - - /** - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * - * Generated from protobuf field .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Firestore\V1\ExplainOptions|null - */ - public function getExplainOptions() - { - return $this->explain_options; - } - - public function hasExplainOptions() - { - return isset($this->explain_options); - } - - public function clearExplainOptions() - { - unset($this->explain_options); - } - - /** - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * - * Generated from protobuf field .google.firestore.v1.ExplainOptions explain_options = 10 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Firestore\V1\ExplainOptions $var - * @return $this - */ - public function setExplainOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ExplainOptions::class); - $this->explain_options = $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 1d32089587e3..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/RunQueryResponse.php +++ /dev/null @@ -1,327 +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; - /** - * Query explain metrics. This is only present when the - * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.firestore.v1.ExplainMetrics explain_metrics = 11; - */ - protected $explain_metrics = null; - 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. - * @type \Google\Cloud\Firestore\V1\ExplainMetrics $explain_metrics - * Query explain metrics. This is only present when the - * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * } - */ - 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; - } - - /** - * Query explain metrics. This is only present when the - * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.firestore.v1.ExplainMetrics explain_metrics = 11; - * @return \Google\Cloud\Firestore\V1\ExplainMetrics|null - */ - public function getExplainMetrics() - { - return $this->explain_metrics; - } - - public function hasExplainMetrics() - { - return isset($this->explain_metrics); - } - - public function clearExplainMetrics() - { - unset($this->explain_metrics); - } - - /** - * Query explain metrics. This is only present when the - * [RunQueryRequest.explain_options][google.firestore.v1.RunQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.firestore.v1.ExplainMetrics explain_metrics = 11; - * @param \Google\Cloud\Firestore\V1\ExplainMetrics $var - * @return $this - */ - public function setExplainMetrics($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\ExplainMetrics::class); - $this->explain_metrics = $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 fc6fd5d1504a..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery.php +++ /dev/null @@ -1,651 +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; - /** - * Optional. A potential nearest neighbors search. - * Applies after all other filters and ordering. - * Finds the closest vector embeddings to the given query vector. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FindNearest find_nearest = 9 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $find_nearest = 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. - * @type \Google\Cloud\Firestore\V1\StructuredQuery\FindNearest $find_nearest - * Optional. A potential nearest neighbors search. - * Applies after all other filters and ordering. - * Finds the closest vector embeddings to the given query vector. - * } - */ - 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;} - - /** - * Optional. A potential nearest neighbors search. - * Applies after all other filters and ordering. - * Finds the closest vector embeddings to the given query vector. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FindNearest find_nearest = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Firestore\V1\StructuredQuery\FindNearest|null - */ - public function getFindNearest() - { - return $this->find_nearest; - } - - public function hasFindNearest() - { - return isset($this->find_nearest); - } - - public function clearFindNearest() - { - unset($this->find_nearest); - } - - /** - * Optional. A potential nearest neighbors search. - * Applies after all other filters and ordering. - * Finds the closest vector embeddings to the given query vector. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FindNearest find_nearest = 9 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Firestore\V1\StructuredQuery\FindNearest $var - * @return $this - */ - public function setFindNearest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FindNearest::class); - $this->find_nearest = $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/FindNearest.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FindNearest.php deleted file mode 100644 index 3e32c9a7be8d..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FindNearest.php +++ /dev/null @@ -1,399 +0,0 @@ -google.firestore.v1.StructuredQuery.FindNearest - */ -class FindNearest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. An indexed vector field to search upon. Only documents which - * contain vectors whose dimensionality match the query_vector can be - * returned. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference vector_field = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $vector_field = null; - /** - * Required. The query vector that we are searching on. Must be a vector of - * no more than 2048 dimensions. - * - * Generated from protobuf field .google.firestore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $query_vector = null; - /** - * Required. The distance measure to use, required. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $distance_measure = 0; - /** - * Required. The number of nearest neighbors to return. Must be a positive - * integer of no more than 1000. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $limit = null; - /** - * Optional. Optional name of the field to output the result of the vector - * distance calculation. Must conform to [document field - * name][google.firestore.v1.Document.fields] limitations. - * - * Generated from protobuf field string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $distance_result_field = ''; - /** - * Optional. Option to specify a threshold for which no less similar - * documents will be returned. The behavior of the specified - * `distance_measure` will affect the meaning of the distance threshold. - * Since DOT_PRODUCT distances increase when the vectors are more similar, - * the comparison is inverted. - * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold - * For DOT_PRODUCT: WHERE distance >= distance_threshold - * - * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $distance_threshold = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $vector_field - * Required. An indexed vector field to search upon. Only documents which - * contain vectors whose dimensionality match the query_vector can be - * returned. - * @type \Google\Cloud\Firestore\V1\Value $query_vector - * Required. The query vector that we are searching on. Must be a vector of - * no more than 2048 dimensions. - * @type int $distance_measure - * Required. The distance measure to use, required. - * @type \Google\Protobuf\Int32Value $limit - * Required. The number of nearest neighbors to return. Must be a positive - * integer of no more than 1000. - * @type string $distance_result_field - * Optional. Optional name of the field to output the result of the vector - * distance calculation. Must conform to [document field - * name][google.firestore.v1.Document.fields] limitations. - * @type \Google\Protobuf\DoubleValue $distance_threshold - * Optional. Option to specify a threshold for which no less similar - * documents will be returned. The behavior of the specified - * `distance_measure` will affect the meaning of the distance threshold. - * Since DOT_PRODUCT distances increase when the vectors are more similar, - * the comparison is inverted. - * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold - * For DOT_PRODUCT: WHERE distance >= distance_threshold - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Firestore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * Required. An indexed vector field to search upon. Only documents which - * contain vectors whose dimensionality match the query_vector can be - * returned. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference vector_field = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference|null - */ - public function getVectorField() - { - return $this->vector_field; - } - - public function hasVectorField() - { - return isset($this->vector_field); - } - - public function clearVectorField() - { - unset($this->vector_field); - } - - /** - * Required. An indexed vector field to search upon. Only documents which - * contain vectors whose dimensionality match the query_vector can be - * returned. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FieldReference vector_field = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference $var - * @return $this - */ - public function setVectorField($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\StructuredQuery\FieldReference::class); - $this->vector_field = $var; - - return $this; - } - - /** - * Required. The query vector that we are searching on. Must be a vector of - * no more than 2048 dimensions. - * - * Generated from protobuf field .google.firestore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Firestore\V1\Value|null - */ - public function getQueryVector() - { - return $this->query_vector; - } - - public function hasQueryVector() - { - return isset($this->query_vector); - } - - public function clearQueryVector() - { - unset($this->query_vector); - } - - /** - * Required. The query vector that we are searching on. Must be a vector of - * no more than 2048 dimensions. - * - * Generated from protobuf field .google.firestore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Firestore\V1\Value $var - * @return $this - */ - public function setQueryVector($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Firestore\V1\Value::class); - $this->query_vector = $var; - - return $this; - } - - /** - * Required. The distance measure to use, required. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getDistanceMeasure() - { - return $this->distance_measure; - } - - /** - * Required. The distance measure to use, required. - * - * Generated from protobuf field .google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setDistanceMeasure($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1\StructuredQuery\FindNearest\DistanceMeasure::class); - $this->distance_measure = $var; - - return $this; - } - - /** - * Required. The number of nearest neighbors to return. Must be a positive - * integer of no more than 1000. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; - * @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() - - * Required. The number of nearest neighbors to return. Must be a positive - * integer of no more than 1000. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return int|null - */ - public function getLimitUnwrapped() - { - return $this->readWrapperValue("limit"); - } - - /** - * Required. The number of nearest neighbors to return. Must be a positive - * integer of no more than 1000. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; - * @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. - - * Required. The number of nearest neighbors to return. Must be a positive - * integer of no more than 1000. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param int|null $var - * @return $this - */ - public function setLimitUnwrapped($var) - { - $this->writeWrapperValue("limit", $var); - return $this;} - - /** - * Optional. Optional name of the field to output the result of the vector - * distance calculation. Must conform to [document field - * name][google.firestore.v1.Document.fields] limitations. - * - * Generated from protobuf field string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getDistanceResultField() - { - return $this->distance_result_field; - } - - /** - * Optional. Optional name of the field to output the result of the vector - * distance calculation. Must conform to [document field - * name][google.firestore.v1.Document.fields] limitations. - * - * Generated from protobuf field string distance_result_field = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setDistanceResultField($var) - { - GPBUtil::checkString($var, True); - $this->distance_result_field = $var; - - return $this; - } - - /** - * Optional. Option to specify a threshold for which no less similar - * documents will be returned. The behavior of the specified - * `distance_measure` will affect the meaning of the distance threshold. - * Since DOT_PRODUCT distances increase when the vectors are more similar, - * the comparison is inverted. - * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold - * For DOT_PRODUCT: WHERE distance >= distance_threshold - * - * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\DoubleValue|null - */ - public function getDistanceThreshold() - { - return $this->distance_threshold; - } - - public function hasDistanceThreshold() - { - return isset($this->distance_threshold); - } - - public function clearDistanceThreshold() - { - unset($this->distance_threshold); - } - - /** - * Returns the unboxed value from getDistanceThreshold() - - * Optional. Option to specify a threshold for which no less similar - * documents will be returned. The behavior of the specified - * `distance_measure` will affect the meaning of the distance threshold. - * Since DOT_PRODUCT distances increase when the vectors are more similar, - * the comparison is inverted. - * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold - * For DOT_PRODUCT: WHERE distance >= distance_threshold - * - * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return float|null - */ - public function getDistanceThresholdUnwrapped() - { - return $this->readWrapperValue("distance_threshold"); - } - - /** - * Optional. Option to specify a threshold for which no less similar - * documents will be returned. The behavior of the specified - * `distance_measure` will affect the meaning of the distance threshold. - * Since DOT_PRODUCT distances increase when the vectors are more similar, - * the comparison is inverted. - * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold - * For DOT_PRODUCT: WHERE distance >= distance_threshold - * - * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\DoubleValue $var - * @return $this - */ - public function setDistanceThreshold($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); - $this->distance_threshold = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. - - * Optional. Option to specify a threshold for which no less similar - * documents will be returned. The behavior of the specified - * `distance_measure` will affect the meaning of the distance threshold. - * Since DOT_PRODUCT distances increase when the vectors are more similar, - * the comparison is inverted. - * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold - * For DOT_PRODUCT: WHERE distance >= distance_threshold - * - * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param float|null $var - * @return $this - */ - public function setDistanceThresholdUnwrapped($var) - { - $this->writeWrapperValue("distance_threshold", $var); - return $this;} - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(FindNearest::class, \Google\Cloud\Firestore\V1\StructuredQuery_FindNearest::class); - diff --git a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FindNearest/DistanceMeasure.php b/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FindNearest/DistanceMeasure.php deleted file mode 100644 index f50ed905abcd..000000000000 --- a/owl-bot-staging/Firestore/v1/proto/src/Google/Cloud/Firestore/V1/StructuredQuery/FindNearest/DistanceMeasure.php +++ /dev/null @@ -1,83 +0,0 @@ -google.firestore.v1.StructuredQuery.FindNearest.DistanceMeasure - */ -class DistanceMeasure -{ - /** - * Should not be set. - * - * Generated from protobuf enum DISTANCE_MEASURE_UNSPECIFIED = 0; - */ - const DISTANCE_MEASURE_UNSPECIFIED = 0; - /** - * Measures the EUCLIDEAN distance between the vectors. See - * [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn - * more. The resulting distance decreases the more similar two vectors - * are. - * - * Generated from protobuf enum EUCLIDEAN = 1; - */ - const EUCLIDEAN = 1; - /** - * COSINE distance compares vectors based on the angle between them, which - * allows you to measure similarity that isn't based on the vectors - * magnitude. We recommend using DOT_PRODUCT with unit normalized vectors - * instead of COSINE distance, which is mathematically equivalent with - * better performance. See [Cosine - * Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) to learn - * more about COSINE similarity and COSINE distance. The resulting - * COSINE distance decreases the more similar two vectors are. - * - * Generated from protobuf enum COSINE = 2; - */ - const COSINE = 2; - /** - * Similar to cosine but is affected by the magnitude of the vectors. See - * [Dot Product](https://en.wikipedia.org/wiki/Dot_product) to learn more. - * The resulting distance increases the more similar two vectors are. - * - * Generated from protobuf enum DOT_PRODUCT = 3; - */ - const DOT_PRODUCT = 3; - - private static $valueToName = [ - self::DISTANCE_MEASURE_UNSPECIFIED => 'DISTANCE_MEASURE_UNSPECIFIED', - self::EUCLIDEAN => 'EUCLIDEAN', - self::COSINE => 'COSINE', - self::DOT_PRODUCT => 'DOT_PRODUCT', - ]; - - 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(DistanceMeasure::class, \Google\Cloud\Firestore\V1\StructuredQuery_FindNearest_DistanceMeasure::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 fbfb290bbe78..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 a - * 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 a - * 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 a - * 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 ExplainOptions $explainOptions - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * @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']); - } - - if (isset($optionalArgs['explainOptions'])) { - $request->setExplainOptions($optionalArgs['explainOptions']); - } - - $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 ExplainOptions $explainOptions - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * @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']); - } - - if (isset($optionalArgs['explainOptions'])) { - $request->setExplainOptions($optionalArgs['explainOptions']); - } - - $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 4fff43f18ee9..000000000000 --- a/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_descriptor_config.php +++ /dev/null @@ -1,272 +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 054730f1901a..000000000000 --- a/owl-bot-staging/Firestore/v1/src/V1/resources/firestore_rest_client_config.php +++ /dev/null @@ -1,292 +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()); - } -}