| GitHub Repository | Product Reference | RPC Documentation |
Service Description: Service for managing UserList resources.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
UserListName name = UserListName.of("[ACCOUNT_TYPE]", "[ACCOUNT]", "[USER_LIST]");
UserList response = userListServiceClient.getUserList(name);
}
Note: close() needs to be called on the UserListServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
GetUserList |
Gets a UserList. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request:
|
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListUserLists |
Lists UserLists. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request:
|
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateUserList |
Creates a UserList. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request:
|
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateUserList |
Updates a UserList. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request:
|
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteUserList |
Deletes a UserList. Authorization Headers: This method supports the following optional headers to define how the API authorizes access for the request:
|
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of UserListServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
UserListServiceSettings userListServiceSettings =
UserListServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
UserListServiceClient userListServiceClient =
UserListServiceClient.create(userListServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
UserListServiceSettings userListServiceSettings =
UserListServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
UserListServiceClient userListServiceClient =
UserListServiceClient.create(userListServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
UserListServiceSettings userListServiceSettings =
UserListServiceSettings.newHttpJsonBuilder().build();
UserListServiceClient userListServiceClient =
UserListServiceClient.create(userListServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final UserListServiceClient create()Constructs an instance of UserListServiceClient with default settings.
| Returns | |
|---|---|
| Type | Description |
UserListServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(UserListServiceSettings settings)
public static final UserListServiceClient create(UserListServiceSettings settings)Constructs an instance of UserListServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
| Parameter | |
|---|---|
| Name | Description |
settings |
UserListServiceSettings |
| Returns | |
|---|---|
| Type | Description |
UserListServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(UserListServiceStub stub)
public static final UserListServiceClient create(UserListServiceStub stub)Constructs an instance of UserListServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(UserListServiceSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
UserListServiceStub |
| Returns | |
|---|---|
| Type | Description |
UserListServiceClient |
|
Constructors
UserListServiceClient(UserListServiceSettings settings)
protected UserListServiceClient(UserListServiceSettings settings)Constructs an instance of UserListServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
| Parameter | |
|---|---|
| Name | Description |
settings |
UserListServiceSettings |
UserListServiceClient(UserListServiceStub stub)
protected UserListServiceClient(UserListServiceStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
UserListServiceStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)| Parameters | |
|---|---|
| Name | Description |
duration |
long |
unit |
TimeUnit |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
| Exceptions | |
|---|---|
| Type | Description |
InterruptedException |
|
close()
public final void close()createUserList(AccountName parent, UserList userList)
public final UserList createUserList(AccountName parent, UserList userList)Creates a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
AccountName parent = AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]");
UserList userList = UserList.newBuilder().build();
UserList response = userListServiceClient.createUserList(parent, userList);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
AccountNameRequired. The parent account where this user list will be created. Format: accountTypes/{account_type}/accounts/{account} |
userList |
UserListRequired. The user list to create. |
| Returns | |
|---|---|
| Type | Description |
UserList |
|
createUserList(CreateUserListRequest request)
public final UserList createUserList(CreateUserListRequest request)Creates a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
CreateUserListRequest request =
CreateUserListRequest.newBuilder()
.setParent(AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString())
.setUserList(UserList.newBuilder().build())
.setValidateOnly(true)
.build();
UserList response = userListServiceClient.createUserList(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateUserListRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
UserList |
|
createUserList(String parent, UserList userList)
public final UserList createUserList(String parent, UserList userList)Creates a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
String parent = AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString();
UserList userList = UserList.newBuilder().build();
UserList response = userListServiceClient.createUserList(parent, userList);
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent account where this user list will be created. Format: accountTypes/{account_type}/accounts/{account} |
userList |
UserListRequired. The user list to create. |
| Returns | |
|---|---|
| Type | Description |
UserList |
|
createUserListCallable()
public final UnaryCallable<CreateUserListRequest,UserList> createUserListCallable()Creates a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
CreateUserListRequest request =
CreateUserListRequest.newBuilder()
.setParent(AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString())
.setUserList(UserList.newBuilder().build())
.setValidateOnly(true)
.build();
ApiFuture<UserList> future =
userListServiceClient.createUserListCallable().futureCall(request);
// Do something.
UserList response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateUserListRequest,UserList> |
|
deleteUserList(DeleteUserListRequest request)
public final void deleteUserList(DeleteUserListRequest request)Deletes a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
DeleteUserListRequest request =
DeleteUserListRequest.newBuilder()
.setName(UserListName.of("[ACCOUNT_TYPE]", "[ACCOUNT]", "[USER_LIST]").toString())
.setValidateOnly(true)
.build();
userListServiceClient.deleteUserList(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteUserListRequestThe request object containing all of the parameters for the API call. |
deleteUserList(UserListName name)
public final void deleteUserList(UserListName name)Deletes a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
UserListName name = UserListName.of("[ACCOUNT_TYPE]", "[ACCOUNT]", "[USER_LIST]");
userListServiceClient.deleteUserList(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
UserListNameRequired. The name of the user list to delete. Format: accountTypes/{account_type}/accounts/{account}/userLists/{user_list} |
deleteUserList(String name)
public final void deleteUserList(String name)Deletes a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
String name = UserListName.of("[ACCOUNT_TYPE]", "[ACCOUNT]", "[USER_LIST]").toString();
userListServiceClient.deleteUserList(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the user list to delete. Format: accountTypes/{account_type}/accounts/{account}/userLists/{user_list} |
deleteUserListCallable()
public final UnaryCallable<DeleteUserListRequest,Empty> deleteUserListCallable()Deletes a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
DeleteUserListRequest request =
DeleteUserListRequest.newBuilder()
.setName(UserListName.of("[ACCOUNT_TYPE]", "[ACCOUNT]", "[USER_LIST]").toString())
.setValidateOnly(true)
.build();
ApiFuture<Empty> future = userListServiceClient.deleteUserListCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteUserListRequest,Empty> |
|
getSettings()
public final UserListServiceSettings getSettings()| Returns | |
|---|---|
| Type | Description |
UserListServiceSettings |
|
getStub()
public UserListServiceStub getStub()| Returns | |
|---|---|
| Type | Description |
UserListServiceStub |
|
getUserList(GetUserListRequest request)
public final UserList getUserList(GetUserListRequest request)Gets a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
GetUserListRequest request =
GetUserListRequest.newBuilder()
.setName(UserListName.of("[ACCOUNT_TYPE]", "[ACCOUNT]", "[USER_LIST]").toString())
.build();
UserList response = userListServiceClient.getUserList(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetUserListRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
UserList |
|
getUserList(UserListName name)
public final UserList getUserList(UserListName name)Gets a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
UserListName name = UserListName.of("[ACCOUNT_TYPE]", "[ACCOUNT]", "[USER_LIST]");
UserList response = userListServiceClient.getUserList(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
UserListNameRequired. The resource name of the UserList to retrieve. Format: accountTypes/{account_type}/accounts/{account}/userLists/{user_list} |
| Returns | |
|---|---|
| Type | Description |
UserList |
|
getUserList(String name)
public final UserList getUserList(String name)Gets a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
String name = UserListName.of("[ACCOUNT_TYPE]", "[ACCOUNT]", "[USER_LIST]").toString();
UserList response = userListServiceClient.getUserList(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The resource name of the UserList to retrieve. Format: accountTypes/{account_type}/accounts/{account}/userLists/{user_list} |
| Returns | |
|---|---|
| Type | Description |
UserList |
|
getUserListCallable()
public final UnaryCallable<GetUserListRequest,UserList> getUserListCallable()Gets a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
GetUserListRequest request =
GetUserListRequest.newBuilder()
.setName(UserListName.of("[ACCOUNT_TYPE]", "[ACCOUNT]", "[USER_LIST]").toString())
.build();
ApiFuture<UserList> future = userListServiceClient.getUserListCallable().futureCall(request);
// Do something.
UserList response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetUserListRequest,UserList> |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listUserLists(AccountName parent)
public final UserListServiceClient.ListUserListsPagedResponse listUserLists(AccountName parent)Lists UserLists.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
AccountName parent = AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]");
for (UserList element : userListServiceClient.listUserLists(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
AccountNameRequired. The parent account which owns this collection of user lists. Format: accountTypes/{account_type}/accounts/{account} |
| Returns | |
|---|---|
| Type | Description |
UserListServiceClient.ListUserListsPagedResponse |
|
listUserLists(ListUserListsRequest request)
public final UserListServiceClient.ListUserListsPagedResponse listUserLists(ListUserListsRequest request)Lists UserLists.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
ListUserListsRequest request =
ListUserListsRequest.newBuilder()
.setParent(AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
for (UserList element : userListServiceClient.listUserLists(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListUserListsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
UserListServiceClient.ListUserListsPagedResponse |
|
listUserLists(String parent)
public final UserListServiceClient.ListUserListsPagedResponse listUserLists(String parent)Lists UserLists.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
String parent = AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString();
for (UserList element : userListServiceClient.listUserLists(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent account which owns this collection of user lists. Format: accountTypes/{account_type}/accounts/{account} |
| Returns | |
|---|---|
| Type | Description |
UserListServiceClient.ListUserListsPagedResponse |
|
listUserListsCallable()
public final UnaryCallable<ListUserListsRequest,ListUserListsResponse> listUserListsCallable()Lists UserLists.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
ListUserListsRequest request =
ListUserListsRequest.newBuilder()
.setParent(AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
while (true) {
ListUserListsResponse response =
userListServiceClient.listUserListsCallable().call(request);
for (UserList element : response.getUserListsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListUserListsRequest,ListUserListsResponse> |
|
listUserListsPagedCallable()
public final UnaryCallable<ListUserListsRequest,UserListServiceClient.ListUserListsPagedResponse> listUserListsPagedCallable()Lists UserLists.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
ListUserListsRequest request =
ListUserListsRequest.newBuilder()
.setParent(AccountName.of("[ACCOUNT_TYPE]", "[ACCOUNT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
ApiFuture<UserList> future =
userListServiceClient.listUserListsPagedCallable().futureCall(request);
// Do something.
for (UserList element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListUserListsRequest,ListUserListsPagedResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()updateUserList(UpdateUserListRequest request)
public final UserList updateUserList(UpdateUserListRequest request)Updates a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
UpdateUserListRequest request =
UpdateUserListRequest.newBuilder()
.setUserList(UserList.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.build();
UserList response = userListServiceClient.updateUserList(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateUserListRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
UserList |
|
updateUserList(UserList userList, FieldMask updateMask)
public final UserList updateUserList(UserList userList, FieldMask updateMask)Updates a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
UserList userList = UserList.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UserList response = userListServiceClient.updateUserList(userList, updateMask);
}
| Parameters | |
|---|---|
| Name | Description |
userList |
UserListRequired. The user list to update. The user list's |
updateMask |
FieldMaskOptional. The list of fields to update. |
| Returns | |
|---|---|
| Type | Description |
UserList |
|
updateUserListCallable()
public final UnaryCallable<UpdateUserListRequest,UserList> updateUserListCallable()Updates a UserList.
Authorization Headers:
This method supports the following optional headers to define how the API authorizes access for the request:
login-account: (Optional) The resource name of the account where the Google Account of the credentials is a user. If not set, defaults to the account of the request. Format:accountTypes/{loginAccountType}/accounts/{loginAccountId}linked-account: (Optional) The resource name of the account with an established product link to thelogin-account. Format:accountTypes/{linkedAccountType}/accounts/{linkedAccountId}
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UserListServiceClient userListServiceClient = UserListServiceClient.create()) {
UpdateUserListRequest request =
UpdateUserListRequest.newBuilder()
.setUserList(UserList.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.build();
ApiFuture<UserList> future =
userListServiceClient.updateUserListCallable().futureCall(request);
// Do something.
UserList response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateUserListRequest,UserList> |
|