-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support per-entity search and autocomplete feat: support new filter syntax for recommendation feat: expose A/B experiment info in search response docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 522675951 Source-Link: googleapis/googleapis@f149e91 Source-Link: googleapis/googleapis-gen@c4538a8 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuUmV0YWlsLlYyLy5Pd2xCb3QueWFtbCIsImgiOiJjNDUzOGE4ODhkMmVjMTNjZTcxOWMxYTFhYTlkYzdkZTViMTczNzVhIn0=
- Loading branch information
1 parent
217853b
commit a54f6b9
Showing
76 changed files
with
13,861 additions
and
399 deletions.
There are no files selected for viewing
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
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
62 changes: 62 additions & 0 deletions
62
.../Google.Cloud.Retail.V2.GeneratedSnippets/ModelServiceClient.CreateModelAsyncSnippet.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 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 Google.Cloud.Retail.V2.Snippets | ||
{ | ||
// [START retail_v2_generated_ModelService_CreateModel_async_flattened] | ||
using Google.Cloud.Retail.V2; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedModelServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateModelAsync</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 CreateModelAsync() | ||
{ | ||
// Create client | ||
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]"; | ||
Model model = new Model(); | ||
// Make the request | ||
Operation<Model, CreateModelMetadata> response = await modelServiceClient.CreateModelAsync(parent, model); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Model, CreateModelMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Model 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<Model, CreateModelMetadata> retrievedResponse = await modelServiceClient.PollOnceCreateModelAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Model retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END retail_v2_generated_ModelService_CreateModel_async_flattened] | ||
} |
66 changes: 66 additions & 0 deletions
66
....Retail.V2.GeneratedSnippets/ModelServiceClient.CreateModelRequestObjectAsyncSnippet.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,66 @@ | ||
// 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 Google.Cloud.Retail.V2.Snippets | ||
{ | ||
// [START retail_v2_generated_ModelService_CreateModel_async] | ||
using Google.Cloud.Retail.V2; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedModelServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateModelAsync</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 CreateModelRequestObjectAsync() | ||
{ | ||
// Create client | ||
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
CreateModelRequest request = new CreateModelRequest | ||
{ | ||
ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"), | ||
Model = new Model(), | ||
DryRun = false, | ||
}; | ||
// Make the request | ||
Operation<Model, CreateModelMetadata> response = await modelServiceClient.CreateModelAsync(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Model, CreateModelMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Model 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<Model, CreateModelMetadata> retrievedResponse = await modelServiceClient.PollOnceCreateModelAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Model retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END retail_v2_generated_ModelService_CreateModel_async] | ||
} |
65 changes: 65 additions & 0 deletions
65
...Cloud.Retail.V2.GeneratedSnippets/ModelServiceClient.CreateModelRequestObjectSnippet.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 Google.Cloud.Retail.V2.Snippets | ||
{ | ||
// [START retail_v2_generated_ModelService_CreateModel_sync] | ||
using Google.Cloud.Retail.V2; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedModelServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateModel</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 CreateModelRequestObject() | ||
{ | ||
// Create client | ||
ModelServiceClient modelServiceClient = ModelServiceClient.Create(); | ||
// Initialize request argument(s) | ||
CreateModelRequest request = new CreateModelRequest | ||
{ | ||
ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"), | ||
Model = new Model(), | ||
DryRun = false, | ||
}; | ||
// Make the request | ||
Operation<Model, CreateModelMetadata> response = modelServiceClient.CreateModel(request); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Model, CreateModelMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Model 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<Model, CreateModelMetadata> retrievedResponse = modelServiceClient.PollOnceCreateModel(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Model retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END retail_v2_generated_ModelService_CreateModel_sync] | ||
} |
62 changes: 62 additions & 0 deletions
62
....Retail.V2.GeneratedSnippets/ModelServiceClient.CreateModelResourceNamesAsyncSnippet.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 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 Google.Cloud.Retail.V2.Snippets | ||
{ | ||
// [START retail_v2_generated_ModelService_CreateModel_async_flattened_resourceNames] | ||
using Google.Cloud.Retail.V2; | ||
using Google.LongRunning; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedModelServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateModelAsync</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 CreateModelResourceNamesAsync() | ||
{ | ||
// Create client | ||
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"); | ||
Model model = new Model(); | ||
// Make the request | ||
Operation<Model, CreateModelMetadata> response = await modelServiceClient.CreateModelAsync(parent, model); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Model, CreateModelMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Model 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<Model, CreateModelMetadata> retrievedResponse = await modelServiceClient.PollOnceCreateModelAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Model retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END retail_v2_generated_ModelService_CreateModel_async_flattened_resourceNames] | ||
} |
61 changes: 61 additions & 0 deletions
61
...Cloud.Retail.V2.GeneratedSnippets/ModelServiceClient.CreateModelResourceNamesSnippet.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 Google.Cloud.Retail.V2.Snippets | ||
{ | ||
// [START retail_v2_generated_ModelService_CreateModel_sync_flattened_resourceNames] | ||
using Google.Cloud.Retail.V2; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedModelServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateModel</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 CreateModelResourceNames() | ||
{ | ||
// Create client | ||
ModelServiceClient modelServiceClient = ModelServiceClient.Create(); | ||
// Initialize request argument(s) | ||
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"); | ||
Model model = new Model(); | ||
// Make the request | ||
Operation<Model, CreateModelMetadata> response = modelServiceClient.CreateModel(parent, model); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Model, CreateModelMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Model 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<Model, CreateModelMetadata> retrievedResponse = modelServiceClient.PollOnceCreateModel(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Model retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END retail_v2_generated_ModelService_CreateModel_sync_flattened_resourceNames] | ||
} |
61 changes: 61 additions & 0 deletions
61
...il.V2/Google.Cloud.Retail.V2.GeneratedSnippets/ModelServiceClient.CreateModelSnippet.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 Google.Cloud.Retail.V2.Snippets | ||
{ | ||
// [START retail_v2_generated_ModelService_CreateModel_sync_flattened] | ||
using Google.Cloud.Retail.V2; | ||
using Google.LongRunning; | ||
|
||
public sealed partial class GeneratedModelServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateModel</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 CreateModel() | ||
{ | ||
// Create client | ||
ModelServiceClient modelServiceClient = ModelServiceClient.Create(); | ||
// Initialize request argument(s) | ||
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]"; | ||
Model model = new Model(); | ||
// Make the request | ||
Operation<Model, CreateModelMetadata> response = modelServiceClient.CreateModel(parent, model); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Model, CreateModelMetadata> completedResponse = response.PollUntilCompleted(); | ||
// Retrieve the operation result | ||
Model 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<Model, CreateModelMetadata> retrievedResponse = modelServiceClient.PollOnceCreateModel(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Model retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END retail_v2_generated_ModelService_CreateModel_sync_flattened] | ||
} |
Oops, something went wrong.