-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add UpdateEndpointLongRunning API in v1beta1 version
PiperOrigin-RevId: 691203761 Source-Link: googleapis/googleapis@67878b0 Source-Link: googleapis/googleapis-gen@47e8a2d Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQUlQbGF0Zm9ybS5WMUJldGExLy5Pd2xCb3QueWFtbCIsImgiOiI0N2U4YTJkZWEwYzg5NmMwOGExMWZkZjgyOTRjZGE2MjQ5NDNjMzYyIn0=
- Loading branch information
1 parent
0120a36
commit 42c90e3
Showing
11 changed files
with
1,659 additions
and
161 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
...1Beta1.GeneratedSnippets/EndpointServiceClient.UpdateEndpointLongRunningAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START aiplatform_v1beta1_generated_EndpointService_UpdateEndpointLongRunning_async_flattened] | ||
using Google.Cloud.AIPlatform.V1Beta1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedEndpointServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for UpdateEndpointLongRunningAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task UpdateEndpointLongRunningAsync() | ||
{ | ||
// Create client | ||
EndpointServiceClient endpointServiceClient = await EndpointServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
Endpoint endpoint = new Endpoint(); | ||
// Make the request | ||
Operation<Endpoint, UpdateEndpointOperationMetadata> response = await endpointServiceClient.UpdateEndpointLongRunningAsync(endpoint); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Endpoint, UpdateEndpointOperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Endpoint result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<Endpoint, UpdateEndpointOperationMetadata> retrievedResponse = await endpointServiceClient.PollOnceUpdateEndpointLongRunningAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Endpoint retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END aiplatform_v1beta1_generated_EndpointService_UpdateEndpointLongRunning_async_flattened] | ||
} |
64 changes: 64 additions & 0 deletions
64
...tedSnippets/EndpointServiceClient.UpdateEndpointLongRunningRequestObjectAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START aiplatform_v1beta1_generated_EndpointService_UpdateEndpointLongRunning_async] | ||
using Google.Cloud.AIPlatform.V1Beta1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedEndpointServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for UpdateEndpointLongRunningAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task UpdateEndpointLongRunningRequestObjectAsync() | ||
{ | ||
// Create client | ||
EndpointServiceClient endpointServiceClient = await EndpointServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
UpdateEndpointLongRunningRequest request = new UpdateEndpointLongRunningRequest | ||
{ | ||
Endpoint = new Endpoint(), | ||
}; | ||
// Make the request | ||
Operation<Endpoint, UpdateEndpointOperationMetadata> response = await endpointServiceClient.UpdateEndpointLongRunningAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Endpoint, UpdateEndpointOperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Endpoint result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<Endpoint, UpdateEndpointOperationMetadata> retrievedResponse = await endpointServiceClient.PollOnceUpdateEndpointLongRunningAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Endpoint retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END aiplatform_v1beta1_generated_EndpointService_UpdateEndpointLongRunning_async] | ||
} |
63 changes: 63 additions & 0 deletions
63
...eneratedSnippets/EndpointServiceClient.UpdateEndpointLongRunningRequestObjectSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START aiplatform_v1beta1_generated_EndpointService_UpdateEndpointLongRunning_sync] | ||
using Google.Cloud.AIPlatform.V1Beta1; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedEndpointServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for UpdateEndpointLongRunning</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public void UpdateEndpointLongRunningRequestObject() | ||
{ | ||
// Create client | ||
EndpointServiceClient endpointServiceClient = EndpointServiceClient.Create(); | ||
// Initialize request argument(s) | ||
UpdateEndpointLongRunningRequest request = new UpdateEndpointLongRunningRequest | ||
{ | ||
Endpoint = new Endpoint(), | ||
}; | ||
// Make the request | ||
Operation<Endpoint, UpdateEndpointOperationMetadata> response = endpointServiceClient.UpdateEndpointLongRunning(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Endpoint, UpdateEndpointOperationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Endpoint result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<Endpoint, UpdateEndpointOperationMetadata> retrievedResponse = endpointServiceClient.PollOnceUpdateEndpointLongRunning(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Endpoint retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END aiplatform_v1beta1_generated_EndpointService_UpdateEndpointLongRunning_sync] | ||
} |
60 changes: 60 additions & 0 deletions
60
...orm.V1Beta1.GeneratedSnippets/EndpointServiceClient.UpdateEndpointLongRunningSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START aiplatform_v1beta1_generated_EndpointService_UpdateEndpointLongRunning_sync_flattened] | ||
using Google.Cloud.AIPlatform.V1Beta1; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedEndpointServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for UpdateEndpointLongRunning</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public void UpdateEndpointLongRunning() | ||
{ | ||
// Create client | ||
EndpointServiceClient endpointServiceClient = EndpointServiceClient.Create(); | ||
// Initialize request argument(s) | ||
Endpoint endpoint = new Endpoint(); | ||
// Make the request | ||
Operation<Endpoint, UpdateEndpointOperationMetadata> response = endpointServiceClient.UpdateEndpointLongRunning(endpoint); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Endpoint, UpdateEndpointOperationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Endpoint result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<Endpoint, UpdateEndpointOperationMetadata> retrievedResponse = endpointServiceClient.PollOnceUpdateEndpointLongRunning(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Endpoint retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END aiplatform_v1beta1_generated_EndpointService_UpdateEndpointLongRunning_sync_flattened] | ||
} |
Oops, something went wrong.