public abstract class SessionServiceClient
Reference documentation and code samples for the Discovery Engine v1beta API class SessionServiceClient.
SessionService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.DiscoveryEngine.V1BetaAssembly
Google.Cloud.DiscoveryEngine.V1Beta.dll
Remarks
Service for managing Sessions and Session-related resources.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the SessionService service, which is a host of "discoveryengine.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default SessionService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default SessionService scopes are:
GrpcClient
public virtual SessionService.SessionServiceClient GrpcClient { get; }
The underlying gRPC SessionService client
Property Value | |
---|---|
Type | Description |
SessionServiceSessionServiceClient |
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 SessionServiceClient Create()
Synchronously creates a SessionServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SessionServiceClientBuilder.
Returns | |
---|---|
Type | Description |
SessionServiceClient |
The created SessionServiceClient. |
CreateAsync(CancellationToken)
public static Task<SessionServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a SessionServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SessionServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken |
CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskSessionServiceClient |
The task representing the created SessionServiceClient. |
CreateSession(CreateSessionRequest, CallSettings)
public virtual Session CreateSession(CreateSessionRequest request, CallSettings callSettings = null)
Creates a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
request |
CreateSessionRequest 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 |
Session |
The RPC response. |
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
CreateSessionRequest request = new CreateSessionRequest
{
ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
Session = new Session(),
};
// Make the request
Session response = sessionServiceClient.CreateSession(request);
CreateSession(DataStoreName, Session, CallSettings)
public virtual Session CreateSession(DataStoreName parent, Session session, CallSettings callSettings = null)
Creates a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
parent |
DataStoreName Required. Full resource name of parent data store. Format:
|
session |
Session Required. The session to create. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Session |
The RPC response. |
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
DataStoreName parent = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]");
Session session = new Session();
// Make the request
Session response = sessionServiceClient.CreateSession(parent, session);
CreateSession(string, Session, CallSettings)
public virtual Session CreateSession(string parent, Session session, CallSettings callSettings = null)
Creates a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
parent |
string Required. Full resource name of parent data store. Format:
|
session |
Session Required. The session to create. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Session |
The RPC response. |
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]";
Session session = new Session();
// Make the request
Session response = sessionServiceClient.CreateSession(parent, session);
CreateSessionAsync(CreateSessionRequest, CallSettings)
public virtual Task<Session> CreateSessionAsync(CreateSessionRequest request, CallSettings callSettings = null)
Creates a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
request |
CreateSessionRequest 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 |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSessionRequest request = new CreateSessionRequest
{
ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
Session = new Session(),
};
// Make the request
Session response = await sessionServiceClient.CreateSessionAsync(request);
CreateSessionAsync(CreateSessionRequest, CancellationToken)
public virtual Task<Session> CreateSessionAsync(CreateSessionRequest request, CancellationToken cancellationToken)
Creates a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
request |
CreateSessionRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSessionRequest request = new CreateSessionRequest
{
ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
Session = new Session(),
};
// Make the request
Session response = await sessionServiceClient.CreateSessionAsync(request);
CreateSessionAsync(DataStoreName, Session, CallSettings)
public virtual Task<Session> CreateSessionAsync(DataStoreName parent, Session session, CallSettings callSettings = null)
Creates a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
parent |
DataStoreName Required. Full resource name of parent data store. Format:
|
session |
Session Required. The session to create. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
DataStoreName parent = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]");
Session session = new Session();
// Make the request
Session response = await sessionServiceClient.CreateSessionAsync(parent, session);
CreateSessionAsync(DataStoreName, Session, CancellationToken)
public virtual Task<Session> CreateSessionAsync(DataStoreName parent, Session session, CancellationToken cancellationToken)
Creates a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
parent |
DataStoreName Required. Full resource name of parent data store. Format:
|
session |
Session Required. The session to create. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
DataStoreName parent = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]");
Session session = new Session();
// Make the request
Session response = await sessionServiceClient.CreateSessionAsync(parent, session);
CreateSessionAsync(string, Session, CallSettings)
public virtual Task<Session> CreateSessionAsync(string parent, Session session, CallSettings callSettings = null)
Creates a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
parent |
string Required. Full resource name of parent data store. Format:
|
session |
Session Required. The session to create. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]";
Session session = new Session();
// Make the request
Session response = await sessionServiceClient.CreateSessionAsync(parent, session);
CreateSessionAsync(string, Session, CancellationToken)
public virtual Task<Session> CreateSessionAsync(string parent, Session session, CancellationToken cancellationToken)
Creates a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
parent |
string Required. Full resource name of parent data store. Format:
|
session |
Session Required. The session to create. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]";
Session session = new Session();
// Make the request
Session response = await sessionServiceClient.CreateSessionAsync(parent, session);
DeleteSession(DeleteSessionRequest, CallSettings)
public virtual void DeleteSession(DeleteSessionRequest request, CallSettings callSettings = null)
Deletes a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to delete does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
request |
DeleteSessionRequest 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
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
DeleteSessionRequest request = new DeleteSessionRequest
{
SessionName = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]"),
};
// Make the request
sessionServiceClient.DeleteSession(request);
DeleteSession(SessionName, CallSettings)
public virtual void DeleteSession(SessionName name, CallSettings callSettings = null)
Deletes a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to delete does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
name |
SessionName Required. The resource name of the Session to delete. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]");
// Make the request
sessionServiceClient.DeleteSession(name);
DeleteSession(string, CallSettings)
public virtual void DeleteSession(string name, CallSettings callSettings = null)
Deletes a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to delete does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
name |
string Required. The resource name of the Session to delete. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]/sessions/[SESSION]";
// Make the request
sessionServiceClient.DeleteSession(name);
DeleteSessionAsync(DeleteSessionRequest, CallSettings)
public virtual Task DeleteSessionAsync(DeleteSessionRequest request, CallSettings callSettings = null)
Deletes a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to delete does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
request |
DeleteSessionRequest 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
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSessionRequest request = new DeleteSessionRequest
{
SessionName = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]"),
};
// Make the request
await sessionServiceClient.DeleteSessionAsync(request);
DeleteSessionAsync(DeleteSessionRequest, CancellationToken)
public virtual Task DeleteSessionAsync(DeleteSessionRequest request, CancellationToken cancellationToken)
Deletes a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to delete does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
request |
DeleteSessionRequest 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
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSessionRequest request = new DeleteSessionRequest
{
SessionName = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]"),
};
// Make the request
await sessionServiceClient.DeleteSessionAsync(request);
DeleteSessionAsync(SessionName, CallSettings)
public virtual Task DeleteSessionAsync(SessionName name, CallSettings callSettings = null)
Deletes a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to delete does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
name |
SessionName Required. The resource name of the Session to delete. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]");
// Make the request
await sessionServiceClient.DeleteSessionAsync(name);
DeleteSessionAsync(SessionName, CancellationToken)
public virtual Task DeleteSessionAsync(SessionName name, CancellationToken cancellationToken)
Deletes a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to delete does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
name |
SessionName Required. The resource name of the Session to delete. Format:
|
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]");
// Make the request
await sessionServiceClient.DeleteSessionAsync(name);
DeleteSessionAsync(string, CallSettings)
public virtual Task DeleteSessionAsync(string name, CallSettings callSettings = null)
Deletes a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to delete does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
name |
string Required. The resource name of the Session to delete. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]/sessions/[SESSION]";
// Make the request
await sessionServiceClient.DeleteSessionAsync(name);
DeleteSessionAsync(string, CancellationToken)
public virtual Task DeleteSessionAsync(string name, CancellationToken cancellationToken)
Deletes a Session.
If the [Session][google.cloud.discoveryengine.v1beta.Session] to delete does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
name |
string Required. The resource name of the Session to delete. Format:
|
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]/sessions/[SESSION]";
// Make the request
await sessionServiceClient.DeleteSessionAsync(name);
GetSession(GetSessionRequest, CallSettings)
public virtual Session GetSession(GetSessionRequest request, CallSettings callSettings = null)
Gets a Session.
Parameters | |
---|---|
Name | Description |
request |
GetSessionRequest 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 |
Session |
The RPC response. |
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
GetSessionRequest request = new GetSessionRequest
{
SessionName = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]"),
IncludeAnswerDetails = false,
};
// Make the request
Session response = sessionServiceClient.GetSession(request);
GetSession(SessionName, CallSettings)
public virtual Session GetSession(SessionName name, CallSettings callSettings = null)
Gets a Session.
Parameters | |
---|---|
Name | Description |
name |
SessionName Required. The resource name of the Session to get. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Session |
The RPC response. |
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]");
// Make the request
Session response = sessionServiceClient.GetSession(name);
GetSession(string, CallSettings)
public virtual Session GetSession(string name, CallSettings callSettings = null)
Gets a Session.
Parameters | |
---|---|
Name | Description |
name |
string Required. The resource name of the Session to get. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Session |
The RPC response. |
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]/sessions/[SESSION]";
// Make the request
Session response = sessionServiceClient.GetSession(name);
GetSessionAsync(GetSessionRequest, CallSettings)
public virtual Task<Session> GetSessionAsync(GetSessionRequest request, CallSettings callSettings = null)
Gets a Session.
Parameters | |
---|---|
Name | Description |
request |
GetSessionRequest 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 |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
GetSessionRequest request = new GetSessionRequest
{
SessionName = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]"),
IncludeAnswerDetails = false,
};
// Make the request
Session response = await sessionServiceClient.GetSessionAsync(request);
GetSessionAsync(GetSessionRequest, CancellationToken)
public virtual Task<Session> GetSessionAsync(GetSessionRequest request, CancellationToken cancellationToken)
Gets a Session.
Parameters | |
---|---|
Name | Description |
request |
GetSessionRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
GetSessionRequest request = new GetSessionRequest
{
SessionName = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]"),
IncludeAnswerDetails = false,
};
// Make the request
Session response = await sessionServiceClient.GetSessionAsync(request);
GetSessionAsync(SessionName, CallSettings)
public virtual Task<Session> GetSessionAsync(SessionName name, CallSettings callSettings = null)
Gets a Session.
Parameters | |
---|---|
Name | Description |
name |
SessionName Required. The resource name of the Session to get. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]");
// Make the request
Session response = await sessionServiceClient.GetSessionAsync(name);
GetSessionAsync(SessionName, CancellationToken)
public virtual Task<Session> GetSessionAsync(SessionName name, CancellationToken cancellationToken)
Gets a Session.
Parameters | |
---|---|
Name | Description |
name |
SessionName Required. The resource name of the Session to get. Format:
|
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]");
// Make the request
Session response = await sessionServiceClient.GetSessionAsync(name);
GetSessionAsync(string, CallSettings)
public virtual Task<Session> GetSessionAsync(string name, CallSettings callSettings = null)
Gets a Session.
Parameters | |
---|---|
Name | Description |
name |
string Required. The resource name of the Session to get. Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]/sessions/[SESSION]";
// Make the request
Session response = await sessionServiceClient.GetSessionAsync(name);
GetSessionAsync(string, CancellationToken)
public virtual Task<Session> GetSessionAsync(string name, CancellationToken cancellationToken)
Gets a Session.
Parameters | |
---|---|
Name | Description |
name |
string Required. The resource name of the Session to get. Format:
|
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]/sessions/[SESSION]";
// Make the request
Session response = await sessionServiceClient.GetSessionAsync(name);
ListSessions(DataStoreName, string, int?, CallSettings)
public virtual PagedEnumerable<ListSessionsResponse, Session> ListSessions(DataStoreName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all Sessions by their parent [DataStore][google.cloud.discoveryengine.v1beta.DataStore].
Parameters | |
---|---|
Name | Description |
parent |
DataStoreName Required. The data store resource name. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int 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 |
PagedEnumerableListSessionsResponseSession |
A pageable sequence of Session resources. |
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
DataStoreName parent = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]");
// Make the request
PagedEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessions(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Session 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 (ListSessionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Session 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<Session> 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 (Session 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;
ListSessions(ListSessionsRequest, CallSettings)
public virtual PagedEnumerable<ListSessionsResponse, Session> ListSessions(ListSessionsRequest request, CallSettings callSettings = null)
Lists all Sessions by their parent [DataStore][google.cloud.discoveryengine.v1beta.DataStore].
Parameters | |
---|---|
Name | Description |
request |
ListSessionsRequest 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 |
PagedEnumerableListSessionsResponseSession |
A pageable sequence of Session resources. |
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
ListSessionsRequest request = new ListSessionsRequest
{
ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
Filter = "",
OrderBy = "",
};
// Make the request
PagedEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessions(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Session 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 (ListSessionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Session 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<Session> 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 (Session 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;
ListSessions(string, string, int?, CallSettings)
public virtual PagedEnumerable<ListSessionsResponse, Session> ListSessions(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all Sessions by their parent [DataStore][google.cloud.discoveryengine.v1beta.DataStore].
Parameters | |
---|---|
Name | Description |
parent |
string Required. The data store resource name. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int 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 |
PagedEnumerableListSessionsResponseSession |
A pageable sequence of Session resources. |
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]";
// Make the request
PagedEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessions(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Session 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 (ListSessionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Session 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<Session> 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 (Session 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;
ListSessionsAsync(DataStoreName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListSessionsResponse, Session> ListSessionsAsync(DataStoreName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all Sessions by their parent [DataStore][google.cloud.discoveryengine.v1beta.DataStore].
Parameters | |
---|---|
Name | Description |
parent |
DataStoreName Required. The data store resource name. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int 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 |
PagedAsyncEnumerableListSessionsResponseSession |
A pageable asynchronous sequence of Session resources. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
DataStoreName parent = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]");
// Make the request
PagedAsyncEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessionsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Session 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((ListSessionsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Session 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<Session> 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 (Session 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;
ListSessionsAsync(ListSessionsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListSessionsResponse, Session> ListSessionsAsync(ListSessionsRequest request, CallSettings callSettings = null)
Lists all Sessions by their parent [DataStore][google.cloud.discoveryengine.v1beta.DataStore].
Parameters | |
---|---|
Name | Description |
request |
ListSessionsRequest 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 |
PagedAsyncEnumerableListSessionsResponseSession |
A pageable asynchronous sequence of Session resources. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
ListSessionsRequest request = new ListSessionsRequest
{
ParentAsDataStoreName = DataStoreName.FromProjectLocationDataStore("[PROJECT]", "[LOCATION]", "[DATA_STORE]"),
Filter = "",
OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessionsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Session 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((ListSessionsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Session 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<Session> 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 (Session 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;
ListSessionsAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListSessionsResponse, Session> ListSessionsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all Sessions by their parent [DataStore][google.cloud.discoveryengine.v1beta.DataStore].
Parameters | |
---|---|
Name | Description |
parent |
string Required. The data store resource name. Format:
|
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int 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 |
PagedAsyncEnumerableListSessionsResponseSession |
A pageable asynchronous sequence of Session resources. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/dataStores/[DATA_STORE]";
// Make the request
PagedAsyncEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessionsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Session 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((ListSessionsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Session 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<Session> 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 (Session 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.
UpdateSession(Session, FieldMask, CallSettings)
public virtual Session UpdateSession(Session session, FieldMask updateMask, CallSettings callSettings = null)
Updates a Session.
[Session][google.cloud.discoveryengine.v1beta.Session] action type cannot be changed. If the [Session][google.cloud.discoveryengine.v1beta.Session] to update does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
session |
Session Required. The Session to update. |
updateMask |
FieldMask Indicates which fields in the provided [Session][google.cloud.discoveryengine.v1beta.Session] to update. The following are NOT supported:
If not set or empty, all supported fields are updated. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Session |
The RPC response. |
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
Session session = new Session();
FieldMask updateMask = new FieldMask();
// Make the request
Session response = sessionServiceClient.UpdateSession(session, updateMask);
UpdateSession(UpdateSessionRequest, CallSettings)
public virtual Session UpdateSession(UpdateSessionRequest request, CallSettings callSettings = null)
Updates a Session.
[Session][google.cloud.discoveryengine.v1beta.Session] action type cannot be changed. If the [Session][google.cloud.discoveryengine.v1beta.Session] to update does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
request |
UpdateSessionRequest 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 |
Session |
The RPC response. |
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
UpdateSessionRequest request = new UpdateSessionRequest
{
Session = new Session(),
UpdateMask = new FieldMask(),
};
// Make the request
Session response = sessionServiceClient.UpdateSession(request);
UpdateSessionAsync(Session, FieldMask, CallSettings)
public virtual Task<Session> UpdateSessionAsync(Session session, FieldMask updateMask, CallSettings callSettings = null)
Updates a Session.
[Session][google.cloud.discoveryengine.v1beta.Session] action type cannot be changed. If the [Session][google.cloud.discoveryengine.v1beta.Session] to update does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
session |
Session Required. The Session to update. |
updateMask |
FieldMask Indicates which fields in the provided [Session][google.cloud.discoveryengine.v1beta.Session] to update. The following are NOT supported:
If not set or empty, all supported fields are updated. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
Session session = new Session();
FieldMask updateMask = new FieldMask();
// Make the request
Session response = await sessionServiceClient.UpdateSessionAsync(session, updateMask);
UpdateSessionAsync(Session, FieldMask, CancellationToken)
public virtual Task<Session> UpdateSessionAsync(Session session, FieldMask updateMask, CancellationToken cancellationToken)
Updates a Session.
[Session][google.cloud.discoveryengine.v1beta.Session] action type cannot be changed. If the [Session][google.cloud.discoveryengine.v1beta.Session] to update does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
session |
Session Required. The Session to update. |
updateMask |
FieldMask Indicates which fields in the provided [Session][google.cloud.discoveryengine.v1beta.Session] to update. The following are NOT supported:
If not set or empty, all supported fields are updated. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
Session session = new Session();
FieldMask updateMask = new FieldMask();
// Make the request
Session response = await sessionServiceClient.UpdateSessionAsync(session, updateMask);
UpdateSessionAsync(UpdateSessionRequest, CallSettings)
public virtual Task<Session> UpdateSessionAsync(UpdateSessionRequest request, CallSettings callSettings = null)
Updates a Session.
[Session][google.cloud.discoveryengine.v1beta.Session] action type cannot be changed. If the [Session][google.cloud.discoveryengine.v1beta.Session] to update does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
request |
UpdateSessionRequest 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 |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSessionRequest request = new UpdateSessionRequest
{
Session = new Session(),
UpdateMask = new FieldMask(),
};
// Make the request
Session response = await sessionServiceClient.UpdateSessionAsync(request);
UpdateSessionAsync(UpdateSessionRequest, CancellationToken)
public virtual Task<Session> UpdateSessionAsync(UpdateSessionRequest request, CancellationToken cancellationToken)
Updates a Session.
[Session][google.cloud.discoveryengine.v1beta.Session] action type cannot be changed. If the [Session][google.cloud.discoveryengine.v1beta.Session] to update does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
request |
UpdateSessionRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSession |
A Task containing the RPC response. |
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSessionRequest request = new UpdateSessionRequest
{
Session = new Session(),
UpdateMask = new FieldMask(),
};
// Make the request
Session response = await sessionServiceClient.UpdateSessionAsync(request);