Shuts down any channels automatically created by Create() and
CreateAsync(CancellationToken). Channels which weren't automatically created are not
affected.
A task representing the asynchronous shutdown operation.
Remarks
After calling this method, further calls to Create() and
CreateAsync(CancellationToken) will create new channels, which could in turn be shut down
by another call to this method.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eRecommendationServiceClient\u003c/code\u003e class, part of the Discovery Engine v1 API, is used for making recommendations, requiring a contextual user event.\u003c/p\u003e\n"],["\u003cp\u003eThis service client offers synchronous and asynchronous methods for creating instances (\u003ccode\u003eCreate()\u003c/code\u003e and \u003ccode\u003eCreateAsync()\u003c/code\u003e) and for making recommendations (\u003ccode\u003eRecommend()\u003c/code\u003e and \u003ccode\u003eRecommendAsync()\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eRecommendationServiceClient\u003c/code\u003e has properties for accessing the default endpoint, scopes, underlying gRPC client, locations client, and service metadata.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of \u003ccode\u003eRecommendationServiceClient\u003c/code\u003e is 1.6.0, and other available versions include 1.5.0, 1.4.0, 1.3.0, 1.2.0, 1.1.0, and 1.0.0-beta06, all of which are accessible via their respective links.\u003c/p\u003e\n"],["\u003cp\u003eA method named \u003ccode\u003eShutdownDefaultChannelsAsync()\u003c/code\u003e is provided for shutting down any automatically created channels, ensuring manual channel management is not affected.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1 API - Class RecommendationServiceClient (1.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.9.0 (latest)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.8.0/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.7.0/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.6.0/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.5.0/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.4.0/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.3.0/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.2.0/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.1.0/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.0.0-beta06/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient) \n\n public abstract class RecommendationServiceClient\n\nReference documentation and code samples for the Discovery Engine v1 API class RecommendationServiceClient.\n\nRecommendationService client wrapper, for convenient use. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e RecommendationServiceClient \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring) \n\nDerived Types\n-------------\n\n[RecommendationServiceClientImpl](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClientImpl)\n\nNamespace\n---------\n\n[Google.Cloud.DiscoveryEngine.V1](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.DiscoveryEngine.V1.dll\n\nRemarks\n-------\n\nService for making recommendations.\n\nProperties\n----------\n\n### DefaultEndpoint\n\n public static string DefaultEndpoint { get; }\n\nThe default endpoint for the RecommendationService service, which is a host of\n\"discoveryengine.googleapis.com\" and a port of 443.\n\n### DefaultScopes\n\n public static IReadOnlyList\u003cstring\u003e DefaultScopes { get; }\n\nThe default RecommendationService scopes.\n\n**Remarks** \nThe default RecommendationService scopes are:\n\n- \u003chttps://www.googleapis.com/auth/cloud-platform\u003e\n\n\u003cbr /\u003e\n\n### GrpcClient\n\n public virtual RecommendationService.RecommendationServiceClient GrpcClient { get; }\n\nThe underlying gRPC RecommendationService client\n\n### LocationsClient\n\n public virtual LocationsClient LocationsClient { get; }\n\nThe [LocationsClient](https://cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html) associated with this client.\n\n### ServiceMetadata\n\n public static ServiceMetadata ServiceMetadata { get; }\n\nThe service metadata associated with this client type.\n\nMethods\n-------\n\n### Create()\n\n public static RecommendationServiceClient Create()\n\nSynchronously creates a [RecommendationServiceClient](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient) using the default credentials, endpoint\nand settings. To specify custom credentials or other settings, use\n[RecommendationServiceClientBuilder](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClientBuilder).\n\n### CreateAsync(CancellationToken)\n\n public static Task\u003cRecommendationServiceClient\u003e CreateAsync(CancellationToken cancellationToken = default)\n\nAsynchronously creates a [RecommendationServiceClient](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient) using the default credentials, endpoint\nand settings. To specify custom credentials or other settings, use\n[RecommendationServiceClientBuilder](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClientBuilder).\n\n### Recommend(RecommendRequest, CallSettings)\n\n public virtual RecommendResponse Recommend(RecommendRequest request, CallSettings callSettings = null)\n\nMakes a recommendation, which requires a contextual user event.\n\n**Example** \n\n // Create client\n RecommendationServiceClient recommendationServiceClient = RecommendationServiceClient.Create();\n // Initialize request argument(s)\n RecommendRequest request = new RecommendRequest\n {\n ServingConfigAsServingConfigName = ServingConfigName.FromProjectLocationDataStoreServingConfig(\"[PROJECT]\", \"[LOCATION]\", \"[DATA_STORE]\", \"[SERVING_CONFIG]\"),\n UserEvent = new UserEvent(),\n PageSize = 0,\n Filter = \"\",\n ValidateOnly = false,\n Params = { { \"\", new Value() }, },\n UserLabels = { { \"\", \"\" }, },\n };\n // Make the request\n RecommendResponse response = recommendationServiceClient.Recommend(request);\n\n### RecommendAsync(RecommendRequest, CallSettings)\n\n public virtual Task\u003cRecommendResponse\u003e RecommendAsync(RecommendRequest request, CallSettings callSettings = null)\n\nMakes a recommendation, which requires a contextual user event.\n\n**Example** \n\n // Create client\n RecommendationServiceClient recommendationServiceClient = await RecommendationServiceClient.CreateAsync();\n // Initialize request argument(s)\n RecommendRequest request = new RecommendRequest\n {\n ServingConfigAsServingConfigName = ServingConfigName.FromProjectLocationDataStoreServingConfig(\"[PROJECT]\", \"[LOCATION]\", \"[DATA_STORE]\", \"[SERVING_CONFIG]\"),\n UserEvent = new UserEvent(),\n PageSize = 0,\n Filter = \"\",\n ValidateOnly = false,\n Params = { { \"\", new Value() }, },\n UserLabels = { { \"\", \"\" }, },\n };\n // Make the request\n RecommendResponse response = await recommendationServiceClient.RecommendAsync(request);\n\n### RecommendAsync(RecommendRequest, CancellationToken)\n\n public virtual Task\u003cRecommendResponse\u003e RecommendAsync(RecommendRequest request, CancellationToken cancellationToken)\n\nMakes a recommendation, which requires a contextual user event.\n\n**Example** \n\n // Create client\n RecommendationServiceClient recommendationServiceClient = await RecommendationServiceClient.CreateAsync();\n // Initialize request argument(s)\n RecommendRequest request = new RecommendRequest\n {\n ServingConfigAsServingConfigName = ServingConfigName.FromProjectLocationDataStoreServingConfig(\"[PROJECT]\", \"[LOCATION]\", \"[DATA_STORE]\", \"[SERVING_CONFIG]\"),\n UserEvent = new UserEvent(),\n PageSize = 0,\n Filter = \"\",\n ValidateOnly = false,\n Params = { { \"\", new Value() }, },\n UserLabels = { { \"\", \"\" }, },\n };\n // Make the request\n RecommendResponse response = await recommendationServiceClient.RecommendAsync(request);\n\n### ShutdownDefaultChannelsAsync()\n\n public static Task ShutdownDefaultChannelsAsync()\n\nShuts down any channels automatically created by [Create()](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient#Google_Cloud_DiscoveryEngine_V1_RecommendationServiceClient_Create) and\n[CreateAsync(CancellationToken)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient#Google_Cloud_DiscoveryEngine_V1_RecommendationServiceClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not\naffected.\n\n**Remarks** \nAfter calling this method, further calls to [Create()](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient#Google_Cloud_DiscoveryEngine_V1_RecommendationServiceClient_Create) and\n[CreateAsync(CancellationToken)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.RecommendationServiceClient#Google_Cloud_DiscoveryEngine_V1_RecommendationServiceClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down\nby another call to this method."]]