1.0.0-beta25 (latest) 1.0.0-beta24

    public abstract class RankServiceClient

Reference documentation and code samples for the Discovery Engine v1beta API class RankServiceClient.

RankService client wrapper, for convenient use.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> RankServiceClient

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Derived Types

[RankServiceClientImpl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServiceClientImpl)

## Namespace

[Google.Cloud.DiscoveryEngine.V1Beta](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta)

## Assembly

Google.Cloud.DiscoveryEngine.V1Beta.dll

## Remarks

Service for ranking text records.

## Properties

### DefaultEndpoint

    public static string DefaultEndpoint { get; }

The default endpoint for the RankService service, which is a host of "discoveryengine.googleapis.com" and a
port of 443.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DefaultScopes

    public static IReadOnlyList<string> DefaultScopes { get; }

The default RankService scopes.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** The default RankService scopes are:

- <https://www.googleapis.com/auth/cloud-platform>
- <https://www.googleapis.com/auth/discoveryengine.readwrite>
- <https://www.googleapis.com/auth/discoveryengine.serving.readwrite>

### GrpcClient

    public virtual RankService.RankServiceClient GrpcClient { get; }

The underlying gRPC RankService client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServicehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankService.RankServiceClient` |   |

### LocationsClient

    public virtual LocationsClient LocationsClient { get; }

The [LocationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html) associated with this client.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html` |   |

### ServiceMetadata

    public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ServiceMetadata.html` |   |

## Methods

### Create()

    public static RankServiceClient Create()

Synchronously creates a [RankServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServiceClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [RankServiceClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServiceClientBuilder).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServiceClient` | The created [RankServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServiceClient). |

### CreateAsync(CancellationToken)

    public static Task<RankServiceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a [RankServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServiceClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [RankServiceClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServiceClientBuilder).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use while creating the client. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServiceClient` | The task representing the created [RankServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServiceClient). |

### Rank(RankRequest, CallSettings)

    public virtual RankResponse Rank(RankRequest request, CallSettings callSettings = null)

Ranks a list of text records based on the given input query.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankResponse` | The RPC response. |

**Example**

    // Create client
    RankServiceClient rankServiceClient = RankServiceClient.Create();
    // Initialize request argument(s)
    RankRequest request = new RankRequest
    {
        RankingConfigAsRankingConfigName = RankingConfigName.FromProjectLocationRankingConfig("[PROJECT]", "[LOCATION]", "[RANKING_CONFIG]"),
        Model = "",
        TopN = 0,
        Query = "",
        Records =
        {
            new RankingRecord(),
        },
        IgnoreRecordDetailsInResponse = false,
        UserLabels = { { "", "" }, },
    };
    // Make the request
    RankResponse response = rankServiceClient.Rank(request);

### RankAsync(RankRequest, CallSettings)

    public virtual Task<RankResponse> RankAsync(RankRequest request, CallSettings callSettings = null)

Ranks a list of text records based on the given input query.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    RankServiceClient rankServiceClient = await RankServiceClient.CreateAsync();
    // Initialize request argument(s)
    RankRequest request = new RankRequest
    {
        RankingConfigAsRankingConfigName = RankingConfigName.FromProjectLocationRankingConfig("[PROJECT]", "[LOCATION]", "[RANKING_CONFIG]"),
        Model = "",
        TopN = 0,
        Query = "",
        Records =
        {
            new RankingRecord(),
        },
        IgnoreRecordDetailsInResponse = false,
        UserLabels = { { "", "" }, },
    };
    // Make the request
    RankResponse response = await rankServiceClient.RankAsync(request);

### RankAsync(RankRequest, CancellationToken)

    public virtual Task<RankResponse> RankAsync(RankRequest request, CancellationToken cancellationToken)

Ranks a list of text records based on the given input query.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    RankServiceClient rankServiceClient = await RankServiceClient.CreateAsync();
    // Initialize request argument(s)
    RankRequest request = new RankRequest
    {
        RankingConfigAsRankingConfigName = RankingConfigName.FromProjectLocationRankingConfig("[PROJECT]", "[LOCATION]", "[RANKING_CONFIG]"),
        Model = "",
        TopN = 0,
        Query = "",
        Records =
        {
            new RankingRecord(),
        },
        IgnoreRecordDetailsInResponse = false,
        UserLabels = { { "", "" }, },
    };
    // Make the request
    RankResponse response = await rankServiceClient.RankAsync(request);

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServiceClient#Google_Cloud_DiscoveryEngine_V1Beta_RankServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServiceClient#Google_Cloud_DiscoveryEngine_V1Beta_RankServiceClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not
affected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous shutdown operation. |

**Remarks** After calling this method, further calls to [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServiceClient#Google_Cloud_DiscoveryEngine_V1Beta_RankServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1Beta/latest/Google.Cloud.DiscoveryEngine.V1Beta.RankServiceClient#Google_Cloud_DiscoveryEngine_V1Beta_RankServiceClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.