Skip to content

Commit

Permalink
feat: add sample query set APIs
Browse files Browse the repository at this point in the history
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
gcf-owl-bot[bot] authored and amanda-tarafa committed Jul 17, 2024
1 parent 64af82f commit cc1366d
Show file tree
Hide file tree
Showing 109 changed files with 28,369 additions and 333 deletions.
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]
}
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]
}
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]
}
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]
}
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]
}
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]
}
Loading

0 comments on commit cc1366d

Please sign in to comment.