public abstract class VersionsClient
Reference documentation and code samples for the Google Cloud Dialogflow v2 API class VersionsClient.
Versions client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Dialogflow.V2Assembly
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 | |
---|---|
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default Versions scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default Versions scopes are:
GrpcClient
public virtual Versions.VersionsClient GrpcClient { get; }
The underlying gRPC Versions client
Property Value | |
---|---|
Type | Description |
Versions.VersionsClient |
LocationsClient
public virtual LocationsClient LocationsClient { get; }
The LocationsClient associated with this client.
Property Value | |
---|---|
Type | Description |
LocationsClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | AgentName Required. The agent to create a version for. Supported formats:
|
version | Version Required. The version to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Version | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | CreateVersionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Version | The RPC response. |
// 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 | |
---|---|
Name | Description |
parent | String Required. The agent to create a version for. Supported formats:
|
version | Version Required. The version to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Version | The RPC response. |
// 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 | |
---|---|
Name | Description |
parent | AgentName Required. The agent to create a version for. Supported formats:
|
version | Version Required. The version to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | AgentName Required. The agent to create a version for. Supported formats:
|
version | Version Required. The version to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | CreateVersionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | CreateVersionRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | String Required. The agent to create a version for. Supported formats:
|
version | Version Required. The version to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | String Required. The agent to create a version for. Supported formats:
|
version | Version Required. The version to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | DeleteVersionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// 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 | |
---|---|
Name | Description |
name | VersionName Required. The name of the version to delete. Supported formats:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// 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 | |
---|---|
Name | Description |
name | String Required. The name of the version to delete. Supported formats:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// 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 | |
---|---|
Name | Description |
request | DeleteVersionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | DeleteVersionRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | VersionName Required. The name of the version to delete. Supported formats:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | VersionName Required. The name of the version to delete. Supported formats:
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | String Required. The name of the version to delete. Supported formats:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | String Required. The name of the version to delete. Supported formats:
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetVersionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Version | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | VersionName Required. The name of the version. Supported formats:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Version | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | String Required. The name of the version. Supported formats:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Version | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetVersionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetVersionRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | VersionName Required. The name of the version. Supported formats:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | VersionName Required. The name of the version. Supported formats:
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | String Required. The name of the version. Supported formats:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | String Required. The name of the version. Supported formats:
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | AgentName Required. The agent to list all versions from. Supported formats:
|
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListVersionsResponse, Version> | A pageable sequence of Version resources. |
// 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 | |
---|---|
Name | Description |
request | ListVersionsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListVersionsResponse, Version> | A pageable sequence of Version resources. |
// 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 | |
---|---|
Name | Description |
parent | String Required. The agent to list all versions from. Supported formats:
|
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListVersionsResponse, Version> | A pageable sequence of Version resources. |
// 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 | |
---|---|
Name | Description |
parent | AgentName Required. The agent to list all versions from. Supported formats:
|
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListVersionsResponse, Version> | A pageable asynchronous sequence of Version resources. |
// 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 | |
---|---|
Name | Description |
request | ListVersionsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListVersionsResponse, Version> | A pageable asynchronous sequence of Version resources. |
// 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 | |
---|---|
Name | Description |
parent | String Required. The agent to list all versions from. Supported formats:
|
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListVersionsResponse, Version> | A pageable asynchronous sequence of Version resources. |
// 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 | |
---|---|
Type | Description |
Task | A task representing the asynchronous shutdown operation. |
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 | |
---|---|
Name | Description |
request | UpdateVersionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Version | The RPC response. |
// 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 | |
---|---|
Name | Description |
version | Version Required. The version to update. Supported formats:
|
updateMask | FieldMask Required. The mask to control which fields get updated. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Version | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | UpdateVersionRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | UpdateVersionRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
version | Version Required. The version to update. Supported formats:
|
updateMask | FieldMask Required. The mask to control which fields get updated. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
version | Version Required. The version to update. Supported formats:
|
updateMask | FieldMask Required. The mask to control which fields get updated. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Version> | A Task containing the RPC response. |
// 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);