Skip to content

Commit 22ab921

Browse files
1 parent 86480e4 commit 22ab921

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

src/Storage.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,29 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
794794
'type' => 'string',
795795
],
796796
],
797+
],'deleteRecursive' => [
798+
'path' => 'b/{bucket}/folders/{folder}/deleteRecursive',
799+
'httpMethod' => 'POST',
800+
'parameters' => [
801+
'bucket' => [
802+
'location' => 'path',
803+
'type' => 'string',
804+
'required' => true,
805+
],
806+
'folder' => [
807+
'location' => 'path',
808+
'type' => 'string',
809+
'required' => true,
810+
],
811+
'ifMetagenerationMatch' => [
812+
'location' => 'query',
813+
'type' => 'string',
814+
],
815+
'ifMetagenerationNotMatch' => [
816+
'location' => 'query',
817+
'type' => 'string',
818+
],
819+
],
797820
],'get' => [
798821
'path' => 'b/{bucket}/folders/{folder}',
799822
'httpMethod' => 'GET',

src/Storage/Resource/Folders.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,27 @@ public function delete($bucket, $folder, $optParams = [])
5151
$params = array_merge($params, $optParams);
5252
return $this->call('delete', [$params]);
5353
}
54+
/**
55+
* Deletes a folder recursively. Only applicable to buckets with hierarchical
56+
* namespace enabled. (folders.deleteRecursive)
57+
*
58+
* @param string $bucket Name of the bucket in which the folder resides.
59+
* @param string $folder Name of a folder.
60+
* @param array $optParams Optional parameters.
61+
*
62+
* @opt_param string ifMetagenerationMatch If set, only deletes the folder if
63+
* its metageneration matches this value.
64+
* @opt_param string ifMetagenerationNotMatch If set, only deletes the folder if
65+
* its metageneration does not match this value.
66+
* @return GoogleLongrunningOperation
67+
* @throws \Google\Service\Exception
68+
*/
69+
public function deleteRecursive($bucket, $folder, $optParams = [])
70+
{
71+
$params = ['bucket' => $bucket, 'folder' => $folder];
72+
$params = array_merge($params, $optParams);
73+
return $this->call('deleteRecursive', [$params], GoogleLongrunningOperation::class);
74+
}
5475
/**
5576
* Returns metadata for the specified folder. Only applicable to buckets with
5677
* hierarchical namespace enabled. (folders.get)

0 commit comments

Comments
 (0)