@BetaApi @Generated(value="by gapic-generator-java") public class RealmsServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
RealmName name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]");
Realm response = realmsServiceClient.getRealm(name);
}
Note: close() needs to be called on the RealmsServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
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 RealmsServiceSettings 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
RealmsServiceSettings realmsServiceSettings =
RealmsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RealmsServiceClient realmsServiceClient = RealmsServiceClient.create(realmsServiceSettings);
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
RealmsServiceSettings realmsServiceSettings =
RealmsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
RealmsServiceClient realmsServiceClient = RealmsServiceClient.create(realmsServiceSettings);
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
RealmsServiceSettings realmsServiceSettings =
RealmsServiceSettings.newHttpJsonBuilder().build();
RealmsServiceClient realmsServiceClient = RealmsServiceClient.create(realmsServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
RealmsServiceClient.ListRealmsFixedSizeCollection |
static class |
RealmsServiceClient.ListRealmsPage |
static class |
RealmsServiceClient.ListRealmsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
RealmsServiceClient(RealmsServiceSettings settings)
Constructs an instance of RealmsServiceClient, using the given settings.
|
protected |
RealmsServiceClient(RealmsServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static RealmsServiceClient |
create()
Constructs an instance of RealmsServiceClient with default settings.
|
static RealmsServiceClient |
create(RealmsServiceSettings settings)
Constructs an instance of RealmsServiceClient, using the given settings.
|
static RealmsServiceClient |
create(RealmsServiceStub stub)
Constructs an instance of RealmsServiceClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Realm,OperationMetadata> |
createRealmAsync(CreateRealmRequest request)
Creates a new realm in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Realm,OperationMetadata> |
createRealmAsync(LocationName parent,
Realm realm,
String realmId)
Creates a new realm in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Realm,OperationMetadata> |
createRealmAsync(String parent,
Realm realm,
String realmId)
Creates a new realm in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateRealmRequest,com.google.longrunning.Operation> |
createRealmCallable()
Creates a new realm in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateRealmRequest,Realm,OperationMetadata> |
createRealmOperationCallable()
Creates a new realm in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteRealmAsync(DeleteRealmRequest request)
Deletes a single realm.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteRealmAsync(RealmName name)
Deletes a single realm.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteRealmAsync(String name)
Deletes a single realm.
|
com.google.api.gax.rpc.UnaryCallable<DeleteRealmRequest,com.google.longrunning.Operation> |
deleteRealmCallable()
Deletes a single realm.
|
com.google.api.gax.rpc.OperationCallable<DeleteRealmRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteRealmOperationCallable()
Deletes a single realm.
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
Realm |
getRealm(GetRealmRequest request)
Gets details of a single realm.
|
Realm |
getRealm(RealmName name)
Gets details of a single realm.
|
Realm |
getRealm(String name)
Gets details of a single realm.
|
com.google.api.gax.rpc.UnaryCallable<GetRealmRequest,Realm> |
getRealmCallable()
Gets details of a single realm.
|
RealmsServiceSettings |
getSettings() |
RealmsServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
RealmsServiceClient.ListRealmsPagedResponse |
listRealms(ListRealmsRequest request)
Lists realms in a given project and location.
|
RealmsServiceClient.ListRealmsPagedResponse |
listRealms(LocationName parent)
Lists realms in a given project and location.
|
RealmsServiceClient.ListRealmsPagedResponse |
listRealms(String parent)
Lists realms in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListRealmsRequest,ListRealmsResponse> |
listRealmsCallable()
Lists realms in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListRealmsRequest,RealmsServiceClient.ListRealmsPagedResponse> |
listRealmsPagedCallable()
Lists realms in a given project and location.
|
PreviewRealmUpdateResponse |
previewRealmUpdate(PreviewRealmUpdateRequest request)
Previews patches to a single realm.
|
com.google.api.gax.rpc.UnaryCallable<PreviewRealmUpdateRequest,PreviewRealmUpdateResponse> |
previewRealmUpdateCallable()
Previews patches to a single realm.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<Realm,OperationMetadata> |
updateRealmAsync(Realm realm,
com.google.protobuf.FieldMask updateMask)
Patches a single realm.
|
com.google.api.gax.longrunning.OperationFuture<Realm,OperationMetadata> |
updateRealmAsync(UpdateRealmRequest request)
Patches a single realm.
|
com.google.api.gax.rpc.UnaryCallable<UpdateRealmRequest,com.google.longrunning.Operation> |
updateRealmCallable()
Patches a single realm.
|
com.google.api.gax.rpc.OperationCallable<UpdateRealmRequest,Realm,OperationMetadata> |
updateRealmOperationCallable()
Patches a single realm.
|
protected RealmsServiceClient(RealmsServiceSettings settings) throws IOException
IOExceptionprotected RealmsServiceClient(RealmsServiceStub stub)
public static final RealmsServiceClient create() throws IOException
IOExceptionpublic static final RealmsServiceClient create(RealmsServiceSettings settings) throws IOException
IOExceptionpublic static final RealmsServiceClient create(RealmsServiceStub stub)
public final RealmsServiceSettings getSettings()
public RealmsServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final RealmsServiceClient.ListRealmsPagedResponse listRealms(LocationName parent)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Realm element : realmsServiceClient.listRealms(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource name. Uses the form:
`projects/{project}/locations/{location}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RealmsServiceClient.ListRealmsPagedResponse listRealms(String parent)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Realm element : realmsServiceClient.listRealms(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource name. Uses the form:
`projects/{project}/locations/{location}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RealmsServiceClient.ListRealmsPagedResponse listRealms(ListRealmsRequest request)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
ListRealmsRequest request =
ListRealmsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Realm element : realmsServiceClient.listRealms(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListRealmsRequest,RealmsServiceClient.ListRealmsPagedResponse> listRealmsPagedCallable()
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
ListRealmsRequest request =
ListRealmsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Realm> future = realmsServiceClient.listRealmsPagedCallable().futureCall(request);
// Do something.
for (Realm element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListRealmsRequest,ListRealmsResponse> listRealmsCallable()
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
ListRealmsRequest request =
ListRealmsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListRealmsResponse response = realmsServiceClient.listRealmsCallable().call(request);
for (Realm element : response.getRealmsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Realm getRealm(RealmName name)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
RealmName name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]");
Realm response = realmsServiceClient.getRealm(name);
}
name - Required. The name of the realm to retrieve. Uses the form:
`projects/{project}/locations/{location}/realms/{realm}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Realm getRealm(String name)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
String name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString();
Realm response = realmsServiceClient.getRealm(name);
}
name - Required. The name of the realm to retrieve. Uses the form:
`projects/{project}/locations/{location}/realms/{realm}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Realm getRealm(GetRealmRequest request)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
GetRealmRequest request =
GetRealmRequest.newBuilder()
.setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
.build();
Realm response = realmsServiceClient.getRealm(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetRealmRequest,Realm> getRealmCallable()
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
GetRealmRequest request =
GetRealmRequest.newBuilder()
.setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
.build();
ApiFuture<Realm> future = realmsServiceClient.getRealmCallable().futureCall(request);
// Do something.
Realm response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Realm,OperationMetadata> createRealmAsync(LocationName parent, Realm realm, String realmId)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Realm realm = Realm.newBuilder().build();
String realmId = "realmId1080654858";
Realm response = realmsServiceClient.createRealmAsync(parent, realm, realmId).get();
}
parent - Required. The parent resource name. Uses the form:
`projects/{project}/locations/{location}`.realm - Required. The realm resource to be created.realmId - Required. The ID of the realm resource to be created.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Realm,OperationMetadata> createRealmAsync(String parent, Realm realm, String realmId)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Realm realm = Realm.newBuilder().build();
String realmId = "realmId1080654858";
Realm response = realmsServiceClient.createRealmAsync(parent, realm, realmId).get();
}
parent - Required. The parent resource name. Uses the form:
`projects/{project}/locations/{location}`.realm - Required. The realm resource to be created.realmId - Required. The ID of the realm resource to be created.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Realm,OperationMetadata> createRealmAsync(CreateRealmRequest request)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
CreateRealmRequest request =
CreateRealmRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setRealmId("realmId1080654858")
.setRealm(Realm.newBuilder().build())
.build();
Realm response = realmsServiceClient.createRealmAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateRealmRequest,Realm,OperationMetadata> createRealmOperationCallable()
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
CreateRealmRequest request =
CreateRealmRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setRealmId("realmId1080654858")
.setRealm(Realm.newBuilder().build())
.build();
OperationFuture<Realm, OperationMetadata> future =
realmsServiceClient.createRealmOperationCallable().futureCall(request);
// Do something.
Realm response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateRealmRequest,com.google.longrunning.Operation> createRealmCallable()
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
CreateRealmRequest request =
CreateRealmRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setRealmId("realmId1080654858")
.setRealm(Realm.newBuilder().build())
.build();
ApiFuture<Operation> future = realmsServiceClient.createRealmCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRealmAsync(RealmName name)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
RealmName name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]");
realmsServiceClient.deleteRealmAsync(name).get();
}
name - Required. The name of the realm to delete. Uses the form:
`projects/{project}/locations/{location}/realms/{realm}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRealmAsync(String name)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
String name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString();
realmsServiceClient.deleteRealmAsync(name).get();
}
name - Required. The name of the realm to delete. Uses the form:
`projects/{project}/locations/{location}/realms/{realm}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRealmAsync(DeleteRealmRequest request)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
DeleteRealmRequest request =
DeleteRealmRequest.newBuilder()
.setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
.build();
realmsServiceClient.deleteRealmAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteRealmRequest,com.google.protobuf.Empty,OperationMetadata> deleteRealmOperationCallable()
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
DeleteRealmRequest request =
DeleteRealmRequest.newBuilder()
.setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
realmsServiceClient.deleteRealmOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteRealmRequest,com.google.longrunning.Operation> deleteRealmCallable()
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
DeleteRealmRequest request =
DeleteRealmRequest.newBuilder()
.setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
.build();
ApiFuture<Operation> future = realmsServiceClient.deleteRealmCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Realm,OperationMetadata> updateRealmAsync(Realm realm, com.google.protobuf.FieldMask updateMask)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
Realm realm = Realm.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Realm response = realmsServiceClient.updateRealmAsync(realm, updateMask).get();
}
realm - Required. The realm to be updated. Only fields specified in update_mask are
updated.updateMask - Required. The update mask applies to the resource. For the `FieldMask`
definition, see
https: //developers.google.com/protocol-buffers // /docs/reference/google.protobuf#fieldmask
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Realm,OperationMetadata> updateRealmAsync(UpdateRealmRequest request)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
UpdateRealmRequest request =
UpdateRealmRequest.newBuilder()
.setRealm(Realm.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Realm response = realmsServiceClient.updateRealmAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateRealmRequest,Realm,OperationMetadata> updateRealmOperationCallable()
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
UpdateRealmRequest request =
UpdateRealmRequest.newBuilder()
.setRealm(Realm.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
OperationFuture<Realm, OperationMetadata> future =
realmsServiceClient.updateRealmOperationCallable().futureCall(request);
// Do something.
Realm response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateRealmRequest,com.google.longrunning.Operation> updateRealmCallable()
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
UpdateRealmRequest request =
UpdateRealmRequest.newBuilder()
.setRealm(Realm.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Operation> future = realmsServiceClient.updateRealmCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final PreviewRealmUpdateResponse previewRealmUpdate(PreviewRealmUpdateRequest request)
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
PreviewRealmUpdateRequest request =
PreviewRealmUpdateRequest.newBuilder()
.setRealm(Realm.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setPreviewTime(Timestamp.newBuilder().build())
.build();
PreviewRealmUpdateResponse response = realmsServiceClient.previewRealmUpdate(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<PreviewRealmUpdateRequest,PreviewRealmUpdateResponse> previewRealmUpdateCallable()
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 (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
PreviewRealmUpdateRequest request =
PreviewRealmUpdateRequest.newBuilder()
.setRealm(Realm.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setPreviewTime(Timestamp.newBuilder().build())
.build();
ApiFuture<PreviewRealmUpdateResponse> future =
realmsServiceClient.previewRealmUpdateCallable().futureCall(request);
// Do something.
PreviewRealmUpdateResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2023 Google LLC. All rights reserved.