Skip to content

Commit 449cce7

Browse files
feat: Update Compute Engine API to revision 20240407 (#890)
Source-Link: googleapis/googleapis@018c0e3 Source-Link: googleapis/googleapis-gen@dad8476 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQ29tcHV0ZS5WMS8uT3dsQm90LnlhbWwiLCJoIjoiZGFkODQ3NmM5NGViMWVjYjJmZDcyZjI5NjgyNWU5NjIxZWE4YjQ1ZCJ9
1 parent 773d751 commit 449cce7

File tree

3,270 files changed

+1286103
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,270 files changed

+1286103
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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 compute_v1_generated_AcceleratorTypes_AggregatedList_async_flattened]
20+
using Google.Api.Gax;
21+
using Google.Cloud.Compute.V1;
22+
using System;
23+
using System.Collections.Generic;
24+
using System.Linq;
25+
using System.Threading.Tasks;
26+
27+
public sealed partial class GeneratedAcceleratorTypesClientSnippets
28+
{
29+
/// <summary>Snippet for AggregatedListAsync</summary>
30+
/// <remarks>
31+
/// This snippet has been automatically generated and should be regarded as a code template only.
32+
/// It will require modifications to work:
33+
/// - It may require correct/in-range values for request initialization.
34+
/// - It may require specifying regional endpoints when creating the service client as shown in
35+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
36+
/// </remarks>
37+
public async Task AggregatedListAsync()
38+
{
39+
// Create client
40+
AcceleratorTypesClient acceleratorTypesClient = await AcceleratorTypesClient.CreateAsync();
41+
// Initialize request argument(s)
42+
string project = "";
43+
// Make the request
44+
PagedAsyncEnumerable<AcceleratorTypeAggregatedList, KeyValuePair<string, AcceleratorTypesScopedList>> response = acceleratorTypesClient.AggregatedListAsync(project);
45+
46+
// Iterate over all response items, lazily performing RPCs as required
47+
await response.ForEachAsync((KeyValuePair<string, AcceleratorTypesScopedList> item) =>
48+
{
49+
// Do something with each item
50+
Console.WriteLine(item);
51+
});
52+
53+
// Or iterate over pages (of server-defined size), performing one RPC per page
54+
await response.AsRawResponses().ForEachAsync((AcceleratorTypeAggregatedList page) =>
55+
{
56+
// Do something with each page of items
57+
Console.WriteLine("A page of results:");
58+
foreach (KeyValuePair<string, AcceleratorTypesScopedList> item in page)
59+
{
60+
// Do something with each item
61+
Console.WriteLine(item);
62+
}
63+
});
64+
65+
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
66+
int pageSize = 10;
67+
Page<KeyValuePair<string, AcceleratorTypesScopedList>> singlePage = await response.ReadPageAsync(pageSize);
68+
// Do something with the page of items
69+
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
70+
foreach (KeyValuePair<string, AcceleratorTypesScopedList> item in singlePage)
71+
{
72+
// Do something with each item
73+
Console.WriteLine(item);
74+
}
75+
// Store the pageToken, for when the next page is required.
76+
string nextPageToken = singlePage.NextPageToken;
77+
}
78+
}
79+
// [END compute_v1_generated_AcceleratorTypes_AggregatedList_async_flattened]
80+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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 compute_v1_generated_AcceleratorTypes_AggregatedList_async]
20+
using Google.Api.Gax;
21+
using Google.Cloud.Compute.V1;
22+
using System;
23+
using System.Collections.Generic;
24+
using System.Linq;
25+
using System.Threading.Tasks;
26+
27+
public sealed partial class GeneratedAcceleratorTypesClientSnippets
28+
{
29+
/// <summary>Snippet for AggregatedListAsync</summary>
30+
/// <remarks>
31+
/// This snippet has been automatically generated and should be regarded as a code template only.
32+
/// It will require modifications to work:
33+
/// - It may require correct/in-range values for request initialization.
34+
/// - It may require specifying regional endpoints when creating the service client as shown in
35+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
36+
/// </remarks>
37+
public async Task AggregatedListRequestObjectAsync()
38+
{
39+
// Create client
40+
AcceleratorTypesClient acceleratorTypesClient = await AcceleratorTypesClient.CreateAsync();
41+
// Initialize request argument(s)
42+
AggregatedListAcceleratorTypesRequest request = new AggregatedListAcceleratorTypesRequest
43+
{
44+
OrderBy = "",
45+
Project = "",
46+
ServiceProjectNumber = 0L,
47+
Filter = "",
48+
IncludeAllScopes = false,
49+
ReturnPartialSuccess = false,
50+
};
51+
// Make the request
52+
PagedAsyncEnumerable<AcceleratorTypeAggregatedList, KeyValuePair<string, AcceleratorTypesScopedList>> response = acceleratorTypesClient.AggregatedListAsync(request);
53+
54+
// Iterate over all response items, lazily performing RPCs as required
55+
await response.ForEachAsync((KeyValuePair<string, AcceleratorTypesScopedList> item) =>
56+
{
57+
// Do something with each item
58+
Console.WriteLine(item);
59+
});
60+
61+
// Or iterate over pages (of server-defined size), performing one RPC per page
62+
await response.AsRawResponses().ForEachAsync((AcceleratorTypeAggregatedList page) =>
63+
{
64+
// Do something with each page of items
65+
Console.WriteLine("A page of results:");
66+
foreach (KeyValuePair<string, AcceleratorTypesScopedList> item in page)
67+
{
68+
// Do something with each item
69+
Console.WriteLine(item);
70+
}
71+
});
72+
73+
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
74+
int pageSize = 10;
75+
Page<KeyValuePair<string, AcceleratorTypesScopedList>> singlePage = await response.ReadPageAsync(pageSize);
76+
// Do something with the page of items
77+
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
78+
foreach (KeyValuePair<string, AcceleratorTypesScopedList> item in singlePage)
79+
{
80+
// Do something with each item
81+
Console.WriteLine(item);
82+
}
83+
// Store the pageToken, for when the next page is required.
84+
string nextPageToken = singlePage.NextPageToken;
85+
}
86+
}
87+
// [END compute_v1_generated_AcceleratorTypes_AggregatedList_async]
88+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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 compute_v1_generated_AcceleratorTypes_AggregatedList_sync]
20+
using Google.Api.Gax;
21+
using Google.Cloud.Compute.V1;
22+
using System;
23+
using System.Collections.Generic;
24+
25+
public sealed partial class GeneratedAcceleratorTypesClientSnippets
26+
{
27+
/// <summary>Snippet for AggregatedList</summary>
28+
/// <remarks>
29+
/// This snippet has been automatically generated and should be regarded as a code template only.
30+
/// It will require modifications to work:
31+
/// - It may require correct/in-range values for request initialization.
32+
/// - It may require specifying regional endpoints when creating the service client as shown in
33+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
34+
/// </remarks>
35+
public void AggregatedListRequestObject()
36+
{
37+
// Create client
38+
AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.Create();
39+
// Initialize request argument(s)
40+
AggregatedListAcceleratorTypesRequest request = new AggregatedListAcceleratorTypesRequest
41+
{
42+
OrderBy = "",
43+
Project = "",
44+
ServiceProjectNumber = 0L,
45+
Filter = "",
46+
IncludeAllScopes = false,
47+
ReturnPartialSuccess = false,
48+
};
49+
// Make the request
50+
PagedEnumerable<AcceleratorTypeAggregatedList, KeyValuePair<string, AcceleratorTypesScopedList>> response = acceleratorTypesClient.AggregatedList(request);
51+
52+
// Iterate over all response items, lazily performing RPCs as required
53+
foreach (KeyValuePair<string, AcceleratorTypesScopedList> item in response)
54+
{
55+
// Do something with each item
56+
Console.WriteLine(item);
57+
}
58+
59+
// Or iterate over pages (of server-defined size), performing one RPC per page
60+
foreach (AcceleratorTypeAggregatedList page in response.AsRawResponses())
61+
{
62+
// Do something with each page of items
63+
Console.WriteLine("A page of results:");
64+
foreach (KeyValuePair<string, AcceleratorTypesScopedList> item in page)
65+
{
66+
// Do something with each item
67+
Console.WriteLine(item);
68+
}
69+
}
70+
71+
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
72+
int pageSize = 10;
73+
Page<KeyValuePair<string, AcceleratorTypesScopedList>> singlePage = response.ReadPage(pageSize);
74+
// Do something with the page of items
75+
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
76+
foreach (KeyValuePair<string, AcceleratorTypesScopedList> item in singlePage)
77+
{
78+
// Do something with each item
79+
Console.WriteLine(item);
80+
}
81+
// Store the pageToken, for when the next page is required.
82+
string nextPageToken = singlePage.NextPageToken;
83+
}
84+
}
85+
// [END compute_v1_generated_AcceleratorTypes_AggregatedList_sync]
86+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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 compute_v1_generated_AcceleratorTypes_AggregatedList_sync_flattened]
20+
using Google.Api.Gax;
21+
using Google.Cloud.Compute.V1;
22+
using System;
23+
using System.Collections.Generic;
24+
25+
public sealed partial class GeneratedAcceleratorTypesClientSnippets
26+
{
27+
/// <summary>Snippet for AggregatedList</summary>
28+
/// <remarks>
29+
/// This snippet has been automatically generated and should be regarded as a code template only.
30+
/// It will require modifications to work:
31+
/// - It may require correct/in-range values for request initialization.
32+
/// - It may require specifying regional endpoints when creating the service client as shown in
33+
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
34+
/// </remarks>
35+
public void AggregatedList()
36+
{
37+
// Create client
38+
AcceleratorTypesClient acceleratorTypesClient = AcceleratorTypesClient.Create();
39+
// Initialize request argument(s)
40+
string project = "";
41+
// Make the request
42+
PagedEnumerable<AcceleratorTypeAggregatedList, KeyValuePair<string, AcceleratorTypesScopedList>> response = acceleratorTypesClient.AggregatedList(project);
43+
44+
// Iterate over all response items, lazily performing RPCs as required
45+
foreach (KeyValuePair<string, AcceleratorTypesScopedList> item in response)
46+
{
47+
// Do something with each item
48+
Console.WriteLine(item);
49+
}
50+
51+
// Or iterate over pages (of server-defined size), performing one RPC per page
52+
foreach (AcceleratorTypeAggregatedList page in response.AsRawResponses())
53+
{
54+
// Do something with each page of items
55+
Console.WriteLine("A page of results:");
56+
foreach (KeyValuePair<string, AcceleratorTypesScopedList> item in page)
57+
{
58+
// Do something with each item
59+
Console.WriteLine(item);
60+
}
61+
}
62+
63+
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
64+
int pageSize = 10;
65+
Page<KeyValuePair<string, AcceleratorTypesScopedList>> singlePage = response.ReadPage(pageSize);
66+
// Do something with the page of items
67+
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
68+
foreach (KeyValuePair<string, AcceleratorTypesScopedList> item in singlePage)
69+
{
70+
// Do something with each item
71+
Console.WriteLine(item);
72+
}
73+
// Store the pageToken, for when the next page is required.
74+
string nextPageToken = singlePage.NextPageToken;
75+
}
76+
}
77+
// [END compute_v1_generated_AcceleratorTypes_AggregatedList_sync_flattened]
78+
}
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 compute_v1_generated_AcceleratorTypes_Get_async_flattened]
20+
using Google.Cloud.Compute.V1;
21+
using System.Threading.Tasks;
22+
23+
public sealed partial class GeneratedAcceleratorTypesClientSnippets
24+
{
25+
/// <summary>Snippet for GetAsync</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 GetAsync()
34+
{
35+
// Create client
36+
AcceleratorTypesClient acceleratorTypesClient = await AcceleratorTypesClient.CreateAsync();
37+
// Initialize request argument(s)
38+
string project = "";
39+
string zone = "";
40+
string acceleratorType = "";
41+
// Make the request
42+
AcceleratorType response = await acceleratorTypesClient.GetAsync(project, zone, acceleratorType);
43+
}
44+
}
45+
// [END compute_v1_generated_AcceleratorTypes_Get_async_flattened]
46+
}

0 commit comments

Comments
 (0)