# Cloud Natural Language v2 API - Class LanguageServiceClient (1.0.0-beta06)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [1.0.0-beta06 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.LanguageServiceClient)
- [1.0.0-beta05](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/1.0.0-beta05/Google.Cloud.Language.V2.LanguageServiceClient)

    public abstract class LanguageServiceClient

Reference documentation and code samples for the Cloud Natural Language v2 API class LanguageServiceClient.

LanguageService client wrapper, for convenient use.

## Inheritance

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

## 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

[LanguageServiceClientImpl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.LanguageServiceClientImpl)

## Namespace

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

## Assembly

Google.Cloud.Language.V2.dll

## Remarks

Provides text analysis operations such as sentiment analysis and entity
recognition.

## Properties

### DefaultEndpoint

    public static string DefaultEndpoint { get; }

The default endpoint for the LanguageService service, which is a host of "language.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 LanguageService 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 LanguageService scopes are:

- <https://www.googleapis.com/auth/cloud-language>
- <https://www.googleapis.com/auth/cloud-platform>

<br />

### GrpcClient

    public virtual LanguageService.LanguageServiceClient GrpcClient { get; }

The underlying gRPC LanguageService client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.LanguageServicehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.LanguageService.LanguageServiceClient` |   |

### 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

### AnalyzeEntities(AnalyzeEntitiesRequest, CallSettings)

    public virtual AnalyzeEntitiesResponse AnalyzeEntities(AnalyzeEntitiesRequest request, CallSettings callSettings = null)

Finds named entities (currently proper names and common nouns) in the text
along with entity types, probability, mentions for each entity, and
other properties.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeEntitiesRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeEntitiesResponse` | The RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = LanguageServiceClient.Create();
    // Initialize request argument(s)
    AnalyzeEntitiesRequest request = new AnalyzeEntitiesRequest
    {
        Document = new Document(),
        EncodingType = EncodingType.None,
    };
    // Make the request
    AnalyzeEntitiesResponse response = languageServiceClient.AnalyzeEntities(request);

### AnalyzeEntities(Document, CallSettings)

    public virtual AnalyzeEntitiesResponse AnalyzeEntities(Document document, CallSettings callSettings = null)

Finds named entities (currently proper names and common nouns) in the text
along with entity types, probability, mentions for each entity, and
other properties.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeEntitiesResponse` | The RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = LanguageServiceClient.Create();
    // Initialize request argument(s)
    Document document = new Document();
    // Make the request
    AnalyzeEntitiesResponse response = languageServiceClient.AnalyzeEntities(document);

### AnalyzeEntities(Document, EncodingType, CallSettings)

    public virtual AnalyzeEntitiesResponse AnalyzeEntities(Document document, EncodingType encodingType, CallSettings callSettings = null)

Finds named entities (currently proper names and common nouns) in the text
along with entity types, probability, mentions for each entity, and
other properties.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `encodingType` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.EncodingType` The encoding type used by the API to calculate offsets. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeEntitiesResponse` | The RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = LanguageServiceClient.Create();
    // Initialize request argument(s)
    Document document = new Document();
    EncodingType encodingType = EncodingType.None;
    // Make the request
    AnalyzeEntitiesResponse response = languageServiceClient.AnalyzeEntities(document, encodingType);

### AnalyzeEntitiesAsync(AnalyzeEntitiesRequest, CallSettings)

    public virtual Task<AnalyzeEntitiesResponse> AnalyzeEntitiesAsync(AnalyzeEntitiesRequest request, CallSettings callSettings = null)

Finds named entities (currently proper names and common nouns) in the text
along with entity types, probability, mentions for each entity, and
other properties.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeEntitiesRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeEntitiesResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    AnalyzeEntitiesRequest request = new AnalyzeEntitiesRequest
    {
        Document = new Document(),
        EncodingType = EncodingType.None,
    };
    // Make the request
    AnalyzeEntitiesResponse response = await languageServiceClient.AnalyzeEntitiesAsync(request);

### AnalyzeEntitiesAsync(AnalyzeEntitiesRequest, CancellationToken)

    public virtual Task<AnalyzeEntitiesResponse> AnalyzeEntitiesAsync(AnalyzeEntitiesRequest request, CancellationToken cancellationToken)

Finds named entities (currently proper names and common nouns) in the text
along with entity types, probability, mentions for each entity, and
other properties.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeEntitiesRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeEntitiesResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    AnalyzeEntitiesRequest request = new AnalyzeEntitiesRequest
    {
        Document = new Document(),
        EncodingType = EncodingType.None,
    };
    // Make the request
    AnalyzeEntitiesResponse response = await languageServiceClient.AnalyzeEntitiesAsync(request);

### AnalyzeEntitiesAsync(Document, CallSettings)

    public virtual Task<AnalyzeEntitiesResponse> AnalyzeEntitiesAsync(Document document, CallSettings callSettings = null)

Finds named entities (currently proper names and common nouns) in the text
along with entity types, probability, mentions for each entity, and
other properties.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeEntitiesResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    // Make the request
    AnalyzeEntitiesResponse response = await languageServiceClient.AnalyzeEntitiesAsync(document);

### AnalyzeEntitiesAsync(Document, EncodingType, CallSettings)

    public virtual Task<AnalyzeEntitiesResponse> AnalyzeEntitiesAsync(Document document, EncodingType encodingType, CallSettings callSettings = null)

Finds named entities (currently proper names and common nouns) in the text
along with entity types, probability, mentions for each entity, and
other properties.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `encodingType` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.EncodingType` The encoding type used by the API to calculate offsets. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeEntitiesResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    EncodingType encodingType = EncodingType.None;
    // Make the request
    AnalyzeEntitiesResponse response = await languageServiceClient.AnalyzeEntitiesAsync(document, encodingType);

### AnalyzeEntitiesAsync(Document, EncodingType, CancellationToken)

    public virtual Task<AnalyzeEntitiesResponse> AnalyzeEntitiesAsync(Document document, EncodingType encodingType, CancellationToken cancellationToken)

Finds named entities (currently proper names and common nouns) in the text
along with entity types, probability, mentions for each entity, and
other properties.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `encodingType` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.EncodingType` The encoding type used by the API to calculate offsets. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeEntitiesResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    EncodingType encodingType = EncodingType.None;
    // Make the request
    AnalyzeEntitiesResponse response = await languageServiceClient.AnalyzeEntitiesAsync(document, encodingType);

### AnalyzeEntitiesAsync(Document, CancellationToken)

    public virtual Task<AnalyzeEntitiesResponse> AnalyzeEntitiesAsync(Document document, CancellationToken cancellationToken)

Finds named entities (currently proper names and common nouns) in the text
along with entity types, probability, mentions for each entity, and
other properties.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeEntitiesResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    // Make the request
    AnalyzeEntitiesResponse response = await languageServiceClient.AnalyzeEntitiesAsync(document);

### AnalyzeSentiment(AnalyzeSentimentRequest, CallSettings)

    public virtual AnalyzeSentimentResponse AnalyzeSentiment(AnalyzeSentimentRequest request, CallSettings callSettings = null)

Analyzes the sentiment of the provided text.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeSentimentRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeSentimentResponse` | The RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = LanguageServiceClient.Create();
    // Initialize request argument(s)
    AnalyzeSentimentRequest request = new AnalyzeSentimentRequest
    {
        Document = new Document(),
        EncodingType = EncodingType.None,
    };
    // Make the request
    AnalyzeSentimentResponse response = languageServiceClient.AnalyzeSentiment(request);

### AnalyzeSentiment(Document, CallSettings)

    public virtual AnalyzeSentimentResponse AnalyzeSentiment(Document document, CallSettings callSettings = null)

Analyzes the sentiment of the provided text.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeSentimentResponse` | The RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = LanguageServiceClient.Create();
    // Initialize request argument(s)
    Document document = new Document();
    // Make the request
    AnalyzeSentimentResponse response = languageServiceClient.AnalyzeSentiment(document);

### AnalyzeSentiment(Document, EncodingType, CallSettings)

    public virtual AnalyzeSentimentResponse AnalyzeSentiment(Document document, EncodingType encodingType, CallSettings callSettings = null)

Analyzes the sentiment of the provided text.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `encodingType` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.EncodingType` The encoding type used by the API to calculate sentence offsets. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeSentimentResponse` | The RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = LanguageServiceClient.Create();
    // Initialize request argument(s)
    Document document = new Document();
    EncodingType encodingType = EncodingType.None;
    // Make the request
    AnalyzeSentimentResponse response = languageServiceClient.AnalyzeSentiment(document, encodingType);

### AnalyzeSentimentAsync(AnalyzeSentimentRequest, CallSettings)

    public virtual Task<AnalyzeSentimentResponse> AnalyzeSentimentAsync(AnalyzeSentimentRequest request, CallSettings callSettings = null)

Analyzes the sentiment of the provided text.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeSentimentRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeSentimentResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    AnalyzeSentimentRequest request = new AnalyzeSentimentRequest
    {
        Document = new Document(),
        EncodingType = EncodingType.None,
    };
    // Make the request
    AnalyzeSentimentResponse response = await languageServiceClient.AnalyzeSentimentAsync(request);

### AnalyzeSentimentAsync(AnalyzeSentimentRequest, CancellationToken)

    public virtual Task<AnalyzeSentimentResponse> AnalyzeSentimentAsync(AnalyzeSentimentRequest request, CancellationToken cancellationToken)

Analyzes the sentiment of the provided text.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeSentimentRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeSentimentResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    AnalyzeSentimentRequest request = new AnalyzeSentimentRequest
    {
        Document = new Document(),
        EncodingType = EncodingType.None,
    };
    // Make the request
    AnalyzeSentimentResponse response = await languageServiceClient.AnalyzeSentimentAsync(request);

### AnalyzeSentimentAsync(Document, CallSettings)

    public virtual Task<AnalyzeSentimentResponse> AnalyzeSentimentAsync(Document document, CallSettings callSettings = null)

Analyzes the sentiment of the provided text.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeSentimentResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    // Make the request
    AnalyzeSentimentResponse response = await languageServiceClient.AnalyzeSentimentAsync(document);

### AnalyzeSentimentAsync(Document, EncodingType, CallSettings)

    public virtual Task<AnalyzeSentimentResponse> AnalyzeSentimentAsync(Document document, EncodingType encodingType, CallSettings callSettings = null)

Analyzes the sentiment of the provided text.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `encodingType` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.EncodingType` The encoding type used by the API to calculate sentence offsets. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeSentimentResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    EncodingType encodingType = EncodingType.None;
    // Make the request
    AnalyzeSentimentResponse response = await languageServiceClient.AnalyzeSentimentAsync(document, encodingType);

### AnalyzeSentimentAsync(Document, EncodingType, CancellationToken)

    public virtual Task<AnalyzeSentimentResponse> AnalyzeSentimentAsync(Document document, EncodingType encodingType, CancellationToken cancellationToken)

Analyzes the sentiment of the provided text.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `encodingType` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.EncodingType` The encoding type used by the API to calculate sentence offsets. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeSentimentResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    EncodingType encodingType = EncodingType.None;
    // Make the request
    AnalyzeSentimentResponse response = await languageServiceClient.AnalyzeSentimentAsync(document, encodingType);

### AnalyzeSentimentAsync(Document, CancellationToken)

    public virtual Task<AnalyzeSentimentResponse> AnalyzeSentimentAsync(Document document, CancellationToken cancellationToken)

Analyzes the sentiment of the provided text.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnalyzeSentimentResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    // Make the request
    AnalyzeSentimentResponse response = await languageServiceClient.AnalyzeSentimentAsync(document);

### AnnotateText(AnnotateTextRequest, CallSettings)

    public virtual AnnotateTextResponse AnnotateText(AnnotateTextRequest request, CallSettings callSettings = null)

A convenience method that provides all features in one call.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextResponse` | The RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = LanguageServiceClient.Create();
    // Initialize request argument(s)
    AnnotateTextRequest request = new AnnotateTextRequest
    {
        Document = new Document(),
        Features = new AnnotateTextRequest.Types.Features(),
        EncodingType = EncodingType.None,
    };
    // Make the request
    AnnotateTextResponse response = languageServiceClient.AnnotateText(request);

### AnnotateText(Document, Features, CallSettings)

    public virtual AnnotateTextResponse AnnotateText(Document document, AnnotateTextRequest.Types.Features features, CallSettings callSettings = null)

A convenience method that provides all features in one call.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `features` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest.Types.Features` Required. The enabled features. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextResponse` | The RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = LanguageServiceClient.Create();
    // Initialize request argument(s)
    Document document = new Document();
    AnnotateTextRequest.Types.Features features = new AnnotateTextRequest.Types.Features();
    // Make the request
    AnnotateTextResponse response = languageServiceClient.AnnotateText(document, features);

### AnnotateText(Document, Features, EncodingType, CallSettings)

    public virtual AnnotateTextResponse AnnotateText(Document document, AnnotateTextRequest.Types.Features features, EncodingType encodingType, CallSettings callSettings = null)

A convenience method that provides all features in one call.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `features` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest.Types.Features` Required. The enabled features. |
| `encodingType` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.EncodingType` The encoding type used by the API to calculate offsets. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextResponse` | The RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = LanguageServiceClient.Create();
    // Initialize request argument(s)
    Document document = new Document();
    AnnotateTextRequest.Types.Features features = new AnnotateTextRequest.Types.Features();
    EncodingType encodingType = EncodingType.None;
    // Make the request
    AnnotateTextResponse response = languageServiceClient.AnnotateText(document, features, encodingType);

### AnnotateTextAsync(AnnotateTextRequest, CallSettings)

    public virtual Task<AnnotateTextResponse> AnnotateTextAsync(AnnotateTextRequest request, CallSettings callSettings = null)

A convenience method that provides all features in one call.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    AnnotateTextRequest request = new AnnotateTextRequest
    {
        Document = new Document(),
        Features = new AnnotateTextRequest.Types.Features(),
        EncodingType = EncodingType.None,
    };
    // Make the request
    AnnotateTextResponse response = await languageServiceClient.AnnotateTextAsync(request);

### AnnotateTextAsync(AnnotateTextRequest, CancellationToken)

    public virtual Task<AnnotateTextResponse> AnnotateTextAsync(AnnotateTextRequest request, CancellationToken cancellationToken)

A convenience method that provides all features in one call.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    AnnotateTextRequest request = new AnnotateTextRequest
    {
        Document = new Document(),
        Features = new AnnotateTextRequest.Types.Features(),
        EncodingType = EncodingType.None,
    };
    // Make the request
    AnnotateTextResponse response = await languageServiceClient.AnnotateTextAsync(request);

### AnnotateTextAsync(Document, Features, CallSettings)

    public virtual Task<AnnotateTextResponse> AnnotateTextAsync(Document document, AnnotateTextRequest.Types.Features features, CallSettings callSettings = null)

A convenience method that provides all features in one call.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `features` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest.Types.Features` Required. The enabled features. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    AnnotateTextRequest.Types.Features features = new AnnotateTextRequest.Types.Features();
    // Make the request
    AnnotateTextResponse response = await languageServiceClient.AnnotateTextAsync(document, features);

### AnnotateTextAsync(Document, Features, EncodingType, CallSettings)

    public virtual Task<AnnotateTextResponse> AnnotateTextAsync(Document document, AnnotateTextRequest.Types.Features features, EncodingType encodingType, CallSettings callSettings = null)

A convenience method that provides all features in one call.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `features` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest.Types.Features` Required. The enabled features. |
| `encodingType` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.EncodingType` The encoding type used by the API to calculate offsets. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    AnnotateTextRequest.Types.Features features = new AnnotateTextRequest.Types.Features();
    EncodingType encodingType = EncodingType.None;
    // Make the request
    AnnotateTextResponse response = await languageServiceClient.AnnotateTextAsync(document, features, encodingType);

### AnnotateTextAsync(Document, Features, EncodingType, CancellationToken)

    public virtual Task<AnnotateTextResponse> AnnotateTextAsync(Document document, AnnotateTextRequest.Types.Features features, EncodingType encodingType, CancellationToken cancellationToken)

A convenience method that provides all features in one call.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `features` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest.Types.Features` Required. The enabled features. |
| `encodingType` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.EncodingType` The encoding type used by the API to calculate offsets. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    AnnotateTextRequest.Types.Features features = new AnnotateTextRequest.Types.Features();
    EncodingType encodingType = EncodingType.None;
    // Make the request
    AnnotateTextResponse response = await languageServiceClient.AnnotateTextAsync(document, features, encodingType);

### AnnotateTextAsync(Document, Features, CancellationToken)

    public virtual Task<AnnotateTextResponse> AnnotateTextAsync(Document document, AnnotateTextRequest.Types.Features features, CancellationToken cancellationToken)

A convenience method that provides all features in one call.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `features` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequesthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextRequest.Types.Features` Required. The enabled features. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.AnnotateTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    AnnotateTextRequest.Types.Features features = new AnnotateTextRequest.Types.Features();
    // Make the request
    AnnotateTextResponse response = await languageServiceClient.AnnotateTextAsync(document, features);

### ClassifyText(ClassifyTextRequest, CallSettings)

    public virtual ClassifyTextResponse ClassifyText(ClassifyTextRequest request, CallSettings callSettings = null)

Classifies a document into categories.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.ClassifyTextRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.ClassifyTextResponse` | The RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = LanguageServiceClient.Create();
    // Initialize request argument(s)
    ClassifyTextRequest request = new ClassifyTextRequest
    {
        Document = new Document(),
    };
    // Make the request
    ClassifyTextResponse response = languageServiceClient.ClassifyText(request);

### ClassifyText(Document, CallSettings)

    public virtual ClassifyTextResponse ClassifyText(Document document, CallSettings callSettings = null)

Classifies a document into categories.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.ClassifyTextResponse` | The RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = LanguageServiceClient.Create();
    // Initialize request argument(s)
    Document document = new Document();
    // Make the request
    ClassifyTextResponse response = languageServiceClient.ClassifyText(document);

### ClassifyTextAsync(ClassifyTextRequest, CallSettings)

    public virtual Task<ClassifyTextResponse> ClassifyTextAsync(ClassifyTextRequest request, CallSettings callSettings = null)

Classifies a document into categories.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.ClassifyTextRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.ClassifyTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    ClassifyTextRequest request = new ClassifyTextRequest
    {
        Document = new Document(),
    };
    // Make the request
    ClassifyTextResponse response = await languageServiceClient.ClassifyTextAsync(request);

### ClassifyTextAsync(ClassifyTextRequest, CancellationToken)

    public virtual Task<ClassifyTextResponse> ClassifyTextAsync(ClassifyTextRequest request, CancellationToken cancellationToken)

Classifies a document into categories.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.ClassifyTextRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.ClassifyTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    ClassifyTextRequest request = new ClassifyTextRequest
    {
        Document = new Document(),
    };
    // Make the request
    ClassifyTextResponse response = await languageServiceClient.ClassifyTextAsync(request);

### ClassifyTextAsync(Document, CallSettings)

    public virtual Task<ClassifyTextResponse> ClassifyTextAsync(Document document, CallSettings callSettings = null)

Classifies a document into categories.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.ClassifyTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    // Make the request
    ClassifyTextResponse response = await languageServiceClient.ClassifyTextAsync(document);

### ClassifyTextAsync(Document, CancellationToken)

    public virtual Task<ClassifyTextResponse> ClassifyTextAsync(Document document, CancellationToken cancellationToken)

Classifies a document into categories.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.ClassifyTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    // Make the request
    ClassifyTextResponse response = await languageServiceClient.ClassifyTextAsync(document);

### Create()

    public static LanguageServiceClient Create()

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

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

### CreateAsync(CancellationToken)

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

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

| **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.Language.V2/latest/Google.Cloud.Language.V2.LanguageServiceClient` | The task representing the created [LanguageServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.LanguageServiceClient). |

### ModerateText(Document, CallSettings)

    public virtual ModerateTextResponse ModerateText(Document document, CallSettings callSettings = null)

Moderates a document for harmful and sensitive categories.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.ModerateTextResponse` | The RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = LanguageServiceClient.Create();
    // Initialize request argument(s)
    Document document = new Document();
    // Make the request
    ModerateTextResponse response = languageServiceClient.ModerateText(document);

### ModerateText(ModerateTextRequest, CallSettings)

    public virtual ModerateTextResponse ModerateText(ModerateTextRequest request, CallSettings callSettings = null)

Moderates a document for harmful and sensitive categories.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.ModerateTextRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.ModerateTextResponse` | The RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = LanguageServiceClient.Create();
    // Initialize request argument(s)
    ModerateTextRequest request = new ModerateTextRequest
    {
        Document = new Document(),
        ModelVersion = ModerateTextRequest.Types.ModelVersion.Unspecified,
    };
    // Make the request
    ModerateTextResponse response = languageServiceClient.ModerateText(request);

### ModerateTextAsync(Document, CallSettings)

    public virtual Task<ModerateTextResponse> ModerateTextAsync(Document document, CallSettings callSettings = null)

Moderates a document for harmful and sensitive categories.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.ModerateTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    // Make the request
    ModerateTextResponse response = await languageServiceClient.ModerateTextAsync(document);

### ModerateTextAsync(Document, CancellationToken)

    public virtual Task<ModerateTextResponse> ModerateTextAsync(Document document, CancellationToken cancellationToken)

Moderates a document for harmful and sensitive categories.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `document` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.Document` Required. Input document. |
| `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.Language.V2/latest/Google.Cloud.Language.V2.ModerateTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    Document document = new Document();
    // Make the request
    ModerateTextResponse response = await languageServiceClient.ModerateTextAsync(document);

### ModerateTextAsync(ModerateTextRequest, CallSettings)

    public virtual Task<ModerateTextResponse> ModerateTextAsync(ModerateTextRequest request, CallSettings callSettings = null)

Moderates a document for harmful and sensitive categories.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.ModerateTextRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.ModerateTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    ModerateTextRequest request = new ModerateTextRequest
    {
        Document = new Document(),
        ModelVersion = ModerateTextRequest.Types.ModelVersion.Unspecified,
    };
    // Make the request
    ModerateTextResponse response = await languageServiceClient.ModerateTextAsync(request);

### ModerateTextAsync(ModerateTextRequest, CancellationToken)

    public virtual Task<ModerateTextResponse> ModerateTextAsync(ModerateTextRequest request, CancellationToken cancellationToken)

Moderates a document for harmful and sensitive categories.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.ModerateTextRequest` 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.Language.V2/latest/Google.Cloud.Language.V2.ModerateTextResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    LanguageServiceClient languageServiceClient = await LanguageServiceClient.CreateAsync();
    // Initialize request argument(s)
    ModerateTextRequest request = new ModerateTextRequest
    {
        Document = new Document(),
        ModelVersion = ModerateTextRequest.Types.ModelVersion.Unspecified,
    };
    // Make the request
    ModerateTextResponse response = await languageServiceClient.ModerateTextAsync(request);

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.LanguageServiceClient#Google_Cloud_Language_V2_LanguageServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.LanguageServiceClient#Google_Cloud_Language_V2_LanguageServiceClient_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.Language.V2/latest/Google.Cloud.Language.V2.LanguageServiceClient#Google_Cloud_Language_V2_LanguageServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Language.V2/latest/Google.Cloud.Language.V2.LanguageServiceClient#Google_Cloud_Language_V2_LanguageServiceClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.