Skip to content

Commit f904f90

Browse files
gcf-owl-bot[bot]jskeet
authored andcommitted
feat: Make Managed Folders operations public
PiperOrigin-RevId: 620299849 Source-Link: googleapis/googleapis@c5b9e24 Source-Link: googleapis/googleapis-gen@61b8d39 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuU3RvcmFnZS5Db250cm9sLlYyLy5Pd2xCb3QueWFtbCIsImgiOiI2MWI4ZDM5MjMxNDFjMjFjYTU4YzYzZDBhNmExY2NiMTVkZTUyNmZlIn0=
1 parent 74afcba commit f904f90

File tree

31 files changed

+6589
-32
lines changed

31 files changed

+6589
-32
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright 2024 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START storage_v2_generated_StorageControl_CreateManagedFolder_async_flattened]
20+
using Google.Cloud.Storage.Control.V2;
21+
using System.Threading.Tasks;
22+
23+
public sealed partial class GeneratedStorageControlClientSnippets
24+
{
25+
/// <summary>Snippet for CreateManagedFolderAsync</summary>
26+
/// <remarks>
27+
/// This snippet has been automatically generated and should be regarded as a code template only.
28+
/// It will require modifications to work:
29+
/// - It may require correct/in-range values for request initialization.
30+
/// - It may require specifying regional endpoints when creating the service client as shown in
31+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
32+
/// </remarks>
33+
public async Task CreateManagedFolderAsync()
34+
{
35+
// Create client
36+
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
37+
// Initialize request argument(s)
38+
string parent = "projects/[PROJECT]/buckets/[BUCKET]";
39+
ManagedFolder managedFolder = new ManagedFolder();
40+
string managedFolderId = "";
41+
// Make the request
42+
ManagedFolder response = await storageControlClient.CreateManagedFolderAsync(parent, managedFolder, managedFolderId);
43+
}
44+
}
45+
// [END storage_v2_generated_StorageControl_CreateManagedFolder_async_flattened]
46+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright 2024 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START storage_v2_generated_StorageControl_CreateManagedFolder_async]
20+
using Google.Cloud.Storage.Control.V2;
21+
using System.Threading.Tasks;
22+
23+
public sealed partial class GeneratedStorageControlClientSnippets
24+
{
25+
/// <summary>Snippet for CreateManagedFolderAsync</summary>
26+
/// <remarks>
27+
/// This snippet has been automatically generated and should be regarded as a code template only.
28+
/// It will require modifications to work:
29+
/// - It may require correct/in-range values for request initialization.
30+
/// - It may require specifying regional endpoints when creating the service client as shown in
31+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
32+
/// </remarks>
33+
public async Task CreateManagedFolderRequestObjectAsync()
34+
{
35+
// Create client
36+
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
37+
// Initialize request argument(s)
38+
CreateManagedFolderRequest request = new CreateManagedFolderRequest
39+
{
40+
ParentAsBucketName = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]"),
41+
ManagedFolder = new ManagedFolder(),
42+
ManagedFolderId = "",
43+
};
44+
// Make the request
45+
ManagedFolder response = await storageControlClient.CreateManagedFolderAsync(request);
46+
}
47+
}
48+
// [END storage_v2_generated_StorageControl_CreateManagedFolder_async]
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright 2024 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START storage_v2_generated_StorageControl_CreateManagedFolder_sync]
20+
using Google.Cloud.Storage.Control.V2;
21+
22+
public sealed partial class GeneratedStorageControlClientSnippets
23+
{
24+
/// <summary>Snippet for CreateManagedFolder</summary>
25+
/// <remarks>
26+
/// This snippet has been automatically generated and should be regarded as a code template only.
27+
/// It will require modifications to work:
28+
/// - It may require correct/in-range values for request initialization.
29+
/// - It may require specifying regional endpoints when creating the service client as shown in
30+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
31+
/// </remarks>
32+
public void CreateManagedFolderRequestObject()
33+
{
34+
// Create client
35+
StorageControlClient storageControlClient = StorageControlClient.Create();
36+
// Initialize request argument(s)
37+
CreateManagedFolderRequest request = new CreateManagedFolderRequest
38+
{
39+
ParentAsBucketName = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]"),
40+
ManagedFolder = new ManagedFolder(),
41+
ManagedFolderId = "",
42+
};
43+
// Make the request
44+
ManagedFolder response = storageControlClient.CreateManagedFolder(request);
45+
}
46+
}
47+
// [END storage_v2_generated_StorageControl_CreateManagedFolder_sync]
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright 2024 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START storage_v2_generated_StorageControl_CreateManagedFolder_async_flattened_resourceNames]
20+
using Google.Cloud.Storage.Control.V2;
21+
using System.Threading.Tasks;
22+
23+
public sealed partial class GeneratedStorageControlClientSnippets
24+
{
25+
/// <summary>Snippet for CreateManagedFolderAsync</summary>
26+
/// <remarks>
27+
/// This snippet has been automatically generated and should be regarded as a code template only.
28+
/// It will require modifications to work:
29+
/// - It may require correct/in-range values for request initialization.
30+
/// - It may require specifying regional endpoints when creating the service client as shown in
31+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
32+
/// </remarks>
33+
public async Task CreateManagedFolderResourceNamesAsync()
34+
{
35+
// Create client
36+
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
37+
// Initialize request argument(s)
38+
BucketName parent = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]");
39+
ManagedFolder managedFolder = new ManagedFolder();
40+
string managedFolderId = "";
41+
// Make the request
42+
ManagedFolder response = await storageControlClient.CreateManagedFolderAsync(parent, managedFolder, managedFolderId);
43+
}
44+
}
45+
// [END storage_v2_generated_StorageControl_CreateManagedFolder_async_flattened_resourceNames]
46+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 2024 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START storage_v2_generated_StorageControl_CreateManagedFolder_sync_flattened_resourceNames]
20+
using Google.Cloud.Storage.Control.V2;
21+
22+
public sealed partial class GeneratedStorageControlClientSnippets
23+
{
24+
/// <summary>Snippet for CreateManagedFolder</summary>
25+
/// <remarks>
26+
/// This snippet has been automatically generated and should be regarded as a code template only.
27+
/// It will require modifications to work:
28+
/// - It may require correct/in-range values for request initialization.
29+
/// - It may require specifying regional endpoints when creating the service client as shown in
30+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
31+
/// </remarks>
32+
public void CreateManagedFolderResourceNames()
33+
{
34+
// Create client
35+
StorageControlClient storageControlClient = StorageControlClient.Create();
36+
// Initialize request argument(s)
37+
BucketName parent = BucketName.FromProjectBucket("[PROJECT]", "[BUCKET]");
38+
ManagedFolder managedFolder = new ManagedFolder();
39+
string managedFolderId = "";
40+
// Make the request
41+
ManagedFolder response = storageControlClient.CreateManagedFolder(parent, managedFolder, managedFolderId);
42+
}
43+
}
44+
// [END storage_v2_generated_StorageControl_CreateManagedFolder_sync_flattened_resourceNames]
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 2024 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START storage_v2_generated_StorageControl_CreateManagedFolder_sync_flattened]
20+
using Google.Cloud.Storage.Control.V2;
21+
22+
public sealed partial class GeneratedStorageControlClientSnippets
23+
{
24+
/// <summary>Snippet for CreateManagedFolder</summary>
25+
/// <remarks>
26+
/// This snippet has been automatically generated and should be regarded as a code template only.
27+
/// It will require modifications to work:
28+
/// - It may require correct/in-range values for request initialization.
29+
/// - It may require specifying regional endpoints when creating the service client as shown in
30+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
31+
/// </remarks>
32+
public void CreateManagedFolder()
33+
{
34+
// Create client
35+
StorageControlClient storageControlClient = StorageControlClient.Create();
36+
// Initialize request argument(s)
37+
string parent = "projects/[PROJECT]/buckets/[BUCKET]";
38+
ManagedFolder managedFolder = new ManagedFolder();
39+
string managedFolderId = "";
40+
// Make the request
41+
ManagedFolder response = storageControlClient.CreateManagedFolder(parent, managedFolder, managedFolderId);
42+
}
43+
}
44+
// [END storage_v2_generated_StorageControl_CreateManagedFolder_sync_flattened]
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright 2024 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START storage_v2_generated_StorageControl_DeleteManagedFolder_async_flattened]
20+
using Google.Cloud.Storage.Control.V2;
21+
using System.Threading.Tasks;
22+
23+
public sealed partial class GeneratedStorageControlClientSnippets
24+
{
25+
/// <summary>Snippet for DeleteManagedFolderAsync</summary>
26+
/// <remarks>
27+
/// This snippet has been automatically generated and should be regarded as a code template only.
28+
/// It will require modifications to work:
29+
/// - It may require correct/in-range values for request initialization.
30+
/// - It may require specifying regional endpoints when creating the service client as shown in
31+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
32+
/// </remarks>
33+
public async Task DeleteManagedFolderAsync()
34+
{
35+
// Create client
36+
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
37+
// Initialize request argument(s)
38+
string name = "projects/[PROJECT]/buckets/[BUCKET]/managedFolders/[MANAGEDFOLDER]";
39+
// Make the request
40+
await storageControlClient.DeleteManagedFolderAsync(name);
41+
}
42+
}
43+
// [END storage_v2_generated_StorageControl_DeleteManagedFolder_async_flattened]
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright 2024 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Generated code. DO NOT EDIT!
16+
17+
namespace GoogleCSharpSnippets
18+
{
19+
// [START storage_v2_generated_StorageControl_DeleteManagedFolder_async]
20+
using Google.Cloud.Storage.Control.V2;
21+
using System.Threading.Tasks;
22+
23+
public sealed partial class GeneratedStorageControlClientSnippets
24+
{
25+
/// <summary>Snippet for DeleteManagedFolderAsync</summary>
26+
/// <remarks>
27+
/// This snippet has been automatically generated and should be regarded as a code template only.
28+
/// It will require modifications to work:
29+
/// - It may require correct/in-range values for request initialization.
30+
/// - It may require specifying regional endpoints when creating the service client as shown in
31+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
32+
/// </remarks>
33+
public async Task DeleteManagedFolderRequestObjectAsync()
34+
{
35+
// Create client
36+
StorageControlClient storageControlClient = await StorageControlClient.CreateAsync();
37+
// Initialize request argument(s)
38+
DeleteManagedFolderRequest request = new DeleteManagedFolderRequest
39+
{
40+
IfMetagenerationMatch = 0L,
41+
IfMetagenerationNotMatch = 0L,
42+
AllowNonEmpty = false,
43+
ManagedFolderName = ManagedFolderName.FromProjectBucketManagedFolder("[PROJECT]", "[BUCKET]", "[MANAGEDFOLDER]"),
44+
};
45+
// Make the request
46+
await storageControlClient.DeleteManagedFolderAsync(request);
47+
}
48+
}
49+
// [END storage_v2_generated_StorageControl_DeleteManagedFolder_async]
50+
}

0 commit comments

Comments
 (0)