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: - * - *
- *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
- * AllocationPolicy response = allocationPoliciesServiceClient.getAllocationPolicy(formattedName);
- * }
- *
- *
- *
- * Note: close() needs to be called on the allocationPoliciesServiceClient object to clean up - * resources such as threads. In the example above, try-with-resources is used, which automatically - * calls close(). - * - *
The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *
See the individual methods for example code. - * - *
Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. - * - *
This class can be customized by passing in a custom instance of - * AllocationPoliciesServiceSettings to create(). For example: - * - *
To customize credentials: - * - *
- *
- * AllocationPoliciesServiceSettings allocationPoliciesServiceSettings =
- * AllocationPoliciesServiceSettings.newBuilder()
- * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- * .build();
- * AllocationPoliciesServiceClient allocationPoliciesServiceClient =
- * AllocationPoliciesServiceClient.create(allocationPoliciesServiceSettings);
- *
- *
- *
- * To customize the endpoint:
- *
- *
- *
- * AllocationPoliciesServiceSettings allocationPoliciesServiceSettings =
- * AllocationPoliciesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * AllocationPoliciesServiceClient allocationPoliciesServiceClient =
- * AllocationPoliciesServiceClient.create(allocationPoliciesServiceSettings);
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class AllocationPoliciesServiceClient implements BackgroundResource {
- private final AllocationPoliciesServiceSettings settings;
- private final AllocationPoliciesServiceStub stub;
- private final OperationsClient operationsClient;
-
- private static final PathTemplate ALLOCATION_POLICY_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding(
- "projects/{project}/locations/{location}/allocationPolicies/{allocation_policy}");
-
- private static final PathTemplate LOCATION_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}");
-
- /**
- * Formats a string containing the fully-qualified path to represent a allocation_policy resource.
- *
- * @deprecated Use the {@link AllocationPolicyName} class instead.
- */
- @Deprecated
- public static final String formatAllocationPolicyName(
- String project, String location, String allocationPolicy) {
- return ALLOCATION_POLICY_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location,
- "allocation_policy", allocationPolicy);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a location resource.
- *
- * @deprecated Use the {@link LocationName} class instead.
- */
- @Deprecated
- public static final String formatLocationName(String project, String location) {
- return LOCATION_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location);
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a allocation_policy
- * resource.
- *
- * @deprecated Use the {@link AllocationPolicyName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromAllocationPolicyName(String allocationPolicyName) {
- return ALLOCATION_POLICY_PATH_TEMPLATE.parse(allocationPolicyName).get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a allocation_policy
- * resource.
- *
- * @deprecated Use the {@link AllocationPolicyName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromAllocationPolicyName(String allocationPolicyName) {
- return ALLOCATION_POLICY_PATH_TEMPLATE.parse(allocationPolicyName).get("location");
- }
-
- /**
- * Parses the allocation_policy from the given fully-qualified path which represents a
- * allocation_policy resource.
- *
- * @deprecated Use the {@link AllocationPolicyName} class instead.
- */
- @Deprecated
- public static final String parseAllocationPolicyFromAllocationPolicyName(
- String allocationPolicyName) {
- return ALLOCATION_POLICY_PATH_TEMPLATE.parse(allocationPolicyName).get("allocation_policy");
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a location resource.
- *
- * @deprecated Use the {@link LocationName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromLocationName(String locationName) {
- return LOCATION_PATH_TEMPLATE.parse(locationName).get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a location resource.
- *
- * @deprecated Use the {@link LocationName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromLocationName(String locationName) {
- return LOCATION_PATH_TEMPLATE.parse(locationName).get("location");
- }
-
- /** Constructs an instance of AllocationPoliciesServiceClient with default settings. */
- public static final AllocationPoliciesServiceClient create() throws IOException {
- return create(AllocationPoliciesServiceSettings.newBuilder().build());
- }
-
- /**
- * Constructs an instance of AllocationPoliciesServiceClient, using the given settings. The
- * channels are created based on the settings passed in, or defaults for any settings that are not
- * set.
- */
- public static final AllocationPoliciesServiceClient create(
- AllocationPoliciesServiceSettings settings) throws IOException {
- return new AllocationPoliciesServiceClient(settings);
- }
-
- /**
- * Constructs an instance of AllocationPoliciesServiceClient, using the given stub for making
- * calls. This is for advanced usage - prefer to use AllocationPoliciesServiceSettings}.
- */
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public static final AllocationPoliciesServiceClient create(AllocationPoliciesServiceStub stub) {
- return new AllocationPoliciesServiceClient(stub);
- }
-
- /**
- * Constructs an instance of AllocationPoliciesServiceClient, using the given settings. This is
- * protected so that it is easy to make a subclass, but otherwise, the static factory methods
- * should be preferred.
- */
- protected AllocationPoliciesServiceClient(AllocationPoliciesServiceSettings settings)
- throws IOException {
- this.settings = settings;
- this.stub = ((AllocationPoliciesServiceStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- protected AllocationPoliciesServiceClient(AllocationPoliciesServiceStub stub) {
- this.settings = null;
- this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- public final AllocationPoliciesServiceSettings getSettings() {
- return settings;
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public AllocationPoliciesServiceStub getStub() {
- return stub;
- }
-
- /**
- * Returns the OperationsClient that can be used to query the status of a long-running operation
- * returned by another API method call.
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationsClient getOperationsClient() {
- return operationsClient;
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * List allocation policies in a given project and location.
- *
- * Sample code: - * - *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * for (AllocationPolicy element : allocationPoliciesServiceClient.listAllocationPolicies(formattedParent).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- *
- * @param parent Required. The parent resource name, using the form:
- * `projects/{project_id}/locations/{location}`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final ListAllocationPoliciesPagedResponse listAllocationPolicies(String parent) {
- LOCATION_PATH_TEMPLATE.validate(parent, "listAllocationPolicies");
- ListAllocationPoliciesRequest request =
- ListAllocationPoliciesRequest.newBuilder().setParent(parent).build();
- return listAllocationPolicies(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * List allocation policies in a given project and location.
- *
- * Sample code: - * - *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * ListAllocationPoliciesRequest request = ListAllocationPoliciesRequest.newBuilder()
- * .setParent(formattedParent)
- * .build();
- * for (AllocationPolicy element : allocationPoliciesServiceClient.listAllocationPolicies(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
- */
- public final ListAllocationPoliciesPagedResponse listAllocationPolicies(
- ListAllocationPoliciesRequest request) {
- return listAllocationPoliciesPagedCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * List allocation policies in a given project and location.
- *
- * Sample code: - * - *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * ListAllocationPoliciesRequest request = ListAllocationPoliciesRequest.newBuilder()
- * .setParent(formattedParent)
- * .build();
- * ApiFuture<ListAllocationPoliciesPagedResponse> future = allocationPoliciesServiceClient.listAllocationPoliciesPagedCallable().futureCall(request);
- * // Do something
- * for (AllocationPolicy element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * ListAllocationPoliciesRequest request = ListAllocationPoliciesRequest.newBuilder()
- * .setParent(formattedParent)
- * .build();
- * while (true) {
- * ListAllocationPoliciesResponse response = allocationPoliciesServiceClient.listAllocationPoliciesCallable().call(request);
- * for (AllocationPolicy element : response.getAllocationPoliciesList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
- * AllocationPolicy response = allocationPoliciesServiceClient.getAllocationPolicy(formattedName);
- * }
- *
- *
- * @param name Required. The name of the allocation policy to retrieve, using the form:
- * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final AllocationPolicy getAllocationPolicy(String name) { - ALLOCATION_POLICY_PATH_TEMPLATE.validate(name, "getAllocationPolicy"); - GetAllocationPolicyRequest request = - GetAllocationPolicyRequest.newBuilder().setName(name).build(); - return getAllocationPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Gets details of a single allocation policy. - * - *
Sample code: - * - *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
- * GetAllocationPolicyRequest request = GetAllocationPolicyRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * AllocationPolicy response = allocationPoliciesServiceClient.getAllocationPolicy(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
- */
- public final AllocationPolicy getAllocationPolicy(GetAllocationPolicyRequest request) {
- return getAllocationPolicyCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets details of a single allocation policy.
- *
- * Sample code: - * - *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
- * GetAllocationPolicyRequest request = GetAllocationPolicyRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * ApiFuture<AllocationPolicy> future = allocationPoliciesServiceClient.getAllocationPolicyCallable().futureCall(request);
- * // Do something
- * AllocationPolicy response = future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * String allocationPolicyId = "";
- * AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
- * AllocationPolicy response = allocationPoliciesServiceClient.createAllocationPolicyAsync(formattedParent, allocationPolicyId, allocationPolicy).get();
- * }
- *
- *
- * @param parent Required. The parent resource name, using the form:
- * `projects/{project_id}/locations/{location}`.
- * @param allocationPolicyId Required. The ID of the allocation policy resource to be created.
- * @param allocationPolicy Required. The allocation policy resource to be created.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFutureSample code: - * - *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * String allocationPolicyId = "";
- * AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
- * CreateAllocationPolicyRequest request = CreateAllocationPolicyRequest.newBuilder()
- * .setParent(formattedParent)
- * .setAllocationPolicyId(allocationPolicyId)
- * .setAllocationPolicy(allocationPolicy)
- * .build();
- * AllocationPolicy response = allocationPoliciesServiceClient.createAllocationPolicyAsync(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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFutureSample code: - * - *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * String allocationPolicyId = "";
- * AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
- * CreateAllocationPolicyRequest request = CreateAllocationPolicyRequest.newBuilder()
- * .setParent(formattedParent)
- * .setAllocationPolicyId(allocationPolicyId)
- * .setAllocationPolicy(allocationPolicy)
- * .build();
- * OperationFuture<AllocationPolicy, Empty> future = allocationPoliciesServiceClient.createAllocationPolicyOperationCallable().futureCall(request);
- * // Do something
- * AllocationPolicy response = future.get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallableSample code: - * - *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedParent = AllocationPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * String allocationPolicyId = "";
- * AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
- * CreateAllocationPolicyRequest request = CreateAllocationPolicyRequest.newBuilder()
- * .setParent(formattedParent)
- * .setAllocationPolicyId(allocationPolicyId)
- * .setAllocationPolicy(allocationPolicy)
- * .build();
- * ApiFuture<Operation> future = allocationPoliciesServiceClient.createAllocationPolicyCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
- * allocationPoliciesServiceClient.deleteAllocationPolicyAsync(formattedName).get();
- * }
- *
- *
- * @param name Required. The name of the allocation policy to delete, using the form:
- * `projects/{project_id}/locations/{location}/allocationPolicies/{allocation_policy_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * https: //developers.google.com/protocol-buffers //
- * /docs/reference/google.protobuf#fieldmask
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * The default instance has everything set to sensible defaults:
- *
- * The builder of this class is recursive, so contained classes are themselves builders. When
- * build() is called, the tree of builders is called to create the complete settings object.
- *
- * For example, to set the total timeout of getAllocationPolicy to 30 seconds:
- *
- * Note: This method does not support applying settings to streaming methods.
- */
- public Builder applyToAllUnaryMethods(
- ApiFunction 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:
@@ -307,7 +307,7 @@ public final OperationsClient getOperationsClient() {
*
*
* @param parent Required. The parent resource name, using the form:
- * "projects/{project_id}/locations/{location}/realms/{realm-id}".
+ * "projects/{project}/locations/{location}/realms/{realm-id}".
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListGameServerClustersPagedResponse listGameServerClusters(String parent) {
@@ -414,7 +414,7 @@ public final ListGameServerClustersPagedResponse listGameServerClusters(
*
*
* @param name Required. The name of the game server cluster to retrieve, using the form:
- * `projects/{project_id}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster_id}`
+ * `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final GameServerCluster getGameServerCluster(String name) {
@@ -486,7 +486,7 @@ public final GameServerCluster getGameServerCluster(GetGameServerClusterRequest
*
*
* @param parent Required. The parent resource name, using the form:
- * `projects/{project_id}/locations/{location}/realms/{realm-id}`.
+ * `projects/{project}/locations/{location}/realms/{realm-id}`.
* @param gameServerClusterId Required. The ID of the game server cluster resource to be created.
* @param gameServerCluster Required. The game server cluster resource to be created.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -604,7 +604,7 @@ public final OperationFuture `projects/{project_id}/locations/{location}/gameServerClusters/{cluster_id}`
+ * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@BetaApi(
@@ -715,7 +715,6 @@ public final OperationFuture Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * 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:
@@ -287,7 +287,7 @@ public final OperationsClient getOperationsClient() {
*
*
* @param parent Required. The parent resource name, using the form:
- * `projects/{project_id}/locations/{location}`.
+ * `projects/{project}/locations/{location}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListGameServerDeploymentsPagedResponse listGameServerDeployments(String parent) {
@@ -395,7 +395,7 @@ public final ListGameServerDeploymentsPagedResponse listGameServerDeployments(
*
*
* @param name Required. The name of the game server deployment to retrieve, using the form:
- * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+ * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final GameServerDeployment getGameServerDeployment(String name) {
@@ -468,7 +468,7 @@ public final GameServerDeployment getGameServerDeployment(
*
*
* @param parent Required. The parent resource name, using the form:
- * `projects/{project_id}/locations/{location}`.
+ * `projects/{project}/locations/{location}`.
* @param deploymentId Required. The ID of the game server deployment resource to be created.
* @param gameServerDeployment Required. The game server deployment resource to be created.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -586,7 +586,7 @@ public final OperationFuture `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
+ * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@BetaApi(
@@ -697,7 +697,6 @@ public final OperationFuture Sample code:
- *
- * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
- * @param newGameServerTemplate Required. The game server template for the new rollout.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture Sample code:
- *
- * Sample code:
- *
- * Sample code:
*
* Sample code:
- *
- * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
- * @param clusterPercentageSelector Required. The percentage of game servers that should run the
- * new game server template in the specified clusters. Default is 0.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture Sample code:
- *
- * Sample code:
- *
- * Sample code:
*
* Sample code:
*
* `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture Sample code:
- *
- * Sample code:
*
* Sample code:
- *
- * Sample code:
- *
- * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture Sample code:
*
* Sample code:
*
* Sample code:
- *
- * Sample code:
- *
- * `projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final DeploymentTarget getDeploymentTarget(String name) {
- GAME_SERVER_DEPLOYMENT_PATH_TEMPLATE.validate(name, "getDeploymentTarget");
- GetDeploymentTargetRequest request =
- GetDeploymentTargetRequest.newBuilder().setName(name).build();
- return getDeploymentTarget(request);
+ public final UnaryCallable<
+ PreviewGameServerDeploymentRolloutRequest, PreviewGameServerDeploymentRolloutResponse>
+ previewGameServerDeploymentRolloutCallable() {
+ return stub.previewGameServerDeploymentRolloutCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Retrieves information on the rollout target of the deployment, e.g. the target percentage of
- * game servers running stable_game_server_template and new_game_server_template in clusters.
+ * Retrieves information about the current state of the deployment, e.g. it gathers all the fleets
+ * and autoscalars for this deployment. This includes fleets running older version of the
+ * deployment.
*
* Sample code:
*
* Sample code:
*
* 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:
@@ -272,7 +272,7 @@ public final OperationsClient getOperationsClient() {
*
*
* @param parent Required. The parent resource name, using the form:
- * `projects/{project_id}/locations/{location}`.
+ * `projects/{project}/locations/{location}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListRealmsPagedResponse listRealms(String parent) {
@@ -375,7 +375,7 @@ public final UnaryCallable Sample code:
+ *
+ * Sample code:
+ *
+ * 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:
- *
- * Note: close() needs to be called on the scalingPoliciesServiceClient object to clean up
- * resources such as threads. In the example above, try-with-resources is used, which automatically
- * calls close().
- *
- * The surface of this class includes several types of Java methods for each of the API's
- * methods:
- *
- * See the individual methods for example code.
- *
- * Many parameters require resource names to be formatted in a particular way. To assist with
- * these names, this class includes a format method for each type of name, and additionally a parse
- * method to extract the individual identifiers contained within names that are returned.
- *
- * This class can be customized by passing in a custom instance of ScalingPoliciesServiceSettings
- * to create(). For example:
- *
- * To customize credentials:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final ScalingPolicy getScalingPolicy(String name) {
- SCALING_POLICY_PATH_TEMPLATE.validate(name, "getScalingPolicy");
- GetScalingPolicyRequest request = GetScalingPolicyRequest.newBuilder().setName(name).build();
- return getScalingPolicy(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets details of a single scaling policy.
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * `projects/{project_id}/locations/{location}/scalingPolicies/{scaling_policy_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * https: //developers.google.com/protocol-buffers //
- * /docs/reference/google.protobuf#fieldmask
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * The default instance has everything set to sensible defaults:
- *
- * The builder of this class is recursive, so contained classes are themselves builders. When
- * build() is called, the tree of builders is called to create the complete settings object.
- *
- * For example, to set the total timeout of getScalingPolicy to 30 seconds:
- *
- * Note: This method does not support applying settings to streaming methods.
- */
- public Builder applyToAllUnaryMethods(
- ApiFunction The interfaces provided are listed below, along with usage samples.
*
- * =============================== AllocationPoliciesServiceClient
+ * =============================== GameServerClustersServiceClient
* ===============================
*
- * Service Description: The cloud gaming allocation policy is used as the controller's recipe for
- * the allocating game servers from clusters. The policy has three modes: 1. Default mode which is
- * not limited to time. 2. Time based mode which is temporary and overrides the default mode when
- * effective. 3. Periodic mode which follows the time base mode, but happens periodically using
- * local time, identified by cron specs.
- *
- * Sample for AllocationPoliciesServiceClient:
- *
- * Service Description: The game server cluster is used to capture the game server cluster's
- * settings which are used to manage game server clusters.
+ * Service Description: The game server cluster maps to Kubernetes clusters running Agones and is
+ * used to manage fleets within clusters.
*
* Sample for GameServerClustersServiceClient:
*
@@ -58,8 +39,8 @@
* ================================== GameServerDeploymentsServiceClient
* ==================================
*
- * Service Description: The game server deployment is used to configure the deployment of game
- * server software to Agones Fleets in game server clusters.
+ * Service Description: The game server deployment is used to control the deployment of game
+ * server software to Agones fleets.
*
* Sample for GameServerDeploymentsServiceClient:
*
@@ -74,7 +55,7 @@
*
* =================== RealmsServiceClient ===================
*
- * Service Description: Realm provides grouping of game server clusters that are serving
+ * Service Description: Realm provides grouping of game server clusters that are serving a
* particular gamer population.
*
* Sample for RealmsServiceClient:
@@ -87,22 +68,6 @@
* }
*
*
- *
- * ============================ ScalingPoliciesServiceClient ============================
- *
- * Service Description: The cloud gaming scaling policy is used to configure scaling parameters
- * for each fleet.
- *
- * Sample for ScalingPoliciesServiceClient:
- *
- * This class is for advanced usage and reflects the underlying API directly.
- */
-@Generated("by gapic-generator")
-@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
-public abstract class AllocationPoliciesServiceStub implements BackgroundResource {
-
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public OperationsStub getOperationsStub() {
- throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
- }
-
- public UnaryCallable The default instance has everything set to sensible defaults:
- *
- * The builder of this class is recursive, so contained classes are themselves builders. When
- * build() is called, the tree of builders is called to create the complete settings object.
- *
- * For example, to set the total timeout of getAllocationPolicy to 30 seconds:
- *
- * Note: This method does not support applying settings to streaming methods.
- */
- public Builder applyToAllUnaryMethods(
- ApiFunction
- *
- * @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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
- * DeleteAllocationPolicyRequest request = DeleteAllocationPolicyRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * allocationPoliciesServiceClient.deleteAllocationPolicyAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
- * DeleteAllocationPolicyRequest request = DeleteAllocationPolicyRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * OperationFuture<Empty, Empty> future = allocationPoliciesServiceClient.deleteAllocationPolicyOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
- * DeleteAllocationPolicyRequest request = DeleteAllocationPolicyRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * ApiFuture<Operation> future = allocationPoliciesServiceClient.deleteAllocationPolicyCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
- * @param allocationPolicy Required. The allocation policy 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
- * this field. For the `FieldMask` definition, see
- *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * AllocationPolicy response = allocationPoliciesServiceClient.updateAllocationPolicyAsync(allocationPolicy, updateMask).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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateAllocationPolicyRequest request = UpdateAllocationPolicyRequest.newBuilder()
- * .setAllocationPolicy(allocationPolicy)
- * .setUpdateMask(updateMask)
- * .build();
- * AllocationPolicy response = allocationPoliciesServiceClient.updateAllocationPolicyAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateAllocationPolicyRequest request = UpdateAllocationPolicyRequest.newBuilder()
- * .setAllocationPolicy(allocationPolicy)
- * .setUpdateMask(updateMask)
- * .build();
- * OperationFuture<AllocationPolicy, Empty> future = allocationPoliciesServiceClient.updateAllocationPolicyOperationCallable().futureCall(request);
- * // Do something
- * AllocationPolicy response = future.get();
- * }
- *
- */
- public final UnaryCallable
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * AllocationPolicy allocationPolicy = AllocationPolicy.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateAllocationPolicyRequest request = UpdateAllocationPolicyRequest.newBuilder()
- * .setAllocationPolicy(allocationPolicy)
- * .setUpdateMask(updateMask)
- * .build();
- * ApiFuture<Operation> future = allocationPoliciesServiceClient.updateAllocationPolicyCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- *
- *
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class AllocationPoliciesServiceSettings
- extends ClientSettings
- * AllocationPoliciesServiceSettings.Builder allocationPoliciesServiceSettingsBuilder =
- * AllocationPoliciesServiceSettings.newBuilder();
- * allocationPoliciesServiceSettingsBuilder.getAllocationPolicySettings().getRetrySettings().toBuilder()
- * .setTotalTimeout(Duration.ofSeconds(30));
- * AllocationPoliciesServiceSettings allocationPoliciesServiceSettings = allocationPoliciesServiceSettingsBuilder.build();
- *
- *
+ *
+ * @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
+ */
+ public final PreviewCreateGameServerClusterResponse previewCreateGameServerCluster(
+ PreviewCreateGameServerClusterRequest request) {
+ return previewCreateGameServerClusterCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Previews creation of a new game server cluster in a given project and location.
+ *
+ *
+ * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+ * PreviewCreateGameServerClusterRequest request = PreviewCreateGameServerClusterRequest.newBuilder().build();
+ * PreviewCreateGameServerClusterResponse response = gameServerClustersServiceClient.previewCreateGameServerCluster(request);
+ * }
+ *
+ */
+ public final UnaryCallable<
+ PreviewCreateGameServerClusterRequest, PreviewCreateGameServerClusterResponse>
+ previewCreateGameServerClusterCallable() {
+ return stub.previewCreateGameServerClusterCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Previews deletion of a single game server cluster.
+ *
+ *
+ * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+ * PreviewCreateGameServerClusterRequest request = PreviewCreateGameServerClusterRequest.newBuilder().build();
+ * ApiFuture<PreviewCreateGameServerClusterResponse> future = gameServerClustersServiceClient.previewCreateGameServerClusterCallable().futureCall(request);
+ * // Do something
+ * PreviewCreateGameServerClusterResponse response = future.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
+ */
+ public final PreviewDeleteGameServerClusterResponse previewDeleteGameServerCluster(
+ PreviewDeleteGameServerClusterRequest request) {
+ return previewDeleteGameServerClusterCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Previews deletion of a single game server cluster.
+ *
+ *
+ * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+ * PreviewDeleteGameServerClusterRequest request = PreviewDeleteGameServerClusterRequest.newBuilder().build();
+ * PreviewDeleteGameServerClusterResponse response = gameServerClustersServiceClient.previewDeleteGameServerCluster(request);
+ * }
+ *
+ */
+ public final UnaryCallable<
+ PreviewDeleteGameServerClusterRequest, PreviewDeleteGameServerClusterResponse>
+ previewDeleteGameServerClusterCallable() {
+ return stub.previewDeleteGameServerClusterCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Previews updating a GameServerCluster.
+ *
+ *
+ * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+ * PreviewDeleteGameServerClusterRequest request = PreviewDeleteGameServerClusterRequest.newBuilder().build();
+ * ApiFuture<PreviewDeleteGameServerClusterResponse> future = gameServerClustersServiceClient.previewDeleteGameServerClusterCallable().futureCall(request);
+ * // Do something
+ * PreviewDeleteGameServerClusterResponse response = future.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
+ */
+ public final PreviewUpdateGameServerClusterResponse previewUpdateGameServerCluster(
+ PreviewUpdateGameServerClusterRequest request) {
+ return previewUpdateGameServerClusterCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Previews updating a GameServerCluster.
+ *
+ *
+ * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+ * PreviewUpdateGameServerClusterRequest request = PreviewUpdateGameServerClusterRequest.newBuilder().build();
+ * PreviewUpdateGameServerClusterResponse response = gameServerClustersServiceClient.previewUpdateGameServerCluster(request);
+ * }
+ *
+ */
+ public final UnaryCallable<
+ PreviewUpdateGameServerClusterRequest, PreviewUpdateGameServerClusterResponse>
+ previewUpdateGameServerClusterCallable() {
+ return stub.previewUpdateGameServerClusterCallable();
+ }
+
@Override
public final void close() {
stub.close();
diff --git a/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceSettings.java b/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceSettings.java
index ad523dce..70010c02 100644
--- a/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceSettings.java
+++ b/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerClustersServiceSettings.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 Google LLC
+ * Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -132,6 +132,30 @@ public class GameServerClustersServiceSettings
.updateGameServerClusterOperationSettings();
}
+ /** Returns the object with the settings used for calls to previewCreateGameServerCluster. */
+ public UnaryCallSettings<
+ PreviewCreateGameServerClusterRequest, PreviewCreateGameServerClusterResponse>
+ previewCreateGameServerClusterSettings() {
+ return ((GameServerClustersServiceStubSettings) getStubSettings())
+ .previewCreateGameServerClusterSettings();
+ }
+
+ /** Returns the object with the settings used for calls to previewDeleteGameServerCluster. */
+ public UnaryCallSettings<
+ PreviewDeleteGameServerClusterRequest, PreviewDeleteGameServerClusterResponse>
+ previewDeleteGameServerClusterSettings() {
+ return ((GameServerClustersServiceStubSettings) getStubSettings())
+ .previewDeleteGameServerClusterSettings();
+ }
+
+ /** Returns the object with the settings used for calls to previewUpdateGameServerCluster. */
+ public UnaryCallSettings<
+ PreviewUpdateGameServerClusterRequest, PreviewUpdateGameServerClusterResponse>
+ previewUpdateGameServerClusterSettings() {
+ return ((GameServerClustersServiceStubSettings) getStubSettings())
+ .previewUpdateGameServerClusterSettings();
+ }
+
public static final GameServerClustersServiceSettings create(
GameServerClustersServiceStubSettings stub) throws IOException {
return new GameServerClustersServiceSettings.Builder(stub.toBuilder()).build();
@@ -287,6 +311,27 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().updateGameServerClusterOperationSettings();
}
+ /** Returns the builder for the settings used for calls to previewCreateGameServerCluster. */
+ public UnaryCallSettings.Builder<
+ PreviewCreateGameServerClusterRequest, PreviewCreateGameServerClusterResponse>
+ previewCreateGameServerClusterSettings() {
+ return getStubSettingsBuilder().previewCreateGameServerClusterSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to previewDeleteGameServerCluster. */
+ public UnaryCallSettings.Builder<
+ PreviewDeleteGameServerClusterRequest, PreviewDeleteGameServerClusterResponse>
+ previewDeleteGameServerClusterSettings() {
+ return getStubSettingsBuilder().previewDeleteGameServerClusterSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to previewUpdateGameServerCluster. */
+ public UnaryCallSettings.Builder<
+ PreviewUpdateGameServerClusterRequest, PreviewUpdateGameServerClusterResponse>
+ previewUpdateGameServerClusterSettings() {
+ return getStubSettingsBuilder().previewUpdateGameServerClusterSettings();
+ }
+
@Override
public GameServerClustersServiceSettings build() throws IOException {
return new GameServerClustersServiceSettings(this);
diff --git a/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceClient.java b/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceClient.java
index edb69d89..1fec17b2 100644
--- a/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceClient.java
+++ b/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/GameServerDeploymentsServiceClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 Google LLC
+ * Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,8 +42,8 @@
// AUTO-GENERATED DOCUMENTATION AND SERVICE
/**
- * Service Description: The game server deployment is used to configure the deployment of game
- * server software to Agones Fleets in game server clusters.
+ * Service Description: The game server deployment is used to control the deployment of game server
+ * software to Agones fleets.
*
*
+ * try (GameServerClustersServiceClient gameServerClustersServiceClient = GameServerClustersServiceClient.create()) {
+ * PreviewUpdateGameServerClusterRequest request = PreviewUpdateGameServerClusterRequest.newBuilder().build();
+ * ApiFuture<PreviewUpdateGameServerClusterResponse> future = gameServerClustersServiceClient.previewUpdateGameServerClusterCallable().futureCall(request);
+ * // Do something
+ * PreviewUpdateGameServerClusterResponse response = future.get();
+ * }
+ *
- *
- * @param name Required. The name of the game server deployment, using the form:
- *
- * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build();
- * GameServerDeployment response = gameServerDeploymentsServiceClient.startRolloutAsync(formattedName, newGameServerTemplate).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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build();
- * StartRolloutRequest request = StartRolloutRequest.newBuilder()
- * .setName(formattedName)
- * .setNewGameServerTemplate(newGameServerTemplate)
- * .build();
- * GameServerDeployment response = gameServerDeploymentsServiceClient.startRolloutAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build();
- * StartRolloutRequest request = StartRolloutRequest.newBuilder()
- * .setName(formattedName)
- * .setNewGameServerTemplate(newGameServerTemplate)
- * .build();
- * OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.startRolloutOperationCallable().futureCall(request);
- * // Do something
- * GameServerDeployment response = future.get();
- * }
- *
- */
- public final UnaryCallable
* try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build();
- * StartRolloutRequest request = StartRolloutRequest.newBuilder()
- * .setName(formattedName)
- * .setNewGameServerTemplate(newGameServerTemplate)
- * .build();
- * ApiFuture<Operation> future = gameServerDeploymentsServiceClient.startRolloutCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- *
- * @param name Required. The name of the game server deployment, using the form:
- *
- * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * List<ClusterPercentageSelector> clusterPercentageSelector = new ArrayList<>();
- * GameServerDeployment response = gameServerDeploymentsServiceClient.setRolloutTargetAsync(formattedName, clusterPercentageSelector).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
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * List<ClusterPercentageSelector> clusterPercentageSelector = new ArrayList<>();
- * SetRolloutTargetRequest request = SetRolloutTargetRequest.newBuilder()
- * .setName(formattedName)
- * .addAllClusterPercentageSelector(clusterPercentageSelector)
- * .build();
- * GameServerDeployment response = gameServerDeploymentsServiceClient.setRolloutTargetAsync(request).get();
+ * GetGameServerDeploymentRolloutRequest request = GetGameServerDeploymentRolloutRequest.newBuilder().build();
+ * GameServerDeploymentRollout response = gameServerDeploymentsServiceClient.getGameServerDeploymentRollout(request);
* }
*
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * List<ClusterPercentageSelector> clusterPercentageSelector = new ArrayList<>();
- * SetRolloutTargetRequest request = SetRolloutTargetRequest.newBuilder()
- * .setName(formattedName)
- * .addAllClusterPercentageSelector(clusterPercentageSelector)
- * .build();
- * OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.setRolloutTargetOperationCallable().futureCall(request);
- * // Do something
- * GameServerDeployment response = future.get();
- * }
- *
*/
- public final UnaryCallable
* try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * List<ClusterPercentageSelector> clusterPercentageSelector = new ArrayList<>();
- * SetRolloutTargetRequest request = SetRolloutTargetRequest.newBuilder()
- * .setName(formattedName)
- * .addAllClusterPercentageSelector(clusterPercentageSelector)
- * .build();
- * ApiFuture<Operation> future = gameServerDeploymentsServiceClient.setRolloutTargetCallable().futureCall(request);
+ * GetGameServerDeploymentRolloutRequest request = GetGameServerDeploymentRolloutRequest.newBuilder().build();
+ * ApiFuture<GameServerDeploymentRollout> future = gameServerDeploymentsServiceClient.getGameServerDeploymentRolloutCallable().futureCall(request);
* // Do something
- * Operation response = future.get();
+ * GameServerDeploymentRollout response = future.get();
* }
*
- *
- * @param name Required. The name of the game server deployment, using the form:
- *
* try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * GameServerDeployment response = gameServerDeploymentsServiceClient.commitRolloutAsync(formattedName).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
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * CommitRolloutRequest request = CommitRolloutRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * GameServerDeployment response = gameServerDeploymentsServiceClient.commitRolloutAsync(request).get();
+ * UpdateGameServerDeploymentRolloutRequest request = UpdateGameServerDeploymentRolloutRequest.newBuilder().build();
+ * Operation response = gameServerDeploymentsServiceClient.updateGameServerDeploymentRollout(request);
* }
*
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
* try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * CommitRolloutRequest request = CommitRolloutRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.commitRolloutOperationCallable().futureCall(request);
- * // Do something
- * GameServerDeployment response = future.get();
- * }
- *
*/
- public final UnaryCallable
- * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * CommitRolloutRequest request = CommitRolloutRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * ApiFuture<Operation> future = gameServerDeploymentsServiceClient.commitRolloutCallable().futureCall(request);
+ * UpdateGameServerDeploymentRolloutRequest request = UpdateGameServerDeploymentRolloutRequest.newBuilder().build();
+ * ApiFuture<Operation> future = gameServerDeploymentsServiceClient.updateGameServerDeploymentRolloutCallable().futureCall(request);
* // Do something
* Operation response = future.get();
* }
*
- *
- * @param name Required. The name of the game server deployment to deploy, using the form:
- *
- * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * GameServerDeployment response = gameServerDeploymentsServiceClient.revertRolloutAsync(formattedName).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
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
* try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * RevertRolloutRequest request = RevertRolloutRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * GameServerDeployment response = gameServerDeploymentsServiceClient.revertRolloutAsync(request).get();
+ * PreviewGameServerDeploymentRolloutRequest request = PreviewGameServerDeploymentRolloutRequest.newBuilder().build();
+ * PreviewGameServerDeploymentRolloutResponse response = gameServerDeploymentsServiceClient.previewGameServerDeploymentRollout(request);
* }
*
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
* try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * RevertRolloutRequest request = RevertRolloutRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.revertRolloutOperationCallable().futureCall(request);
+ * PreviewGameServerDeploymentRolloutRequest request = PreviewGameServerDeploymentRolloutRequest.newBuilder().build();
+ * ApiFuture<PreviewGameServerDeploymentRolloutResponse> future = gameServerDeploymentsServiceClient.previewGameServerDeploymentRolloutCallable().futureCall(request);
* // Do something
- * GameServerDeployment response = future.get();
+ * PreviewGameServerDeploymentRolloutResponse response = future.get();
* }
*
- */
- public final UnaryCallable
- * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * RevertRolloutRequest request = RevertRolloutRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * ApiFuture<Operation> future = gameServerDeploymentsServiceClient.revertRolloutCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- *
- * @param name Required. The name of the game server deployment, using the form:
- *
- * try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * DeploymentTarget response = gameServerDeploymentsServiceClient.getDeploymentTarget(formattedName);
- * }
- *
*
* @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
*/
- public final DeploymentTarget getDeploymentTarget(GetDeploymentTargetRequest request) {
- return getDeploymentTargetCallable().call(request);
+ public final FetchDeploymentStateResponse fetchDeploymentState(
+ FetchDeploymentStateRequest request) {
+ return fetchDeploymentStateCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Retrieves information on the rollout target of the deployment, e.g. the target percentage of
- * game servers running stable_game_server_template and new_game_server_template in clusters.
+ * Retrieves information about the current state of the deployment, e.g. it gathers all the fleets
+ * and autoscalars for this deployment. This includes fleets running older version of the
+ * deployment.
*
*
* try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * GetDeploymentTargetRequest request = GetDeploymentTargetRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * DeploymentTarget response = gameServerDeploymentsServiceClient.getDeploymentTarget(request);
+ * FetchDeploymentStateRequest request = FetchDeploymentStateRequest.newBuilder().build();
+ * FetchDeploymentStateResponse response = gameServerDeploymentsServiceClient.fetchDeploymentState(request);
* }
*
*/
- public final UnaryCallable
* try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
- * String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
- * GetDeploymentTargetRequest request = GetDeploymentTargetRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * ApiFuture<DeploymentTarget> future = gameServerDeploymentsServiceClient.getDeploymentTargetCallable().futureCall(request);
+ * FetchDeploymentStateRequest request = FetchDeploymentStateRequest.newBuilder().build();
+ * ApiFuture<FetchDeploymentStateResponse> future = gameServerDeploymentsServiceClient.fetchDeploymentStateCallable().futureCall(request);
* // Do something
- * DeploymentTarget response = future.get();
+ * FetchDeploymentStateResponse response = future.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
+ */
+ public final PreviewRealmUpdateResponse previewRealmUpdate(PreviewRealmUpdateRequest request) {
+ return previewRealmUpdateCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Previews patches to a single Realm.
+ *
+ *
+ * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+ * PreviewRealmUpdateRequest request = PreviewRealmUpdateRequest.newBuilder().build();
+ * PreviewRealmUpdateResponse response = realmsServiceClient.previewRealmUpdate(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (RealmsServiceClient realmsServiceClient = RealmsServiceClient.create()) {
+ * PreviewRealmUpdateRequest request = PreviewRealmUpdateRequest.newBuilder().build();
+ * ApiFuture<PreviewRealmUpdateResponse> future = realmsServiceClient.previewRealmUpdateCallable().futureCall(request);
+ * // Do something
+ * PreviewRealmUpdateResponse response = future.get();
+ * }
+ *
- *
- *
- *
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
- * ScalingPolicy response = scalingPoliciesServiceClient.getScalingPolicy(formattedName);
- * }
- *
- *
- *
- *
- *
- *
- *
- * To customize the endpoint:
- *
- *
- * ScalingPoliciesServiceSettings scalingPoliciesServiceSettings =
- * ScalingPoliciesServiceSettings.newBuilder()
- * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- * .build();
- * ScalingPoliciesServiceClient scalingPoliciesServiceClient =
- * ScalingPoliciesServiceClient.create(scalingPoliciesServiceSettings);
- *
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class ScalingPoliciesServiceClient implements BackgroundResource {
- private final ScalingPoliciesServiceSettings settings;
- private final ScalingPoliciesServiceStub stub;
- private final OperationsClient operationsClient;
-
- private static final PathTemplate LOCATION_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}");
-
- private static final PathTemplate SCALING_POLICY_PATH_TEMPLATE =
- PathTemplate.createWithoutUrlEncoding(
- "projects/{project}/locations/{location}/scalingPolicies/{scaling_policy}");
-
- /**
- * Formats a string containing the fully-qualified path to represent a location resource.
- *
- * @deprecated Use the {@link LocationName} class instead.
- */
- @Deprecated
- public static final String formatLocationName(String project, String location) {
- return LOCATION_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location);
- }
-
- /**
- * Formats a string containing the fully-qualified path to represent a scaling_policy resource.
- *
- * @deprecated Use the {@link ScalingPolicyName} class instead.
- */
- @Deprecated
- public static final String formatScalingPolicyName(
- String project, String location, String scalingPolicy) {
- return SCALING_POLICY_PATH_TEMPLATE.instantiate(
- "project", project,
- "location", location,
- "scaling_policy", scalingPolicy);
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a location resource.
- *
- * @deprecated Use the {@link LocationName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromLocationName(String locationName) {
- return LOCATION_PATH_TEMPLATE.parse(locationName).get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a location resource.
- *
- * @deprecated Use the {@link LocationName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromLocationName(String locationName) {
- return LOCATION_PATH_TEMPLATE.parse(locationName).get("location");
- }
-
- /**
- * Parses the project from the given fully-qualified path which represents a scaling_policy
- * resource.
- *
- * @deprecated Use the {@link ScalingPolicyName} class instead.
- */
- @Deprecated
- public static final String parseProjectFromScalingPolicyName(String scalingPolicyName) {
- return SCALING_POLICY_PATH_TEMPLATE.parse(scalingPolicyName).get("project");
- }
-
- /**
- * Parses the location from the given fully-qualified path which represents a scaling_policy
- * resource.
- *
- * @deprecated Use the {@link ScalingPolicyName} class instead.
- */
- @Deprecated
- public static final String parseLocationFromScalingPolicyName(String scalingPolicyName) {
- return SCALING_POLICY_PATH_TEMPLATE.parse(scalingPolicyName).get("location");
- }
-
- /**
- * Parses the scaling_policy from the given fully-qualified path which represents a scaling_policy
- * resource.
- *
- * @deprecated Use the {@link ScalingPolicyName} class instead.
- */
- @Deprecated
- public static final String parseScalingPolicyFromScalingPolicyName(String scalingPolicyName) {
- return SCALING_POLICY_PATH_TEMPLATE.parse(scalingPolicyName).get("scaling_policy");
- }
-
- /** Constructs an instance of ScalingPoliciesServiceClient with default settings. */
- public static final ScalingPoliciesServiceClient create() throws IOException {
- return create(ScalingPoliciesServiceSettings.newBuilder().build());
- }
-
- /**
- * Constructs an instance of ScalingPoliciesServiceClient, using the given settings. The channels
- * are created based on the settings passed in, or defaults for any settings that are not set.
- */
- public static final ScalingPoliciesServiceClient create(ScalingPoliciesServiceSettings settings)
- throws IOException {
- return new ScalingPoliciesServiceClient(settings);
- }
-
- /**
- * Constructs an instance of ScalingPoliciesServiceClient, using the given stub for making calls.
- * This is for advanced usage - prefer to use ScalingPoliciesServiceSettings}.
- */
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public static final ScalingPoliciesServiceClient create(ScalingPoliciesServiceStub stub) {
- return new ScalingPoliciesServiceClient(stub);
- }
-
- /**
- * Constructs an instance of ScalingPoliciesServiceClient, using the given settings. This is
- * protected so that it is easy to make a subclass, but otherwise, the static factory methods
- * should be preferred.
- */
- protected ScalingPoliciesServiceClient(ScalingPoliciesServiceSettings settings)
- throws IOException {
- this.settings = settings;
- this.stub = ((ScalingPoliciesServiceStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- protected ScalingPoliciesServiceClient(ScalingPoliciesServiceStub stub) {
- this.settings = null;
- this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- public final ScalingPoliciesServiceSettings getSettings() {
- return settings;
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public ScalingPoliciesServiceStub getStub() {
- return stub;
- }
-
- /**
- * Returns the OperationsClient that can be used to query the status of a long-running operation
- * returned by another API method call.
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationsClient getOperationsClient() {
- return operationsClient;
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists ScalingPolicies in a given project and location.
- *
- *
- * ScalingPoliciesServiceSettings scalingPoliciesServiceSettings =
- * ScalingPoliciesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * ScalingPoliciesServiceClient scalingPoliciesServiceClient =
- * ScalingPoliciesServiceClient.create(scalingPoliciesServiceSettings);
- *
- *
- *
- * @param parent Required. The parent resource name, using the form:
- * `projects/{project_id}/locations/{location}`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final ListScalingPoliciesPagedResponse listScalingPolicies(String parent) {
- LOCATION_PATH_TEMPLATE.validate(parent, "listScalingPolicies");
- ListScalingPoliciesRequest request =
- ListScalingPoliciesRequest.newBuilder().setParent(parent).build();
- return listScalingPolicies(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists ScalingPolicies in a given project and location.
- *
- *
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * for (ScalingPolicy element : scalingPoliciesServiceClient.listScalingPolicies(formattedParent).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
- */
- public final ListScalingPoliciesPagedResponse listScalingPolicies(
- ListScalingPoliciesRequest request) {
- return listScalingPoliciesPagedCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists ScalingPolicies in a given project and location.
- *
- *
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * ListScalingPoliciesRequest request = ListScalingPoliciesRequest.newBuilder()
- * .setParent(formattedParent)
- * .build();
- * for (ScalingPolicy element : scalingPoliciesServiceClient.listScalingPolicies(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallable
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * ListScalingPoliciesRequest request = ListScalingPoliciesRequest.newBuilder()
- * .setParent(formattedParent)
- * .build();
- * ApiFuture<ListScalingPoliciesPagedResponse> future = scalingPoliciesServiceClient.listScalingPoliciesPagedCallable().futureCall(request);
- * // Do something
- * for (ScalingPolicy element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallable
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * ListScalingPoliciesRequest request = ListScalingPoliciesRequest.newBuilder()
- * .setParent(formattedParent)
- * .build();
- * while (true) {
- * ListScalingPoliciesResponse response = scalingPoliciesServiceClient.listScalingPoliciesCallable().call(request);
- * for (ScalingPolicy element : response.getScalingPoliciesList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- *
- * @param name Required. The name of the scaling policy to retrieve, using the form:
- *
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
- * ScalingPolicy response = scalingPoliciesServiceClient.getScalingPolicy(formattedName);
- * }
- *
- *
- * @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
- */
- public final ScalingPolicy getScalingPolicy(GetScalingPolicyRequest request) {
- return getScalingPolicyCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets details of a single scaling policy.
- *
- *
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
- * GetScalingPolicyRequest request = GetScalingPolicyRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * ScalingPolicy response = scalingPoliciesServiceClient.getScalingPolicy(request);
- * }
- *
- */
- public final UnaryCallable
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
- * GetScalingPolicyRequest request = GetScalingPolicyRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * ApiFuture<ScalingPolicy> future = scalingPoliciesServiceClient.getScalingPolicyCallable().futureCall(request);
- * // Do something
- * ScalingPolicy response = future.get();
- * }
- *
- *
- * @param parent Required. The parent resource name, using the form:
- * `projects/{project_id}/locations/{location}`.
- * @param scalingPolicyId Required. The ID of the scaling policy resource to be created.
- * @param scalingPolicy Required. The scaling policy resource to be created.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * String scalingPolicyId = "";
- * ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
- * ScalingPolicy response = scalingPoliciesServiceClient.createScalingPolicyAsync(formattedParent, scalingPolicyId, scalingPolicy).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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * String scalingPolicyId = "";
- * ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
- * CreateScalingPolicyRequest request = CreateScalingPolicyRequest.newBuilder()
- * .setParent(formattedParent)
- * .setScalingPolicyId(scalingPolicyId)
- * .setScalingPolicy(scalingPolicy)
- * .build();
- * ScalingPolicy response = scalingPoliciesServiceClient.createScalingPolicyAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * String scalingPolicyId = "";
- * ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
- * CreateScalingPolicyRequest request = CreateScalingPolicyRequest.newBuilder()
- * .setParent(formattedParent)
- * .setScalingPolicyId(scalingPolicyId)
- * .setScalingPolicy(scalingPolicy)
- * .build();
- * OperationFuture<ScalingPolicy, Empty> future = scalingPoliciesServiceClient.createScalingPolicyOperationCallable().futureCall(request);
- * // Do something
- * ScalingPolicy response = future.get();
- * }
- *
- */
- public final UnaryCallable
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedParent = ScalingPoliciesServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
- * String scalingPolicyId = "";
- * ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
- * CreateScalingPolicyRequest request = CreateScalingPolicyRequest.newBuilder()
- * .setParent(formattedParent)
- * .setScalingPolicyId(scalingPolicyId)
- * .setScalingPolicy(scalingPolicy)
- * .build();
- * ApiFuture<Operation> future = scalingPoliciesServiceClient.createScalingPolicyCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- *
- * @param name Required. The name of the scaling policy to delete, using the form:
- *
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
- * scalingPoliciesServiceClient.deleteScalingPolicyAsync(formattedName).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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
- * DeleteScalingPolicyRequest request = DeleteScalingPolicyRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * scalingPoliciesServiceClient.deleteScalingPolicyAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
- * DeleteScalingPolicyRequest request = DeleteScalingPolicyRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * OperationFuture<Empty, Empty> future = scalingPoliciesServiceClient.deleteScalingPolicyOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
- * DeleteScalingPolicyRequest request = DeleteScalingPolicyRequest.newBuilder()
- * .setName(formattedName)
- * .build();
- * ApiFuture<Operation> future = scalingPoliciesServiceClient.deleteScalingPolicyCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
- * @param scalingPolicy Required. The scaling policy 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
- * this field. For the `FieldMask` definition, see
- *
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * ScalingPolicy response = scalingPoliciesServiceClient.updateScalingPolicyAsync(scalingPolicy, updateMask).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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateScalingPolicyRequest request = UpdateScalingPolicyRequest.newBuilder()
- * .setScalingPolicy(scalingPolicy)
- * .setUpdateMask(updateMask)
- * .build();
- * ScalingPolicy response = scalingPoliciesServiceClient.updateScalingPolicyAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateScalingPolicyRequest request = UpdateScalingPolicyRequest.newBuilder()
- * .setScalingPolicy(scalingPolicy)
- * .setUpdateMask(updateMask)
- * .build();
- * OperationFuture<ScalingPolicy, Empty> future = scalingPoliciesServiceClient.updateScalingPolicyOperationCallable().futureCall(request);
- * // Do something
- * ScalingPolicy response = future.get();
- * }
- *
- */
- public final UnaryCallable
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * ScalingPolicy scalingPolicy = ScalingPolicy.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateScalingPolicyRequest request = UpdateScalingPolicyRequest.newBuilder()
- * .setScalingPolicy(scalingPolicy)
- * .setUpdateMask(updateMask)
- * .build();
- * ApiFuture<Operation> future = scalingPoliciesServiceClient.updateScalingPolicyCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- *
- *
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class ScalingPoliciesServiceSettings extends ClientSettings
- * ScalingPoliciesServiceSettings.Builder scalingPoliciesServiceSettingsBuilder =
- * ScalingPoliciesServiceSettings.newBuilder();
- * scalingPoliciesServiceSettingsBuilder.getScalingPolicySettings().getRetrySettings().toBuilder()
- * .setTotalTimeout(Duration.ofSeconds(30));
- * ScalingPoliciesServiceSettings scalingPoliciesServiceSettings = scalingPoliciesServiceSettingsBuilder.build();
- *
- *
- *
- *
- * =============================== GameServerClustersServiceClient ===============================
- *
- *
- * try (AllocationPoliciesServiceClient allocationPoliciesServiceClient = AllocationPoliciesServiceClient.create()) {
- * String formattedName = AllocationPoliciesServiceClient.formatAllocationPolicyName("[PROJECT]", "[LOCATION]", "[ALLOCATION_POLICY]");
- * AllocationPolicy response = allocationPoliciesServiceClient.getAllocationPolicy(formattedName);
- * }
- *
- *
- *
*/
@Generated("by gapic-generator")
package com.google.cloud.gaming.v1alpha;
diff --git a/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/AllocationPoliciesServiceStub.java b/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/AllocationPoliciesServiceStub.java
deleted file mode 100644
index 8ef33cfa..00000000
--- a/google-cloud-gameservices/src/main/java/com/google/cloud/gaming/v1alpha/stub/AllocationPoliciesServiceStub.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright 2019 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.google.cloud.gaming.v1alpha.stub;
-
-import static com.google.cloud.gaming.v1alpha.AllocationPoliciesServiceClient.ListAllocationPoliciesPagedResponse;
-
-import com.google.api.core.BetaApi;
-import com.google.api.gax.core.BackgroundResource;
-import com.google.api.gax.rpc.OperationCallable;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.cloud.gaming.v1alpha.AllocationPolicy;
-import com.google.cloud.gaming.v1alpha.CreateAllocationPolicyRequest;
-import com.google.cloud.gaming.v1alpha.DeleteAllocationPolicyRequest;
-import com.google.cloud.gaming.v1alpha.GetAllocationPolicyRequest;
-import com.google.cloud.gaming.v1alpha.ListAllocationPoliciesRequest;
-import com.google.cloud.gaming.v1alpha.ListAllocationPoliciesResponse;
-import com.google.cloud.gaming.v1alpha.UpdateAllocationPolicyRequest;
-import com.google.longrunning.Operation;
-import com.google.longrunning.stub.OperationsStub;
-import com.google.protobuf.Empty;
-import javax.annotation.Generated;
-
-// AUTO-GENERATED DOCUMENTATION AND CLASS
-/**
- * Base stub class for Game Services API.
- *
- *
- * try (ScalingPoliciesServiceClient scalingPoliciesServiceClient = ScalingPoliciesServiceClient.create()) {
- * String formattedName = ScalingPoliciesServiceClient.formatScalingPolicyName("[PROJECT]", "[LOCATION]", "[SCALING_POLICY]");
- * ScalingPolicy response = scalingPoliciesServiceClient.getScalingPolicy(formattedName);
- * }
- *
- *
- *
- *
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class AllocationPoliciesServiceStubSettings
- extends StubSettings
- * AllocationPoliciesServiceStubSettings.Builder allocationPoliciesServiceSettingsBuilder =
- * AllocationPoliciesServiceStubSettings.newBuilder();
- * allocationPoliciesServiceSettingsBuilder.getAllocationPolicySettings().getRetrySettings().toBuilder()
- * .setTotalTimeout(Duration.ofSeconds(30));
- * AllocationPoliciesServiceStubSettings allocationPoliciesServiceSettings = allocationPoliciesServiceSettingsBuilder.build();
- *
- *