Google Cloud Dialogflow v2 API - Class VersionsClient (4.5.0)

public abstract class VersionsClient

Reference documentation and code samples for the Google Cloud Dialogflow v2 API class VersionsClient.

Versions client wrapper, for convenient use.

Inheritance

Object > VersionsClient

Derived Types

Namespace

Google.Cloud.Dialogflow.V2

Assembly

Google.Cloud.Dialogflow.V2.dll

Remarks

Service for managing [Versions][google.cloud.dialogflow.v2.Version].

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the Versions 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 Versions scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

GrpcClient

public virtual Versions.VersionsClient GrpcClient { get; }

The underlying gRPC Versions client

Property Value
TypeDescription
Versions.VersionsClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
TypeDescription
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static VersionsClient Create()

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

Returns
TypeDescription
VersionsClient

The created VersionsClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<VersionsClient>

The task representing the created VersionsClient.

CreateVersion(AgentName, Version, CallSettings)

public virtual Version CreateVersion(AgentName parent, Version version, CallSettings callSettings = null)

Creates an agent version.

The new version points to the agent instance in the "default" environment.

Parameters
NameDescription
parentAgentName

Required. The agent to create a version for. Supported formats:

  • projects/&lt;Project ID>/agent
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent
versionVersion

Required. The version to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Version

The RPC response.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
AgentName parent = AgentName.FromProject("[PROJECT]");
gcdv::Version version = new gcdv::Version();
// Make the request
gcdv::Version response = versionsClient.CreateVersion(parent, version);

CreateVersion(CreateVersionRequest, CallSettings)

public virtual Version CreateVersion(CreateVersionRequest request, CallSettings callSettings = null)

Creates an agent version.

The new version points to the agent instance in the "default" environment.

Parameters
NameDescription
requestCreateVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Version

The RPC response.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
CreateVersionRequest request = new CreateVersionRequest
{
    ParentAsAgentName = AgentName.FromProject("[PROJECT]"),
    Version = new gcdv::Version(),
};
// Make the request
gcdv::Version response = versionsClient.CreateVersion(request);

CreateVersion(String, Version, CallSettings)

public virtual Version CreateVersion(string parent, Version version, CallSettings callSettings = null)

Creates an agent version.

The new version points to the agent instance in the "default" environment.

Parameters
NameDescription
parentString

Required. The agent to create a version for. Supported formats:

  • projects/&lt;Project ID>/agent
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent
versionVersion

Required. The version to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Version

The RPC response.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/agent";
gcdv::Version version = new gcdv::Version();
// Make the request
gcdv::Version response = versionsClient.CreateVersion(parent, version);

CreateVersionAsync(AgentName, Version, CallSettings)

public virtual Task<Version> CreateVersionAsync(AgentName parent, Version version, CallSettings callSettings = null)

Creates an agent version.

The new version points to the agent instance in the "default" environment.

Parameters
NameDescription
parentAgentName

Required. The agent to create a version for. Supported formats:

  • projects/&lt;Project ID>/agent
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent
versionVersion

Required. The version to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Version>

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
AgentName parent = AgentName.FromProject("[PROJECT]");
gcdv::Version version = new gcdv::Version();
// Make the request
gcdv::Version response = await versionsClient.CreateVersionAsync(parent, version);

CreateVersionAsync(AgentName, Version, CancellationToken)

public virtual Task<Version> CreateVersionAsync(AgentName parent, Version version, CancellationToken cancellationToken)

Creates an agent version.

The new version points to the agent instance in the "default" environment.

Parameters
NameDescription
parentAgentName

Required. The agent to create a version for. Supported formats:

  • projects/&lt;Project ID>/agent
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent
versionVersion

Required. The version to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Version>

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
AgentName parent = AgentName.FromProject("[PROJECT]");
gcdv::Version version = new gcdv::Version();
// Make the request
gcdv::Version response = await versionsClient.CreateVersionAsync(parent, version);

CreateVersionAsync(CreateVersionRequest, CallSettings)

public virtual Task<Version> CreateVersionAsync(CreateVersionRequest request, CallSettings callSettings = null)

Creates an agent version.

The new version points to the agent instance in the "default" environment.

Parameters
NameDescription
requestCreateVersionRequest

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

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
CreateVersionRequest request = new CreateVersionRequest
{
    ParentAsAgentName = AgentName.FromProject("[PROJECT]"),
    Version = new gcdv::Version(),
};
// Make the request
gcdv::Version response = await versionsClient.CreateVersionAsync(request);

CreateVersionAsync(CreateVersionRequest, CancellationToken)

public virtual Task<Version> CreateVersionAsync(CreateVersionRequest request, CancellationToken cancellationToken)

Creates an agent version.

The new version points to the agent instance in the "default" environment.

Parameters
NameDescription
requestCreateVersionRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Version>

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
CreateVersionRequest request = new CreateVersionRequest
{
    ParentAsAgentName = AgentName.FromProject("[PROJECT]"),
    Version = new gcdv::Version(),
};
// Make the request
gcdv::Version response = await versionsClient.CreateVersionAsync(request);

CreateVersionAsync(String, Version, CallSettings)

public virtual Task<Version> CreateVersionAsync(string parent, Version version, CallSettings callSettings = null)

Creates an agent version.

The new version points to the agent instance in the "default" environment.

Parameters
NameDescription
parentString

Required. The agent to create a version for. Supported formats:

  • projects/&lt;Project ID>/agent
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent
versionVersion

Required. The version to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Version>

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/agent";
gcdv::Version version = new gcdv::Version();
// Make the request
gcdv::Version response = await versionsClient.CreateVersionAsync(parent, version);

CreateVersionAsync(String, Version, CancellationToken)

public virtual Task<Version> CreateVersionAsync(string parent, Version version, CancellationToken cancellationToken)

Creates an agent version.

The new version points to the agent instance in the "default" environment.

Parameters
NameDescription
parentString

Required. The agent to create a version for. Supported formats:

  • projects/&lt;Project ID>/agent
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent
versionVersion

Required. The version to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Version>

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/agent";
gcdv::Version version = new gcdv::Version();
// Make the request
gcdv::Version response = await versionsClient.CreateVersionAsync(parent, version);

DeleteVersion(DeleteVersionRequest, CallSettings)

public virtual void DeleteVersion(DeleteVersionRequest request, CallSettings callSettings = null)

Delete the specified agent version.

Parameters
NameDescription
requestDeleteVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
DeleteVersionRequest request = new DeleteVersionRequest
{
    VersionName = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
};
// Make the request
versionsClient.DeleteVersion(request);

DeleteVersion(VersionName, CallSettings)

public virtual void DeleteVersion(VersionName name, CallSettings callSettings = null)

Delete the specified agent version.

Parameters
NameDescription
nameVersionName

Required. The name of the version to delete. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
VersionName name = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]");
// Make the request
versionsClient.DeleteVersion(name);

DeleteVersion(String, CallSettings)

public virtual void DeleteVersion(string name, CallSettings callSettings = null)

Delete the specified agent version.

Parameters
NameDescription
nameString

Required. The name of the version to delete. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/agent/versions/[VERSION]";
// Make the request
versionsClient.DeleteVersion(name);

DeleteVersionAsync(DeleteVersionRequest, CallSettings)

public virtual Task DeleteVersionAsync(DeleteVersionRequest request, CallSettings callSettings = null)

Delete the specified agent version.

Parameters
NameDescription
requestDeleteVersionRequest

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

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
DeleteVersionRequest request = new DeleteVersionRequest
{
    VersionName = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
};
// Make the request
await versionsClient.DeleteVersionAsync(request);

DeleteVersionAsync(DeleteVersionRequest, CancellationToken)

public virtual Task DeleteVersionAsync(DeleteVersionRequest request, CancellationToken cancellationToken)

Delete the specified agent version.

Parameters
NameDescription
requestDeleteVersionRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
DeleteVersionRequest request = new DeleteVersionRequest
{
    VersionName = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
};
// Make the request
await versionsClient.DeleteVersionAsync(request);

DeleteVersionAsync(VersionName, CallSettings)

public virtual Task DeleteVersionAsync(VersionName name, CallSettings callSettings = null)

Delete the specified agent version.

Parameters
NameDescription
nameVersionName

Required. The name of the version to delete. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
VersionName name = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]");
// Make the request
await versionsClient.DeleteVersionAsync(name);

DeleteVersionAsync(VersionName, CancellationToken)

public virtual Task DeleteVersionAsync(VersionName name, CancellationToken cancellationToken)

Delete the specified agent version.

Parameters
NameDescription
nameVersionName

Required. The name of the version to delete. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
VersionName name = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]");
// Make the request
await versionsClient.DeleteVersionAsync(name);

DeleteVersionAsync(String, CallSettings)

public virtual Task DeleteVersionAsync(string name, CallSettings callSettings = null)

Delete the specified agent version.

Parameters
NameDescription
nameString

Required. The name of the version to delete. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/agent/versions/[VERSION]";
// Make the request
await versionsClient.DeleteVersionAsync(name);

DeleteVersionAsync(String, CancellationToken)

public virtual Task DeleteVersionAsync(string name, CancellationToken cancellationToken)

Delete the specified agent version.

Parameters
NameDescription
nameString

Required. The name of the version to delete. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/agent/versions/[VERSION]";
// Make the request
await versionsClient.DeleteVersionAsync(name);

GetVersion(GetVersionRequest, CallSettings)

public virtual Version GetVersion(GetVersionRequest request, CallSettings callSettings = null)

Retrieves the specified agent version.

Parameters
NameDescription
requestGetVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Version

The RPC response.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
GetVersionRequest request = new GetVersionRequest
{
    VersionName = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
};
// Make the request
gcdv::Version response = versionsClient.GetVersion(request);

GetVersion(VersionName, CallSettings)

public virtual Version GetVersion(VersionName name, CallSettings callSettings = null)

Retrieves the specified agent version.

Parameters
NameDescription
nameVersionName

Required. The name of the version. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Version

The RPC response.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
VersionName name = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]");
// Make the request
gcdv::Version response = versionsClient.GetVersion(name);

GetVersion(String, CallSettings)

public virtual Version GetVersion(string name, CallSettings callSettings = null)

Retrieves the specified agent version.

Parameters
NameDescription
nameString

Required. The name of the version. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Version

The RPC response.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/agent/versions/[VERSION]";
// Make the request
gcdv::Version response = versionsClient.GetVersion(name);

GetVersionAsync(GetVersionRequest, CallSettings)

public virtual Task<Version> GetVersionAsync(GetVersionRequest request, CallSettings callSettings = null)

Retrieves the specified agent version.

Parameters
NameDescription
requestGetVersionRequest

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

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
GetVersionRequest request = new GetVersionRequest
{
    VersionName = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
};
// Make the request
gcdv::Version response = await versionsClient.GetVersionAsync(request);

GetVersionAsync(GetVersionRequest, CancellationToken)

public virtual Task<Version> GetVersionAsync(GetVersionRequest request, CancellationToken cancellationToken)

Retrieves the specified agent version.

Parameters
NameDescription
requestGetVersionRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Version>

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
GetVersionRequest request = new GetVersionRequest
{
    VersionName = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]"),
};
// Make the request
gcdv::Version response = await versionsClient.GetVersionAsync(request);

GetVersionAsync(VersionName, CallSettings)

public virtual Task<Version> GetVersionAsync(VersionName name, CallSettings callSettings = null)

Retrieves the specified agent version.

Parameters
NameDescription
nameVersionName

Required. The name of the version. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Version>

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
VersionName name = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]");
// Make the request
gcdv::Version response = await versionsClient.GetVersionAsync(name);

GetVersionAsync(VersionName, CancellationToken)

public virtual Task<Version> GetVersionAsync(VersionName name, CancellationToken cancellationToken)

Retrieves the specified agent version.

Parameters
NameDescription
nameVersionName

Required. The name of the version. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Version>

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
VersionName name = VersionName.FromProjectVersion("[PROJECT]", "[VERSION]");
// Make the request
gcdv::Version response = await versionsClient.GetVersionAsync(name);

GetVersionAsync(String, CallSettings)

public virtual Task<Version> GetVersionAsync(string name, CallSettings callSettings = null)

Retrieves the specified agent version.

Parameters
NameDescription
nameString

Required. The name of the version. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Version>

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/agent/versions/[VERSION]";
// Make the request
gcdv::Version response = await versionsClient.GetVersionAsync(name);

GetVersionAsync(String, CancellationToken)

public virtual Task<Version> GetVersionAsync(string name, CancellationToken cancellationToken)

Retrieves the specified agent version.

Parameters
NameDescription
nameString

Required. The name of the version. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Version>

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/agent/versions/[VERSION]";
// Make the request
gcdv::Version response = await versionsClient.GetVersionAsync(name);

ListVersions(AgentName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListVersionsResponse, Version> ListVersions(AgentName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns the list of all versions of the specified agent.

Parameters
NameDescription
parentAgentName

Required. The agent to list all versions from. Supported formats:

  • projects/&lt;Project ID>/agent
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent
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<ListVersionsResponse, Version>

A pageable sequence of Version resources.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
AgentName parent = AgentName.FromProject("[PROJECT]");
// Make the request
PagedEnumerable<ListVersionsResponse, gcdv::Version> response = versionsClient.ListVersions(parent);

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

ListVersions(ListVersionsRequest, CallSettings)

public virtual PagedEnumerable<ListVersionsResponse, Version> ListVersions(ListVersionsRequest request, CallSettings callSettings = null)

Returns the list of all versions of the specified agent.

Parameters
NameDescription
requestListVersionsRequest

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<ListVersionsResponse, Version>

A pageable sequence of Version resources.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
ListVersionsRequest request = new ListVersionsRequest
{
    ParentAsAgentName = AgentName.FromProject("[PROJECT]"),
};
// Make the request
PagedEnumerable<ListVersionsResponse, gcdv::Version> response = versionsClient.ListVersions(request);

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

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

public virtual PagedEnumerable<ListVersionsResponse, Version> ListVersions(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns the list of all versions of the specified agent.

Parameters
NameDescription
parentString

Required. The agent to list all versions from. Supported formats:

  • projects/&lt;Project ID>/agent
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent
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<ListVersionsResponse, Version>

A pageable sequence of Version resources.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/agent";
// Make the request
PagedEnumerable<ListVersionsResponse, gcdv::Version> response = versionsClient.ListVersions(parent);

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

ListVersionsAsync(AgentName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListVersionsResponse, Version> ListVersionsAsync(AgentName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns the list of all versions of the specified agent.

Parameters
NameDescription
parentAgentName

Required. The agent to list all versions from. Supported formats:

  • projects/&lt;Project ID>/agent
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent
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<ListVersionsResponse, Version>

A pageable asynchronous sequence of Version resources.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
AgentName parent = AgentName.FromProject("[PROJECT]");
// Make the request
PagedAsyncEnumerable<ListVersionsResponse, gcdv::Version> response = versionsClient.ListVersionsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gcdv::Version 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((ListVersionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gcdv::Version 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<gcdv::Version> 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 (gcdv::Version 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;

ListVersionsAsync(ListVersionsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListVersionsResponse, Version> ListVersionsAsync(ListVersionsRequest request, CallSettings callSettings = null)

Returns the list of all versions of the specified agent.

Parameters
NameDescription
requestListVersionsRequest

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<ListVersionsResponse, Version>

A pageable asynchronous sequence of Version resources.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
ListVersionsRequest request = new ListVersionsRequest
{
    ParentAsAgentName = AgentName.FromProject("[PROJECT]"),
};
// Make the request
PagedAsyncEnumerable<ListVersionsResponse, gcdv::Version> response = versionsClient.ListVersionsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gcdv::Version 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((ListVersionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gcdv::Version 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<gcdv::Version> 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 (gcdv::Version 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;

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

public virtual PagedAsyncEnumerable<ListVersionsResponse, Version> ListVersionsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns the list of all versions of the specified agent.

Parameters
NameDescription
parentString

Required. The agent to list all versions from. Supported formats:

  • projects/&lt;Project ID>/agent
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent
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<ListVersionsResponse, Version>

A pageable asynchronous sequence of Version resources.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/agent";
// Make the request
PagedAsyncEnumerable<ListVersionsResponse, gcdv::Version> response = versionsClient.ListVersionsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gcdv::Version 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((ListVersionsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gcdv::Version 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<gcdv::Version> 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 (gcdv::Version 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.

UpdateVersion(UpdateVersionRequest, CallSettings)

public virtual Version UpdateVersion(UpdateVersionRequest request, CallSettings callSettings = null)

Updates the specified agent version.

Note that this method does not allow you to update the state of the agent the given version points to. It allows you to update only mutable properties of the version resource.

Parameters
NameDescription
requestUpdateVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Version

The RPC response.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
UpdateVersionRequest request = new UpdateVersionRequest
{
    Version = new gcdv::Version(),
    UpdateMask = new FieldMask(),
};
// Make the request
gcdv::Version response = versionsClient.UpdateVersion(request);

UpdateVersion(Version, FieldMask, CallSettings)

public virtual Version UpdateVersion(Version version, FieldMask updateMask, CallSettings callSettings = null)

Updates the specified agent version.

Note that this method does not allow you to update the state of the agent the given version points to. It allows you to update only mutable properties of the version resource.

Parameters
NameDescription
versionVersion

Required. The version to update. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
updateMaskFieldMask

Required. The mask to control which fields get updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Version

The RPC response.

Example
// Create client
VersionsClient versionsClient = VersionsClient.Create();
// Initialize request argument(s)
gcdv::Version version = new gcdv::Version();
FieldMask updateMask = new FieldMask();
// Make the request
gcdv::Version response = versionsClient.UpdateVersion(version, updateMask);

UpdateVersionAsync(UpdateVersionRequest, CallSettings)

public virtual Task<Version> UpdateVersionAsync(UpdateVersionRequest request, CallSettings callSettings = null)

Updates the specified agent version.

Note that this method does not allow you to update the state of the agent the given version points to. It allows you to update only mutable properties of the version resource.

Parameters
NameDescription
requestUpdateVersionRequest

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

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
UpdateVersionRequest request = new UpdateVersionRequest
{
    Version = new gcdv::Version(),
    UpdateMask = new FieldMask(),
};
// Make the request
gcdv::Version response = await versionsClient.UpdateVersionAsync(request);

UpdateVersionAsync(UpdateVersionRequest, CancellationToken)

public virtual Task<Version> UpdateVersionAsync(UpdateVersionRequest request, CancellationToken cancellationToken)

Updates the specified agent version.

Note that this method does not allow you to update the state of the agent the given version points to. It allows you to update only mutable properties of the version resource.

Parameters
NameDescription
requestUpdateVersionRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Version>

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
UpdateVersionRequest request = new UpdateVersionRequest
{
    Version = new gcdv::Version(),
    UpdateMask = new FieldMask(),
};
// Make the request
gcdv::Version response = await versionsClient.UpdateVersionAsync(request);

UpdateVersionAsync(Version, FieldMask, CallSettings)

public virtual Task<Version> UpdateVersionAsync(Version version, FieldMask updateMask, CallSettings callSettings = null)

Updates the specified agent version.

Note that this method does not allow you to update the state of the agent the given version points to. It allows you to update only mutable properties of the version resource.

Parameters
NameDescription
versionVersion

Required. The version to update. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
updateMaskFieldMask

Required. The mask to control which fields get updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Version>

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
gcdv::Version version = new gcdv::Version();
FieldMask updateMask = new FieldMask();
// Make the request
gcdv::Version response = await versionsClient.UpdateVersionAsync(version, updateMask);

UpdateVersionAsync(Version, FieldMask, CancellationToken)

public virtual Task<Version> UpdateVersionAsync(Version version, FieldMask updateMask, CancellationToken cancellationToken)

Updates the specified agent version.

Note that this method does not allow you to update the state of the agent the given version points to. It allows you to update only mutable properties of the version resource.

Parameters
NameDescription
versionVersion

Required. The version to update. Supported formats:

  • projects/&lt;Project ID>/agent/versions/&lt;Version ID>
  • projects/&lt;Project ID>/locations/&lt;Location ID>/agent/versions/&lt;Version ID>
updateMaskFieldMask

Required. The mask to control which fields get updated.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Version>

A Task containing the RPC response.

Example
// Create client
VersionsClient versionsClient = await VersionsClient.CreateAsync();
// Initialize request argument(s)
gcdv::Version version = new gcdv::Version();
FieldMask updateMask = new FieldMask();
// Make the request
gcdv::Version response = await versionsClient.UpdateVersionAsync(version, updateMask);