Skip to content

Commit

Permalink
feat: add DeleteDatabase API and delete protection (#6901)
Browse files Browse the repository at this point in the history
docs: update Database API description
PiperOrigin-RevId: 591922567
Source-Link: googleapis/googleapis@204f2ae
Source-Link: googleapis/googleapis-gen@bd98650
Copy-Tag: eyJwIjoiRmlyZXN0b3JlLy5Pd2xCb3QueWFtbCIsImgiOiJiZDk4NjUwMDAzNTA0NjUyNzE5MTFkOTk2ODliNzU2MTE1ODg1NWQ0In0=
  • Loading branch information
gcf-owl-bot[bot] authored Dec 19, 2023
1 parent 66c6574 commit 62122f9
Show file tree
Hide file tree
Showing 18 changed files with 923 additions and 26 deletions.
Binary file modified Firestore/metadata/Admin/V1/Database.php
Binary file not shown.
20 changes: 14 additions & 6 deletions Firestore/metadata/Admin/V1/FirestoreAdmin.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion Firestore/src/Admin/V1/Client/FirestoreAdminClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
use Google\Cloud\Firestore\Admin\V1\CreateDatabaseRequest;
use Google\Cloud\Firestore\Admin\V1\CreateIndexRequest;
use Google\Cloud\Firestore\Admin\V1\Database;
use Google\Cloud\Firestore\Admin\V1\DeleteDatabaseRequest;
use Google\Cloud\Firestore\Admin\V1\DeleteIndexRequest;
use Google\Cloud\Firestore\Admin\V1\ExportDocumentsRequest;
use Google\Cloud\Firestore\Admin\V1\Field;
Expand Down Expand Up @@ -97,6 +98,7 @@
*
* @method PromiseInterface createDatabaseAsync(CreateDatabaseRequest $request, array $optionalArgs = [])
* @method PromiseInterface createIndexAsync(CreateIndexRequest $request, array $optionalArgs = [])
* @method PromiseInterface deleteDatabaseAsync(DeleteDatabaseRequest $request, array $optionalArgs = [])
* @method PromiseInterface deleteIndexAsync(DeleteIndexRequest $request, array $optionalArgs = [])
* @method PromiseInterface exportDocumentsAsync(ExportDocumentsRequest $request, array $optionalArgs = [])
* @method PromiseInterface getDatabaseAsync(GetDatabaseRequest $request, array $optionalArgs = [])
Expand Down Expand Up @@ -434,6 +436,30 @@ public function createIndex(CreateIndexRequest $request, array $callOptions = []
return $this->startApiCall('CreateIndex', $request, $callOptions)->wait();
}

/**
* Deletes a database.
*
* The async variant is {@see FirestoreAdminClient::deleteDatabaseAsync()} .
*
* @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.
*
Expand Down Expand Up @@ -622,7 +648,8 @@ public function listDatabases(ListDatabasesRequest $request, array $callOptions
* 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` .
* with the filter set to `indexConfig.usesAncestorConfig:false or
* `ttlConfig:*`.
*
* The async variant is {@see FirestoreAdminClient::listFieldsAsync()} .
*
Expand Down
26 changes: 21 additions & 5 deletions Firestore/src/Admin/V1/CreateDatabaseRequest.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

170 changes: 168 additions & 2 deletions Firestore/src/Admin/V1/Database.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 62122f9

Please sign in to comment.