[![](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/logo.svg)](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/index.html)
- 
[Show / Hide Table of Contents](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClient#sidetoggle) DeveloperKnowledge client wrapper, for convenient use.

##### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) DeveloperKnowledgeClient [DeveloperKnowledgeClientImpl](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClientImpl)

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

###### **Namespace** : [Google](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google).[Developers](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers).[DeveloperKnowledge](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge).[V1](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1)

###### **Assembly**: Google.Developers.DeveloperKnowledge.V1.dll

##### Syntax

    public abstract class DeveloperKnowledgeClient

##### **Remarks**

The Developer Knowledge API provides programmatic access to Google's public
developer documentation, enabling you to integrate this knowledge base into
your own applications and workflows.

The API is designed to be the canonical source for machine-readable access to
Google's developer documentation.

A typical use case is to first use
\[DeveloperKnowledge.SearchDocumentChunks\]\[google.developers.knowledge.v1.DeveloperKnowledge.SearchDocumentChunks\]
to find relevant page URIs based on a query, and then use
\[DeveloperKnowledge.GetDocument\]\[google.developers.knowledge.v1.DeveloperKnowledge.GetDocument\]
or
\[DeveloperKnowledge.BatchGetDocuments\]\[google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments\]
to fetch the full content of the top results.

All document content is provided in Markdown format.

### Properties

#### DefaultEndpoint

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

##### Declaration

    public static string DefaultEndpoint { get; }

##### Property Value

| Type | Description |
|---|---|
| [string](https://learn.microsoft.com/dotnet/api/system.string) |   |

#### DefaultScopes

The default DeveloperKnowledge scopes.

##### Declaration

    public static IReadOnlyList<string> DefaultScopes { get; }

##### Property Value

| Type | Description |
|---|---|
| [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\> |   |

##### Remarks

The default DeveloperKnowledge scopes are:

- https://www.googleapis.com/auth/cloud-platform

#### GrpcClient

The underlying gRPC DeveloperKnowledge client

##### Declaration

    public virtual DeveloperKnowledge.DeveloperKnowledgeClient GrpcClient { get; }

##### Property Value

| Type | Description |
|---|---|
| [DeveloperKnowledge](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledge).[DeveloperKnowledgeClient](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledge.DeveloperKnowledgeClient) |   |

#### ServiceMetadata

The service metadata associated with this client type.

##### Declaration

    public static ServiceMetadata ServiceMetadata { get; }

##### Property Value

| Type | Description |
|---|---|
| [ServiceMetadata](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ServiceMetadata.html) |   |

### Methods

#### BatchGetDocuments(BatchGetDocumentsRequest, CallSettings)

Retrieves multiple documents, each with its full Markdown content.

##### Declaration

    public virtual BatchGetDocumentsResponse BatchGetDocuments(BatchGetDocumentsRequest request, CallSettings callSettings = null)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [BatchGetDocumentsRequest](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.BatchGetDocumentsRequest) | request | 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) | callSettings | If not null, applies overrides to this RPC call. |

##### Returns

| Type | Description |
|---|---|
| [BatchGetDocumentsResponse](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.BatchGetDocumentsResponse) | The RPC response. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = DeveloperKnowledgeClient.Create();
    // Initialize request argument(s)
    BatchGetDocumentsRequest request = new BatchGetDocumentsRequest
    {
        DocumentNames =
        {
            DocumentName.FromDocument("[DOCUMENT]"),
        },
        View = DocumentView.Unspecified,
    };
    // Make the request
    BatchGetDocumentsResponse response = developerKnowledgeClient.BatchGetDocuments(request);

#### BatchGetDocumentsAsync(BatchGetDocumentsRequest, CallSettings)

Retrieves multiple documents, each with its full Markdown content.

##### Declaration

    public virtual Task<BatchGetDocumentsResponse> BatchGetDocumentsAsync(BatchGetDocumentsRequest request, CallSettings callSettings = null)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [BatchGetDocumentsRequest](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.BatchGetDocumentsRequest) | request | 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) | callSettings | If not null, applies overrides to this RPC call. |

##### Returns

| Type | Description |
|---|---|
| [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[BatchGetDocumentsResponse](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.BatchGetDocumentsResponse)\> | A Task containing the RPC response. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = await DeveloperKnowledgeClient.CreateAsync();
    // Initialize request argument(s)
    BatchGetDocumentsRequest request = new BatchGetDocumentsRequest
    {
        DocumentNames =
        {
            DocumentName.FromDocument("[DOCUMENT]"),
        },
        View = DocumentView.Unspecified,
    };
    // Make the request
    BatchGetDocumentsResponse response = await developerKnowledgeClient.BatchGetDocumentsAsync(request);

#### BatchGetDocumentsAsync(BatchGetDocumentsRequest, CancellationToken)

Retrieves multiple documents, each with its full Markdown content.

##### Declaration

    public virtual Task<BatchGetDocumentsResponse> BatchGetDocumentsAsync(BatchGetDocumentsRequest request, CancellationToken cancellationToken)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [BatchGetDocumentsRequest](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.BatchGetDocumentsRequest) | request | The request object containing all of the parameters for the API call. |
| [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) | cancellationToken | A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

##### Returns

| Type | Description |
|---|---|
| [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[BatchGetDocumentsResponse](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.BatchGetDocumentsResponse)\> | A Task containing the RPC response. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = await DeveloperKnowledgeClient.CreateAsync();
    // Initialize request argument(s)
    BatchGetDocumentsRequest request = new BatchGetDocumentsRequest
    {
        DocumentNames =
        {
            DocumentName.FromDocument("[DOCUMENT]"),
        },
        View = DocumentView.Unspecified,
    };
    // Make the request
    BatchGetDocumentsResponse response = await developerKnowledgeClient.BatchGetDocumentsAsync(request);

#### Create()

Synchronously creates a [DeveloperKnowledgeClient](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [DeveloperKnowledgeClientBuilder](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClientBuilder)
.

##### Declaration

    public static DeveloperKnowledgeClient Create()

##### Returns

| Type | Description |
|---|---|
| [DeveloperKnowledgeClient](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClient) | The created [DeveloperKnowledgeClient](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClient). |

#### CreateAsync(CancellationToken)

Asynchronously creates a [DeveloperKnowledgeClient](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [DeveloperKnowledgeClientBuilder](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClientBuilder)
.

##### Declaration

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

##### Parameters

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

##### Returns

| Type | Description |
|---|---|
| [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[DeveloperKnowledgeClient](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClient)\> | The task representing the created [DeveloperKnowledgeClient](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClient). |

#### GetDocument(DocumentName, CallSettings)

Retrieves a single document with its full Markdown content.

##### Declaration

    public virtual Document GetDocument(DocumentName name, CallSettings callSettings = null)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [DocumentName](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DocumentName) | name | Required. Specifies the name of the document to retrieve. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` |
| [CallSettings](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html) | callSettings | If not null, applies overrides to this RPC call. |

##### Returns

| Type | Description |
|---|---|
| [Document](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.Document) | The RPC response. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = DeveloperKnowledgeClient.Create();
    // Initialize request argument(s)
    DocumentName name = DocumentName.FromDocument("[DOCUMENT]");
    // Make the request
    Document response = developerKnowledgeClient.GetDocument(name);

#### GetDocument(GetDocumentRequest, CallSettings)

Retrieves a single document with its full Markdown content.

##### Declaration

    public virtual Document GetDocument(GetDocumentRequest request, CallSettings callSettings = null)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [GetDocumentRequest](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.GetDocumentRequest) | request | 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) | callSettings | If not null, applies overrides to this RPC call. |

##### Returns

| Type | Description |
|---|---|
| [Document](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.Document) | The RPC response. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = DeveloperKnowledgeClient.Create();
    // Initialize request argument(s)
    GetDocumentRequest request = new GetDocumentRequest
    {
        DocumentName = DocumentName.FromDocument("[DOCUMENT]"),
        View = DocumentView.Unspecified,
    };
    // Make the request
    Document response = developerKnowledgeClient.GetDocument(request);

#### GetDocument(string, CallSettings)

Retrieves a single document with its full Markdown content.

##### Declaration

    public virtual Document GetDocument(string name, CallSettings callSettings = null)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [string](https://learn.microsoft.com/dotnet/api/system.string) | name | Required. Specifies the name of the document to retrieve. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` |
| [CallSettings](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html) | callSettings | If not null, applies overrides to this RPC call. |

##### Returns

| Type | Description |
|---|---|
| [Document](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.Document) | The RPC response. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = DeveloperKnowledgeClient.Create();
    // Initialize request argument(s)
    string name = "documents/[DOCUMENT]";
    // Make the request
    Document response = developerKnowledgeClient.GetDocument(name);

#### GetDocumentAsync(DocumentName, CallSettings)

Retrieves a single document with its full Markdown content.

##### Declaration

    public virtual Task<Document> GetDocumentAsync(DocumentName name, CallSettings callSettings = null)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [DocumentName](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DocumentName) | name | Required. Specifies the name of the document to retrieve. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` |
| [CallSettings](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html) | callSettings | If not null, applies overrides to this RPC call. |

##### Returns

| Type | Description |
|---|---|
| [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[Document](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.Document)\> | A Task containing the RPC response. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = await DeveloperKnowledgeClient.CreateAsync();
    // Initialize request argument(s)
    DocumentName name = DocumentName.FromDocument("[DOCUMENT]");
    // Make the request
    Document response = await developerKnowledgeClient.GetDocumentAsync(name);

#### GetDocumentAsync(DocumentName, CancellationToken)

Retrieves a single document with its full Markdown content.

##### Declaration

    public virtual Task<Document> GetDocumentAsync(DocumentName name, CancellationToken cancellationToken)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [DocumentName](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DocumentName) | name | Required. Specifies the name of the document to retrieve. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` |
| [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) | cancellationToken | A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

##### Returns

| Type | Description |
|---|---|
| [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[Document](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.Document)\> | A Task containing the RPC response. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = await DeveloperKnowledgeClient.CreateAsync();
    // Initialize request argument(s)
    DocumentName name = DocumentName.FromDocument("[DOCUMENT]");
    // Make the request
    Document response = await developerKnowledgeClient.GetDocumentAsync(name);

#### GetDocumentAsync(GetDocumentRequest, CallSettings)

Retrieves a single document with its full Markdown content.

##### Declaration

    public virtual Task<Document> GetDocumentAsync(GetDocumentRequest request, CallSettings callSettings = null)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [GetDocumentRequest](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.GetDocumentRequest) | request | 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) | callSettings | If not null, applies overrides to this RPC call. |

##### Returns

| Type | Description |
|---|---|
| [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[Document](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.Document)\> | A Task containing the RPC response. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = await DeveloperKnowledgeClient.CreateAsync();
    // Initialize request argument(s)
    GetDocumentRequest request = new GetDocumentRequest
    {
        DocumentName = DocumentName.FromDocument("[DOCUMENT]"),
        View = DocumentView.Unspecified,
    };
    // Make the request
    Document response = await developerKnowledgeClient.GetDocumentAsync(request);

#### GetDocumentAsync(GetDocumentRequest, CancellationToken)

Retrieves a single document with its full Markdown content.

##### Declaration

    public virtual Task<Document> GetDocumentAsync(GetDocumentRequest request, CancellationToken cancellationToken)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [GetDocumentRequest](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.GetDocumentRequest) | request | The request object containing all of the parameters for the API call. |
| [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) | cancellationToken | A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

##### Returns

| Type | Description |
|---|---|
| [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[Document](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.Document)\> | A Task containing the RPC response. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = await DeveloperKnowledgeClient.CreateAsync();
    // Initialize request argument(s)
    GetDocumentRequest request = new GetDocumentRequest
    {
        DocumentName = DocumentName.FromDocument("[DOCUMENT]"),
        View = DocumentView.Unspecified,
    };
    // Make the request
    Document response = await developerKnowledgeClient.GetDocumentAsync(request);

#### GetDocumentAsync(string, CallSettings)

Retrieves a single document with its full Markdown content.

##### Declaration

    public virtual Task<Document> GetDocumentAsync(string name, CallSettings callSettings = null)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [string](https://learn.microsoft.com/dotnet/api/system.string) | name | Required. Specifies the name of the document to retrieve. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` |
| [CallSettings](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html) | callSettings | If not null, applies overrides to this RPC call. |

##### Returns

| Type | Description |
|---|---|
| [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[Document](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.Document)\> | A Task containing the RPC response. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = await DeveloperKnowledgeClient.CreateAsync();
    // Initialize request argument(s)
    string name = "documents/[DOCUMENT]";
    // Make the request
    Document response = await developerKnowledgeClient.GetDocumentAsync(name);

#### GetDocumentAsync(string, CancellationToken)

Retrieves a single document with its full Markdown content.

##### Declaration

    public virtual Task<Document> GetDocumentAsync(string name, CancellationToken cancellationToken)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [string](https://learn.microsoft.com/dotnet/api/system.string) | name | Required. Specifies the name of the document to retrieve. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets` |
| [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) | cancellationToken | A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

##### Returns

| Type | Description |
|---|---|
| [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[Document](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.Document)\> | A Task containing the RPC response. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = await DeveloperKnowledgeClient.CreateAsync();
    // Initialize request argument(s)
    string name = "documents/[DOCUMENT]";
    // Make the request
    Document response = await developerKnowledgeClient.GetDocumentAsync(name);

#### SearchDocumentChunks(SearchDocumentChunksRequest, CallSettings)

Searches for developer knowledge across Google's developer documentation.
Returns \[DocumentChunk\]\[google.developers.knowledge.v1.DocumentChunk\]s
based on the user's query. There may be many chunks from the same
\[Document\]\[google.developers.knowledge.v1.Document\]. To retrieve full
documents, use
\[DeveloperKnowledge.GetDocument\]\[google.developers.knowledge.v1.DeveloperKnowledge.GetDocument\]
or
\[DeveloperKnowledge.BatchGetDocuments\]\[google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments\]
with the
\[DocumentChunk.parent\]\[google.developers.knowledge.v1.DocumentChunk.parent\]
returned in the
\[SearchDocumentChunksResponse.results\]\[google.developers.knowledge.v1.SearchDocumentChunksResponse.results\].

##### Declaration

    public virtual PagedEnumerable<SearchDocumentChunksResponse, DocumentChunk> SearchDocumentChunks(SearchDocumentChunksRequest request, CallSettings callSettings = null)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [SearchDocumentChunksRequest](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.SearchDocumentChunksRequest) | request | 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) | callSettings | If not null, applies overrides to this RPC call. |

##### Returns

| Type | Description |
|---|---|
| [PagedEnumerable](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.html)\<[SearchDocumentChunksResponse](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.SearchDocumentChunksResponse), [DocumentChunk](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DocumentChunk)\> | A pageable sequence of [DocumentChunk](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DocumentChunk) resources. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = DeveloperKnowledgeClient.Create();
    // Initialize request argument(s)
    SearchDocumentChunksRequest request = new SearchDocumentChunksRequest
    {
        Query = "",
        Filter = "",
    };
    // Make the request
    PagedEnumerable<SearchDocumentChunksResponse, DocumentChunk> response = developerKnowledgeClient.SearchDocumentChunks(request);

    // Iterate over all response items, lazily performing RPCs as required
    foreach (DocumentChunk item in response)
    {
        // Do something with each item
        Console.WriteLine(item);
    }

    // Or iterate over pages (of server-defined size), performing one RPC per page
    foreach (SearchDocumentChunksResponse page in response.AsRawResponses())
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (DocumentChunk item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    }

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<DocumentChunk> singlePage = response.ReadPage(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (DocumentChunk item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

#### SearchDocumentChunksAsync(SearchDocumentChunksRequest, CallSettings)

Searches for developer knowledge across Google's developer documentation.
Returns \[DocumentChunk\]\[google.developers.knowledge.v1.DocumentChunk\]s
based on the user's query. There may be many chunks from the same
\[Document\]\[google.developers.knowledge.v1.Document\]. To retrieve full
documents, use
\[DeveloperKnowledge.GetDocument\]\[google.developers.knowledge.v1.DeveloperKnowledge.GetDocument\]
or
\[DeveloperKnowledge.BatchGetDocuments\]\[google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments\]
with the
\[DocumentChunk.parent\]\[google.developers.knowledge.v1.DocumentChunk.parent\]
returned in the
\[SearchDocumentChunksResponse.results\]\[google.developers.knowledge.v1.SearchDocumentChunksResponse.results\].

##### Declaration

    public virtual PagedAsyncEnumerable<SearchDocumentChunksResponse, DocumentChunk> SearchDocumentChunksAsync(SearchDocumentChunksRequest request, CallSettings callSettings = null)

##### Parameters

| Type | Name | Description |
|---|---|---|
| [SearchDocumentChunksRequest](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.SearchDocumentChunksRequest) | request | 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) | callSettings | If not null, applies overrides to this RPC call. |

##### Returns

| Type | Description |
|---|---|
| [PagedAsyncEnumerable](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.html)\<[SearchDocumentChunksResponse](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.SearchDocumentChunksResponse), [DocumentChunk](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DocumentChunk)\> | A pageable asynchronous sequence of [DocumentChunk](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DocumentChunk) resources. |

##### Sample code

    // Create client
    DeveloperKnowledgeClient developerKnowledgeClient = await DeveloperKnowledgeClient.CreateAsync();
    // Initialize request argument(s)
    SearchDocumentChunksRequest request = new SearchDocumentChunksRequest
    {
        Query = "",
        Filter = "",
    };
    // Make the request
    PagedAsyncEnumerable<SearchDocumentChunksResponse, DocumentChunk> response = developerKnowledgeClient.SearchDocumentChunksAsync(request);

    // Iterate over all response items, lazily performing RPCs as required
    await foreach (DocumentChunk item in response)
    {
        // Do something with each item
        Console.WriteLine(item);
    }

    // Or iterate over pages (of server-defined size), performing one RPC per page
    await foreach (SearchDocumentChunksResponse page in response.AsRawResponses())
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (DocumentChunk item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    }

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<DocumentChunk> singlePage = await response.ReadPageAsync(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (DocumentChunk item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

#### ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClient#Google_Developers_DeveloperKnowledge_V1_DeveloperKnowledgeClient_Create) and
[CreateAsync(CancellationToken)](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClient#Google_Developers_DeveloperKnowledge_V1_DeveloperKnowledgeClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not
affected.

##### Declaration

    public static Task ShutdownDefaultChannelsAsync()

##### Returns

| Type | Description |
|---|---|
| [Task](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://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClient#Google_Developers_DeveloperKnowledge_V1_DeveloperKnowledgeClient_Create) and
[CreateAsync(CancellationToken)](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClient#Google_Developers_DeveloperKnowledge_V1_DeveloperKnowledgeClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.

##### In this article

[Back to top](https://developers.google.com/dotnet/docs/reference/Google.Developers.DeveloperKnowledge.V1/latest/api/Google.Developers.DeveloperKnowledge.V1.DeveloperKnowledgeClient#top) Generated by **DocFX**