Class DeploymentsClient (1.5.0)

public abstract class DeploymentsClient

Deployments client wrapper, for convenient use.

Inheritance

Object > DeploymentsClient

Derived Types

Namespace

Google.Cloud.Dialogflow.Cx.V3

Assembly

Google.Cloud.Dialogflow.Cx.V3.dll

Remarks

Service for managing [Deployments][google.cloud.dialogflow.cx.v3.Deployment].

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Deployments scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

GrpcClient

public virtual Deployments.DeploymentsClient GrpcClient { get; }

The underlying gRPC Deployments client

Property Value
TypeDescription
Deployments.DeploymentsClient

Methods

Create()

public static DeploymentsClient Create()

Synchronously creates a DeploymentsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DeploymentsClientBuilder.

Returns
TypeDescription
DeploymentsClient

The created DeploymentsClient.

CreateAsync(CancellationToken)

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

Asynchronously creates a DeploymentsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DeploymentsClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<DeploymentsClient>

The task representing the created DeploymentsClient.

GetDeployment(DeploymentName, CallSettings)

public virtual Deployment GetDeployment(DeploymentName name, CallSettings callSettings = null)

Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment].

Parameters
NameDescription
nameDeploymentName

Required. The name of the [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. Format: projects/&amp;lt;Project ID&amp;gt;/locations/&amp;lt;Location ID&amp;gt;/agents/&amp;lt;Agent ID&amp;gt;/environments/&amp;lt;Environment ID&amp;gt;/deployments/&amp;lt;Deployment ID&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Deployment

The RPC response.

Example
// Create client
DeploymentsClient deploymentsClient = DeploymentsClient.Create();
// Initialize request argument(s)
DeploymentName name = DeploymentName.FromProjectLocationAgentEnvironmentDeployment("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]");
// Make the request
Deployment response = deploymentsClient.GetDeployment(name);

GetDeployment(GetDeploymentRequest, CallSettings)

public virtual Deployment GetDeployment(GetDeploymentRequest request, CallSettings callSettings = null)

Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment].

Parameters
NameDescription
requestGetDeploymentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Deployment

The RPC response.

Example
// Create client
DeploymentsClient deploymentsClient = DeploymentsClient.Create();
// Initialize request argument(s)
GetDeploymentRequest request = new GetDeploymentRequest
{
    DeploymentName = DeploymentName.FromProjectLocationAgentEnvironmentDeployment("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]"),
};
// Make the request
Deployment response = deploymentsClient.GetDeployment(request);

GetDeployment(String, CallSettings)

public virtual Deployment GetDeployment(string name, CallSettings callSettings = null)

Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment].

Parameters
NameDescription
nameString

Required. The name of the [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. Format: projects/&amp;lt;Project ID&amp;gt;/locations/&amp;lt;Location ID&amp;gt;/agents/&amp;lt;Agent ID&amp;gt;/environments/&amp;lt;Environment ID&amp;gt;/deployments/&amp;lt;Deployment ID&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Deployment

The RPC response.

Example
// Create client
DeploymentsClient deploymentsClient = DeploymentsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/agents/[AGENT]/environments/[ENVIRONMENT]/deployments/[DEPLOYMENT]";
// Make the request
Deployment response = deploymentsClient.GetDeployment(name);

GetDeploymentAsync(DeploymentName, CallSettings)

public virtual Task<Deployment> GetDeploymentAsync(DeploymentName name, CallSettings callSettings = null)

Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment].

Parameters
NameDescription
nameDeploymentName

Required. The name of the [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. Format: projects/&amp;lt;Project ID&amp;gt;/locations/&amp;lt;Location ID&amp;gt;/agents/&amp;lt;Agent ID&amp;gt;/environments/&amp;lt;Environment ID&amp;gt;/deployments/&amp;lt;Deployment ID&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Deployment>

A Task containing the RPC response.

Example
// Create client
DeploymentsClient deploymentsClient = await DeploymentsClient.CreateAsync();
// Initialize request argument(s)
DeploymentName name = DeploymentName.FromProjectLocationAgentEnvironmentDeployment("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]");
// Make the request
Deployment response = await deploymentsClient.GetDeploymentAsync(name);

GetDeploymentAsync(DeploymentName, CancellationToken)

public virtual Task<Deployment> GetDeploymentAsync(DeploymentName name, CancellationToken cancellationToken)

Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment].

Parameters
NameDescription
nameDeploymentName

Required. The name of the [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. Format: projects/&amp;lt;Project ID&amp;gt;/locations/&amp;lt;Location ID&amp;gt;/agents/&amp;lt;Agent ID&amp;gt;/environments/&amp;lt;Environment ID&amp;gt;/deployments/&amp;lt;Deployment ID&amp;gt;.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Deployment>

A Task containing the RPC response.

Example
// Create client
DeploymentsClient deploymentsClient = await DeploymentsClient.CreateAsync();
// Initialize request argument(s)
DeploymentName name = DeploymentName.FromProjectLocationAgentEnvironmentDeployment("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]");
// Make the request
Deployment response = await deploymentsClient.GetDeploymentAsync(name);

GetDeploymentAsync(GetDeploymentRequest, CallSettings)

public virtual Task<Deployment> GetDeploymentAsync(GetDeploymentRequest request, CallSettings callSettings = null)

Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment].

Parameters
NameDescription
requestGetDeploymentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Deployment>

A Task containing the RPC response.

Example
// Create client
DeploymentsClient deploymentsClient = await DeploymentsClient.CreateAsync();
// Initialize request argument(s)
GetDeploymentRequest request = new GetDeploymentRequest
{
    DeploymentName = DeploymentName.FromProjectLocationAgentEnvironmentDeployment("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]"),
};
// Make the request
Deployment response = await deploymentsClient.GetDeploymentAsync(request);

GetDeploymentAsync(GetDeploymentRequest, CancellationToken)

public virtual Task<Deployment> GetDeploymentAsync(GetDeploymentRequest request, CancellationToken cancellationToken)

Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment].

Parameters
NameDescription
requestGetDeploymentRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Deployment>

A Task containing the RPC response.

Example
// Create client
DeploymentsClient deploymentsClient = await DeploymentsClient.CreateAsync();
// Initialize request argument(s)
GetDeploymentRequest request = new GetDeploymentRequest
{
    DeploymentName = DeploymentName.FromProjectLocationAgentEnvironmentDeployment("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[DEPLOYMENT]"),
};
// Make the request
Deployment response = await deploymentsClient.GetDeploymentAsync(request);

GetDeploymentAsync(String, CallSettings)

public virtual Task<Deployment> GetDeploymentAsync(string name, CallSettings callSettings = null)

Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment].

Parameters
NameDescription
nameString

Required. The name of the [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. Format: projects/&amp;lt;Project ID&amp;gt;/locations/&amp;lt;Location ID&amp;gt;/agents/&amp;lt;Agent ID&amp;gt;/environments/&amp;lt;Environment ID&amp;gt;/deployments/&amp;lt;Deployment ID&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Deployment>

A Task containing the RPC response.

Example
// Create client
DeploymentsClient deploymentsClient = await DeploymentsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/agents/[AGENT]/environments/[ENVIRONMENT]/deployments/[DEPLOYMENT]";
// Make the request
Deployment response = await deploymentsClient.GetDeploymentAsync(name);

GetDeploymentAsync(String, CancellationToken)

public virtual Task<Deployment> GetDeploymentAsync(string name, CancellationToken cancellationToken)

Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3.Deployment].

Parameters
NameDescription
nameString

Required. The name of the [Deployment][google.cloud.dialogflow.cx.v3.Deployment]. Format: projects/&amp;lt;Project ID&amp;gt;/locations/&amp;lt;Location ID&amp;gt;/agents/&amp;lt;Agent ID&amp;gt;/environments/&amp;lt;Environment ID&amp;gt;/deployments/&amp;lt;Deployment ID&amp;gt;.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Deployment>

A Task containing the RPC response.

Example
// Create client
DeploymentsClient deploymentsClient = await DeploymentsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/agents/[AGENT]/environments/[ENVIRONMENT]/deployments/[DEPLOYMENT]";
// Make the request
Deployment response = await deploymentsClient.GetDeploymentAsync(name);

ListDeployments(EnvironmentName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListDeploymentsResponse, Deployment> ListDeployments(EnvironmentName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Returns the list of all deployments in the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].

Parameters
NameDescription
parentEnvironmentName

Required. The [Environment][google.cloud.dialogflow.cx.v3.Environment] to list all environments for. Format: projects/&amp;lt;Project ID&amp;gt;/locations/&amp;lt;Location ID&amp;gt;/agents/&amp;lt;Agent ID&amp;gt;/environments/&amp;lt;Environment ID&amp;gt;.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListDeploymentsResponse, Deployment>

A pageable sequence of Deployment resources.

Example
// Create client
DeploymentsClient deploymentsClient = DeploymentsClient.Create();
// Initialize request argument(s)
EnvironmentName parent = EnvironmentName.FromProjectLocationAgentEnvironment("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
// Make the request
PagedEnumerable<ListDeploymentsResponse, Deployment> response = deploymentsClient.ListDeployments(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Deployment 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 (ListDeploymentsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Deployment 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<Deployment> 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 (Deployment 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;

ListDeployments(ListDeploymentsRequest, CallSettings)

public virtual PagedEnumerable<ListDeploymentsResponse, Deployment> ListDeployments(ListDeploymentsRequest request, CallSettings callSettings = null)

Returns the list of all deployments in the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].

Parameters
NameDescription
requestListDeploymentsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListDeploymentsResponse, Deployment>

A pageable sequence of Deployment resources.

Example
// Create client
DeploymentsClient deploymentsClient = DeploymentsClient.Create();
// Initialize request argument(s)
ListDeploymentsRequest request = new ListDeploymentsRequest
{
    ParentAsEnvironmentName = EnvironmentName.FromProjectLocationAgentEnvironment("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"),
};
// Make the request
PagedEnumerable<ListDeploymentsResponse, Deployment> response = deploymentsClient.ListDeployments(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Deployment 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 (ListDeploymentsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Deployment 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<Deployment> 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 (Deployment 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;

ListDeployments(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListDeploymentsResponse, Deployment> ListDeployments(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Returns the list of all deployments in the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].

Parameters
NameDescription
parentString

Required. The [Environment][google.cloud.dialogflow.cx.v3.Environment] to list all environments for. Format: projects/&amp;lt;Project ID&amp;gt;/locations/&amp;lt;Location ID&amp;gt;/agents/&amp;lt;Agent ID&amp;gt;/environments/&amp;lt;Environment ID&amp;gt;.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListDeploymentsResponse, Deployment>

A pageable sequence of Deployment resources.

Example
// Create client
DeploymentsClient deploymentsClient = DeploymentsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/agents/[AGENT]/environments/[ENVIRONMENT]";
// Make the request
PagedEnumerable<ListDeploymentsResponse, Deployment> response = deploymentsClient.ListDeployments(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Deployment 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 (ListDeploymentsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Deployment 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<Deployment> 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 (Deployment 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;

ListDeploymentsAsync(EnvironmentName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListDeploymentsResponse, Deployment> ListDeploymentsAsync(EnvironmentName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Returns the list of all deployments in the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].

Parameters
NameDescription
parentEnvironmentName

Required. The [Environment][google.cloud.dialogflow.cx.v3.Environment] to list all environments for. Format: projects/&amp;lt;Project ID&amp;gt;/locations/&amp;lt;Location ID&amp;gt;/agents/&amp;lt;Agent ID&amp;gt;/environments/&amp;lt;Environment ID&amp;gt;.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListDeploymentsResponse, Deployment>

A pageable asynchronous sequence of Deployment resources.

Example
// Create client
DeploymentsClient deploymentsClient = await DeploymentsClient.CreateAsync();
// Initialize request argument(s)
EnvironmentName parent = EnvironmentName.FromProjectLocationAgentEnvironment("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
// Make the request
PagedAsyncEnumerable<ListDeploymentsResponse, Deployment> response = deploymentsClient.ListDeploymentsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Deployment item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListDeploymentsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Deployment 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<Deployment> 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 (Deployment 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;

ListDeploymentsAsync(ListDeploymentsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListDeploymentsResponse, Deployment> ListDeploymentsAsync(ListDeploymentsRequest request, CallSettings callSettings = null)

Returns the list of all deployments in the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].

Parameters
NameDescription
requestListDeploymentsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListDeploymentsResponse, Deployment>

A pageable asynchronous sequence of Deployment resources.

Example
// Create client
DeploymentsClient deploymentsClient = await DeploymentsClient.CreateAsync();
// Initialize request argument(s)
ListDeploymentsRequest request = new ListDeploymentsRequest
{
    ParentAsEnvironmentName = EnvironmentName.FromProjectLocationAgentEnvironment("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"),
};
// Make the request
PagedAsyncEnumerable<ListDeploymentsResponse, Deployment> response = deploymentsClient.ListDeploymentsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Deployment item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListDeploymentsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Deployment 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<Deployment> 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 (Deployment 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;

ListDeploymentsAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListDeploymentsResponse, Deployment> ListDeploymentsAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Returns the list of all deployments in the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].

Parameters
NameDescription
parentString

Required. The [Environment][google.cloud.dialogflow.cx.v3.Environment] to list all environments for. Format: projects/&amp;lt;Project ID&amp;gt;/locations/&amp;lt;Location ID&amp;gt;/agents/&amp;lt;Agent ID&amp;gt;/environments/&amp;lt;Environment ID&amp;gt;.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListDeploymentsResponse, Deployment>

A pageable asynchronous sequence of Deployment resources.

Example
// Create client
DeploymentsClient deploymentsClient = await DeploymentsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/agents/[AGENT]/environments/[ENVIRONMENT]";
// Make the request
PagedAsyncEnumerable<ListDeploymentsResponse, Deployment> response = deploymentsClient.ListDeploymentsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Deployment item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListDeploymentsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Deployment 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<Deployment> 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 (Deployment 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()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.