Content-Length: 760606 | pFad | https://github.com/googleapis/google-cloud-dotnet/commit/69c07c0d7ae57a1e045affd11300246b81108e6e

1B feat: add a v1 UpdateEndpointLongRunning API · googleapis/google-cloud-dotnet@69c07c0 · GitHub
Skip to content

Commit 69c07c0

Browse files
gcf-owl-bot[bot]amanda-tarafa
authored andcommitted
feat: add a v1 UpdateEndpointLongRunning API
PiperOrigin-RevId: 697715678 Source-Link: googleapis/googleapis@4ab02f3 Source-Link: googleapis/googleapis-gen@829605e Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQUlQbGF0Zm9ybS5WMS8uT3dsQm90LnlhbWwiLCJoIjoiODI5NjA1ZTE2ZGVlMWQ4ZDc5NWQ0ZGVhNDViNGMxMmQ4ZDk4M2ExYyJ9
1 parent 1c70f59 commit 69c07c0

11 files changed

+1654
-158
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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 aiplatform_v1_generated_EndpointService_UpdateEndpointLongRunning_async_flattened]
20+
using Google.Cloud.AIPlatform.V1;
21+
using Google.LongRunning;
22+
using System.Threading.Tasks;
23+
24+
public sealed partial class GeneratedEndpointServiceClientSnippets
25+
{
26+
//github.com/ <summary>Snippet for UpdateEndpointLongRunningAsync</summary>
27+
//github.com/ <remarks>
28+
//github.com/ This snippet has been automatically generated and should be regarded as a code template only.
29+
//github.com/ It will require modifications to work:
30+
//github.com/ - It may require correct/in-range values for request initialization.
31+
//github.com/ - It may require specifying regional endpoints when creating the service client as shown in
32+
//github.com/ https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
33+
//github.com/ </remarks>
34+
public async Task UpdateEndpointLongRunningAsync()
35+
{
36+
// Create client
37+
EndpointServiceClient endpointServiceClient = await EndpointServiceClient.CreateAsync();
38+
// Initialize request argument(s)
39+
Endpoint endpoint = new Endpoint();
40+
// Make the request
41+
Operation<Endpoint, UpdateEndpointOperationMetadata> response = await endpointServiceClient.UpdateEndpointLongRunningAsync(endpoint);
42+
43+
// Poll until the returned long-running operation is complete
44+
Operation<Endpoint, UpdateEndpointOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
45+
// Retrieve the operation result
46+
Endpoint result = completedResponse.Result;
47+
48+
// Or get the name of the operation
49+
string operationName = response.Name;
50+
// This name can be stored, then the long-running operation retrieved later by name
51+
Operation<Endpoint, UpdateEndpointOperationMetadata> retrievedResponse = await endpointServiceClient.PollOnceUpdateEndpointLongRunningAsync(operationName);
52+
// Check if the retrieved long-running operation has completed
53+
if (retrievedResponse.IsCompleted)
54+
{
55+
// If it has completed, then access the result
56+
Endpoint retrievedResult = retrievedResponse.Result;
57+
}
58+
}
59+
}
60+
// [END aiplatform_v1_generated_EndpointService_UpdateEndpointLongRunning_async_flattened]
61+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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 aiplatform_v1_generated_EndpointService_UpdateEndpointLongRunning_async]
20+
using Google.Cloud.AIPlatform.V1;
21+
using Google.LongRunning;
22+
using System.Threading.Tasks;
23+
24+
public sealed partial class GeneratedEndpointServiceClientSnippets
25+
{
26+
//github.com/ <summary>Snippet for UpdateEndpointLongRunningAsync</summary>
27+
//github.com/ <remarks>
28+
//github.com/ This snippet has been automatically generated and should be regarded as a code template only.
29+
//github.com/ It will require modifications to work:
30+
//github.com/ - It may require correct/in-range values for request initialization.
31+
//github.com/ - It may require specifying regional endpoints when creating the service client as shown in
32+
//github.com/ https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
33+
//github.com/ </remarks>
34+
public async Task UpdateEndpointLongRunningRequestObjectAsync()
35+
{
36+
// Create client
37+
EndpointServiceClient endpointServiceClient = await EndpointServiceClient.CreateAsync();
38+
// Initialize request argument(s)
39+
UpdateEndpointLongRunningRequest request = new UpdateEndpointLongRunningRequest
40+
{
41+
Endpoint = new Endpoint(),
42+
};
43+
// Make the request
44+
Operation<Endpoint, UpdateEndpointOperationMetadata> response = await endpointServiceClient.UpdateEndpointLongRunningAsync(request);
45+
46+
// Poll until the returned long-running operation is complete
47+
Operation<Endpoint, UpdateEndpointOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
48+
// Retrieve the operation result
49+
Endpoint result = completedResponse.Result;
50+
51+
// Or get the name of the operation
52+
string operationName = response.Name;
53+
// This name can be stored, then the long-running operation retrieved later by name
54+
Operation<Endpoint, UpdateEndpointOperationMetadata> retrievedResponse = await endpointServiceClient.PollOnceUpdateEndpointLongRunningAsync(operationName);
55+
// Check if the retrieved long-running operation has completed
56+
if (retrievedResponse.IsCompleted)
57+
{
58+
// If it has completed, then access the result
59+
Endpoint retrievedResult = retrievedResponse.Result;
60+
}
61+
}
62+
}
63+
// [END aiplatform_v1_generated_EndpointService_UpdateEndpointLongRunning_async]
64+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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 aiplatform_v1_generated_EndpointService_UpdateEndpointLongRunning_sync]
20+
using Google.Cloud.AIPlatform.V1;
21+
using Google.LongRunning;
22+
23+
public sealed partial class GeneratedEndpointServiceClientSnippets
24+
{
25+
//github.com/ <summary>Snippet for UpdateEndpointLongRunning</summary>
26+
//github.com/ <remarks>
27+
//github.com/ This snippet has been automatically generated and should be regarded as a code template only.
28+
//github.com/ It will require modifications to work:
29+
//github.com/ - It may require correct/in-range values for request initialization.
30+
//github.com/ - It may require specifying regional endpoints when creating the service client as shown in
31+
//github.com/ https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
32+
//github.com/ </remarks>
33+
public void UpdateEndpointLongRunningRequestObject()
34+
{
35+
// Create client
36+
EndpointServiceClient endpointServiceClient = EndpointServiceClient.Create();
37+
// Initialize request argument(s)
38+
UpdateEndpointLongRunningRequest request = new UpdateEndpointLongRunningRequest
39+
{
40+
Endpoint = new Endpoint(),
41+
};
42+
// Make the request
43+
Operation<Endpoint, UpdateEndpointOperationMetadata> response = endpointServiceClient.UpdateEndpointLongRunning(request);
44+
45+
// Poll until the returned long-running operation is complete
46+
Operation<Endpoint, UpdateEndpointOperationMetadata> completedResponse = response.PollUntilCompleted();
47+
// Retrieve the operation result
48+
Endpoint result = completedResponse.Result;
49+
50+
// Or get the name of the operation
51+
string operationName = response.Name;
52+
// This name can be stored, then the long-running operation retrieved later by name
53+
Operation<Endpoint, UpdateEndpointOperationMetadata> retrievedResponse = endpointServiceClient.PollOnceUpdateEndpointLongRunning(operationName);
54+
// Check if the retrieved long-running operation has completed
55+
if (retrievedResponse.IsCompleted)
56+
{
57+
// If it has completed, then access the result
58+
Endpoint retrievedResult = retrievedResponse.Result;
59+
}
60+
}
61+
}
62+
// [END aiplatform_v1_generated_EndpointService_UpdateEndpointLongRunning_sync]
63+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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 aiplatform_v1_generated_EndpointService_UpdateEndpointLongRunning_sync_flattened]
20+
using Google.Cloud.AIPlatform.V1;
21+
using Google.LongRunning;
22+
23+
public sealed partial class GeneratedEndpointServiceClientSnippets
24+
{
25+
//github.com/ <summary>Snippet for UpdateEndpointLongRunning</summary>
26+
//github.com/ <remarks>
27+
//github.com/ This snippet has been automatically generated and should be regarded as a code template only.
28+
//github.com/ It will require modifications to work:
29+
//github.com/ - It may require correct/in-range values for request initialization.
30+
//github.com/ - It may require specifying regional endpoints when creating the service client as shown in
31+
//github.com/ https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
32+
//github.com/ </remarks>
33+
public void UpdateEndpointLongRunning()
34+
{
35+
// Create client
36+
EndpointServiceClient endpointServiceClient = EndpointServiceClient.Create();
37+
// Initialize request argument(s)
38+
Endpoint endpoint = new Endpoint();
39+
// Make the request
40+
Operation<Endpoint, UpdateEndpointOperationMetadata> response = endpointServiceClient.UpdateEndpointLongRunning(endpoint);
41+
42+
// Poll until the returned long-running operation is complete
43+
Operation<Endpoint, UpdateEndpointOperationMetadata> completedResponse = response.PollUntilCompleted();
44+
// Retrieve the operation result
45+
Endpoint result = completedResponse.Result;
46+
47+
// Or get the name of the operation
48+
string operationName = response.Name;
49+
// This name can be stored, then the long-running operation retrieved later by name
50+
Operation<Endpoint, UpdateEndpointOperationMetadata> retrievedResponse = endpointServiceClient.PollOnceUpdateEndpointLongRunning(operationName);
51+
// Check if the retrieved long-running operation has completed
52+
if (retrievedResponse.IsCompleted)
53+
{
54+
// If it has completed, then access the result
55+
Endpoint retrievedResult = retrievedResponse.Result;
56+
}
57+
}
58+
}
59+
// [END aiplatform_v1_generated_EndpointService_UpdateEndpointLongRunning_sync_flattened]
60+
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/google-cloud-dotnet/commit/69c07c0d7ae57a1e045affd11300246b81108e6e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy