-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sample query APIs feat: add evaluation APIs PiperOrigin-RevId: 653246344 Source-Link: googleapis/googleapis@4e570db Source-Link: googleapis/googleapis-gen@18fd0a2 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuRGlzY292ZXJ5RW5naW5lLlYxQmV0YS8uT3dsQm90LnlhbWwiLCJoIjoiMThmZDBhMmIxNWFiMDBjNzQxOWNkYmQ0NDY2MDMxNDFjYTg5Zjc1MCJ9
- Loading branch information
1 parent
64af82f
commit cc1366d
Showing
109 changed files
with
28,369 additions
and
333 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
...Engine.V1Beta.GeneratedSnippets/EvaluationServiceClient.CreateEvaluationAsyncSnippet.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,62 @@ | ||
// 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 discoveryengine_v1beta_generated_EvaluationService_CreateEvaluation_async_flattened] | ||
using Google.Cloud.DiscoveryEngine.V1Beta; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedEvaluationServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateEvaluationAsync</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 CreateEvaluationAsync() | ||
{ | ||
// Create client | ||
EvaluationServiceClient evaluationServiceClient = await EvaluationServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
string parent = "projects/[PROJECT]/locations/[LOCATION]"; | ||
Evaluation evaluation = new Evaluation(); | ||
// Make the request | ||
Operation<Evaluation, CreateEvaluationMetadata> response = await evaluationServiceClient.CreateEvaluationAsync(parent, evaluation); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Evaluation, CreateEvaluationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Evaluation 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<Evaluation, CreateEvaluationMetadata> retrievedResponse = await evaluationServiceClient.PollOnceCreateEvaluationAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Evaluation retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END discoveryengine_v1beta_generated_EvaluationService_CreateEvaluation_async_flattened] | ||
} |
65 changes: 65 additions & 0 deletions
65
....GeneratedSnippets/EvaluationServiceClient.CreateEvaluationRequestObjectAsyncSnippet.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 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 discoveryengine_v1beta_generated_EvaluationService_CreateEvaluation_async] | ||
using Google.Cloud.DiscoveryEngine.V1Beta; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedEvaluationServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateEvaluationAsync</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 CreateEvaluationRequestObjectAsync() | ||
{ | ||
// Create client | ||
EvaluationServiceClient evaluationServiceClient = await EvaluationServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
CreateEvaluationRequest request = new CreateEvaluationRequest | ||
{ | ||
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), | ||
Evaluation = new Evaluation(), | ||
}; | ||
// Make the request | ||
Operation<Evaluation, CreateEvaluationMetadata> response = await evaluationServiceClient.CreateEvaluationAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Evaluation, CreateEvaluationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Evaluation 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<Evaluation, CreateEvaluationMetadata> retrievedResponse = await evaluationServiceClient.PollOnceCreateEvaluationAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Evaluation retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END discoveryengine_v1beta_generated_EvaluationService_CreateEvaluation_async] | ||
} |
64 changes: 64 additions & 0 deletions
64
...1Beta.GeneratedSnippets/EvaluationServiceClient.CreateEvaluationRequestObjectSnippet.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 discoveryengine_v1beta_generated_EvaluationService_CreateEvaluation_sync] | ||
using Google.Cloud.DiscoveryEngine.V1Beta; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedEvaluationServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateEvaluation</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 CreateEvaluationRequestObject() | ||
{ | ||
// Create client | ||
EvaluationServiceClient evaluationServiceClient = EvaluationServiceClient.Create(); | ||
// Initialize request argument(s) | ||
CreateEvaluationRequest request = new CreateEvaluationRequest | ||
{ | ||
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), | ||
Evaluation = new Evaluation(), | ||
}; | ||
// Make the request | ||
Operation<Evaluation, CreateEvaluationMetadata> response = evaluationServiceClient.CreateEvaluation(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Evaluation, CreateEvaluationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Evaluation 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<Evaluation, CreateEvaluationMetadata> retrievedResponse = evaluationServiceClient.PollOnceCreateEvaluation(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Evaluation retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END discoveryengine_v1beta_generated_EvaluationService_CreateEvaluation_sync] | ||
} |
62 changes: 62 additions & 0 deletions
62
....GeneratedSnippets/EvaluationServiceClient.CreateEvaluationResourceNamesAsyncSnippet.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,62 @@ | ||
// 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 discoveryengine_v1beta_generated_EvaluationService_CreateEvaluation_async_flattened_resourceNames] | ||
using Google.Cloud.DiscoveryEngine.V1Beta; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedEvaluationServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateEvaluationAsync</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 CreateEvaluationResourceNamesAsync() | ||
{ | ||
// Create client | ||
EvaluationServiceClient evaluationServiceClient = await EvaluationServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"); | ||
Evaluation evaluation = new Evaluation(); | ||
// Make the request | ||
Operation<Evaluation, CreateEvaluationMetadata> response = await evaluationServiceClient.CreateEvaluationAsync(parent, evaluation); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Evaluation, CreateEvaluationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Evaluation 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<Evaluation, CreateEvaluationMetadata> retrievedResponse = await evaluationServiceClient.PollOnceCreateEvaluationAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Evaluation retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END discoveryengine_v1beta_generated_EvaluationService_CreateEvaluation_async_flattened_resourceNames] | ||
} |
61 changes: 61 additions & 0 deletions
61
...1Beta.GeneratedSnippets/EvaluationServiceClient.CreateEvaluationResourceNamesSnippet.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 discoveryengine_v1beta_generated_EvaluationService_CreateEvaluation_sync_flattened_resourceNames] | ||
using Google.Cloud.DiscoveryEngine.V1Beta; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedEvaluationServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateEvaluation</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 CreateEvaluationResourceNames() | ||
{ | ||
// Create client | ||
EvaluationServiceClient evaluationServiceClient = EvaluationServiceClient.Create(); | ||
// Initialize request argument(s) | ||
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"); | ||
Evaluation evaluation = new Evaluation(); | ||
// Make the request | ||
Operation<Evaluation, CreateEvaluationMetadata> response = evaluationServiceClient.CreateEvaluation(parent, evaluation); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Evaluation, CreateEvaluationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Evaluation 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<Evaluation, CreateEvaluationMetadata> retrievedResponse = evaluationServiceClient.PollOnceCreateEvaluation(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Evaluation retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END discoveryengine_v1beta_generated_EvaluationService_CreateEvaluation_sync_flattened_resourceNames] | ||
} |
61 changes: 61 additions & 0 deletions
61
...overyEngine.V1Beta.GeneratedSnippets/EvaluationServiceClient.CreateEvaluationSnippet.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 discoveryengine_v1beta_generated_EvaluationService_CreateEvaluation_sync_flattened] | ||
using Google.Cloud.DiscoveryEngine.V1Beta; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedEvaluationServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateEvaluation</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 CreateEvaluation() | ||
{ | ||
// Create client | ||
EvaluationServiceClient evaluationServiceClient = EvaluationServiceClient.Create(); | ||
// Initialize request argument(s) | ||
string parent = "projects/[PROJECT]/locations/[LOCATION]"; | ||
Evaluation evaluation = new Evaluation(); | ||
// Make the request | ||
Operation<Evaluation, CreateEvaluationMetadata> response = evaluationServiceClient.CreateEvaluation(parent, evaluation); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Evaluation, CreateEvaluationMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Evaluation 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<Evaluation, CreateEvaluationMetadata> retrievedResponse = evaluationServiceClient.PollOnceCreateEvaluation(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Evaluation retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END discoveryengine_v1beta_generated_EvaluationService_CreateEvaluation_sync_flattened] | ||
} |
Oops, something went wrong.