@BetaApi @Generated(value="by gapic-generator-java") public class GameServerConfigsServiceClient 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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
GameServerConfigName name =
GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]");
GameServerConfig response = gameServerConfigsServiceClient.getGameServerConfig(name);
}
Note: close() needs to be called on the GameServerConfigsServiceClient 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 GameServerConfigsServiceSettings 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
GameServerConfigsServiceSettings gameServerConfigsServiceSettings =
GameServerConfigsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create(gameServerConfigsServiceSettings);
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
GameServerConfigsServiceSettings gameServerConfigsServiceSettings =
GameServerConfigsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create(gameServerConfigsServiceSettings);
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
GameServerConfigsServiceSettings gameServerConfigsServiceSettings =
GameServerConfigsServiceSettings.newHttpJsonBuilder().build();
GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create(gameServerConfigsServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
GameServerConfigsServiceClient.ListGameServerConfigsFixedSizeCollection |
static class |
GameServerConfigsServiceClient.ListGameServerConfigsPage |
static class |
GameServerConfigsServiceClient.ListGameServerConfigsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
GameServerConfigsServiceClient(GameServerConfigsServiceSettings settings)
Constructs an instance of GameServerConfigsServiceClient, using the given settings.
|
protected |
GameServerConfigsServiceClient(GameServerConfigsServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static GameServerConfigsServiceClient |
create()
Constructs an instance of GameServerConfigsServiceClient with default settings.
|
static GameServerConfigsServiceClient |
create(GameServerConfigsServiceSettings settings)
Constructs an instance of GameServerConfigsServiceClient, using the given settings.
|
static GameServerConfigsServiceClient |
create(GameServerConfigsServiceStub stub)
Constructs an instance of GameServerConfigsServiceClient, using the given stub for making
calls.
|
com.google.api.gax.longrunning.OperationFuture<GameServerConfig,OperationMetadata> |
createGameServerConfigAsync(CreateGameServerConfigRequest request)
Creates a new game server config in a given project, location, and game server deployment.
|
com.google.api.gax.longrunning.OperationFuture<GameServerConfig,OperationMetadata> |
createGameServerConfigAsync(GameServerDeploymentName parent,
GameServerConfig gameServerConfig)
Creates a new game server config in a given project, location, and game server deployment.
|
com.google.api.gax.longrunning.OperationFuture<GameServerConfig,OperationMetadata> |
createGameServerConfigAsync(String parent,
GameServerConfig gameServerConfig)
Creates a new game server config in a given project, location, and game server deployment.
|
com.google.api.gax.rpc.UnaryCallable<CreateGameServerConfigRequest,com.google.longrunning.Operation> |
createGameServerConfigCallable()
Creates a new game server config in a given project, location, and game server deployment.
|
com.google.api.gax.rpc.OperationCallable<CreateGameServerConfigRequest,GameServerConfig,OperationMetadata> |
createGameServerConfigOperationCallable()
Creates a new game server config in a given project, location, and game server deployment.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteGameServerConfigAsync(DeleteGameServerConfigRequest request)
Deletes a single game server config.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteGameServerConfigAsync(GameServerConfigName name)
Deletes a single game server config.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteGameServerConfigAsync(String name)
Deletes a single game server config.
|
com.google.api.gax.rpc.UnaryCallable<DeleteGameServerConfigRequest,com.google.longrunning.Operation> |
deleteGameServerConfigCallable()
Deletes a single game server config.
|
com.google.api.gax.rpc.OperationCallable<DeleteGameServerConfigRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteGameServerConfigOperationCallable()
Deletes a single game server config.
|
GameServerConfig |
getGameServerConfig(GameServerConfigName name)
Gets details of a single game server config.
|
GameServerConfig |
getGameServerConfig(GetGameServerConfigRequest request)
Gets details of a single game server config.
|
GameServerConfig |
getGameServerConfig(String name)
Gets details of a single game server config.
|
com.google.api.gax.rpc.UnaryCallable<GetGameServerConfigRequest,GameServerConfig> |
getGameServerConfigCallable()
Gets details of a single game server config.
|
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.
|
GameServerConfigsServiceSettings |
getSettings() |
GameServerConfigsServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
GameServerConfigsServiceClient.ListGameServerConfigsPagedResponse |
listGameServerConfigs(GameServerDeploymentName parent)
Lists game server configs in a given project, location, and game server deployment.
|
GameServerConfigsServiceClient.ListGameServerConfigsPagedResponse |
listGameServerConfigs(ListGameServerConfigsRequest request)
Lists game server configs in a given project, location, and game server deployment.
|
GameServerConfigsServiceClient.ListGameServerConfigsPagedResponse |
listGameServerConfigs(String parent)
Lists game server configs in a given project, location, and game server deployment.
|
com.google.api.gax.rpc.UnaryCallable<ListGameServerConfigsRequest,ListGameServerConfigsResponse> |
listGameServerConfigsCallable()
Lists game server configs in a given project, location, and game server deployment.
|
com.google.api.gax.rpc.UnaryCallable<ListGameServerConfigsRequest,GameServerConfigsServiceClient.ListGameServerConfigsPagedResponse> |
listGameServerConfigsPagedCallable()
Lists game server configs in a given project, location, and game server deployment.
|
void |
shutdown() |
void |
shutdownNow() |
protected GameServerConfigsServiceClient(GameServerConfigsServiceSettings settings) throws IOException
IOExceptionprotected GameServerConfigsServiceClient(GameServerConfigsServiceStub stub)
public static final GameServerConfigsServiceClient create() throws IOException
IOExceptionpublic static final GameServerConfigsServiceClient create(GameServerConfigsServiceSettings settings) throws IOException
IOExceptionpublic static final GameServerConfigsServiceClient create(GameServerConfigsServiceStub stub)
public final GameServerConfigsServiceSettings getSettings()
public GameServerConfigsServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final GameServerConfigsServiceClient.ListGameServerConfigsPagedResponse listGameServerConfigs(GameServerDeploymentName 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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
GameServerDeploymentName parent =
GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
for (GameServerConfig element :
gameServerConfigsServiceClient.listGameServerConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource name. Uses the form:
`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final GameServerConfigsServiceClient.ListGameServerConfigsPagedResponse listGameServerConfigs(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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
String parent =
GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
for (GameServerConfig element :
gameServerConfigsServiceClient.listGameServerConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource name. Uses the form:
`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final GameServerConfigsServiceClient.ListGameServerConfigsPagedResponse listGameServerConfigs(ListGameServerConfigsRequest 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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
ListGameServerConfigsRequest request =
ListGameServerConfigsRequest.newBuilder()
.setParent(
GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (GameServerConfig element :
gameServerConfigsServiceClient.listGameServerConfigs(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<ListGameServerConfigsRequest,GameServerConfigsServiceClient.ListGameServerConfigsPagedResponse> listGameServerConfigsPagedCallable()
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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
ListGameServerConfigsRequest request =
ListGameServerConfigsRequest.newBuilder()
.setParent(
GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<GameServerConfig> future =
gameServerConfigsServiceClient.listGameServerConfigsPagedCallable().futureCall(request);
// Do something.
for (GameServerConfig element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListGameServerConfigsRequest,ListGameServerConfigsResponse> listGameServerConfigsCallable()
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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
ListGameServerConfigsRequest request =
ListGameServerConfigsRequest.newBuilder()
.setParent(
GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListGameServerConfigsResponse response =
gameServerConfigsServiceClient.listGameServerConfigsCallable().call(request);
for (GameServerConfig element : response.getGameServerConfigsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final GameServerConfig getGameServerConfig(GameServerConfigName 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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
GameServerConfigName name =
GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]");
GameServerConfig response = gameServerConfigsServiceClient.getGameServerConfig(name);
}
name - Required. The name of the game server config to retrieve. Uses the form:
`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final GameServerConfig getGameServerConfig(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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
String name =
GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]").toString();
GameServerConfig response = gameServerConfigsServiceClient.getGameServerConfig(name);
}
name - Required. The name of the game server config to retrieve. Uses the form:
`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final GameServerConfig getGameServerConfig(GetGameServerConfigRequest 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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
GetGameServerConfigRequest request =
GetGameServerConfigRequest.newBuilder()
.setName(
GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
.toString())
.build();
GameServerConfig response = gameServerConfigsServiceClient.getGameServerConfig(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<GetGameServerConfigRequest,GameServerConfig> getGameServerConfigCallable()
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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
GetGameServerConfigRequest request =
GetGameServerConfigRequest.newBuilder()
.setName(
GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
.toString())
.build();
ApiFuture<GameServerConfig> future =
gameServerConfigsServiceClient.getGameServerConfigCallable().futureCall(request);
// Do something.
GameServerConfig response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<GameServerConfig,OperationMetadata> createGameServerConfigAsync(GameServerDeploymentName parent, GameServerConfig gameServerConfig)
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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
GameServerDeploymentName parent =
GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
GameServerConfig gameServerConfig = GameServerConfig.newBuilder().build();
GameServerConfig response =
gameServerConfigsServiceClient
.createGameServerConfigAsync(parent, gameServerConfig)
.get();
}
parent - Required. The parent resource name. Uses the form:
`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`.
gameServerConfig - Required. The game server config resource to be created.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<GameServerConfig,OperationMetadata> createGameServerConfigAsync(String parent, GameServerConfig gameServerConfig)
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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
String parent =
GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
GameServerConfig gameServerConfig = GameServerConfig.newBuilder().build();
GameServerConfig response =
gameServerConfigsServiceClient
.createGameServerConfigAsync(parent, gameServerConfig)
.get();
}
parent - Required. The parent resource name. Uses the form:
`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`.
gameServerConfig - Required. The game server config resource to be created.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<GameServerConfig,OperationMetadata> createGameServerConfigAsync(CreateGameServerConfigRequest 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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
CreateGameServerConfigRequest request =
CreateGameServerConfigRequest.newBuilder()
.setParent(
GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
.setConfigId("configId-580140035")
.setGameServerConfig(GameServerConfig.newBuilder().build())
.build();
GameServerConfig response =
gameServerConfigsServiceClient.createGameServerConfigAsync(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<CreateGameServerConfigRequest,GameServerConfig,OperationMetadata> createGameServerConfigOperationCallable()
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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
CreateGameServerConfigRequest request =
CreateGameServerConfigRequest.newBuilder()
.setParent(
GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
.setConfigId("configId-580140035")
.setGameServerConfig(GameServerConfig.newBuilder().build())
.build();
OperationFuture<GameServerConfig, OperationMetadata> future =
gameServerConfigsServiceClient
.createGameServerConfigOperationCallable()
.futureCall(request);
// Do something.
GameServerConfig response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateGameServerConfigRequest,com.google.longrunning.Operation> createGameServerConfigCallable()
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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
CreateGameServerConfigRequest request =
CreateGameServerConfigRequest.newBuilder()
.setParent(
GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
.setConfigId("configId-580140035")
.setGameServerConfig(GameServerConfig.newBuilder().build())
.build();
ApiFuture<Operation> future =
gameServerConfigsServiceClient.createGameServerConfigCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGameServerConfigAsync(GameServerConfigName 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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
GameServerConfigName name =
GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]");
gameServerConfigsServiceClient.deleteGameServerConfigAsync(name).get();
}
name - Required. The name of the game server config to delete. Uses the form:
`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGameServerConfigAsync(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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
String name =
GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]").toString();
gameServerConfigsServiceClient.deleteGameServerConfigAsync(name).get();
}
name - Required. The name of the game server config to delete. Uses the form:
`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGameServerConfigAsync(DeleteGameServerConfigRequest 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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
DeleteGameServerConfigRequest request =
DeleteGameServerConfigRequest.newBuilder()
.setName(
GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
.toString())
.build();
gameServerConfigsServiceClient.deleteGameServerConfigAsync(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<DeleteGameServerConfigRequest,com.google.protobuf.Empty,OperationMetadata> deleteGameServerConfigOperationCallable()
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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
DeleteGameServerConfigRequest request =
DeleteGameServerConfigRequest.newBuilder()
.setName(
GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
.toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
gameServerConfigsServiceClient
.deleteGameServerConfigOperationCallable()
.futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteGameServerConfigRequest,com.google.longrunning.Operation> deleteGameServerConfigCallable()
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 (GameServerConfigsServiceClient gameServerConfigsServiceClient =
GameServerConfigsServiceClient.create()) {
DeleteGameServerConfigRequest request =
DeleteGameServerConfigRequest.newBuilder()
.setName(
GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
.toString())
.build();
ApiFuture<Operation> future =
gameServerConfigsServiceClient.deleteGameServerConfigCallable().futureCall(request);
// Do something.
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.