@BetaApi @Generated(value="by gapic-generator-java") public class GameServerClustersServiceClient 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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
GameServerClusterName name =
GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]");
GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(name);
}
Note: close() needs to be called on the GameServerClustersServiceClient 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 GameServerClustersServiceSettings 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
GameServerClustersServiceSettings gameServerClustersServiceSettings =
GameServerClustersServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create(gameServerClustersServiceSettings);
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
GameServerClustersServiceSettings gameServerClustersServiceSettings =
GameServerClustersServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create(gameServerClustersServiceSettings);
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
GameServerClustersServiceSettings gameServerClustersServiceSettings =
GameServerClustersServiceSettings.newHttpJsonBuilder().build();
GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create(gameServerClustersServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
GameServerClustersServiceClient.ListGameServerClustersFixedSizeCollection |
static class |
GameServerClustersServiceClient.ListGameServerClustersPage |
static class |
GameServerClustersServiceClient.ListGameServerClustersPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
GameServerClustersServiceClient(GameServerClustersServiceSettings settings)
Constructs an instance of GameServerClustersServiceClient, using the given settings.
|
protected |
GameServerClustersServiceClient(GameServerClustersServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static GameServerClustersServiceClient |
create()
Constructs an instance of GameServerClustersServiceClient with default settings.
|
static GameServerClustersServiceClient |
create(GameServerClustersServiceSettings settings)
Constructs an instance of GameServerClustersServiceClient, using the given settings.
|
static GameServerClustersServiceClient |
create(GameServerClustersServiceStub stub)
Constructs an instance of GameServerClustersServiceClient, using the given stub for making
calls.
|
com.google.api.gax.longrunning.OperationFuture<GameServerCluster,OperationMetadata> |
createGameServerClusterAsync(CreateGameServerClusterRequest request)
Creates a new game server cluster in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<GameServerCluster,OperationMetadata> |
createGameServerClusterAsync(RealmName parent,
GameServerCluster gameServerCluster,
String gameServerClusterId)
Creates a new game server cluster in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<GameServerCluster,OperationMetadata> |
createGameServerClusterAsync(String parent,
GameServerCluster gameServerCluster,
String gameServerClusterId)
Creates a new game server cluster in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateGameServerClusterRequest,com.google.longrunning.Operation> |
createGameServerClusterCallable()
Creates a new game server cluster in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateGameServerClusterRequest,GameServerCluster,OperationMetadata> |
createGameServerClusterOperationCallable()
Creates a new game server cluster in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteGameServerClusterAsync(DeleteGameServerClusterRequest request)
Deletes a single game server cluster.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteGameServerClusterAsync(GameServerClusterName name)
Deletes a single game server cluster.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteGameServerClusterAsync(String name)
Deletes a single game server cluster.
|
com.google.api.gax.rpc.UnaryCallable<DeleteGameServerClusterRequest,com.google.longrunning.Operation> |
deleteGameServerClusterCallable()
Deletes a single game server cluster.
|
com.google.api.gax.rpc.OperationCallable<DeleteGameServerClusterRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteGameServerClusterOperationCallable()
Deletes a single game server cluster.
|
GameServerCluster |
getGameServerCluster(GameServerClusterName name)
Gets details of a single game server cluster.
|
GameServerCluster |
getGameServerCluster(GetGameServerClusterRequest request)
Gets details of a single game server cluster.
|
GameServerCluster |
getGameServerCluster(String name)
Gets details of a single game server cluster.
|
com.google.api.gax.rpc.UnaryCallable<GetGameServerClusterRequest,GameServerCluster> |
getGameServerClusterCallable()
Gets details of a single game server cluster.
|
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.
|
GameServerClustersServiceSettings |
getSettings() |
GameServerClustersServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
GameServerClustersServiceClient.ListGameServerClustersPagedResponse |
listGameServerClusters(ListGameServerClustersRequest request)
Lists game server clusters in a given project and location.
|
GameServerClustersServiceClient.ListGameServerClustersPagedResponse |
listGameServerClusters(RealmName parent)
Lists game server clusters in a given project and location.
|
GameServerClustersServiceClient.ListGameServerClustersPagedResponse |
listGameServerClusters(String parent)
Lists game server clusters in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListGameServerClustersRequest,ListGameServerClustersResponse> |
listGameServerClustersCallable()
Lists game server clusters in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListGameServerClustersRequest,GameServerClustersServiceClient.ListGameServerClustersPagedResponse> |
listGameServerClustersPagedCallable()
Lists game server clusters in a given project and location.
|
PreviewCreateGameServerClusterResponse |
previewCreateGameServerCluster(PreviewCreateGameServerClusterRequest request)
Previews creation of a new game server cluster in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<PreviewCreateGameServerClusterRequest,PreviewCreateGameServerClusterResponse> |
previewCreateGameServerClusterCallable()
Previews creation of a new game server cluster in a given project and location.
|
PreviewDeleteGameServerClusterResponse |
previewDeleteGameServerCluster(PreviewDeleteGameServerClusterRequest request)
Previews deletion of a single game server cluster.
|
com.google.api.gax.rpc.UnaryCallable<PreviewDeleteGameServerClusterRequest,PreviewDeleteGameServerClusterResponse> |
previewDeleteGameServerClusterCallable()
Previews deletion of a single game server cluster.
|
PreviewUpdateGameServerClusterResponse |
previewUpdateGameServerCluster(PreviewUpdateGameServerClusterRequest request)
Previews updating a GameServerCluster.
|
com.google.api.gax.rpc.UnaryCallable<PreviewUpdateGameServerClusterRequest,PreviewUpdateGameServerClusterResponse> |
previewUpdateGameServerClusterCallable()
Previews updating a GameServerCluster.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<GameServerCluster,OperationMetadata> |
updateGameServerClusterAsync(GameServerCluster gameServerCluster,
com.google.protobuf.FieldMask updateMask)
Patches a single game server cluster.
|
com.google.api.gax.longrunning.OperationFuture<GameServerCluster,OperationMetadata> |
updateGameServerClusterAsync(UpdateGameServerClusterRequest request)
Patches a single game server cluster.
|
com.google.api.gax.rpc.UnaryCallable<UpdateGameServerClusterRequest,com.google.longrunning.Operation> |
updateGameServerClusterCallable()
Patches a single game server cluster.
|
com.google.api.gax.rpc.OperationCallable<UpdateGameServerClusterRequest,GameServerCluster,OperationMetadata> |
updateGameServerClusterOperationCallable()
Patches a single game server cluster.
|
protected GameServerClustersServiceClient(GameServerClustersServiceSettings settings) throws IOException
IOExceptionprotected GameServerClustersServiceClient(GameServerClustersServiceStub stub)
public static final GameServerClustersServiceClient create() throws IOException
IOExceptionpublic static final GameServerClustersServiceClient create(GameServerClustersServiceSettings settings) throws IOException
IOExceptionpublic static final GameServerClustersServiceClient create(GameServerClustersServiceStub stub)
public final GameServerClustersServiceSettings getSettings()
public GameServerClustersServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final GameServerClustersServiceClient.ListGameServerClustersPagedResponse listGameServerClusters(RealmName 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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
RealmName parent = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]");
for (GameServerCluster element :
gameServerClustersServiceClient.listGameServerClusters(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource name. Uses the form:
"projects/{project}/locations/{location}/realms/{realm}".com.google.api.gax.rpc.ApiException - if the remote call failspublic final GameServerClustersServiceClient.ListGameServerClustersPagedResponse listGameServerClusters(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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
String parent = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString();
for (GameServerCluster element :
gameServerClustersServiceClient.listGameServerClusters(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource name. Uses the form:
"projects/{project}/locations/{location}/realms/{realm}".com.google.api.gax.rpc.ApiException - if the remote call failspublic final GameServerClustersServiceClient.ListGameServerClustersPagedResponse listGameServerClusters(ListGameServerClustersRequest 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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
ListGameServerClustersRequest request =
ListGameServerClustersRequest.newBuilder()
.setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (GameServerCluster element :
gameServerClustersServiceClient.listGameServerClusters(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<ListGameServerClustersRequest,GameServerClustersServiceClient.ListGameServerClustersPagedResponse> listGameServerClustersPagedCallable()
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
ListGameServerClustersRequest request =
ListGameServerClustersRequest.newBuilder()
.setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<GameServerCluster> future =
gameServerClustersServiceClient.listGameServerClustersPagedCallable().futureCall(request);
// Do something.
for (GameServerCluster element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListGameServerClustersRequest,ListGameServerClustersResponse> listGameServerClustersCallable()
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
ListGameServerClustersRequest request =
ListGameServerClustersRequest.newBuilder()
.setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListGameServerClustersResponse response =
gameServerClustersServiceClient.listGameServerClustersCallable().call(request);
for (GameServerCluster element : response.getGameServerClustersList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final GameServerCluster getGameServerCluster(GameServerClusterName 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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
GameServerClusterName name =
GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]");
GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(name);
}
name - Required. The name of the game server cluster to retrieve. Uses the form:
`projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final GameServerCluster getGameServerCluster(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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
String name =
GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]").toString();
GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(name);
}
name - Required. The name of the game server cluster to retrieve. Uses the form:
`projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final GameServerCluster getGameServerCluster(GetGameServerClusterRequest 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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
GetGameServerClusterRequest request =
GetGameServerClusterRequest.newBuilder()
.setName(
GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
.toString())
.build();
GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(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<GetGameServerClusterRequest,GameServerCluster> getGameServerClusterCallable()
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
GetGameServerClusterRequest request =
GetGameServerClusterRequest.newBuilder()
.setName(
GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
.toString())
.build();
ApiFuture<GameServerCluster> future =
gameServerClustersServiceClient.getGameServerClusterCallable().futureCall(request);
// Do something.
GameServerCluster response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<GameServerCluster,OperationMetadata> createGameServerClusterAsync(RealmName parent, GameServerCluster gameServerCluster, String gameServerClusterId)
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
RealmName parent = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]");
GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
String gameServerClusterId = "gameServerClusterId-1301104032";
GameServerCluster response =
gameServerClustersServiceClient
.createGameServerClusterAsync(parent, gameServerCluster, gameServerClusterId)
.get();
}
parent - Required. The parent resource name. Uses the form:
`projects/{project}/locations/{location}/realms/{realm-id}`.gameServerCluster - Required. The game server cluster resource to be created.gameServerClusterId - Required. The ID of the game server cluster resource to be created.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<GameServerCluster,OperationMetadata> createGameServerClusterAsync(String parent, GameServerCluster gameServerCluster, String gameServerClusterId)
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
String parent = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString();
GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
String gameServerClusterId = "gameServerClusterId-1301104032";
GameServerCluster response =
gameServerClustersServiceClient
.createGameServerClusterAsync(parent, gameServerCluster, gameServerClusterId)
.get();
}
parent - Required. The parent resource name. Uses the form:
`projects/{project}/locations/{location}/realms/{realm-id}`.gameServerCluster - Required. The game server cluster resource to be created.gameServerClusterId - Required. The ID of the game server cluster resource to be created.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<GameServerCluster,OperationMetadata> createGameServerClusterAsync(CreateGameServerClusterRequest 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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
CreateGameServerClusterRequest request =
CreateGameServerClusterRequest.newBuilder()
.setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
.setGameServerClusterId("gameServerClusterId-1301104032")
.setGameServerCluster(GameServerCluster.newBuilder().build())
.build();
GameServerCluster response =
gameServerClustersServiceClient.createGameServerClusterAsync(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<CreateGameServerClusterRequest,GameServerCluster,OperationMetadata> createGameServerClusterOperationCallable()
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
CreateGameServerClusterRequest request =
CreateGameServerClusterRequest.newBuilder()
.setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
.setGameServerClusterId("gameServerClusterId-1301104032")
.setGameServerCluster(GameServerCluster.newBuilder().build())
.build();
OperationFuture<GameServerCluster, OperationMetadata> future =
gameServerClustersServiceClient
.createGameServerClusterOperationCallable()
.futureCall(request);
// Do something.
GameServerCluster response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateGameServerClusterRequest,com.google.longrunning.Operation> createGameServerClusterCallable()
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
CreateGameServerClusterRequest request =
CreateGameServerClusterRequest.newBuilder()
.setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
.setGameServerClusterId("gameServerClusterId-1301104032")
.setGameServerCluster(GameServerCluster.newBuilder().build())
.build();
ApiFuture<Operation> future =
gameServerClustersServiceClient.createGameServerClusterCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final PreviewCreateGameServerClusterResponse previewCreateGameServerCluster(PreviewCreateGameServerClusterRequest 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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
PreviewCreateGameServerClusterRequest request =
PreviewCreateGameServerClusterRequest.newBuilder()
.setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
.setGameServerClusterId("gameServerClusterId-1301104032")
.setGameServerCluster(GameServerCluster.newBuilder().build())
.setPreviewTime(Timestamp.newBuilder().build())
.build();
PreviewCreateGameServerClusterResponse response =
gameServerClustersServiceClient.previewCreateGameServerCluster(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<PreviewCreateGameServerClusterRequest,PreviewCreateGameServerClusterResponse> previewCreateGameServerClusterCallable()
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
PreviewCreateGameServerClusterRequest request =
PreviewCreateGameServerClusterRequest.newBuilder()
.setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
.setGameServerClusterId("gameServerClusterId-1301104032")
.setGameServerCluster(GameServerCluster.newBuilder().build())
.setPreviewTime(Timestamp.newBuilder().build())
.build();
ApiFuture<PreviewCreateGameServerClusterResponse> future =
gameServerClustersServiceClient
.previewCreateGameServerClusterCallable()
.futureCall(request);
// Do something.
PreviewCreateGameServerClusterResponse response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGameServerClusterAsync(GameServerClusterName 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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
GameServerClusterName name =
GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]");
gameServerClustersServiceClient.deleteGameServerClusterAsync(name).get();
}
name - Required. The name of the game server cluster to delete. Uses the form:
`projects/{project}/locations/{location}/gameServerClusters/{cluster}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGameServerClusterAsync(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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
String name =
GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]").toString();
gameServerClustersServiceClient.deleteGameServerClusterAsync(name).get();
}
name - Required. The name of the game server cluster to delete. Uses the form:
`projects/{project}/locations/{location}/gameServerClusters/{cluster}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGameServerClusterAsync(DeleteGameServerClusterRequest 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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
DeleteGameServerClusterRequest request =
DeleteGameServerClusterRequest.newBuilder()
.setName(
GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
.toString())
.build();
gameServerClustersServiceClient.deleteGameServerClusterAsync(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<DeleteGameServerClusterRequest,com.google.protobuf.Empty,OperationMetadata> deleteGameServerClusterOperationCallable()
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
DeleteGameServerClusterRequest request =
DeleteGameServerClusterRequest.newBuilder()
.setName(
GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
.toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
gameServerClustersServiceClient
.deleteGameServerClusterOperationCallable()
.futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteGameServerClusterRequest,com.google.longrunning.Operation> deleteGameServerClusterCallable()
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
DeleteGameServerClusterRequest request =
DeleteGameServerClusterRequest.newBuilder()
.setName(
GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
.toString())
.build();
ApiFuture<Operation> future =
gameServerClustersServiceClient.deleteGameServerClusterCallable().futureCall(request);
// Do something.
future.get();
}
public final PreviewDeleteGameServerClusterResponse previewDeleteGameServerCluster(PreviewDeleteGameServerClusterRequest 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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
PreviewDeleteGameServerClusterRequest request =
PreviewDeleteGameServerClusterRequest.newBuilder()
.setName(
GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
.toString())
.setPreviewTime(Timestamp.newBuilder().build())
.build();
PreviewDeleteGameServerClusterResponse response =
gameServerClustersServiceClient.previewDeleteGameServerCluster(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<PreviewDeleteGameServerClusterRequest,PreviewDeleteGameServerClusterResponse> previewDeleteGameServerClusterCallable()
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
PreviewDeleteGameServerClusterRequest request =
PreviewDeleteGameServerClusterRequest.newBuilder()
.setName(
GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
.toString())
.setPreviewTime(Timestamp.newBuilder().build())
.build();
ApiFuture<PreviewDeleteGameServerClusterResponse> future =
gameServerClustersServiceClient
.previewDeleteGameServerClusterCallable()
.futureCall(request);
// Do something.
PreviewDeleteGameServerClusterResponse response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<GameServerCluster,OperationMetadata> updateGameServerClusterAsync(GameServerCluster gameServerCluster, 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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
GameServerCluster response =
gameServerClustersServiceClient
.updateGameServerClusterAsync(gameServerCluster, updateMask)
.get();
}
gameServerCluster - Required. The game server cluster to be updated. Only fields specified
in update_mask are updated.updateMask - Required. Mask of fields to update. At least one path must be supplied in
this field. 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<GameServerCluster,OperationMetadata> updateGameServerClusterAsync(UpdateGameServerClusterRequest 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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
UpdateGameServerClusterRequest request =
UpdateGameServerClusterRequest.newBuilder()
.setGameServerCluster(GameServerCluster.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
GameServerCluster response =
gameServerClustersServiceClient.updateGameServerClusterAsync(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<UpdateGameServerClusterRequest,GameServerCluster,OperationMetadata> updateGameServerClusterOperationCallable()
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
UpdateGameServerClusterRequest request =
UpdateGameServerClusterRequest.newBuilder()
.setGameServerCluster(GameServerCluster.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
OperationFuture<GameServerCluster, OperationMetadata> future =
gameServerClustersServiceClient
.updateGameServerClusterOperationCallable()
.futureCall(request);
// Do something.
GameServerCluster response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateGameServerClusterRequest,com.google.longrunning.Operation> updateGameServerClusterCallable()
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
UpdateGameServerClusterRequest request =
UpdateGameServerClusterRequest.newBuilder()
.setGameServerCluster(GameServerCluster.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Operation> future =
gameServerClustersServiceClient.updateGameServerClusterCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final PreviewUpdateGameServerClusterResponse previewUpdateGameServerCluster(PreviewUpdateGameServerClusterRequest 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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
PreviewUpdateGameServerClusterRequest request =
PreviewUpdateGameServerClusterRequest.newBuilder()
.setGameServerCluster(GameServerCluster.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setPreviewTime(Timestamp.newBuilder().build())
.build();
PreviewUpdateGameServerClusterResponse response =
gameServerClustersServiceClient.previewUpdateGameServerCluster(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<PreviewUpdateGameServerClusterRequest,PreviewUpdateGameServerClusterResponse> previewUpdateGameServerClusterCallable()
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 (GameServerClustersServiceClient gameServerClustersServiceClient =
GameServerClustersServiceClient.create()) {
PreviewUpdateGameServerClusterRequest request =
PreviewUpdateGameServerClusterRequest.newBuilder()
.setGameServerCluster(GameServerCluster.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setPreviewTime(Timestamp.newBuilder().build())
.build();
ApiFuture<PreviewUpdateGameServerClusterResponse> future =
gameServerClustersServiceClient
.previewUpdateGameServerClusterCallable()
.futureCall(request);
// Do something.
PreviewUpdateGameServerClusterResponse 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.