-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add UpdateExplanationDataset to aiplatform
PiperOrigin-RevId: 541213716 Source-Link: googleapis/googleapis@4a858c4 Source-Link: googleapis/googleapis-gen@e4c3eab Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQUlQbGF0Zm9ybS5WMS8uT3dsQm90LnlhbWwiLCJoIjoiZTRjM2VhYjFmZGE0OWM1ZDk2MTliYjgyODcyYTBhN2U4MWY4MzUyOCJ9
- Loading branch information
1 parent
d127ca2
commit 8a49530
Showing
13 changed files
with
2,034 additions
and
269 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
...latform.V1.GeneratedSnippets/ModelServiceClient.UpdateExplanationDatasetAsyncSnippet.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 2023 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_v1_generated_ModelService_UpdateExplanationDataset_async_flattened] | ||
using Google.Cloud.AIPlatform.V1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedModelServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for UpdateExplanationDatasetAsync</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 UpdateExplanationDatasetAsync() | ||
{ | ||
// Create client | ||
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
string model = "projects/[PROJECT]/locations/[LOCATION]/models/[MODEL]"; | ||
// Make the request | ||
Operation<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> response = await modelServiceClient.UpdateExplanationDatasetAsync(model); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
UpdateExplanationDatasetResponse 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<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> retrievedResponse = await modelServiceClient.PollOnceUpdateExplanationDatasetAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
UpdateExplanationDatasetResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END aiplatform_v1_generated_ModelService_UpdateExplanationDataset_async_flattened] | ||
} |
65 changes: 65 additions & 0 deletions
65
...neratedSnippets/ModelServiceClient.UpdateExplanationDatasetRequestObjectAsyncSnippet.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,65 @@ | ||
// Copyright 2023 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_v1_generated_ModelService_UpdateExplanationDataset_async] | ||
using Google.Cloud.AIPlatform.V1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedModelServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for UpdateExplanationDatasetAsync</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 UpdateExplanationDatasetRequestObjectAsync() | ||
{ | ||
// Create client | ||
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
UpdateExplanationDatasetRequest request = new UpdateExplanationDatasetRequest | ||
{ | ||
ModelAsModelName = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]"), | ||
Examples = new Examples(), | ||
}; | ||
// Make the request | ||
Operation<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> response = await modelServiceClient.UpdateExplanationDatasetAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
UpdateExplanationDatasetResponse 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<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> retrievedResponse = await modelServiceClient.PollOnceUpdateExplanationDatasetAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
UpdateExplanationDatasetResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END aiplatform_v1_generated_ModelService_UpdateExplanationDataset_async] | ||
} |
64 changes: 64 additions & 0 deletions
64
...V1.GeneratedSnippets/ModelServiceClient.UpdateExplanationDatasetRequestObjectSnippet.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 2023 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_v1_generated_ModelService_UpdateExplanationDataset_sync] | ||
using Google.Cloud.AIPlatform.V1; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedModelServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for UpdateExplanationDataset</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 UpdateExplanationDatasetRequestObject() | ||
{ | ||
// Create client | ||
ModelServiceClient modelServiceClient = ModelServiceClient.Create(); | ||
// Initialize request argument(s) | ||
UpdateExplanationDatasetRequest request = new UpdateExplanationDatasetRequest | ||
{ | ||
ModelAsModelName = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]"), | ||
Examples = new Examples(), | ||
}; | ||
// Make the request | ||
Operation<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> response = modelServiceClient.UpdateExplanationDataset(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
UpdateExplanationDatasetResponse 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<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> retrievedResponse = modelServiceClient.PollOnceUpdateExplanationDataset(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
UpdateExplanationDatasetResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END aiplatform_v1_generated_ModelService_UpdateExplanationDataset_sync] | ||
} |
61 changes: 61 additions & 0 deletions
61
...neratedSnippets/ModelServiceClient.UpdateExplanationDatasetResourceNamesAsyncSnippet.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 2023 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_v1_generated_ModelService_UpdateExplanationDataset_async_flattened_resourceNames] | ||
using Google.Cloud.AIPlatform.V1; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedModelServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for UpdateExplanationDatasetAsync</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 UpdateExplanationDatasetResourceNamesAsync() | ||
{ | ||
// Create client | ||
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
ModelName model = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]"); | ||
// Make the request | ||
Operation<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> response = await modelServiceClient.UpdateExplanationDatasetAsync(model); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
UpdateExplanationDatasetResponse 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<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> retrievedResponse = await modelServiceClient.PollOnceUpdateExplanationDatasetAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
UpdateExplanationDatasetResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END aiplatform_v1_generated_ModelService_UpdateExplanationDataset_async_flattened_resourceNames] | ||
} |
60 changes: 60 additions & 0 deletions
60
...V1.GeneratedSnippets/ModelServiceClient.UpdateExplanationDatasetResourceNamesSnippet.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 2023 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_v1_generated_ModelService_UpdateExplanationDataset_sync_flattened_resourceNames] | ||
using Google.Cloud.AIPlatform.V1; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedModelServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for UpdateExplanationDataset</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 UpdateExplanationDatasetResourceNames() | ||
{ | ||
// Create client | ||
ModelServiceClient modelServiceClient = ModelServiceClient.Create(); | ||
// Initialize request argument(s) | ||
ModelName model = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]"); | ||
// Make the request | ||
Operation<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> response = modelServiceClient.UpdateExplanationDataset(model); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
UpdateExplanationDatasetResponse 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<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> retrievedResponse = modelServiceClient.PollOnceUpdateExplanationDataset(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
UpdateExplanationDatasetResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END aiplatform_v1_generated_ModelService_UpdateExplanationDataset_sync_flattened_resourceNames] | ||
} |
60 changes: 60 additions & 0 deletions
60
...d.AIPlatform.V1.GeneratedSnippets/ModelServiceClient.UpdateExplanationDatasetSnippet.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 2023 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_v1_generated_ModelService_UpdateExplanationDataset_sync_flattened] | ||
using Google.Cloud.AIPlatform.V1; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedModelServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for UpdateExplanationDataset</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 UpdateExplanationDataset() | ||
{ | ||
// Create client | ||
ModelServiceClient modelServiceClient = ModelServiceClient.Create(); | ||
// Initialize request argument(s) | ||
string model = "projects/[PROJECT]/locations/[LOCATION]/models/[MODEL]"; | ||
// Make the request | ||
Operation<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> response = modelServiceClient.UpdateExplanationDataset(model); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
UpdateExplanationDatasetResponse 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<UpdateExplanationDatasetResponse, UpdateExplanationDatasetOperationMetadata> retrievedResponse = modelServiceClient.PollOnceUpdateExplanationDataset(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
UpdateExplanationDatasetResponse retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END aiplatform_v1_generated_ModelService_UpdateExplanationDataset_sync_flattened] | ||
} |
Oops, something went wrong.