From c4aa1fd5f83ad13eba5c2833698a8827e61ddc51 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 19 Feb 2021 15:54:22 -0800 Subject: [PATCH] docs: generate sample code in the javadocs (#355) * feat: generate sample code in the Java microgenerator Committer: @miraleung PiperOrigin-RevId: 356341083 Source-Author: Google APIs Source-Date: Mon Feb 8 13:33:28 2021 -0800 Source-Repo: googleapis/googleapis Source-Sha: 8d8c008e56f1af31d57f75561e0f1848ffb29eeb Source-Link: https://github.com/googleapis/googleapis/commit/8d8c008e56f1af31d57f75561e0f1848ffb29eeb * chore: update gapic-generator-java to 0.0.20 Committer: @miraleung PiperOrigin-RevId: 357800868 Source-Author: Google APIs Source-Date: Tue Feb 16 14:06:04 2021 -0800 Source-Repo: googleapis/googleapis Source-Sha: e8bc4471a88ac5f60defe3ed436f517174e59ba0 Source-Link: https://github.com/googleapis/googleapis/commit/e8bc4471a88ac5f60defe3ed436f517174e59ba0 --- .../v1/GameServerClustersServiceClient.java | 481 +++++++++++++++ .../v1/GameServerConfigsServiceClient.java | 310 ++++++++++ .../GameServerDeploymentsServiceClient.java | 548 ++++++++++++++++++ .../cloud/gaming/v1/RealmsServiceClient.java | 323 +++++++++++ .../google/cloud/gaming/v1/package-info.java | 35 ++ .../GrpcGameServerClustersServiceStub.java | 12 + .../GrpcGameServerConfigsServiceStub.java | 7 + .../GrpcGameServerDeploymentsServiceStub.java | 14 + .../gaming/v1/stub/GrpcRealmsServiceStub.java | 10 + .../GameServerClustersServiceClient.java | 481 +++++++++++++++ .../GameServerConfigsServiceClient.java | 310 ++++++++++ .../GameServerDeploymentsServiceClient.java | 548 ++++++++++++++++++ .../gaming/v1beta/RealmsServiceClient.java | 323 +++++++++++ .../cloud/gaming/v1beta/package-info.java | 35 ++ .../GrpcGameServerClustersServiceStub.java | 12 + .../GrpcGameServerConfigsServiceStub.java | 7 + .../GrpcGameServerDeploymentsServiceStub.java | 14 + .../v1beta/stub/GrpcRealmsServiceStub.java | 10 + .../v1/MockGameServerClustersServiceImpl.java | 64 +- .../v1/MockGameServerConfigsServiceImpl.java | 32 +- .../MockGameServerDeploymentsServiceImpl.java | 72 ++- .../gaming/v1/MockRealmsServiceImpl.java | 48 +- .../MockGameServerClustersServiceImpl.java | 64 +- .../MockGameServerConfigsServiceImpl.java | 32 +- .../MockGameServerDeploymentsServiceImpl.java | 72 ++- .../gaming/v1beta/MockRealmsServiceImpl.java | 48 +- synth.metadata | 10 +- 27 files changed, 3863 insertions(+), 59 deletions(-) diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/GameServerClustersServiceClient.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/GameServerClustersServiceClient.java index a7b9c3ad..b2ffdd7c 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/GameServerClustersServiceClient.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/GameServerClustersServiceClient.java @@ -48,6 +48,15 @@ *

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: * + *

{@code
+ * 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(). @@ -167,6 +176,19 @@ public final OperationsClient getOperationsClient() { /** * Lists game server clusters in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   RealmName parent = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   for (GameServerCluster element :
+   *       gameServerClustersServiceClient.listGameServerClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * "projects/{project}/locations/{location}/realms/{realm}". * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -183,6 +205,20 @@ public final ListGameServerClustersPagedResponse listGameServerClusters(RealmNam /** * Lists game server clusters in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   String parent =
+   *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]").toString();
+   *   for (GameServerCluster element :
+   *       gameServerClustersServiceClient.listGameServerClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * "projects/{project}/locations/{location}/realms/{realm}". * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -197,6 +233,28 @@ public final ListGameServerClustersPagedResponse listGameServerClusters(String p /** * Lists game server clusters in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   ListGameServerClustersRequest request =
+   *       ListGameServerClustersRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (GameServerCluster element :
+   *       gameServerClustersServiceClient.listGameServerClusters(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -210,6 +268,28 @@ public final ListGameServerClustersPagedResponse listGameServerClusters( * Lists game server clusters in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   ListGameServerClustersRequest request =
+   *       ListGameServerClustersRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient.listGameServerClustersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (GameServerCluster element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGameServerClustersPagedCallable() { @@ -221,6 +301,25 @@ public final ListGameServerClustersPagedResponse listGameServerClusters( * Lists game server clusters in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   while (true) {
+   *     ListGameServerClustersResponse response =
+   *         gameServerClustersServiceClient.listGameServerClustersCallable().call(request);
+   *     for (GameServerCluster element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGameServerClustersCallable() { @@ -231,6 +330,17 @@ public final ListGameServerClustersPagedResponse listGameServerClusters( /** * Gets details of a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   GameServerClusterName name =
+   *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]");
+   *   GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server cluster to retrieve. Uses the form: *

`projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -247,6 +357,17 @@ public final GameServerCluster getGameServerCluster(GameServerClusterName name) /** * Gets details of a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   String name =
+   *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]").toString();
+   *   GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server cluster to retrieve. Uses the form: *

`projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -261,6 +382,21 @@ public final GameServerCluster getGameServerCluster(String name) { /** * Gets details of a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   GetGameServerClusterRequest request =
+   *       GetGameServerClusterRequest.newBuilder()
+   *           .setName(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .build();
+   *   GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -273,6 +409,22 @@ public final GameServerCluster getGameServerCluster(GetGameServerClusterRequest * Gets details of a single game server cluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   GetGameServerClusterRequest request =
+   *       GetGameServerClusterRequest.newBuilder()
+   *           .setName(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient.getGameServerClusterCallable().futureCall(request);
+   *   // Do something.
+   *   GameServerCluster response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getGameServerClusterCallable() { @@ -283,6 +435,21 @@ public final GameServerCluster getGameServerCluster(GetGameServerClusterRequest /** * Creates a new game server cluster in a given project and location. * + *

Sample code: + * + *

{@code
+   * 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();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}/realms/{realm-id}`. * @param gameServerCluster Required. The game server cluster resource to be created. @@ -304,6 +471,22 @@ public final OperationFuture createGameSer /** * Creates a new game server cluster in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   String parent =
+   *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]").toString();
+   *   GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
+   *   String gameServerClusterId = "gameServerClusterId-1301104032";
+   *   GameServerCluster response =
+   *       gameServerClustersServiceClient
+   *           .createGameServerClusterAsync(parent, gameServerCluster, gameServerClusterId)
+   *           .get();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}/realms/{realm-id}`. * @param gameServerCluster Required. The game server cluster resource to be created. @@ -325,6 +508,24 @@ public final OperationFuture createGameSer /** * Creates a new game server cluster in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   CreateGameServerClusterRequest request =
+   *       CreateGameServerClusterRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setGameServerClusterId("gameServerClusterId-1301104032")
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .build();
+   *   GameServerCluster response =
+   *       gameServerClustersServiceClient.createGameServerClusterAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -338,6 +539,26 @@ public final OperationFuture createGameSer * Creates a new game server cluster in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   CreateGameServerClusterRequest request =
+   *       CreateGameServerClusterRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setGameServerClusterId("gameServerClusterId-1301104032")
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerClustersServiceClient
+   *           .createGameServerClusterOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerCluster response = future.get();
+   * }
+   * }
*/ public final OperationCallable< CreateGameServerClusterRequest, GameServerCluster, OperationMetadata> @@ -350,6 +571,24 @@ public final OperationFuture createGameSer * Creates a new game server cluster in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   CreateGameServerClusterRequest request =
+   *       CreateGameServerClusterRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setGameServerClusterId("gameServerClusterId-1301104032")
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient.createGameServerClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createGameServerClusterCallable() { @@ -360,6 +599,25 @@ public final OperationFuture createGameSer /** * Previews creation of a new game server cluster in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   PreviewCreateGameServerClusterRequest request =
+   *       PreviewCreateGameServerClusterRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setGameServerClusterId("gameServerClusterId-1301104032")
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   PreviewCreateGameServerClusterResponse response =
+   *       gameServerClustersServiceClient.previewCreateGameServerCluster(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -373,6 +631,27 @@ public final PreviewCreateGameServerClusterResponse previewCreateGameServerClust * Previews creation of a new game server cluster in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   PreviewCreateGameServerClusterRequest request =
+   *       PreviewCreateGameServerClusterRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setGameServerClusterId("gameServerClusterId-1301104032")
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient
+   *           .previewCreateGameServerClusterCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   PreviewCreateGameServerClusterResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable< PreviewCreateGameServerClusterRequest, PreviewCreateGameServerClusterResponse> @@ -384,6 +663,17 @@ public final PreviewCreateGameServerClusterResponse previewCreateGameServerClust /** * Deletes a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   GameServerClusterName name =
+   *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]");
+   *   gameServerClustersServiceClient.deleteGameServerClusterAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the game server cluster to delete. Uses the form: * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -401,6 +691,17 @@ public final OperationFuture deleteGameServerClusterAs /** * Deletes a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   String name =
+   *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]").toString();
+   *   gameServerClustersServiceClient.deleteGameServerClusterAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the game server cluster to delete. Uses the form: * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -415,6 +716,21 @@ public final OperationFuture deleteGameServerClusterAs /** * Deletes a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   DeleteGameServerClusterRequest request =
+   *       DeleteGameServerClusterRequest.newBuilder()
+   *           .setName(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .build();
+   *   gameServerClustersServiceClient.deleteGameServerClusterAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -428,6 +744,24 @@ public final OperationFuture deleteGameServerClusterAs * Deletes a single game server cluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   DeleteGameServerClusterRequest request =
+   *       DeleteGameServerClusterRequest.newBuilder()
+   *           .setName(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerClustersServiceClient
+   *           .deleteGameServerClusterOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final OperationCallable deleteGameServerClusterOperationCallable() { @@ -439,6 +773,22 @@ public final OperationFuture deleteGameServerClusterAs * Deletes a single game server cluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   DeleteGameServerClusterRequest request =
+   *       DeleteGameServerClusterRequest.newBuilder()
+   *           .setName(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient.deleteGameServerClusterCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteGameServerClusterCallable() { @@ -449,6 +799,23 @@ public final OperationFuture deleteGameServerClusterAs /** * Previews deletion of a single game server cluster. * + *

Sample code: + * + *

{@code
+   * 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);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -462,6 +829,25 @@ public final PreviewDeleteGameServerClusterResponse previewDeleteGameServerClust * Previews deletion of a single game server cluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   PreviewDeleteGameServerClusterRequest request =
+   *       PreviewDeleteGameServerClusterRequest.newBuilder()
+   *           .setName(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient
+   *           .previewDeleteGameServerClusterCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   PreviewDeleteGameServerClusterResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable< PreviewDeleteGameServerClusterRequest, PreviewDeleteGameServerClusterResponse> @@ -473,6 +859,20 @@ public final PreviewDeleteGameServerClusterResponse previewDeleteGameServerClust /** * Patches a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   GameServerCluster response =
+   *       gameServerClustersServiceClient
+   *           .updateGameServerClusterAsync(gameServerCluster, updateMask)
+   *           .get();
+   * }
+   * }
+ * * @param gameServerCluster Required. The game server cluster to be updated. Only fields specified * in update_mask are updated. * @param updateMask Required. Mask of fields to update. At least one path must be supplied in @@ -495,6 +895,21 @@ public final OperationFuture updateGameSer /** * Patches a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   UpdateGameServerClusterRequest request =
+   *       UpdateGameServerClusterRequest.newBuilder()
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   GameServerCluster response =
+   *       gameServerClustersServiceClient.updateGameServerClusterAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -508,6 +923,23 @@ public final OperationFuture updateGameSer * Patches a single game server cluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   UpdateGameServerClusterRequest request =
+   *       UpdateGameServerClusterRequest.newBuilder()
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerClustersServiceClient
+   *           .updateGameServerClusterOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerCluster response = future.get();
+   * }
+   * }
*/ public final OperationCallable< UpdateGameServerClusterRequest, GameServerCluster, OperationMetadata> @@ -520,6 +952,21 @@ public final OperationFuture updateGameSer * Patches a single game server cluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   UpdateGameServerClusterRequest request =
+   *       UpdateGameServerClusterRequest.newBuilder()
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient.updateGameServerClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateGameServerClusterCallable() { @@ -530,6 +977,22 @@ public final OperationFuture updateGameSer /** * Previews updating a GameServerCluster. * + *

Sample code: + * + *

{@code
+   * 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);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -543,6 +1006,24 @@ public final PreviewUpdateGameServerClusterResponse previewUpdateGameServerClust * Previews updating a GameServerCluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   PreviewUpdateGameServerClusterRequest request =
+   *       PreviewUpdateGameServerClusterRequest.newBuilder()
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient
+   *           .previewUpdateGameServerClusterCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   PreviewUpdateGameServerClusterResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable< PreviewUpdateGameServerClusterRequest, PreviewUpdateGameServerClusterResponse> diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/GameServerConfigsServiceClient.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/GameServerConfigsServiceClient.java index fb7a46fb..dc7b132c 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/GameServerConfigsServiceClient.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/GameServerConfigsServiceClient.java @@ -46,6 +46,15 @@ *

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: * + *

{@code
+ * 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(). @@ -165,6 +174,20 @@ public final OperationsClient getOperationsClient() { /** * Lists game server configs in a given project, location, and game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   GameServerDeploymentName parent =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+   *   for (GameServerConfig element :
+   *       gameServerConfigsServiceClient.listGameServerConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -182,6 +205,20 @@ public final ListGameServerConfigsPagedResponse listGameServerConfigs( /** * Lists game server configs in a given project, location, and game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   String parent =
+   *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]").toString();
+   *   for (GameServerConfig element :
+   *       gameServerConfigsServiceClient.listGameServerConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -196,6 +233,28 @@ public final ListGameServerConfigsPagedResponse listGameServerConfigs(String par /** * Lists game server configs in a given project, location, and game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   ListGameServerConfigsRequest request =
+   *       ListGameServerConfigsRequest.newBuilder()
+   *           .setParent(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (GameServerConfig element :
+   *       gameServerConfigsServiceClient.listGameServerConfigs(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -209,6 +268,28 @@ public final ListGameServerConfigsPagedResponse listGameServerConfigs( * Lists game server configs in a given project, location, and game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   ListGameServerConfigsRequest request =
+   *       ListGameServerConfigsRequest.newBuilder()
+   *           .setParent(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerConfigsServiceClient.listGameServerConfigsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (GameServerConfig element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGameServerConfigsPagedCallable() { @@ -220,6 +301,25 @@ public final ListGameServerConfigsPagedResponse listGameServerConfigs( * Lists game server configs in a given project, location, and game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   while (true) {
+   *     ListGameServerConfigsResponse response =
+   *         gameServerConfigsServiceClient.listGameServerConfigsCallable().call(request);
+   *     for (GameServerConfig element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGameServerConfigsCallable() { @@ -230,6 +330,17 @@ public final ListGameServerConfigsPagedResponse listGameServerConfigs( /** * Gets details of a single game server config. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   GameServerConfigName name =
+   *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]");
+   *   GameServerConfig response = gameServerConfigsServiceClient.getGameServerConfig(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server config to retrieve. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -246,6 +357,17 @@ public final GameServerConfig getGameServerConfig(GameServerConfigName name) { /** * Gets details of a single game server config. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   String name =
+   *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]").toString();
+   *   GameServerConfig response = gameServerConfigsServiceClient.getGameServerConfig(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server config to retrieve. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -260,6 +382,21 @@ public final GameServerConfig getGameServerConfig(String name) { /** * Gets details of a single game server config. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   GetGameServerConfigRequest request =
+   *       GetGameServerConfigRequest.newBuilder()
+   *           .setName(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   GameServerConfig response = gameServerConfigsServiceClient.getGameServerConfig(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -272,6 +409,22 @@ public final GameServerConfig getGameServerConfig(GetGameServerConfigRequest req * Gets details of a single game server config. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   GetGameServerConfigRequest request =
+   *       GetGameServerConfigRequest.newBuilder()
+   *           .setName(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerConfigsServiceClient.getGameServerConfigCallable().futureCall(request);
+   *   // Do something.
+   *   GameServerConfig response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getGameServerConfigCallable() { @@ -284,6 +437,21 @@ public final GameServerConfig getGameServerConfig(GetGameServerConfigRequest req * server configs are immutable, and are not applied until referenced in the game server * deployment rollout resource. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   GameServerDeploymentName parent =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+   *   GameServerConfig gameServerConfig = GameServerConfig.newBuilder().build();
+   *   GameServerConfig response =
+   *       gameServerConfigsServiceClient
+   *           .createGameServerConfigAsync(parent, gameServerConfig)
+   *           .get();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. * @param gameServerConfig Required. The game server config resource to be created. @@ -305,6 +473,21 @@ public final OperationFuture createGameServ * server configs are immutable, and are not applied until referenced in the game server * deployment rollout resource. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   String parent =
+   *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]").toString();
+   *   GameServerConfig gameServerConfig = GameServerConfig.newBuilder().build();
+   *   GameServerConfig response =
+   *       gameServerConfigsServiceClient
+   *           .createGameServerConfigAsync(parent, gameServerConfig)
+   *           .get();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. * @param gameServerConfig Required. The game server config resource to be created. @@ -326,6 +509,24 @@ public final OperationFuture createGameServ * server configs are immutable, and are not applied until referenced in the game server * deployment rollout resource. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   CreateGameServerConfigRequest request =
+   *       CreateGameServerConfigRequest.newBuilder()
+   *           .setParent(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .setConfigId("configId-580140035")
+   *           .setGameServerConfig(GameServerConfig.newBuilder().build())
+   *           .build();
+   *   GameServerConfig response =
+   *       gameServerConfigsServiceClient.createGameServerConfigAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -341,6 +542,26 @@ public final OperationFuture createGameServ * deployment rollout resource. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   CreateGameServerConfigRequest request =
+   *       CreateGameServerConfigRequest.newBuilder()
+   *           .setParent(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .setConfigId("configId-580140035")
+   *           .setGameServerConfig(GameServerConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerConfigsServiceClient
+   *           .createGameServerConfigOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerConfig response = future.get();
+   * }
+   * }
*/ public final OperationCallable createGameServerConfigOperationCallable() { @@ -354,6 +575,24 @@ public final OperationFuture createGameServ * deployment rollout resource. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   CreateGameServerConfigRequest request =
+   *       CreateGameServerConfigRequest.newBuilder()
+   *           .setParent(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .setConfigId("configId-580140035")
+   *           .setGameServerConfig(GameServerConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerConfigsServiceClient.createGameServerConfigCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createGameServerConfigCallable() { @@ -365,6 +604,17 @@ public final OperationFuture createGameServ * Deletes a single game server config. The deletion will fail if the game server config is * referenced in a game server deployment rollout. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   GameServerConfigName name =
+   *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]");
+   *   gameServerConfigsServiceClient.deleteGameServerConfigAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the game server config to delete. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -383,6 +633,17 @@ public final OperationFuture deleteGameServerConfigAsy * Deletes a single game server config. The deletion will fail if the game server config is * referenced in a game server deployment rollout. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   String name =
+   *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]").toString();
+   *   gameServerConfigsServiceClient.deleteGameServerConfigAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the game server config to delete. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -398,6 +659,21 @@ public final OperationFuture deleteGameServerConfigAsy * Deletes a single game server config. The deletion will fail if the game server config is * referenced in a game server deployment rollout. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   DeleteGameServerConfigRequest request =
+   *       DeleteGameServerConfigRequest.newBuilder()
+   *           .setName(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   gameServerConfigsServiceClient.deleteGameServerConfigAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -412,6 +688,24 @@ public final OperationFuture deleteGameServerConfigAsy * referenced in a game server deployment rollout. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   DeleteGameServerConfigRequest request =
+   *       DeleteGameServerConfigRequest.newBuilder()
+   *           .setName(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerConfigsServiceClient
+   *           .deleteGameServerConfigOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final OperationCallable deleteGameServerConfigOperationCallable() { @@ -424,6 +718,22 @@ public final OperationFuture deleteGameServerConfigAsy * referenced in a game server deployment rollout. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   DeleteGameServerConfigRequest request =
+   *       DeleteGameServerConfigRequest.newBuilder()
+   *           .setName(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerConfigsServiceClient.deleteGameServerConfigCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteGameServerConfigCallable() { diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/GameServerDeploymentsServiceClient.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/GameServerDeploymentsServiceClient.java index 419dceeb..9275d299 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/GameServerDeploymentsServiceClient.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/GameServerDeploymentsServiceClient.java @@ -48,6 +48,16 @@ *

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: * + *

{@code
+ * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+ *     GameServerDeploymentsServiceClient.create()) {
+ *   GameServerDeploymentName name =
+ *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ *   GameServerDeployment response =
+ *       gameServerDeploymentsServiceClient.getGameServerDeployment(name);
+ * }
+ * }
+ * *

Note: close() needs to be called on the GameServerDeploymentsServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). @@ -169,6 +179,19 @@ public final OperationsClient getOperationsClient() { /** * Lists game server deployments in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (GameServerDeployment element :
+   *       gameServerDeploymentsServiceClient.listGameServerDeployments(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -186,6 +209,20 @@ public final ListGameServerDeploymentsPagedResponse listGameServerDeployments( /** * Lists game server deployments in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   String parent =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+   *   for (GameServerDeployment element :
+   *       gameServerDeploymentsServiceClient.listGameServerDeployments(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -200,6 +237,27 @@ public final ListGameServerDeploymentsPagedResponse listGameServerDeployments(St /** * Lists game server deployments in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   ListGameServerDeploymentsRequest request =
+   *       ListGameServerDeploymentsRequest.newBuilder()
+   *           .setParent(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (GameServerDeployment element :
+   *       gameServerDeploymentsServiceClient.listGameServerDeployments(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -213,6 +271,29 @@ public final ListGameServerDeploymentsPagedResponse listGameServerDeployments( * Lists game server deployments in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   ListGameServerDeploymentsRequest request =
+   *       ListGameServerDeploymentsRequest.newBuilder()
+   *           .setParent(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .listGameServerDeploymentsPagedCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   for (GameServerDeployment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable< ListGameServerDeploymentsRequest, ListGameServerDeploymentsPagedResponse> @@ -225,6 +306,25 @@ public final ListGameServerDeploymentsPagedResponse listGameServerDeployments( * Lists game server deployments in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   while (true) {
+   *     ListGameServerDeploymentsResponse response =
+   *         gameServerDeploymentsServiceClient.listGameServerDeploymentsCallable().call(request);
+   *     for (GameServerDeployment element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGameServerDeploymentsCallable() { @@ -235,6 +335,18 @@ public final ListGameServerDeploymentsPagedResponse listGameServerDeployments( /** * Gets details of a single game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeploymentName name =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient.getGameServerDeployment(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server delpoyment to retrieve. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -251,6 +363,18 @@ public final GameServerDeployment getGameServerDeployment(GameServerDeploymentNa /** * Gets details of a single game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   String name =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient.getGameServerDeployment(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server delpoyment to retrieve. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -265,6 +389,21 @@ public final GameServerDeployment getGameServerDeployment(String name) { /** * Gets details of a single game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GetGameServerDeploymentRequest request =
+   *       GetGameServerDeploymentRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient.getGameServerDeployment(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -278,6 +417,21 @@ public final GameServerDeployment getGameServerDeployment( * Gets details of a single game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GetGameServerDeploymentRequest request =
+   *       GetGameServerDeploymentRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient.getGameServerDeploymentCallable().futureCall(request);
+   *   // Do something.
+   *   GameServerDeployment response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getGameServerDeploymentCallable() { @@ -288,6 +442,20 @@ public final GameServerDeployment getGameServerDeployment( /** * Creates a new game server deployment in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient
+   *           .createGameServerDeploymentAsync(parent, gameServerDeployment)
+   *           .get();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @param gameServerDeployment Required. The game server delpoyment resource to be created. @@ -308,6 +476,21 @@ public final GameServerDeployment getGameServerDeployment( /** * Creates a new game server deployment in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   String parent =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient
+   *           .createGameServerDeploymentAsync(parent, gameServerDeployment)
+   *           .get();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @param gameServerDeployment Required. The game server delpoyment resource to be created. @@ -327,6 +510,23 @@ public final GameServerDeployment getGameServerDeployment( /** * Creates a new game server deployment in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   CreateGameServerDeploymentRequest request =
+   *       CreateGameServerDeploymentRequest.newBuilder()
+   *           .setParent(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .setDeploymentId("deploymentId-136894784")
+   *           .setGameServerDeployment(GameServerDeployment.newBuilder().build())
+   *           .build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient.createGameServerDeploymentAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -340,6 +540,25 @@ public final GameServerDeployment getGameServerDeployment( * Creates a new game server deployment in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   CreateGameServerDeploymentRequest request =
+   *       CreateGameServerDeploymentRequest.newBuilder()
+   *           .setParent(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .setDeploymentId("deploymentId-136894784")
+   *           .setGameServerDeployment(GameServerDeployment.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .createGameServerDeploymentOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerDeployment response = future.get();
+   * }
+   * }
*/ public final OperationCallable< CreateGameServerDeploymentRequest, GameServerDeployment, OperationMetadata> @@ -352,6 +571,25 @@ public final GameServerDeployment getGameServerDeployment( * Creates a new game server deployment in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   CreateGameServerDeploymentRequest request =
+   *       CreateGameServerDeploymentRequest.newBuilder()
+   *           .setParent(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .setDeploymentId("deploymentId-136894784")
+   *           .setGameServerDeployment(GameServerDeployment.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .createGameServerDeploymentCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createGameServerDeploymentCallable() { @@ -362,6 +600,17 @@ public final GameServerDeployment getGameServerDeployment( /** * Deletes a single game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeploymentName name =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+   *   gameServerDeploymentsServiceClient.deleteGameServerDeploymentAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the game server delpoyment to delete. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -379,6 +628,17 @@ public final OperationFuture deleteGameServerDeploymen /** * Deletes a single game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   String name =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+   *   gameServerDeploymentsServiceClient.deleteGameServerDeploymentAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the game server delpoyment to delete. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -394,6 +654,20 @@ public final OperationFuture deleteGameServerDeploymen /** * Deletes a single game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   DeleteGameServerDeploymentRequest request =
+   *       DeleteGameServerDeploymentRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   gameServerDeploymentsServiceClient.deleteGameServerDeploymentAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -407,6 +681,23 @@ public final OperationFuture deleteGameServerDeploymen * Deletes a single game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   DeleteGameServerDeploymentRequest request =
+   *       DeleteGameServerDeploymentRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .deleteGameServerDeploymentOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final OperationCallable deleteGameServerDeploymentOperationCallable() { @@ -418,6 +709,23 @@ public final OperationFuture deleteGameServerDeploymen * Deletes a single game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   DeleteGameServerDeploymentRequest request =
+   *       DeleteGameServerDeploymentRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .deleteGameServerDeploymentCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteGameServerDeploymentCallable() { @@ -428,6 +736,20 @@ public final OperationFuture deleteGameServerDeploymen /** * Patches a game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient
+   *           .updateGameServerDeploymentAsync(gameServerDeployment, updateMask)
+   *           .get();
+   * }
+   * }
+ * * @param gameServerDeployment Required. The game server delpoyment to be updated. Only fields * specified in update_mask are updated. * @param updateMask Required. Mask of fields to update. At least one path must be supplied in @@ -451,6 +773,21 @@ public final OperationFuture deleteGameServerDeploymen /** * Patches a game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   UpdateGameServerDeploymentRequest request =
+   *       UpdateGameServerDeploymentRequest.newBuilder()
+   *           .setGameServerDeployment(GameServerDeployment.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient.updateGameServerDeploymentAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -464,6 +801,23 @@ public final OperationFuture deleteGameServerDeploymen * Patches a game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   UpdateGameServerDeploymentRequest request =
+   *       UpdateGameServerDeploymentRequest.newBuilder()
+   *           .setGameServerDeployment(GameServerDeployment.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .updateGameServerDeploymentOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerDeployment response = future.get();
+   * }
+   * }
*/ public final OperationCallable< UpdateGameServerDeploymentRequest, GameServerDeployment, OperationMetadata> @@ -476,6 +830,23 @@ public final OperationFuture deleteGameServerDeploymen * Patches a game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   UpdateGameServerDeploymentRequest request =
+   *       UpdateGameServerDeploymentRequest.newBuilder()
+   *           .setGameServerDeployment(GameServerDeployment.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .updateGameServerDeploymentCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateGameServerDeploymentCallable() { @@ -486,6 +857,18 @@ public final OperationFuture deleteGameServerDeploymen /** * Gets details a single game server deployment rollout. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeploymentName name =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+   *   GameServerDeploymentRollout response =
+   *       gameServerDeploymentsServiceClient.getGameServerDeploymentRollout(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server delpoyment to retrieve. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -503,6 +886,18 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( /** * Gets details a single game server deployment rollout. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   String name =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+   *   GameServerDeploymentRollout response =
+   *       gameServerDeploymentsServiceClient.getGameServerDeploymentRollout(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server delpoyment to retrieve. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -517,6 +912,21 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout(String n /** * Gets details a single game server deployment rollout. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GetGameServerDeploymentRolloutRequest request =
+   *       GetGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   GameServerDeploymentRollout response =
+   *       gameServerDeploymentsServiceClient.getGameServerDeploymentRollout(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -530,6 +940,23 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( * Gets details a single game server deployment rollout. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GetGameServerDeploymentRolloutRequest request =
+   *       GetGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .getGameServerDeploymentRolloutCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerDeploymentRollout response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getGameServerDeploymentRolloutCallable() { @@ -544,6 +971,20 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( * realm is explicitly called out in game_server_config_overrides field, that will also not result * in an error. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeploymentRollout rollout = GameServerDeploymentRollout.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient
+   *           .updateGameServerDeploymentRolloutAsync(rollout, updateMask)
+   *           .get();
+   * }
+   * }
+ * * @param rollout Required. The game server delpoyment rollout to be updated. Only fields * specified in update_mask are updated. * @param updateMask Required. Mask of fields to update. At least one path must be supplied in @@ -571,6 +1012,21 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( * realm is explicitly called out in game_server_config_overrides field, that will also not result * in an error. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   UpdateGameServerDeploymentRolloutRequest request =
+   *       UpdateGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setRollout(GameServerDeploymentRollout.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient.updateGameServerDeploymentRolloutAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -588,6 +1044,23 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( * in an error. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   UpdateGameServerDeploymentRolloutRequest request =
+   *       UpdateGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setRollout(GameServerDeploymentRollout.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .updateGameServerDeploymentRolloutOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerDeployment response = future.get();
+   * }
+   * }
*/ public final OperationCallable< UpdateGameServerDeploymentRolloutRequest, GameServerDeployment, OperationMetadata> @@ -604,6 +1077,23 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( * in an error. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   UpdateGameServerDeploymentRolloutRequest request =
+   *       UpdateGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setRollout(GameServerDeploymentRollout.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .updateGameServerDeploymentRolloutCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateGameServerDeploymentRolloutCallable() { @@ -614,6 +1104,22 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( /** * Previews the game server deployment rollout. This API does not mutate the rollout resource. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   PreviewGameServerDeploymentRolloutRequest request =
+   *       PreviewGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setRollout(GameServerDeploymentRollout.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   PreviewGameServerDeploymentRolloutResponse response =
+   *       gameServerDeploymentsServiceClient.previewGameServerDeploymentRollout(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -627,6 +1133,24 @@ public final PreviewGameServerDeploymentRolloutResponse previewGameServerDeploym * Previews the game server deployment rollout. This API does not mutate the rollout resource. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   PreviewGameServerDeploymentRolloutRequest request =
+   *       PreviewGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setRollout(GameServerDeploymentRollout.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .previewGameServerDeploymentRolloutCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   PreviewGameServerDeploymentRolloutResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable< PreviewGameServerDeploymentRolloutRequest, PreviewGameServerDeploymentRolloutResponse> @@ -640,6 +1164,18 @@ public final PreviewGameServerDeploymentRolloutResponse previewGameServerDeploym * Agones fleets and Agones autoscalers, including fleets running an older version of the game * server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   FetchDeploymentStateRequest request =
+   *       FetchDeploymentStateRequest.newBuilder().setName("name3373707").build();
+   *   FetchDeploymentStateResponse response =
+   *       gameServerDeploymentsServiceClient.fetchDeploymentState(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -655,6 +1191,18 @@ public final FetchDeploymentStateResponse fetchDeploymentState( * server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   FetchDeploymentStateRequest request =
+   *       FetchDeploymentStateRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient.fetchDeploymentStateCallable().futureCall(request);
+   *   // Do something.
+   *   FetchDeploymentStateResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable fetchDeploymentStateCallable() { diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/RealmsServiceClient.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/RealmsServiceClient.java index 19d37ef1..7d246ec3 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/RealmsServiceClient.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/RealmsServiceClient.java @@ -48,6 +48,13 @@ *

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: * + *

{@code
+ * 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(). * @@ -162,6 +169,17 @@ public final OperationsClient getOperationsClient() { /** * Lists realms in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Realm element : realmsServiceClient.listRealms(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -176,6 +194,17 @@ public final ListRealmsPagedResponse listRealms(LocationName parent) { /** * Lists realms in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String parent = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString();
+   *   for (Realm element : realmsServiceClient.listRealms(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -189,6 +218,24 @@ public final ListRealmsPagedResponse listRealms(String parent) { /** * Lists realms in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   ListRealmsRequest request =
+   *       ListRealmsRequest.newBuilder()
+   *           .setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Realm element : realmsServiceClient.listRealms(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -201,6 +248,24 @@ public final ListRealmsPagedResponse listRealms(ListRealmsRequest request) { * Lists realms in a given project and location. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   ListRealmsRequest request =
+   *       ListRealmsRequest.newBuilder()
+   *           .setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future = realmsServiceClient.listRealmsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Realm element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listRealmsPagedCallable() { return stub.listRealmsPagedCallable(); @@ -211,6 +276,23 @@ public final UnaryCallable listRealm * Lists realms in a given project and location. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   while (true) {
+   *     ListRealmsResponse response = realmsServiceClient.listRealmsCallable().call(request);
+   *     for (Realm element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listRealmsCallable() { return stub.listRealmsCallable(); @@ -220,6 +302,15 @@ public final UnaryCallable listRealmsCall /** * Gets details of a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   RealmName name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   Realm response = realmsServiceClient.getRealm(name);
+   * }
+   * }
+ * * @param name Required. The name of the realm to retrieve. Uses the form: * `projects/{project}/locations/{location}/realms/{realm}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -234,6 +325,15 @@ public final Realm getRealm(RealmName name) { /** * Gets details of a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString();
+   *   Realm response = realmsServiceClient.getRealm(name);
+   * }
+   * }
+ * * @param name Required. The name of the realm to retrieve. Uses the form: * `projects/{project}/locations/{location}/realms/{realm}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -247,6 +347,18 @@ public final Realm getRealm(String name) { /** * Gets details of a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   GetRealmRequest request =
+   *       GetRealmRequest.newBuilder()
+   *           .setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .build();
+   *   Realm response = realmsServiceClient.getRealm(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -259,6 +371,18 @@ public final Realm getRealm(GetRealmRequest request) { * Gets details of a single realm. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   GetRealmRequest request =
+   *       GetRealmRequest.newBuilder()
+   *           .setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .build();
+   *   ApiFuture future = realmsServiceClient.getRealmCallable().futureCall(request);
+   *   // Do something.
+   *   Realm response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getRealmCallable() { return stub.getRealmCallable(); @@ -268,6 +392,17 @@ public final UnaryCallable getRealmCallable() { /** * Creates a new realm in a given project and location. * + *

Sample code: + * + *

{@code
+   * 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();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @param realm Required. The realm resource to be created. @@ -289,6 +424,17 @@ public final OperationFuture createRealmAsync( /** * Creates a new realm in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String parent = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString();
+   *   Realm realm = Realm.newBuilder().build();
+   *   String realmId = "realmId1080654858";
+   *   Realm response = realmsServiceClient.createRealmAsync(parent, realm, realmId).get();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @param realm Required. The realm resource to be created. @@ -310,6 +456,20 @@ public final OperationFuture createRealmAsync( /** * Creates a new realm in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   CreateRealmRequest request =
+   *       CreateRealmRequest.newBuilder()
+   *           .setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .setRealmId("realmId1080654858")
+   *           .setRealm(Realm.newBuilder().build())
+   *           .build();
+   *   Realm response = realmsServiceClient.createRealmAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -323,6 +483,21 @@ public final OperationFuture createRealmAsync( * Creates a new realm in a given project and location. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   CreateRealmRequest request =
+   *       CreateRealmRequest.newBuilder()
+   *           .setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .setRealmId("realmId1080654858")
+   *           .setRealm(Realm.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       realmsServiceClient.createRealmOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Realm response = future.get();
+   * }
+   * }
*/ public final OperationCallable createRealmOperationCallable() { @@ -334,6 +509,20 @@ public final OperationFuture createRealmAsync( * Creates a new realm in a given project and location. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   CreateRealmRequest request =
+   *       CreateRealmRequest.newBuilder()
+   *           .setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .setRealmId("realmId1080654858")
+   *           .setRealm(Realm.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = realmsServiceClient.createRealmCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createRealmCallable() { return stub.createRealmCallable(); @@ -343,6 +532,15 @@ public final UnaryCallable createRealmCallable() /** * Deletes a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   RealmName name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   realmsServiceClient.deleteRealmAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the realm to delete. Uses the form: * `projects/{project}/locations/{location}/realms/{realm}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -357,6 +555,15 @@ public final OperationFuture deleteRealmAsync(RealmNam /** * Deletes a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString();
+   *   realmsServiceClient.deleteRealmAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the realm to delete. Uses the form: * `projects/{project}/locations/{location}/realms/{realm}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -370,6 +577,18 @@ public final OperationFuture deleteRealmAsync(String n /** * Deletes a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   DeleteRealmRequest request =
+   *       DeleteRealmRequest.newBuilder()
+   *           .setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .build();
+   *   realmsServiceClient.deleteRealmAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -383,6 +602,19 @@ public final OperationFuture deleteRealmAsync( * Deletes a single realm. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   DeleteRealmRequest request =
+   *       DeleteRealmRequest.newBuilder()
+   *           .setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       realmsServiceClient.deleteRealmOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final OperationCallable deleteRealmOperationCallable() { @@ -394,6 +626,18 @@ public final OperationFuture deleteRealmAsync( * Deletes a single realm. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   DeleteRealmRequest request =
+   *       DeleteRealmRequest.newBuilder()
+   *           .setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .build();
+   *   ApiFuture future = realmsServiceClient.deleteRealmCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteRealmCallable() { return stub.deleteRealmCallable(); @@ -403,6 +647,16 @@ public final UnaryCallable deleteRealmCallable() /** * Patches a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   Realm realm = Realm.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Realm response = realmsServiceClient.updateRealmAsync(realm, updateMask).get();
+   * }
+   * }
+ * * @param realm Required. The realm to be updated. Only fields specified in update_mask are * updated. * @param updateMask Required. The update mask applies to the resource. For the `FieldMask` @@ -422,6 +676,19 @@ public final OperationFuture updateRealmAsync( /** * Patches a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   UpdateRealmRequest request =
+   *       UpdateRealmRequest.newBuilder()
+   *           .setRealm(Realm.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Realm response = realmsServiceClient.updateRealmAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -435,6 +702,20 @@ public final OperationFuture updateRealmAsync( * Patches a single realm. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   UpdateRealmRequest request =
+   *       UpdateRealmRequest.newBuilder()
+   *           .setRealm(Realm.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       realmsServiceClient.updateRealmOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Realm response = future.get();
+   * }
+   * }
*/ public final OperationCallable updateRealmOperationCallable() { @@ -446,6 +727,19 @@ public final OperationFuture updateRealmAsync( * Patches a single realm. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   UpdateRealmRequest request =
+   *       UpdateRealmRequest.newBuilder()
+   *           .setRealm(Realm.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = realmsServiceClient.updateRealmCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateRealmCallable() { return stub.updateRealmCallable(); @@ -455,6 +749,20 @@ public final UnaryCallable updateRealmCallable() /** * Previews patches to a single realm. * + *

Sample code: + * + *

{@code
+   * 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);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -467,6 +775,21 @@ public final PreviewRealmUpdateResponse previewRealmUpdate(PreviewRealmUpdateReq * Previews patches to a single realm. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   PreviewRealmUpdateRequest request =
+   *       PreviewRealmUpdateRequest.newBuilder()
+   *           .setRealm(Realm.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       realmsServiceClient.previewRealmUpdateCallable().futureCall(request);
+   *   // Do something.
+   *   PreviewRealmUpdateResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable previewRealmUpdateCallable() { diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/package-info.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/package-info.java index fd31f3af..b64d3329 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/package-info.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/package-info.java @@ -24,12 +24,30 @@ * *

Sample for GameServerClustersServiceClient: * + *

{@code
+ * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+ *     GameServerClustersServiceClient.create()) {
+ *   GameServerClusterName name =
+ *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]");
+ *   GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(name);
+ * }
+ * }
+ * *

======================= GameServerConfigsServiceClient ======================= * *

Service Description: The game server config configures the game servers in an Agones fleet. * *

Sample for GameServerConfigsServiceClient: * + *

{@code
+ * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+ *     GameServerConfigsServiceClient.create()) {
+ *   GameServerConfigName name =
+ *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]");
+ *   GameServerConfig response = gameServerConfigsServiceClient.getGameServerConfig(name);
+ * }
+ * }
+ * *

======================= GameServerDeploymentsServiceClient ======================= * *

Service Description: The game server deployment is used to control the deployment of Agones @@ -37,12 +55,29 @@ * *

Sample for GameServerDeploymentsServiceClient: * + *

{@code
+ * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+ *     GameServerDeploymentsServiceClient.create()) {
+ *   GameServerDeploymentName name =
+ *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ *   GameServerDeployment response =
+ *       gameServerDeploymentsServiceClient.getGameServerDeployment(name);
+ * }
+ * }
+ * *

======================= RealmsServiceClient ======================= * *

Service Description: A realm is a grouping of game server clusters that are considered * interchangeable. * *

Sample for RealmsServiceClient: + * + *

{@code
+ * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+ *   RealmName name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]");
+ *   Realm response = realmsServiceClient.getRealm(name);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.gaming.v1; diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcGameServerClustersServiceStub.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcGameServerClustersServiceStub.java index b07ef5e7..22e05625 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcGameServerClustersServiceStub.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcGameServerClustersServiceStub.java @@ -439,63 +439,75 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable listGameServerClustersCallable() { return listGameServerClustersCallable; } + @Override public UnaryCallable listGameServerClustersPagedCallable() { return listGameServerClustersPagedCallable; } + @Override public UnaryCallable getGameServerClusterCallable() { return getGameServerClusterCallable; } + @Override public UnaryCallable createGameServerClusterCallable() { return createGameServerClusterCallable; } + @Override public OperationCallable createGameServerClusterOperationCallable() { return createGameServerClusterOperationCallable; } + @Override public UnaryCallable< PreviewCreateGameServerClusterRequest, PreviewCreateGameServerClusterResponse> previewCreateGameServerClusterCallable() { return previewCreateGameServerClusterCallable; } + @Override public UnaryCallable deleteGameServerClusterCallable() { return deleteGameServerClusterCallable; } + @Override public OperationCallable deleteGameServerClusterOperationCallable() { return deleteGameServerClusterOperationCallable; } + @Override public UnaryCallable< PreviewDeleteGameServerClusterRequest, PreviewDeleteGameServerClusterResponse> previewDeleteGameServerClusterCallable() { return previewDeleteGameServerClusterCallable; } + @Override public UnaryCallable updateGameServerClusterCallable() { return updateGameServerClusterCallable; } + @Override public OperationCallable updateGameServerClusterOperationCallable() { return updateGameServerClusterOperationCallable; } + @Override public UnaryCallable< PreviewUpdateGameServerClusterRequest, PreviewUpdateGameServerClusterResponse> previewUpdateGameServerClusterCallable() { diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcGameServerConfigsServiceStub.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcGameServerConfigsServiceStub.java index 22d22a87..9c9a0039 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcGameServerConfigsServiceStub.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcGameServerConfigsServiceStub.java @@ -262,33 +262,40 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable listGameServerConfigsCallable() { return listGameServerConfigsCallable; } + @Override public UnaryCallable listGameServerConfigsPagedCallable() { return listGameServerConfigsPagedCallable; } + @Override public UnaryCallable getGameServerConfigCallable() { return getGameServerConfigCallable; } + @Override public UnaryCallable createGameServerConfigCallable() { return createGameServerConfigCallable; } + @Override public OperationCallable createGameServerConfigOperationCallable() { return createGameServerConfigOperationCallable; } + @Override public UnaryCallable deleteGameServerConfigCallable() { return deleteGameServerConfigCallable; } + @Override public OperationCallable deleteGameServerConfigOperationCallable() { return deleteGameServerConfigOperationCallable; diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcGameServerDeploymentsServiceStub.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcGameServerDeploymentsServiceStub.java index c2b835d2..f0e02926 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcGameServerDeploymentsServiceStub.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcGameServerDeploymentsServiceStub.java @@ -480,75 +480,89 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable listGameServerDeploymentsCallable() { return listGameServerDeploymentsCallable; } + @Override public UnaryCallable listGameServerDeploymentsPagedCallable() { return listGameServerDeploymentsPagedCallable; } + @Override public UnaryCallable getGameServerDeploymentCallable() { return getGameServerDeploymentCallable; } + @Override public UnaryCallable createGameServerDeploymentCallable() { return createGameServerDeploymentCallable; } + @Override public OperationCallable< CreateGameServerDeploymentRequest, GameServerDeployment, OperationMetadata> createGameServerDeploymentOperationCallable() { return createGameServerDeploymentOperationCallable; } + @Override public UnaryCallable deleteGameServerDeploymentCallable() { return deleteGameServerDeploymentCallable; } + @Override public OperationCallable deleteGameServerDeploymentOperationCallable() { return deleteGameServerDeploymentOperationCallable; } + @Override public UnaryCallable updateGameServerDeploymentCallable() { return updateGameServerDeploymentCallable; } + @Override public OperationCallable< UpdateGameServerDeploymentRequest, GameServerDeployment, OperationMetadata> updateGameServerDeploymentOperationCallable() { return updateGameServerDeploymentOperationCallable; } + @Override public UnaryCallable getGameServerDeploymentRolloutCallable() { return getGameServerDeploymentRolloutCallable; } + @Override public UnaryCallable updateGameServerDeploymentRolloutCallable() { return updateGameServerDeploymentRolloutCallable; } + @Override public OperationCallable< UpdateGameServerDeploymentRolloutRequest, GameServerDeployment, OperationMetadata> updateGameServerDeploymentRolloutOperationCallable() { return updateGameServerDeploymentRolloutOperationCallable; } + @Override public UnaryCallable< PreviewGameServerDeploymentRolloutRequest, PreviewGameServerDeploymentRolloutResponse> previewGameServerDeploymentRolloutCallable() { return previewGameServerDeploymentRolloutCallable; } + @Override public UnaryCallable fetchDeploymentStateCallable() { return fetchDeploymentStateCallable; diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcRealmsServiceStub.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcRealmsServiceStub.java index e9d98657..d210f2e7 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcRealmsServiceStub.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1/stub/GrpcRealmsServiceStub.java @@ -294,45 +294,55 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable listRealmsCallable() { return listRealmsCallable; } + @Override public UnaryCallable listRealmsPagedCallable() { return listRealmsPagedCallable; } + @Override public UnaryCallable getRealmCallable() { return getRealmCallable; } + @Override public UnaryCallable createRealmCallable() { return createRealmCallable; } + @Override public OperationCallable createRealmOperationCallable() { return createRealmOperationCallable; } + @Override public UnaryCallable deleteRealmCallable() { return deleteRealmCallable; } + @Override public OperationCallable deleteRealmOperationCallable() { return deleteRealmOperationCallable; } + @Override public UnaryCallable updateRealmCallable() { return updateRealmCallable; } + @Override public OperationCallable updateRealmOperationCallable() { return updateRealmOperationCallable; } + @Override public UnaryCallable previewRealmUpdateCallable() { return previewRealmUpdateCallable; diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/GameServerClustersServiceClient.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/GameServerClustersServiceClient.java index b0c4550d..b784d4ab 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/GameServerClustersServiceClient.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/GameServerClustersServiceClient.java @@ -48,6 +48,15 @@ *

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: * + *

{@code
+ * 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(). @@ -168,6 +177,19 @@ public final OperationsClient getOperationsClient() { /** * Lists game server clusters in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   RealmName parent = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   for (GameServerCluster element :
+   *       gameServerClustersServiceClient.listGameServerClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * "projects/{project}/locations/{location}/realms/{realm}". * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -184,6 +206,20 @@ public final ListGameServerClustersPagedResponse listGameServerClusters(RealmNam /** * Lists game server clusters in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   String parent =
+   *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]").toString();
+   *   for (GameServerCluster element :
+   *       gameServerClustersServiceClient.listGameServerClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * "projects/{project}/locations/{location}/realms/{realm}". * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -198,6 +234,28 @@ public final ListGameServerClustersPagedResponse listGameServerClusters(String p /** * Lists game server clusters in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   ListGameServerClustersRequest request =
+   *       ListGameServerClustersRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (GameServerCluster element :
+   *       gameServerClustersServiceClient.listGameServerClusters(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -211,6 +269,28 @@ public final ListGameServerClustersPagedResponse listGameServerClusters( * Lists game server clusters in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   ListGameServerClustersRequest request =
+   *       ListGameServerClustersRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient.listGameServerClustersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (GameServerCluster element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGameServerClustersPagedCallable() { @@ -222,6 +302,25 @@ public final ListGameServerClustersPagedResponse listGameServerClusters( * Lists game server clusters in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   while (true) {
+   *     ListGameServerClustersResponse response =
+   *         gameServerClustersServiceClient.listGameServerClustersCallable().call(request);
+   *     for (GameServerCluster element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGameServerClustersCallable() { @@ -232,6 +331,17 @@ public final ListGameServerClustersPagedResponse listGameServerClusters( /** * Gets details of a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   GameServerClusterName name =
+   *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]");
+   *   GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server cluster to retrieve. Uses the form: *

`projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -248,6 +358,17 @@ public final GameServerCluster getGameServerCluster(GameServerClusterName name) /** * Gets details of a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   String name =
+   *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]").toString();
+   *   GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server cluster to retrieve. Uses the form: *

`projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -262,6 +383,21 @@ public final GameServerCluster getGameServerCluster(String name) { /** * Gets details of a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   GetGameServerClusterRequest request =
+   *       GetGameServerClusterRequest.newBuilder()
+   *           .setName(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .build();
+   *   GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -274,6 +410,22 @@ public final GameServerCluster getGameServerCluster(GetGameServerClusterRequest * Gets details of a single game server cluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   GetGameServerClusterRequest request =
+   *       GetGameServerClusterRequest.newBuilder()
+   *           .setName(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient.getGameServerClusterCallable().futureCall(request);
+   *   // Do something.
+   *   GameServerCluster response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getGameServerClusterCallable() { @@ -284,6 +436,21 @@ public final GameServerCluster getGameServerCluster(GetGameServerClusterRequest /** * Creates a new game server cluster in a given project and location. * + *

Sample code: + * + *

{@code
+   * 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();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}/realms/{realm-id}`. * @param gameServerCluster Required. The game server cluster resource to be created. @@ -305,6 +472,22 @@ public final OperationFuture createGameSer /** * Creates a new game server cluster in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   String parent =
+   *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]").toString();
+   *   GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
+   *   String gameServerClusterId = "gameServerClusterId-1301104032";
+   *   GameServerCluster response =
+   *       gameServerClustersServiceClient
+   *           .createGameServerClusterAsync(parent, gameServerCluster, gameServerClusterId)
+   *           .get();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}/realms/{realm-id}`. * @param gameServerCluster Required. The game server cluster resource to be created. @@ -326,6 +509,24 @@ public final OperationFuture createGameSer /** * Creates a new game server cluster in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   CreateGameServerClusterRequest request =
+   *       CreateGameServerClusterRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setGameServerClusterId("gameServerClusterId-1301104032")
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .build();
+   *   GameServerCluster response =
+   *       gameServerClustersServiceClient.createGameServerClusterAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -339,6 +540,26 @@ public final OperationFuture createGameSer * Creates a new game server cluster in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   CreateGameServerClusterRequest request =
+   *       CreateGameServerClusterRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setGameServerClusterId("gameServerClusterId-1301104032")
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerClustersServiceClient
+   *           .createGameServerClusterOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerCluster response = future.get();
+   * }
+   * }
*/ public final OperationCallable< CreateGameServerClusterRequest, GameServerCluster, OperationMetadata> @@ -351,6 +572,24 @@ public final OperationFuture createGameSer * Creates a new game server cluster in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   CreateGameServerClusterRequest request =
+   *       CreateGameServerClusterRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setGameServerClusterId("gameServerClusterId-1301104032")
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient.createGameServerClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createGameServerClusterCallable() { @@ -361,6 +600,25 @@ public final OperationFuture createGameSer /** * Previews creation of a new game server cluster in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   PreviewCreateGameServerClusterRequest request =
+   *       PreviewCreateGameServerClusterRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setGameServerClusterId("gameServerClusterId-1301104032")
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   PreviewCreateGameServerClusterResponse response =
+   *       gameServerClustersServiceClient.previewCreateGameServerCluster(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -374,6 +632,27 @@ public final PreviewCreateGameServerClusterResponse previewCreateGameServerClust * Previews creation of a new game server cluster in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   PreviewCreateGameServerClusterRequest request =
+   *       PreviewCreateGameServerClusterRequest.newBuilder()
+   *           .setParent(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setGameServerClusterId("gameServerClusterId-1301104032")
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient
+   *           .previewCreateGameServerClusterCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   PreviewCreateGameServerClusterResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable< PreviewCreateGameServerClusterRequest, PreviewCreateGameServerClusterResponse> @@ -385,6 +664,17 @@ public final PreviewCreateGameServerClusterResponse previewCreateGameServerClust /** * Deletes a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   GameServerClusterName name =
+   *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]");
+   *   gameServerClustersServiceClient.deleteGameServerClusterAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the game server cluster to delete. Uses the form: * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -402,6 +692,17 @@ public final OperationFuture deleteGameServerClusterAs /** * Deletes a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   String name =
+   *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]").toString();
+   *   gameServerClustersServiceClient.deleteGameServerClusterAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the game server cluster to delete. Uses the form: * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -416,6 +717,21 @@ public final OperationFuture deleteGameServerClusterAs /** * Deletes a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   DeleteGameServerClusterRequest request =
+   *       DeleteGameServerClusterRequest.newBuilder()
+   *           .setName(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .build();
+   *   gameServerClustersServiceClient.deleteGameServerClusterAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -429,6 +745,24 @@ public final OperationFuture deleteGameServerClusterAs * Deletes a single game server cluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   DeleteGameServerClusterRequest request =
+   *       DeleteGameServerClusterRequest.newBuilder()
+   *           .setName(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerClustersServiceClient
+   *           .deleteGameServerClusterOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final OperationCallable deleteGameServerClusterOperationCallable() { @@ -440,6 +774,22 @@ public final OperationFuture deleteGameServerClusterAs * Deletes a single game server cluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   DeleteGameServerClusterRequest request =
+   *       DeleteGameServerClusterRequest.newBuilder()
+   *           .setName(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient.deleteGameServerClusterCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteGameServerClusterCallable() { @@ -450,6 +800,23 @@ public final OperationFuture deleteGameServerClusterAs /** * Previews deletion of a single game server cluster. * + *

Sample code: + * + *

{@code
+   * 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);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -463,6 +830,25 @@ public final PreviewDeleteGameServerClusterResponse previewDeleteGameServerClust * Previews deletion of a single game server cluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   PreviewDeleteGameServerClusterRequest request =
+   *       PreviewDeleteGameServerClusterRequest.newBuilder()
+   *           .setName(
+   *               GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]")
+   *                   .toString())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient
+   *           .previewDeleteGameServerClusterCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   PreviewDeleteGameServerClusterResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable< PreviewDeleteGameServerClusterRequest, PreviewDeleteGameServerClusterResponse> @@ -474,6 +860,20 @@ public final PreviewDeleteGameServerClusterResponse previewDeleteGameServerClust /** * Patches a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   GameServerCluster gameServerCluster = GameServerCluster.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   GameServerCluster response =
+   *       gameServerClustersServiceClient
+   *           .updateGameServerClusterAsync(gameServerCluster, updateMask)
+   *           .get();
+   * }
+   * }
+ * * @param gameServerCluster Required. The game server cluster to be updated. Only fields specified * in update_mask are updated. * @param updateMask Required. Mask of fields to update. At least one path must be supplied in @@ -496,6 +896,21 @@ public final OperationFuture updateGameSer /** * Patches a single game server cluster. * + *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   UpdateGameServerClusterRequest request =
+   *       UpdateGameServerClusterRequest.newBuilder()
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   GameServerCluster response =
+   *       gameServerClustersServiceClient.updateGameServerClusterAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -509,6 +924,23 @@ public final OperationFuture updateGameSer * Patches a single game server cluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   UpdateGameServerClusterRequest request =
+   *       UpdateGameServerClusterRequest.newBuilder()
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerClustersServiceClient
+   *           .updateGameServerClusterOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerCluster response = future.get();
+   * }
+   * }
*/ public final OperationCallable< UpdateGameServerClusterRequest, GameServerCluster, OperationMetadata> @@ -521,6 +953,21 @@ public final OperationFuture updateGameSer * Patches a single game server cluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   UpdateGameServerClusterRequest request =
+   *       UpdateGameServerClusterRequest.newBuilder()
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient.updateGameServerClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateGameServerClusterCallable() { @@ -531,6 +978,22 @@ public final OperationFuture updateGameSer /** * Previews updating a GameServerCluster. * + *

Sample code: + * + *

{@code
+   * 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);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -544,6 +1007,24 @@ public final PreviewUpdateGameServerClusterResponse previewUpdateGameServerClust * Previews updating a GameServerCluster. * *

Sample code: + * + *

{@code
+   * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+   *     GameServerClustersServiceClient.create()) {
+   *   PreviewUpdateGameServerClusterRequest request =
+   *       PreviewUpdateGameServerClusterRequest.newBuilder()
+   *           .setGameServerCluster(GameServerCluster.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerClustersServiceClient
+   *           .previewUpdateGameServerClusterCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   PreviewUpdateGameServerClusterResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable< PreviewUpdateGameServerClusterRequest, PreviewUpdateGameServerClusterResponse> diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/GameServerConfigsServiceClient.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/GameServerConfigsServiceClient.java index a6c948d4..dffc326c 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/GameServerConfigsServiceClient.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/GameServerConfigsServiceClient.java @@ -46,6 +46,15 @@ *

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: * + *

{@code
+ * 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(). @@ -166,6 +175,20 @@ public final OperationsClient getOperationsClient() { /** * Lists game server configs in a given project, location, and game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   GameServerDeploymentName parent =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+   *   for (GameServerConfig element :
+   *       gameServerConfigsServiceClient.listGameServerConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -183,6 +206,20 @@ public final ListGameServerConfigsPagedResponse listGameServerConfigs( /** * Lists game server configs in a given project, location, and game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   String parent =
+   *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]").toString();
+   *   for (GameServerConfig element :
+   *       gameServerConfigsServiceClient.listGameServerConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -197,6 +234,28 @@ public final ListGameServerConfigsPagedResponse listGameServerConfigs(String par /** * Lists game server configs in a given project, location, and game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   ListGameServerConfigsRequest request =
+   *       ListGameServerConfigsRequest.newBuilder()
+   *           .setParent(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (GameServerConfig element :
+   *       gameServerConfigsServiceClient.listGameServerConfigs(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -210,6 +269,28 @@ public final ListGameServerConfigsPagedResponse listGameServerConfigs( * Lists game server configs in a given project, location, and game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   ListGameServerConfigsRequest request =
+   *       ListGameServerConfigsRequest.newBuilder()
+   *           .setParent(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerConfigsServiceClient.listGameServerConfigsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (GameServerConfig element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGameServerConfigsPagedCallable() { @@ -221,6 +302,25 @@ public final ListGameServerConfigsPagedResponse listGameServerConfigs( * Lists game server configs in a given project, location, and game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   while (true) {
+   *     ListGameServerConfigsResponse response =
+   *         gameServerConfigsServiceClient.listGameServerConfigsCallable().call(request);
+   *     for (GameServerConfig element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGameServerConfigsCallable() { @@ -231,6 +331,17 @@ public final ListGameServerConfigsPagedResponse listGameServerConfigs( /** * Gets details of a single game server config. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   GameServerConfigName name =
+   *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]");
+   *   GameServerConfig response = gameServerConfigsServiceClient.getGameServerConfig(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server config to retrieve. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -247,6 +358,17 @@ public final GameServerConfig getGameServerConfig(GameServerConfigName name) { /** * Gets details of a single game server config. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   String name =
+   *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]").toString();
+   *   GameServerConfig response = gameServerConfigsServiceClient.getGameServerConfig(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server config to retrieve. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -261,6 +383,21 @@ public final GameServerConfig getGameServerConfig(String name) { /** * Gets details of a single game server config. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   GetGameServerConfigRequest request =
+   *       GetGameServerConfigRequest.newBuilder()
+   *           .setName(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   GameServerConfig response = gameServerConfigsServiceClient.getGameServerConfig(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -273,6 +410,22 @@ public final GameServerConfig getGameServerConfig(GetGameServerConfigRequest req * Gets details of a single game server config. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   GetGameServerConfigRequest request =
+   *       GetGameServerConfigRequest.newBuilder()
+   *           .setName(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerConfigsServiceClient.getGameServerConfigCallable().futureCall(request);
+   *   // Do something.
+   *   GameServerConfig response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getGameServerConfigCallable() { @@ -285,6 +438,21 @@ public final GameServerConfig getGameServerConfig(GetGameServerConfigRequest req * server configs are immutable, and are not applied until referenced in the game server * deployment rollout resource. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   GameServerDeploymentName parent =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+   *   GameServerConfig gameServerConfig = GameServerConfig.newBuilder().build();
+   *   GameServerConfig response =
+   *       gameServerConfigsServiceClient
+   *           .createGameServerConfigAsync(parent, gameServerConfig)
+   *           .get();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. * @param gameServerConfig Required. The game server config resource to be created. @@ -306,6 +474,21 @@ public final OperationFuture createGameServ * server configs are immutable, and are not applied until referenced in the game server * deployment rollout resource. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   String parent =
+   *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]").toString();
+   *   GameServerConfig gameServerConfig = GameServerConfig.newBuilder().build();
+   *   GameServerConfig response =
+   *       gameServerConfigsServiceClient
+   *           .createGameServerConfigAsync(parent, gameServerConfig)
+   *           .get();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. * @param gameServerConfig Required. The game server config resource to be created. @@ -327,6 +510,24 @@ public final OperationFuture createGameServ * server configs are immutable, and are not applied until referenced in the game server * deployment rollout resource. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   CreateGameServerConfigRequest request =
+   *       CreateGameServerConfigRequest.newBuilder()
+   *           .setParent(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .setConfigId("configId-580140035")
+   *           .setGameServerConfig(GameServerConfig.newBuilder().build())
+   *           .build();
+   *   GameServerConfig response =
+   *       gameServerConfigsServiceClient.createGameServerConfigAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -342,6 +543,26 @@ public final OperationFuture createGameServ * deployment rollout resource. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   CreateGameServerConfigRequest request =
+   *       CreateGameServerConfigRequest.newBuilder()
+   *           .setParent(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .setConfigId("configId-580140035")
+   *           .setGameServerConfig(GameServerConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerConfigsServiceClient
+   *           .createGameServerConfigOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerConfig response = future.get();
+   * }
+   * }
*/ public final OperationCallable createGameServerConfigOperationCallable() { @@ -355,6 +576,24 @@ public final OperationFuture createGameServ * deployment rollout resource. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   CreateGameServerConfigRequest request =
+   *       CreateGameServerConfigRequest.newBuilder()
+   *           .setParent(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .setConfigId("configId-580140035")
+   *           .setGameServerConfig(GameServerConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerConfigsServiceClient.createGameServerConfigCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createGameServerConfigCallable() { @@ -366,6 +605,17 @@ public final OperationFuture createGameServ * Deletes a single game server config. The deletion will fail if the game server config is * referenced in a game server deployment rollout. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   GameServerConfigName name =
+   *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]");
+   *   gameServerConfigsServiceClient.deleteGameServerConfigAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the game server config to delete. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -384,6 +634,17 @@ public final OperationFuture deleteGameServerConfigAsy * Deletes a single game server config. The deletion will fail if the game server config is * referenced in a game server deployment rollout. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   String name =
+   *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]").toString();
+   *   gameServerConfigsServiceClient.deleteGameServerConfigAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the game server config to delete. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -399,6 +660,21 @@ public final OperationFuture deleteGameServerConfigAsy * Deletes a single game server config. The deletion will fail if the game server config is * referenced in a game server deployment rollout. * + *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   DeleteGameServerConfigRequest request =
+   *       DeleteGameServerConfigRequest.newBuilder()
+   *           .setName(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   gameServerConfigsServiceClient.deleteGameServerConfigAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -413,6 +689,24 @@ public final OperationFuture deleteGameServerConfigAsy * referenced in a game server deployment rollout. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   DeleteGameServerConfigRequest request =
+   *       DeleteGameServerConfigRequest.newBuilder()
+   *           .setName(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerConfigsServiceClient
+   *           .deleteGameServerConfigOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final OperationCallable deleteGameServerConfigOperationCallable() { @@ -425,6 +719,22 @@ public final OperationFuture deleteGameServerConfigAsy * referenced in a game server deployment rollout. * *

Sample code: + * + *

{@code
+   * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+   *     GameServerConfigsServiceClient.create()) {
+   *   DeleteGameServerConfigRequest request =
+   *       DeleteGameServerConfigRequest.newBuilder()
+   *           .setName(
+   *               GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerConfigsServiceClient.deleteGameServerConfigCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteGameServerConfigCallable() { diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/GameServerDeploymentsServiceClient.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/GameServerDeploymentsServiceClient.java index a9f3a1bb..08e50754 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/GameServerDeploymentsServiceClient.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/GameServerDeploymentsServiceClient.java @@ -48,6 +48,16 @@ *

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: * + *

{@code
+ * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+ *     GameServerDeploymentsServiceClient.create()) {
+ *   GameServerDeploymentName name =
+ *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ *   GameServerDeployment response =
+ *       gameServerDeploymentsServiceClient.getGameServerDeployment(name);
+ * }
+ * }
+ * *

Note: close() needs to be called on the GameServerDeploymentsServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). @@ -170,6 +180,19 @@ public final OperationsClient getOperationsClient() { /** * Lists game server deployments in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (GameServerDeployment element :
+   *       gameServerDeploymentsServiceClient.listGameServerDeployments(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -187,6 +210,20 @@ public final ListGameServerDeploymentsPagedResponse listGameServerDeployments( /** * Lists game server deployments in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   String parent =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+   *   for (GameServerDeployment element :
+   *       gameServerDeploymentsServiceClient.listGameServerDeployments(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -201,6 +238,27 @@ public final ListGameServerDeploymentsPagedResponse listGameServerDeployments(St /** * Lists game server deployments in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   ListGameServerDeploymentsRequest request =
+   *       ListGameServerDeploymentsRequest.newBuilder()
+   *           .setParent(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (GameServerDeployment element :
+   *       gameServerDeploymentsServiceClient.listGameServerDeployments(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -214,6 +272,29 @@ public final ListGameServerDeploymentsPagedResponse listGameServerDeployments( * Lists game server deployments in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   ListGameServerDeploymentsRequest request =
+   *       ListGameServerDeploymentsRequest.newBuilder()
+   *           .setParent(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .listGameServerDeploymentsPagedCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   for (GameServerDeployment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable< ListGameServerDeploymentsRequest, ListGameServerDeploymentsPagedResponse> @@ -226,6 +307,25 @@ public final ListGameServerDeploymentsPagedResponse listGameServerDeployments( * Lists game server deployments in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   while (true) {
+   *     ListGameServerDeploymentsResponse response =
+   *         gameServerDeploymentsServiceClient.listGameServerDeploymentsCallable().call(request);
+   *     for (GameServerDeployment element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGameServerDeploymentsCallable() { @@ -236,6 +336,18 @@ public final ListGameServerDeploymentsPagedResponse listGameServerDeployments( /** * Gets details of a single game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeploymentName name =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient.getGameServerDeployment(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server delpoyment to retrieve. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -252,6 +364,18 @@ public final GameServerDeployment getGameServerDeployment(GameServerDeploymentNa /** * Gets details of a single game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   String name =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient.getGameServerDeployment(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server delpoyment to retrieve. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -266,6 +390,21 @@ public final GameServerDeployment getGameServerDeployment(String name) { /** * Gets details of a single game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GetGameServerDeploymentRequest request =
+   *       GetGameServerDeploymentRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient.getGameServerDeployment(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -279,6 +418,21 @@ public final GameServerDeployment getGameServerDeployment( * Gets details of a single game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GetGameServerDeploymentRequest request =
+   *       GetGameServerDeploymentRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient.getGameServerDeploymentCallable().futureCall(request);
+   *   // Do something.
+   *   GameServerDeployment response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getGameServerDeploymentCallable() { @@ -289,6 +443,20 @@ public final GameServerDeployment getGameServerDeployment( /** * Creates a new game server deployment in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient
+   *           .createGameServerDeploymentAsync(parent, gameServerDeployment)
+   *           .get();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @param gameServerDeployment Required. The game server delpoyment resource to be created. @@ -309,6 +477,21 @@ public final GameServerDeployment getGameServerDeployment( /** * Creates a new game server deployment in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   String parent =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient
+   *           .createGameServerDeploymentAsync(parent, gameServerDeployment)
+   *           .get();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @param gameServerDeployment Required. The game server delpoyment resource to be created. @@ -328,6 +511,23 @@ public final GameServerDeployment getGameServerDeployment( /** * Creates a new game server deployment in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   CreateGameServerDeploymentRequest request =
+   *       CreateGameServerDeploymentRequest.newBuilder()
+   *           .setParent(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .setDeploymentId("deploymentId-136894784")
+   *           .setGameServerDeployment(GameServerDeployment.newBuilder().build())
+   *           .build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient.createGameServerDeploymentAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -341,6 +541,25 @@ public final GameServerDeployment getGameServerDeployment( * Creates a new game server deployment in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   CreateGameServerDeploymentRequest request =
+   *       CreateGameServerDeploymentRequest.newBuilder()
+   *           .setParent(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .setDeploymentId("deploymentId-136894784")
+   *           .setGameServerDeployment(GameServerDeployment.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .createGameServerDeploymentOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerDeployment response = future.get();
+   * }
+   * }
*/ public final OperationCallable< CreateGameServerDeploymentRequest, GameServerDeployment, OperationMetadata> @@ -353,6 +572,25 @@ public final GameServerDeployment getGameServerDeployment( * Creates a new game server deployment in a given project and location. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   CreateGameServerDeploymentRequest request =
+   *       CreateGameServerDeploymentRequest.newBuilder()
+   *           .setParent(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .setDeploymentId("deploymentId-136894784")
+   *           .setGameServerDeployment(GameServerDeployment.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .createGameServerDeploymentCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createGameServerDeploymentCallable() { @@ -363,6 +601,17 @@ public final GameServerDeployment getGameServerDeployment( /** * Deletes a single game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeploymentName name =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+   *   gameServerDeploymentsServiceClient.deleteGameServerDeploymentAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the game server delpoyment to delete. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -380,6 +629,17 @@ public final OperationFuture deleteGameServerDeploymen /** * Deletes a single game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   String name =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+   *   gameServerDeploymentsServiceClient.deleteGameServerDeploymentAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the game server delpoyment to delete. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -395,6 +655,20 @@ public final OperationFuture deleteGameServerDeploymen /** * Deletes a single game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   DeleteGameServerDeploymentRequest request =
+   *       DeleteGameServerDeploymentRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   gameServerDeploymentsServiceClient.deleteGameServerDeploymentAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -408,6 +682,23 @@ public final OperationFuture deleteGameServerDeploymen * Deletes a single game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   DeleteGameServerDeploymentRequest request =
+   *       DeleteGameServerDeploymentRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .deleteGameServerDeploymentOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final OperationCallable deleteGameServerDeploymentOperationCallable() { @@ -419,6 +710,23 @@ public final OperationFuture deleteGameServerDeploymen * Deletes a single game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   DeleteGameServerDeploymentRequest request =
+   *       DeleteGameServerDeploymentRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .deleteGameServerDeploymentCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteGameServerDeploymentCallable() { @@ -429,6 +737,20 @@ public final OperationFuture deleteGameServerDeploymen /** * Patches a game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient
+   *           .updateGameServerDeploymentAsync(gameServerDeployment, updateMask)
+   *           .get();
+   * }
+   * }
+ * * @param gameServerDeployment Required. The game server delpoyment to be updated. Only fields * specified in update_mask are updated. * @param updateMask Required. Mask of fields to update. At least one path must be supplied in @@ -452,6 +774,21 @@ public final OperationFuture deleteGameServerDeploymen /** * Patches a game server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   UpdateGameServerDeploymentRequest request =
+   *       UpdateGameServerDeploymentRequest.newBuilder()
+   *           .setGameServerDeployment(GameServerDeployment.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient.updateGameServerDeploymentAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -465,6 +802,23 @@ public final OperationFuture deleteGameServerDeploymen * Patches a game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   UpdateGameServerDeploymentRequest request =
+   *       UpdateGameServerDeploymentRequest.newBuilder()
+   *           .setGameServerDeployment(GameServerDeployment.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .updateGameServerDeploymentOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerDeployment response = future.get();
+   * }
+   * }
*/ public final OperationCallable< UpdateGameServerDeploymentRequest, GameServerDeployment, OperationMetadata> @@ -477,6 +831,23 @@ public final OperationFuture deleteGameServerDeploymen * Patches a game server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   UpdateGameServerDeploymentRequest request =
+   *       UpdateGameServerDeploymentRequest.newBuilder()
+   *           .setGameServerDeployment(GameServerDeployment.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .updateGameServerDeploymentCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateGameServerDeploymentCallable() { @@ -487,6 +858,18 @@ public final OperationFuture deleteGameServerDeploymen /** * Gets details a single game server deployment rollout. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeploymentName name =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+   *   GameServerDeploymentRollout response =
+   *       gameServerDeploymentsServiceClient.getGameServerDeploymentRollout(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server delpoyment to retrieve. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -504,6 +887,18 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( /** * Gets details a single game server deployment rollout. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   String name =
+   *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
+   *   GameServerDeploymentRollout response =
+   *       gameServerDeploymentsServiceClient.getGameServerDeploymentRollout(name);
+   * }
+   * }
+ * * @param name Required. The name of the game server delpoyment to retrieve. Uses the form: *

`projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -518,6 +913,21 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout(String n /** * Gets details a single game server deployment rollout. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GetGameServerDeploymentRolloutRequest request =
+   *       GetGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   GameServerDeploymentRollout response =
+   *       gameServerDeploymentsServiceClient.getGameServerDeploymentRollout(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -531,6 +941,23 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( * Gets details a single game server deployment rollout. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GetGameServerDeploymentRolloutRequest request =
+   *       GetGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setName(
+   *               GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .getGameServerDeploymentRolloutCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerDeploymentRollout response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getGameServerDeploymentRolloutCallable() { @@ -545,6 +972,20 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( * realm is explicitly called out in game_server_config_overrides field, that will also not result * in an error. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   GameServerDeploymentRollout rollout = GameServerDeploymentRollout.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient
+   *           .updateGameServerDeploymentRolloutAsync(rollout, updateMask)
+   *           .get();
+   * }
+   * }
+ * * @param rollout Required. The game server delpoyment rollout to be updated. Only fields * specified in update_mask are updated. * @param updateMask Required. Mask of fields to update. At least one path must be supplied in @@ -572,6 +1013,21 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( * realm is explicitly called out in game_server_config_overrides field, that will also not result * in an error. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   UpdateGameServerDeploymentRolloutRequest request =
+   *       UpdateGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setRollout(GameServerDeploymentRollout.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   GameServerDeployment response =
+   *       gameServerDeploymentsServiceClient.updateGameServerDeploymentRolloutAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -589,6 +1045,23 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( * in an error. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   UpdateGameServerDeploymentRolloutRequest request =
+   *       UpdateGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setRollout(GameServerDeploymentRollout.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .updateGameServerDeploymentRolloutOperationCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GameServerDeployment response = future.get();
+   * }
+   * }
*/ public final OperationCallable< UpdateGameServerDeploymentRolloutRequest, GameServerDeployment, OperationMetadata> @@ -605,6 +1078,23 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( * in an error. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   UpdateGameServerDeploymentRolloutRequest request =
+   *       UpdateGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setRollout(GameServerDeploymentRollout.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .updateGameServerDeploymentRolloutCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateGameServerDeploymentRolloutCallable() { @@ -615,6 +1105,22 @@ public final GameServerDeploymentRollout getGameServerDeploymentRollout( /** * Previews the game server deployment rollout. This API does not mutate the rollout resource. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   PreviewGameServerDeploymentRolloutRequest request =
+   *       PreviewGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setRollout(GameServerDeploymentRollout.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   PreviewGameServerDeploymentRolloutResponse response =
+   *       gameServerDeploymentsServiceClient.previewGameServerDeploymentRollout(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -628,6 +1134,24 @@ public final PreviewGameServerDeploymentRolloutResponse previewGameServerDeploym * Previews the game server deployment rollout. This API does not mutate the rollout resource. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   PreviewGameServerDeploymentRolloutRequest request =
+   *       PreviewGameServerDeploymentRolloutRequest.newBuilder()
+   *           .setRollout(GameServerDeploymentRollout.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient
+   *           .previewGameServerDeploymentRolloutCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   PreviewGameServerDeploymentRolloutResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable< PreviewGameServerDeploymentRolloutRequest, PreviewGameServerDeploymentRolloutResponse> @@ -641,6 +1165,18 @@ public final PreviewGameServerDeploymentRolloutResponse previewGameServerDeploym * Agones fleets and Agones autoscalers, including fleets running an older version of the game * server deployment. * + *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   FetchDeploymentStateRequest request =
+   *       FetchDeploymentStateRequest.newBuilder().setName("name3373707").build();
+   *   FetchDeploymentStateResponse response =
+   *       gameServerDeploymentsServiceClient.fetchDeploymentState(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -656,6 +1192,18 @@ public final FetchDeploymentStateResponse fetchDeploymentState( * server deployment. * *

Sample code: + * + *

{@code
+   * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+   *     GameServerDeploymentsServiceClient.create()) {
+   *   FetchDeploymentStateRequest request =
+   *       FetchDeploymentStateRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       gameServerDeploymentsServiceClient.fetchDeploymentStateCallable().futureCall(request);
+   *   // Do something.
+   *   FetchDeploymentStateResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable fetchDeploymentStateCallable() { diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/RealmsServiceClient.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/RealmsServiceClient.java index f20492ff..f080432d 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/RealmsServiceClient.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/RealmsServiceClient.java @@ -48,6 +48,13 @@ *

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: * + *

{@code
+ * 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(). * @@ -163,6 +170,17 @@ public final OperationsClient getOperationsClient() { /** * Lists realms in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Realm element : realmsServiceClient.listRealms(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -177,6 +195,17 @@ public final ListRealmsPagedResponse listRealms(LocationName parent) { /** * Lists realms in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String parent = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString();
+   *   for (Realm element : realmsServiceClient.listRealms(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -190,6 +219,24 @@ public final ListRealmsPagedResponse listRealms(String parent) { /** * Lists realms in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   ListRealmsRequest request =
+   *       ListRealmsRequest.newBuilder()
+   *           .setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Realm element : realmsServiceClient.listRealms(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -202,6 +249,24 @@ public final ListRealmsPagedResponse listRealms(ListRealmsRequest request) { * Lists realms in a given project and location. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   ListRealmsRequest request =
+   *       ListRealmsRequest.newBuilder()
+   *           .setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future = realmsServiceClient.listRealmsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Realm element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listRealmsPagedCallable() { return stub.listRealmsPagedCallable(); @@ -212,6 +277,23 @@ public final UnaryCallable listRealm * Lists realms in a given project and location. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   while (true) {
+   *     ListRealmsResponse response = realmsServiceClient.listRealmsCallable().call(request);
+   *     for (Realm element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listRealmsCallable() { return stub.listRealmsCallable(); @@ -221,6 +303,15 @@ public final UnaryCallable listRealmsCall /** * Gets details of a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   RealmName name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   Realm response = realmsServiceClient.getRealm(name);
+   * }
+   * }
+ * * @param name Required. The name of the realm to retrieve. Uses the form: * `projects/{project}/locations/{location}/realms/{realm}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -235,6 +326,15 @@ public final Realm getRealm(RealmName name) { /** * Gets details of a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString();
+   *   Realm response = realmsServiceClient.getRealm(name);
+   * }
+   * }
+ * * @param name Required. The name of the realm to retrieve. Uses the form: * `projects/{project}/locations/{location}/realms/{realm}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -248,6 +348,18 @@ public final Realm getRealm(String name) { /** * Gets details of a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   GetRealmRequest request =
+   *       GetRealmRequest.newBuilder()
+   *           .setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .build();
+   *   Realm response = realmsServiceClient.getRealm(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -260,6 +372,18 @@ public final Realm getRealm(GetRealmRequest request) { * Gets details of a single realm. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   GetRealmRequest request =
+   *       GetRealmRequest.newBuilder()
+   *           .setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .build();
+   *   ApiFuture future = realmsServiceClient.getRealmCallable().futureCall(request);
+   *   // Do something.
+   *   Realm response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getRealmCallable() { return stub.getRealmCallable(); @@ -269,6 +393,17 @@ public final UnaryCallable getRealmCallable() { /** * Creates a new realm in a given project and location. * + *

Sample code: + * + *

{@code
+   * 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();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @param realm Required. The realm resource to be created. @@ -290,6 +425,17 @@ public final OperationFuture createRealmAsync( /** * Creates a new realm in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String parent = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString();
+   *   Realm realm = Realm.newBuilder().build();
+   *   String realmId = "realmId1080654858";
+   *   Realm response = realmsServiceClient.createRealmAsync(parent, realm, realmId).get();
+   * }
+   * }
+ * * @param parent Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @param realm Required. The realm resource to be created. @@ -311,6 +457,20 @@ public final OperationFuture createRealmAsync( /** * Creates a new realm in a given project and location. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   CreateRealmRequest request =
+   *       CreateRealmRequest.newBuilder()
+   *           .setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .setRealmId("realmId1080654858")
+   *           .setRealm(Realm.newBuilder().build())
+   *           .build();
+   *   Realm response = realmsServiceClient.createRealmAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -324,6 +484,21 @@ public final OperationFuture createRealmAsync( * Creates a new realm in a given project and location. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   CreateRealmRequest request =
+   *       CreateRealmRequest.newBuilder()
+   *           .setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .setRealmId("realmId1080654858")
+   *           .setRealm(Realm.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       realmsServiceClient.createRealmOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Realm response = future.get();
+   * }
+   * }
*/ public final OperationCallable createRealmOperationCallable() { @@ -335,6 +510,20 @@ public final OperationFuture createRealmAsync( * Creates a new realm in a given project and location. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   CreateRealmRequest request =
+   *       CreateRealmRequest.newBuilder()
+   *           .setParent(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .setRealmId("realmId1080654858")
+   *           .setRealm(Realm.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = realmsServiceClient.createRealmCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createRealmCallable() { return stub.createRealmCallable(); @@ -344,6 +533,15 @@ public final UnaryCallable createRealmCallable() /** * Deletes a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   RealmName name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]");
+   *   realmsServiceClient.deleteRealmAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the realm to delete. Uses the form: * `projects/{project}/locations/{location}/realms/{realm}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -358,6 +556,15 @@ public final OperationFuture deleteRealmAsync(RealmNam /** * Deletes a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   String name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString();
+   *   realmsServiceClient.deleteRealmAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the realm to delete. Uses the form: * `projects/{project}/locations/{location}/realms/{realm}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -371,6 +578,18 @@ public final OperationFuture deleteRealmAsync(String n /** * Deletes a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   DeleteRealmRequest request =
+   *       DeleteRealmRequest.newBuilder()
+   *           .setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .build();
+   *   realmsServiceClient.deleteRealmAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -384,6 +603,19 @@ public final OperationFuture deleteRealmAsync( * Deletes a single realm. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   DeleteRealmRequest request =
+   *       DeleteRealmRequest.newBuilder()
+   *           .setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       realmsServiceClient.deleteRealmOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final OperationCallable deleteRealmOperationCallable() { @@ -395,6 +627,18 @@ public final OperationFuture deleteRealmAsync( * Deletes a single realm. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   DeleteRealmRequest request =
+   *       DeleteRealmRequest.newBuilder()
+   *           .setName(RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]").toString())
+   *           .build();
+   *   ApiFuture future = realmsServiceClient.deleteRealmCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteRealmCallable() { return stub.deleteRealmCallable(); @@ -404,6 +648,16 @@ public final UnaryCallable deleteRealmCallable() /** * Patches a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   Realm realm = Realm.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Realm response = realmsServiceClient.updateRealmAsync(realm, updateMask).get();
+   * }
+   * }
+ * * @param realm Required. The realm to be updated. Only fields specified in update_mask are * updated. * @param updateMask Required. The update mask applies to the resource. For the `FieldMask` @@ -423,6 +677,19 @@ public final OperationFuture updateRealmAsync( /** * Patches a single realm. * + *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   UpdateRealmRequest request =
+   *       UpdateRealmRequest.newBuilder()
+   *           .setRealm(Realm.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Realm response = realmsServiceClient.updateRealmAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -436,6 +703,20 @@ public final OperationFuture updateRealmAsync( * Patches a single realm. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   UpdateRealmRequest request =
+   *       UpdateRealmRequest.newBuilder()
+   *           .setRealm(Realm.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       realmsServiceClient.updateRealmOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Realm response = future.get();
+   * }
+   * }
*/ public final OperationCallable updateRealmOperationCallable() { @@ -447,6 +728,19 @@ public final OperationFuture updateRealmAsync( * Patches a single realm. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   UpdateRealmRequest request =
+   *       UpdateRealmRequest.newBuilder()
+   *           .setRealm(Realm.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = realmsServiceClient.updateRealmCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateRealmCallable() { return stub.updateRealmCallable(); @@ -456,6 +750,20 @@ public final UnaryCallable updateRealmCallable() /** * Previews patches to a single realm. * + *

Sample code: + * + *

{@code
+   * 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);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -468,6 +776,21 @@ public final PreviewRealmUpdateResponse previewRealmUpdate(PreviewRealmUpdateReq * Previews patches to a single realm. * *

Sample code: + * + *

{@code
+   * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+   *   PreviewRealmUpdateRequest request =
+   *       PreviewRealmUpdateRequest.newBuilder()
+   *           .setRealm(Realm.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPreviewTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       realmsServiceClient.previewRealmUpdateCallable().futureCall(request);
+   *   // Do something.
+   *   PreviewRealmUpdateResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable previewRealmUpdateCallable() { diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/package-info.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/package-info.java index 3d743929..815520b5 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/package-info.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/package-info.java @@ -24,12 +24,30 @@ * *

Sample for GameServerClustersServiceClient: * + *

{@code
+ * try (GameServerClustersServiceClient gameServerClustersServiceClient =
+ *     GameServerClustersServiceClient.create()) {
+ *   GameServerClusterName name =
+ *       GameServerClusterName.of("[PROJECT]", "[LOCATION]", "[REALM]", "[CLUSTER]");
+ *   GameServerCluster response = gameServerClustersServiceClient.getGameServerCluster(name);
+ * }
+ * }
+ * *

======================= GameServerConfigsServiceClient ======================= * *

Service Description: The game server config configures the game servers in an Agones fleet. * *

Sample for GameServerConfigsServiceClient: * + *

{@code
+ * try (GameServerConfigsServiceClient gameServerConfigsServiceClient =
+ *     GameServerConfigsServiceClient.create()) {
+ *   GameServerConfigName name =
+ *       GameServerConfigName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[CONFIG]");
+ *   GameServerConfig response = gameServerConfigsServiceClient.getGameServerConfig(name);
+ * }
+ * }
+ * *

======================= GameServerDeploymentsServiceClient ======================= * *

Service Description: The game server deployment is used to control the deployment of Agones @@ -37,12 +55,29 @@ * *

Sample for GameServerDeploymentsServiceClient: * + *

{@code
+ * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
+ *     GameServerDeploymentsServiceClient.create()) {
+ *   GameServerDeploymentName name =
+ *       GameServerDeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
+ *   GameServerDeployment response =
+ *       gameServerDeploymentsServiceClient.getGameServerDeployment(name);
+ * }
+ * }
+ * *

======================= RealmsServiceClient ======================= * *

Service Description: A realm is a grouping of game server clusters that are considered * interchangeable. * *

Sample for RealmsServiceClient: + * + *

{@code
+ * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+ *   RealmName name = RealmName.of("[PROJECT]", "[LOCATION]", "[REALM]");
+ *   Realm response = realmsServiceClient.getRealm(name);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.gaming.v1beta; diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcGameServerClustersServiceStub.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcGameServerClustersServiceStub.java index b7351e12..d6365511 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcGameServerClustersServiceStub.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcGameServerClustersServiceStub.java @@ -441,63 +441,75 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable listGameServerClustersCallable() { return listGameServerClustersCallable; } + @Override public UnaryCallable listGameServerClustersPagedCallable() { return listGameServerClustersPagedCallable; } + @Override public UnaryCallable getGameServerClusterCallable() { return getGameServerClusterCallable; } + @Override public UnaryCallable createGameServerClusterCallable() { return createGameServerClusterCallable; } + @Override public OperationCallable createGameServerClusterOperationCallable() { return createGameServerClusterOperationCallable; } + @Override public UnaryCallable< PreviewCreateGameServerClusterRequest, PreviewCreateGameServerClusterResponse> previewCreateGameServerClusterCallable() { return previewCreateGameServerClusterCallable; } + @Override public UnaryCallable deleteGameServerClusterCallable() { return deleteGameServerClusterCallable; } + @Override public OperationCallable deleteGameServerClusterOperationCallable() { return deleteGameServerClusterOperationCallable; } + @Override public UnaryCallable< PreviewDeleteGameServerClusterRequest, PreviewDeleteGameServerClusterResponse> previewDeleteGameServerClusterCallable() { return previewDeleteGameServerClusterCallable; } + @Override public UnaryCallable updateGameServerClusterCallable() { return updateGameServerClusterCallable; } + @Override public OperationCallable updateGameServerClusterOperationCallable() { return updateGameServerClusterOperationCallable; } + @Override public UnaryCallable< PreviewUpdateGameServerClusterRequest, PreviewUpdateGameServerClusterResponse> previewUpdateGameServerClusterCallable() { diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcGameServerConfigsServiceStub.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcGameServerConfigsServiceStub.java index 6457cd82..f5603775 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcGameServerConfigsServiceStub.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcGameServerConfigsServiceStub.java @@ -264,33 +264,40 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable listGameServerConfigsCallable() { return listGameServerConfigsCallable; } + @Override public UnaryCallable listGameServerConfigsPagedCallable() { return listGameServerConfigsPagedCallable; } + @Override public UnaryCallable getGameServerConfigCallable() { return getGameServerConfigCallable; } + @Override public UnaryCallable createGameServerConfigCallable() { return createGameServerConfigCallable; } + @Override public OperationCallable createGameServerConfigOperationCallable() { return createGameServerConfigOperationCallable; } + @Override public UnaryCallable deleteGameServerConfigCallable() { return deleteGameServerConfigCallable; } + @Override public OperationCallable deleteGameServerConfigOperationCallable() { return deleteGameServerConfigOperationCallable; diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcGameServerDeploymentsServiceStub.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcGameServerDeploymentsServiceStub.java index f21b1f19..d0336752 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcGameServerDeploymentsServiceStub.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcGameServerDeploymentsServiceStub.java @@ -482,75 +482,89 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable listGameServerDeploymentsCallable() { return listGameServerDeploymentsCallable; } + @Override public UnaryCallable listGameServerDeploymentsPagedCallable() { return listGameServerDeploymentsPagedCallable; } + @Override public UnaryCallable getGameServerDeploymentCallable() { return getGameServerDeploymentCallable; } + @Override public UnaryCallable createGameServerDeploymentCallable() { return createGameServerDeploymentCallable; } + @Override public OperationCallable< CreateGameServerDeploymentRequest, GameServerDeployment, OperationMetadata> createGameServerDeploymentOperationCallable() { return createGameServerDeploymentOperationCallable; } + @Override public UnaryCallable deleteGameServerDeploymentCallable() { return deleteGameServerDeploymentCallable; } + @Override public OperationCallable deleteGameServerDeploymentOperationCallable() { return deleteGameServerDeploymentOperationCallable; } + @Override public UnaryCallable updateGameServerDeploymentCallable() { return updateGameServerDeploymentCallable; } + @Override public OperationCallable< UpdateGameServerDeploymentRequest, GameServerDeployment, OperationMetadata> updateGameServerDeploymentOperationCallable() { return updateGameServerDeploymentOperationCallable; } + @Override public UnaryCallable getGameServerDeploymentRolloutCallable() { return getGameServerDeploymentRolloutCallable; } + @Override public UnaryCallable updateGameServerDeploymentRolloutCallable() { return updateGameServerDeploymentRolloutCallable; } + @Override public OperationCallable< UpdateGameServerDeploymentRolloutRequest, GameServerDeployment, OperationMetadata> updateGameServerDeploymentRolloutOperationCallable() { return updateGameServerDeploymentRolloutOperationCallable; } + @Override public UnaryCallable< PreviewGameServerDeploymentRolloutRequest, PreviewGameServerDeploymentRolloutResponse> previewGameServerDeploymentRolloutCallable() { return previewGameServerDeploymentRolloutCallable; } + @Override public UnaryCallable fetchDeploymentStateCallable() { return fetchDeploymentStateCallable; diff --git a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcRealmsServiceStub.java b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcRealmsServiceStub.java index 7d4f36e3..8072168e 100644 --- a/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcRealmsServiceStub.java +++ b/google-cloud-game-servers/src/main/java/com/google/cloud/gaming/v1beta/stub/GrpcRealmsServiceStub.java @@ -296,45 +296,55 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable listRealmsCallable() { return listRealmsCallable; } + @Override public UnaryCallable listRealmsPagedCallable() { return listRealmsPagedCallable; } + @Override public UnaryCallable getRealmCallable() { return getRealmCallable; } + @Override public UnaryCallable createRealmCallable() { return createRealmCallable; } + @Override public OperationCallable createRealmOperationCallable() { return createRealmOperationCallable; } + @Override public UnaryCallable deleteRealmCallable() { return deleteRealmCallable; } + @Override public OperationCallable deleteRealmOperationCallable() { return deleteRealmOperationCallable; } + @Override public UnaryCallable updateRealmCallable() { return updateRealmCallable; } + @Override public OperationCallable updateRealmOperationCallable() { return updateRealmOperationCallable; } + @Override public UnaryCallable previewRealmUpdateCallable() { return previewRealmUpdateCallable; diff --git a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockGameServerClustersServiceImpl.java b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockGameServerClustersServiceImpl.java index ff42692f..dfb361da 100644 --- a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockGameServerClustersServiceImpl.java +++ b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockGameServerClustersServiceImpl.java @@ -71,7 +71,13 @@ public void listGameServerClusters( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListGameServerClusters, expected %s or %s", + response.getClass().getName(), + ListGameServerClustersResponse.class.getName(), + Exception.class.getName()))); } } @@ -86,7 +92,13 @@ public void getGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetGameServerCluster, expected %s or %s", + response.getClass().getName(), + GameServerCluster.class.getName(), + Exception.class.getName()))); } } @@ -101,7 +113,13 @@ public void createGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateGameServerCluster, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -117,7 +135,13 @@ public void previewCreateGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PreviewCreateGameServerCluster, expected %s or %s", + response.getClass().getName(), + PreviewCreateGameServerClusterResponse.class.getName(), + Exception.class.getName()))); } } @@ -132,7 +156,13 @@ public void deleteGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteGameServerCluster, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -148,7 +178,13 @@ public void previewDeleteGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PreviewDeleteGameServerCluster, expected %s or %s", + response.getClass().getName(), + PreviewDeleteGameServerClusterResponse.class.getName(), + Exception.class.getName()))); } } @@ -163,7 +199,13 @@ public void updateGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateGameServerCluster, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -179,7 +221,13 @@ public void previewUpdateGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PreviewUpdateGameServerCluster, expected %s or %s", + response.getClass().getName(), + PreviewUpdateGameServerClusterResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockGameServerConfigsServiceImpl.java b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockGameServerConfigsServiceImpl.java index 78a6d56f..a2b76034 100644 --- a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockGameServerConfigsServiceImpl.java +++ b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockGameServerConfigsServiceImpl.java @@ -71,7 +71,13 @@ public void listGameServerConfigs( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListGameServerConfigs, expected %s or %s", + response.getClass().getName(), + ListGameServerConfigsResponse.class.getName(), + Exception.class.getName()))); } } @@ -86,7 +92,13 @@ public void getGameServerConfig( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetGameServerConfig, expected %s or %s", + response.getClass().getName(), + GameServerConfig.class.getName(), + Exception.class.getName()))); } } @@ -101,7 +113,13 @@ public void createGameServerConfig( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateGameServerConfig, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -116,7 +134,13 @@ public void deleteGameServerConfig( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteGameServerConfig, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockGameServerDeploymentsServiceImpl.java b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockGameServerDeploymentsServiceImpl.java index ed239240..8d2372e4 100644 --- a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockGameServerDeploymentsServiceImpl.java +++ b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockGameServerDeploymentsServiceImpl.java @@ -71,7 +71,13 @@ public void listGameServerDeployments( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListGameServerDeployments, expected %s or %s", + response.getClass().getName(), + ListGameServerDeploymentsResponse.class.getName(), + Exception.class.getName()))); } } @@ -87,7 +93,13 @@ public void getGameServerDeployment( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetGameServerDeployment, expected %s or %s", + response.getClass().getName(), + GameServerDeployment.class.getName(), + Exception.class.getName()))); } } @@ -102,7 +114,13 @@ public void createGameServerDeployment( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateGameServerDeployment, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -117,7 +135,13 @@ public void deleteGameServerDeployment( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteGameServerDeployment, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -132,7 +156,13 @@ public void updateGameServerDeployment( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateGameServerDeployment, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -148,7 +178,13 @@ public void getGameServerDeploymentRollout( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetGameServerDeploymentRollout, expected %s or %s", + response.getClass().getName(), + GameServerDeploymentRollout.class.getName(), + Exception.class.getName()))); } } @@ -164,7 +200,13 @@ public void updateGameServerDeploymentRollout( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateGameServerDeploymentRollout, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -180,7 +222,13 @@ public void previewGameServerDeploymentRollout( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PreviewGameServerDeploymentRollout, expected %s or %s", + response.getClass().getName(), + PreviewGameServerDeploymentRolloutResponse.class.getName(), + Exception.class.getName()))); } } @@ -196,7 +244,13 @@ public void fetchDeploymentState( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method FetchDeploymentState, expected %s or %s", + response.getClass().getName(), + FetchDeploymentStateResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockRealmsServiceImpl.java b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockRealmsServiceImpl.java index 8b2bd9b7..eddce28b 100644 --- a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockRealmsServiceImpl.java +++ b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1/MockRealmsServiceImpl.java @@ -70,7 +70,13 @@ public void listRealms( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListRealms, expected %s or %s", + response.getClass().getName(), + ListRealmsResponse.class.getName(), + Exception.class.getName()))); } } @@ -84,7 +90,13 @@ public void getRealm(GetRealmRequest request, StreamObserver responseObse } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetRealm, expected %s or %s", + response.getClass().getName(), + Realm.class.getName(), + Exception.class.getName()))); } } @@ -98,7 +110,13 @@ public void createRealm(CreateRealmRequest request, StreamObserver re } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateRealm, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -112,7 +130,13 @@ public void deleteRealm(DeleteRealmRequest request, StreamObserver re } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteRealm, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -126,7 +150,13 @@ public void updateRealm(UpdateRealmRequest request, StreamObserver re } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateRealm, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -142,7 +172,13 @@ public void previewRealmUpdate( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PreviewRealmUpdate, expected %s or %s", + response.getClass().getName(), + PreviewRealmUpdateResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockGameServerClustersServiceImpl.java b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockGameServerClustersServiceImpl.java index c12f169b..4f171ac2 100644 --- a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockGameServerClustersServiceImpl.java +++ b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockGameServerClustersServiceImpl.java @@ -71,7 +71,13 @@ public void listGameServerClusters( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListGameServerClusters, expected %s or %s", + response.getClass().getName(), + ListGameServerClustersResponse.class.getName(), + Exception.class.getName()))); } } @@ -86,7 +92,13 @@ public void getGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetGameServerCluster, expected %s or %s", + response.getClass().getName(), + GameServerCluster.class.getName(), + Exception.class.getName()))); } } @@ -101,7 +113,13 @@ public void createGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateGameServerCluster, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -117,7 +135,13 @@ public void previewCreateGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PreviewCreateGameServerCluster, expected %s or %s", + response.getClass().getName(), + PreviewCreateGameServerClusterResponse.class.getName(), + Exception.class.getName()))); } } @@ -132,7 +156,13 @@ public void deleteGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteGameServerCluster, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -148,7 +178,13 @@ public void previewDeleteGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PreviewDeleteGameServerCluster, expected %s or %s", + response.getClass().getName(), + PreviewDeleteGameServerClusterResponse.class.getName(), + Exception.class.getName()))); } } @@ -163,7 +199,13 @@ public void updateGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateGameServerCluster, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -179,7 +221,13 @@ public void previewUpdateGameServerCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PreviewUpdateGameServerCluster, expected %s or %s", + response.getClass().getName(), + PreviewUpdateGameServerClusterResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockGameServerConfigsServiceImpl.java b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockGameServerConfigsServiceImpl.java index 160dee7a..6ccee870 100644 --- a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockGameServerConfigsServiceImpl.java +++ b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockGameServerConfigsServiceImpl.java @@ -71,7 +71,13 @@ public void listGameServerConfigs( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListGameServerConfigs, expected %s or %s", + response.getClass().getName(), + ListGameServerConfigsResponse.class.getName(), + Exception.class.getName()))); } } @@ -86,7 +92,13 @@ public void getGameServerConfig( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetGameServerConfig, expected %s or %s", + response.getClass().getName(), + GameServerConfig.class.getName(), + Exception.class.getName()))); } } @@ -101,7 +113,13 @@ public void createGameServerConfig( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateGameServerConfig, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -116,7 +134,13 @@ public void deleteGameServerConfig( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteGameServerConfig, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockGameServerDeploymentsServiceImpl.java b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockGameServerDeploymentsServiceImpl.java index c076caa5..d25cacb9 100644 --- a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockGameServerDeploymentsServiceImpl.java +++ b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockGameServerDeploymentsServiceImpl.java @@ -71,7 +71,13 @@ public void listGameServerDeployments( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListGameServerDeployments, expected %s or %s", + response.getClass().getName(), + ListGameServerDeploymentsResponse.class.getName(), + Exception.class.getName()))); } } @@ -87,7 +93,13 @@ public void getGameServerDeployment( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetGameServerDeployment, expected %s or %s", + response.getClass().getName(), + GameServerDeployment.class.getName(), + Exception.class.getName()))); } } @@ -102,7 +114,13 @@ public void createGameServerDeployment( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateGameServerDeployment, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -117,7 +135,13 @@ public void deleteGameServerDeployment( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteGameServerDeployment, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -132,7 +156,13 @@ public void updateGameServerDeployment( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateGameServerDeployment, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -148,7 +178,13 @@ public void getGameServerDeploymentRollout( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetGameServerDeploymentRollout, expected %s or %s", + response.getClass().getName(), + GameServerDeploymentRollout.class.getName(), + Exception.class.getName()))); } } @@ -164,7 +200,13 @@ public void updateGameServerDeploymentRollout( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateGameServerDeploymentRollout, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -180,7 +222,13 @@ public void previewGameServerDeploymentRollout( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PreviewGameServerDeploymentRollout, expected %s or %s", + response.getClass().getName(), + PreviewGameServerDeploymentRolloutResponse.class.getName(), + Exception.class.getName()))); } } @@ -196,7 +244,13 @@ public void fetchDeploymentState( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method FetchDeploymentState, expected %s or %s", + response.getClass().getName(), + FetchDeploymentStateResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockRealmsServiceImpl.java b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockRealmsServiceImpl.java index 42e90ca3..8e141869 100644 --- a/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockRealmsServiceImpl.java +++ b/google-cloud-game-servers/src/test/java/com/google/cloud/gaming/v1beta/MockRealmsServiceImpl.java @@ -70,7 +70,13 @@ public void listRealms( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListRealms, expected %s or %s", + response.getClass().getName(), + ListRealmsResponse.class.getName(), + Exception.class.getName()))); } } @@ -84,7 +90,13 @@ public void getRealm(GetRealmRequest request, StreamObserver responseObse } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetRealm, expected %s or %s", + response.getClass().getName(), + Realm.class.getName(), + Exception.class.getName()))); } } @@ -98,7 +110,13 @@ public void createRealm(CreateRealmRequest request, StreamObserver re } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateRealm, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -112,7 +130,13 @@ public void deleteRealm(DeleteRealmRequest request, StreamObserver re } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteRealm, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -126,7 +150,13 @@ public void updateRealm(UpdateRealmRequest request, StreamObserver re } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateRealm, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -142,7 +172,13 @@ public void previewRealmUpdate( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PreviewRealmUpdate, expected %s or %s", + response.getClass().getName(), + PreviewRealmUpdateResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/synth.metadata b/synth.metadata index cba2d546..a9f7e50e 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,23 +4,23 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-game-servers.git", - "sha": "27c6d467098baeae0728d9eff8ac6025047a30d1" + "sha": "90985e944ec3b0e41e1e417c5eb382486471c327" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "e8bc4471a88ac5f60defe3ed436f517174e59ba0", + "internalRef": "357800868" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "e8bc4471a88ac5f60defe3ed436f517174e59ba0", + "internalRef": "357800868" } }, {