public abstract class UserLicenseServiceClient
Reference documentation and code samples for the Discovery Engine v1 API class UserLicenseServiceClient.
UserLicenseService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.DiscoveryEngine.V1Assembly
Google.Cloud.DiscoveryEngine.V1.dll
Remarks
Service for managing User Licenses.
Properties
BatchUpdateUserLicensesOperationsClient
public virtual OperationsClient BatchUpdateUserLicensesOperationsClient { get; }
The long-running operations client for BatchUpdateUserLicenses
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the UserLicenseService 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 UserLicenseService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default UserLicenseService scopes are:
GrpcClient
public virtual UserLicenseService.UserLicenseServiceClient GrpcClient { get; }
The underlying gRPC UserLicenseService client
Property Value | |
---|---|
Type | Description |
UserLicenseServiceUserLicenseServiceClient |
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
BatchUpdateUserLicenses(BatchUpdateUserLicensesRequest, CallSettings)
public virtual Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata> BatchUpdateUserLicenses(BatchUpdateUserLicensesRequest request, CallSettings callSettings = null)
Updates the User License. This method is used for batch assign/unassign licenses to users.
Parameters | |
---|---|
Name | Description |
request |
BatchUpdateUserLicensesRequest 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 |
OperationBatchUpdateUserLicensesResponseBatchUpdateUserLicensesMetadata |
The RPC response. |
// Create client
UserLicenseServiceClient userLicenseServiceClient = UserLicenseServiceClient.Create();
// Initialize request argument(s)
BatchUpdateUserLicensesRequest request = new BatchUpdateUserLicensesRequest
{
ParentAsUserStoreName = UserStoreName.FromProjectLocationUserStore("[PROJECT]", "[LOCATION]", "[USER_STORE]"),
InlineSource = new BatchUpdateUserLicensesRequest.Types.InlineSource(),
DeleteUnassignedUserLicenses = false,
};
// Make the request
Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata> response = userLicenseServiceClient.BatchUpdateUserLicenses(request);
// Poll until the returned long-running operation is complete
Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
BatchUpdateUserLicensesResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata> retrievedResponse = userLicenseServiceClient.PollOnceBatchUpdateUserLicenses(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchUpdateUserLicensesResponse retrievedResult = retrievedResponse.Result;
}
BatchUpdateUserLicensesAsync(BatchUpdateUserLicensesRequest, CallSettings)
public virtual Task<Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata>> BatchUpdateUserLicensesAsync(BatchUpdateUserLicensesRequest request, CallSettings callSettings = null)
Updates the User License. This method is used for batch assign/unassign licenses to users.
Parameters | |
---|---|
Name | Description |
request |
BatchUpdateUserLicensesRequest 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 |
TaskOperationBatchUpdateUserLicensesResponseBatchUpdateUserLicensesMetadata |
A Task containing the RPC response. |
// Create client
UserLicenseServiceClient userLicenseServiceClient = await UserLicenseServiceClient.CreateAsync();
// Initialize request argument(s)
BatchUpdateUserLicensesRequest request = new BatchUpdateUserLicensesRequest
{
ParentAsUserStoreName = UserStoreName.FromProjectLocationUserStore("[PROJECT]", "[LOCATION]", "[USER_STORE]"),
InlineSource = new BatchUpdateUserLicensesRequest.Types.InlineSource(),
DeleteUnassignedUserLicenses = false,
};
// Make the request
Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata> response = await userLicenseServiceClient.BatchUpdateUserLicensesAsync(request);
// Poll until the returned long-running operation is complete
Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchUpdateUserLicensesResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata> retrievedResponse = await userLicenseServiceClient.PollOnceBatchUpdateUserLicensesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchUpdateUserLicensesResponse retrievedResult = retrievedResponse.Result;
}
BatchUpdateUserLicensesAsync(BatchUpdateUserLicensesRequest, CancellationToken)
public virtual Task<Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata>> BatchUpdateUserLicensesAsync(BatchUpdateUserLicensesRequest request, CancellationToken cancellationToken)
Updates the User License. This method is used for batch assign/unassign licenses to users.
Parameters | |
---|---|
Name | Description |
request |
BatchUpdateUserLicensesRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBatchUpdateUserLicensesResponseBatchUpdateUserLicensesMetadata |
A Task containing the RPC response. |
// Create client
UserLicenseServiceClient userLicenseServiceClient = await UserLicenseServiceClient.CreateAsync();
// Initialize request argument(s)
BatchUpdateUserLicensesRequest request = new BatchUpdateUserLicensesRequest
{
ParentAsUserStoreName = UserStoreName.FromProjectLocationUserStore("[PROJECT]", "[LOCATION]", "[USER_STORE]"),
InlineSource = new BatchUpdateUserLicensesRequest.Types.InlineSource(),
DeleteUnassignedUserLicenses = false,
};
// Make the request
Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata> response = await userLicenseServiceClient.BatchUpdateUserLicensesAsync(request);
// Poll until the returned long-running operation is complete
Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchUpdateUserLicensesResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata> retrievedResponse = await userLicenseServiceClient.PollOnceBatchUpdateUserLicensesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchUpdateUserLicensesResponse retrievedResult = retrievedResponse.Result;
}
Create()
public static UserLicenseServiceClient Create()
Synchronously creates a UserLicenseServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use UserLicenseServiceClientBuilder .
Returns | |
---|---|
Type | Description |
UserLicenseServiceClient |
The created UserLicenseServiceClient. |
CreateAsync(CancellationToken)
public static Task<UserLicenseServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a UserLicenseServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use UserLicenseServiceClientBuilder .
Parameter | |
---|---|
Name | Description |
cancellationToken |
CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskUserLicenseServiceClient |
The task representing the created UserLicenseServiceClient. |
ListUserLicenses(ListUserLicensesRequest, CallSettings)
public virtual PagedEnumerable<ListUserLicensesResponse, UserLicense> ListUserLicenses(ListUserLicensesRequest request, CallSettings callSettings = null)
Lists the User Licenses.
Parameters | |
---|---|
Name | Description |
request |
ListUserLicensesRequest 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 |
PagedEnumerableListUserLicensesResponseUserLicense |
A pageable sequence of UserLicense resources. |
// Create client
UserLicenseServiceClient userLicenseServiceClient = UserLicenseServiceClient.Create();
// Initialize request argument(s)
ListUserLicensesRequest request = new ListUserLicensesRequest
{
ParentAsUserStoreName = UserStoreName.FromProjectLocationUserStore("[PROJECT]", "[LOCATION]", "[USER_STORE]"),
Filter = "",
};
// Make the request
PagedEnumerable<ListUserLicensesResponse, UserLicense> response = userLicenseServiceClient.ListUserLicenses(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (UserLicense 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 (ListUserLicensesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (UserLicense 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<UserLicense> 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 (UserLicense 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;
ListUserLicenses(UserStoreName, string, int?, CallSettings)
public virtual PagedEnumerable<ListUserLicensesResponse, UserLicense> ListUserLicenses(UserStoreName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the User Licenses.
Parameters | |
---|---|
Name | Description |
parent |
UserStoreName Required. The parent [UserStore][] 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 |
PagedEnumerableListUserLicensesResponseUserLicense |
A pageable sequence of UserLicense resources. |
// Create client
UserLicenseServiceClient userLicenseServiceClient = UserLicenseServiceClient.Create();
// Initialize request argument(s)
UserStoreName parent = UserStoreName.FromProjectLocationUserStore("[PROJECT]", "[LOCATION]", "[USER_STORE]");
// Make the request
PagedEnumerable<ListUserLicensesResponse, UserLicense> response = userLicenseServiceClient.ListUserLicenses(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (UserLicense 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 (ListUserLicensesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (UserLicense 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<UserLicense> 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 (UserLicense 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;
ListUserLicenses(string, string, int?, CallSettings)
public virtual PagedEnumerable<ListUserLicensesResponse, UserLicense> ListUserLicenses(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the User Licenses.
Parameters | |
---|---|
Name | Description |
parent |
string Required. The parent [UserStore][] 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 |
PagedEnumerableListUserLicensesResponseUserLicense |
A pageable sequence of UserLicense resources. |
// Create client
UserLicenseServiceClient userLicenseServiceClient = UserLicenseServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/userStores/[USER_STORE]";
// Make the request
PagedEnumerable<ListUserLicensesResponse, UserLicense> response = userLicenseServiceClient.ListUserLicenses(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (UserLicense 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 (ListUserLicensesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (UserLicense 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<UserLicense> 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 (UserLicense 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;
ListUserLicensesAsync(ListUserLicensesRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListUserLicensesResponse, UserLicense> ListUserLicensesAsync(ListUserLicensesRequest request, CallSettings callSettings = null)
Lists the User Licenses.
Parameters | |
---|---|
Name | Description |
request |
ListUserLicensesRequest 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 |
PagedAsyncEnumerableListUserLicensesResponseUserLicense |
A pageable asynchronous sequence of UserLicense resources. |
// Create client
UserLicenseServiceClient userLicenseServiceClient = await UserLicenseServiceClient.CreateAsync();
// Initialize request argument(s)
ListUserLicensesRequest request = new ListUserLicensesRequest
{
ParentAsUserStoreName = UserStoreName.FromProjectLocationUserStore("[PROJECT]", "[LOCATION]", "[USER_STORE]"),
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListUserLicensesResponse, UserLicense> response = userLicenseServiceClient.ListUserLicensesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((UserLicense 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((ListUserLicensesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (UserLicense 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<UserLicense> 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 (UserLicense 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;
ListUserLicensesAsync(UserStoreName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListUserLicensesResponse, UserLicense> ListUserLicensesAsync(UserStoreName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the User Licenses.
Parameters | |
---|---|
Name | Description |
parent |
UserStoreName Required. The parent [UserStore][] 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 |
PagedAsyncEnumerableListUserLicensesResponseUserLicense |
A pageable asynchronous sequence of UserLicense resources. |
// Create client
UserLicenseServiceClient userLicenseServiceClient = await UserLicenseServiceClient.CreateAsync();
// Initialize request argument(s)
UserStoreName parent = UserStoreName.FromProjectLocationUserStore("[PROJECT]", "[LOCATION]", "[USER_STORE]");
// Make the request
PagedAsyncEnumerable<ListUserLicensesResponse, UserLicense> response = userLicenseServiceClient.ListUserLicensesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((UserLicense 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((ListUserLicensesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (UserLicense 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<UserLicense> 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 (UserLicense 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;
ListUserLicensesAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListUserLicensesResponse, UserLicense> ListUserLicensesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the User Licenses.
Parameters | |
---|---|
Name | Description |
parent |
string Required. The parent [UserStore][] 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 |
PagedAsyncEnumerableListUserLicensesResponseUserLicense |
A pageable asynchronous sequence of UserLicense resources. |
// Create client
UserLicenseServiceClient userLicenseServiceClient = await UserLicenseServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/userStores/[USER_STORE]";
// Make the request
PagedAsyncEnumerable<ListUserLicensesResponse, UserLicense> response = userLicenseServiceClient.ListUserLicensesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((UserLicense 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((ListUserLicensesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (UserLicense 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<UserLicense> 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 (UserLicense 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;
PollOnceBatchUpdateUserLicenses(string, CallSettings)
public virtual Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata> PollOnceBatchUpdateUserLicenses(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of
BatchUpdateUserLicenses
.
Parameters | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBatchUpdateUserLicensesResponseBatchUpdateUserLicensesMetadata |
The result of polling the operation. |
PollOnceBatchUpdateUserLicensesAsync(string, CallSettings)
public virtual Task<Operation<BatchUpdateUserLicensesResponse, BatchUpdateUserLicensesMetadata>> PollOnceBatchUpdateUserLicensesAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
BatchUpdateUserLicenses
.
Parameters | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBatchUpdateUserLicensesResponseBatchUpdateUserLicensesMetadata |
A task representing the result of polling the operation. |
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.