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 (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+ * AcceleratorType response = acceleratorTypeClient.getAcceleratorType(acceleratorType);
+ * }
+ *
+ *
+ *
+ * Note: close() needs to be called on the acceleratorTypeClient 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 AcceleratorTypeSettings to + * create(). For example: + * + *
To customize credentials: + * + *
+ *
+ * AcceleratorTypeSettings acceleratorTypeSettings =
+ * AcceleratorTypeSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * AcceleratorTypeClient acceleratorTypeClient =
+ * AcceleratorTypeClient.create(acceleratorTypeSettings);
+ *
+ *
+ *
+ * To customize the endpoint:
+ *
+ *
+ *
+ * AcceleratorTypeSettings acceleratorTypeSettings =
+ * AcceleratorTypeSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AcceleratorTypeClient acceleratorTypeClient =
+ * AcceleratorTypeClient.create(acceleratorTypeSettings);
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class AcceleratorTypeClient implements BackgroundResource {
+ private final AcceleratorTypeSettings settings;
+ private final AcceleratorTypeStub stub;
+
+ /** Constructs an instance of AcceleratorTypeClient with default settings. */
+ public static final AcceleratorTypeClient create() throws IOException {
+ return create(AcceleratorTypeSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of AcceleratorTypeClient, 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 AcceleratorTypeClient create(AcceleratorTypeSettings settings)
+ throws IOException {
+ return new AcceleratorTypeClient(settings);
+ }
+
+ /**
+ * Constructs an instance of AcceleratorTypeClient, using the given stub for making calls. This is
+ * for advanced usage - prefer to use AcceleratorTypeSettings}.
+ */
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public static final AcceleratorTypeClient create(AcceleratorTypeStub stub) {
+ return new AcceleratorTypeClient(stub);
+ }
+
+ /**
+ * Constructs an instance of AcceleratorTypeClient, 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 AcceleratorTypeClient(AcceleratorTypeSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((AcceleratorTypeStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ protected AcceleratorTypeClient(AcceleratorTypeStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final AcceleratorTypeSettings getSettings() {
+ return settings;
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public AcceleratorTypeStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of accelerator types.
+ *
+ * Sample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * for (AcceleratorTypesScopedList element : acceleratorTypeClient.aggregatedListAcceleratorTypes(project).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param project Project ID for this request.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAcceleratorTypes(
+ ProjectName project) {
+ AggregatedListAcceleratorTypesHttpRequest request =
+ AggregatedListAcceleratorTypesHttpRequest.newBuilder()
+ .setProject(project == null ? null : project.toString())
+ .build();
+ return aggregatedListAcceleratorTypes(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of accelerator types.
+ *
+ * Sample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * for (AcceleratorTypesScopedList element : acceleratorTypeClient.aggregatedListAcceleratorTypes(project.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param project Project ID for this request.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAcceleratorTypes(
+ String project) {
+ AggregatedListAcceleratorTypesHttpRequest request =
+ AggregatedListAcceleratorTypesHttpRequest.newBuilder().setProject(project).build();
+ return aggregatedListAcceleratorTypes(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of accelerator types.
+ *
+ * Sample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * AggregatedListAcceleratorTypesHttpRequest request = AggregatedListAcceleratorTypesHttpRequest.newBuilder()
+ * .setProject(project.toString())
+ * .build();
+ * for (AcceleratorTypesScopedList element : acceleratorTypeClient.aggregatedListAcceleratorTypes(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
+ */
+ @BetaApi
+ public final AggregatedListAcceleratorTypesPagedResponse aggregatedListAcceleratorTypes(
+ AggregatedListAcceleratorTypesHttpRequest request) {
+ return aggregatedListAcceleratorTypesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of accelerator types.
+ *
+ * Sample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * AggregatedListAcceleratorTypesHttpRequest request = AggregatedListAcceleratorTypesHttpRequest.newBuilder()
+ * .setProject(project.toString())
+ * .build();
+ * ApiFuture<AggregatedListAcceleratorTypesPagedResponse> future = acceleratorTypeClient.aggregatedListAcceleratorTypesPagedCallable().futureCall(request);
+ * // Do something
+ * for (AcceleratorTypesScopedList element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable<
+ AggregatedListAcceleratorTypesHttpRequest, AggregatedListAcceleratorTypesPagedResponse>
+ aggregatedListAcceleratorTypesPagedCallable() {
+ return stub.aggregatedListAcceleratorTypesPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of accelerator types.
+ *
+ * Sample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * AggregatedListAcceleratorTypesHttpRequest request = AggregatedListAcceleratorTypesHttpRequest.newBuilder()
+ * .setProject(project.toString())
+ * .build();
+ * while (true) {
+ * AcceleratorTypeAggregatedList response = acceleratorTypeClient.aggregatedListAcceleratorTypesCallable().call(request);
+ * for (AcceleratorTypesScopedList element : response.getItemsMap()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable<
+ AggregatedListAcceleratorTypesHttpRequest, AcceleratorTypeAggregatedList>
+ aggregatedListAcceleratorTypesCallable() {
+ return stub.aggregatedListAcceleratorTypesCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the specified accelerator type.
+ *
+ * Sample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+ * AcceleratorType response = acceleratorTypeClient.getAcceleratorType(acceleratorType);
+ * }
+ *
+ *
+ * @param acceleratorType Name of the accelerator type to return.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final AcceleratorType getAcceleratorType(ProjectZoneAcceleratorTypeName acceleratorType) {
+
+ GetAcceleratorTypeHttpRequest request =
+ GetAcceleratorTypeHttpRequest.newBuilder()
+ .setAcceleratorType(acceleratorType == null ? null : acceleratorType.toString())
+ .build();
+ return getAcceleratorType(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the specified accelerator type.
+ *
+ * Sample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+ * AcceleratorType response = acceleratorTypeClient.getAcceleratorType(acceleratorType.toString());
+ * }
+ *
+ *
+ * @param acceleratorType Name of the accelerator type to return.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final AcceleratorType getAcceleratorType(String acceleratorType) {
+
+ GetAcceleratorTypeHttpRequest request =
+ GetAcceleratorTypeHttpRequest.newBuilder().setAcceleratorType(acceleratorType).build();
+ return getAcceleratorType(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the specified accelerator type.
+ *
+ * Sample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+ * GetAcceleratorTypeHttpRequest request = GetAcceleratorTypeHttpRequest.newBuilder()
+ * .setAcceleratorType(acceleratorType.toString())
+ * .build();
+ * AcceleratorType response = acceleratorTypeClient.getAcceleratorType(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
+ */
+ @BetaApi
+ public final AcceleratorType getAcceleratorType(GetAcceleratorTypeHttpRequest request) {
+ return getAcceleratorTypeCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the specified accelerator type.
+ *
+ * Sample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectZoneAcceleratorTypeName acceleratorType = ProjectZoneAcceleratorTypeName.of("[PROJECT]", "[ZONE]", "[ACCELERATOR_TYPE]");
+ * GetAcceleratorTypeHttpRequest request = GetAcceleratorTypeHttpRequest.newBuilder()
+ * .setAcceleratorType(acceleratorType.toString())
+ * .build();
+ * ApiFuture<AcceleratorType> future = acceleratorTypeClient.getAcceleratorTypeCallable().futureCall(request);
+ * // Do something
+ * AcceleratorType response = future.get();
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallableSample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * for (AcceleratorType element : acceleratorTypeClient.listAcceleratorTypes(zone).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param zone The name of the zone for this request.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(ProjectZoneName zone) {
+ ListAcceleratorTypesHttpRequest request =
+ ListAcceleratorTypesHttpRequest.newBuilder()
+ .setZone(zone == null ? null : zone.toString())
+ .build();
+ return listAcceleratorTypes(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves a list of accelerator types available to the specified project.
+ *
+ * Sample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * for (AcceleratorType element : acceleratorTypeClient.listAcceleratorTypes(zone.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param zone The name of the zone for this request.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(String zone) {
+ ListAcceleratorTypesHttpRequest request =
+ ListAcceleratorTypesHttpRequest.newBuilder().setZone(zone).build();
+ return listAcceleratorTypes(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves a list of accelerator types available to the specified project.
+ *
+ * Sample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * ListAcceleratorTypesHttpRequest request = ListAcceleratorTypesHttpRequest.newBuilder()
+ * .setZone(zone.toString())
+ * .build();
+ * for (AcceleratorType element : acceleratorTypeClient.listAcceleratorTypes(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
+ */
+ @BetaApi
+ public final ListAcceleratorTypesPagedResponse listAcceleratorTypes(
+ ListAcceleratorTypesHttpRequest request) {
+ return listAcceleratorTypesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves a list of accelerator types available to the specified project.
+ *
+ * Sample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * ListAcceleratorTypesHttpRequest request = ListAcceleratorTypesHttpRequest.newBuilder()
+ * .setZone(zone.toString())
+ * .build();
+ * ApiFuture<ListAcceleratorTypesPagedResponse> future = acceleratorTypeClient.listAcceleratorTypesPagedCallable().futureCall(request);
+ * // Do something
+ * for (AcceleratorType element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallableSample code: + * + *
+ * try (AcceleratorTypeClient acceleratorTypeClient = AcceleratorTypeClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * ListAcceleratorTypesHttpRequest request = ListAcceleratorTypesHttpRequest.newBuilder()
+ * .setZone(zone.toString())
+ * .build();
+ * while (true) {
+ * AcceleratorTypeList response = acceleratorTypeClient.listAcceleratorTypesCallable().call(request);
+ * for (AcceleratorType element : response.getItemsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallableThe 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 getAcceleratorType to 30 seconds: + * + *
+ *
+ * AcceleratorTypeSettings.Builder acceleratorTypeSettingsBuilder =
+ * AcceleratorTypeSettings.newBuilder();
+ * acceleratorTypeSettingsBuilder.getAcceleratorTypeSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30));
+ * AcceleratorTypeSettings acceleratorTypeSettings = acceleratorTypeSettingsBuilder.build();
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class AcceleratorTypeSettings extends ClientSettingsNote: 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:
+ *
+ * Note: close() needs to be called on the addressClient 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 AddressSettings to create().
+ * For example:
+ *
+ * To customize credentials:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * 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 deleteAddress 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:
+ *
+ * Note: close() needs to be called on the autoscalerClient 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 AutoscalerSettings to
+ * create(). For example:
+ *
+ * To customize credentials:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * 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 deleteAutoscaler to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction
+ *
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+ * Operation response = addressClient.deleteAddress(address);
+ * }
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * To customize the endpoint:
+ *
+ *
+ * AddressSettings addressSettings =
+ * AddressSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * AddressClient addressClient =
+ * AddressClient.create(addressSettings);
+ *
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class AddressClient implements BackgroundResource {
+ private final AddressSettings settings;
+ private final AddressStub stub;
+
+ /** Constructs an instance of AddressClient with default settings. */
+ public static final AddressClient create() throws IOException {
+ return create(AddressSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of AddressClient, 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 AddressClient create(AddressSettings settings) throws IOException {
+ return new AddressClient(settings);
+ }
+
+ /**
+ * Constructs an instance of AddressClient, using the given stub for making calls. This is for
+ * advanced usage - prefer to use AddressSettings}.
+ */
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public static final AddressClient create(AddressStub stub) {
+ return new AddressClient(stub);
+ }
+
+ /**
+ * Constructs an instance of AddressClient, 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 AddressClient(AddressSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((AddressStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ protected AddressClient(AddressStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final AddressSettings getSettings() {
+ return settings;
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public AddressStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of addresses.
+ *
+ *
+ * AddressSettings addressSettings =
+ * AddressSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AddressClient addressClient =
+ * AddressClient.create(addressSettings);
+ *
+ *
+ *
+ * @param project Project ID for this request.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final AggregatedListAddressesPagedResponse aggregatedListAddresses(ProjectName project) {
+ AggregatedListAddressesHttpRequest request =
+ AggregatedListAddressesHttpRequest.newBuilder()
+ .setProject(project == null ? null : project.toString())
+ .build();
+ return aggregatedListAddresses(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of addresses.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * for (AddressesScopedList element : addressClient.aggregatedListAddresses(project).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param project Project ID for this request.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final AggregatedListAddressesPagedResponse aggregatedListAddresses(String project) {
+ AggregatedListAddressesHttpRequest request =
+ AggregatedListAddressesHttpRequest.newBuilder().setProject(project).build();
+ return aggregatedListAddresses(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of addresses.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * for (AddressesScopedList element : addressClient.aggregatedListAddresses(project.toString()).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
+ */
+ @BetaApi
+ public final AggregatedListAddressesPagedResponse aggregatedListAddresses(
+ AggregatedListAddressesHttpRequest request) {
+ return aggregatedListAddressesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of addresses.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * AggregatedListAddressesHttpRequest request = AggregatedListAddressesHttpRequest.newBuilder()
+ * .setProject(project.toString())
+ * .build();
+ * for (AddressesScopedList element : addressClient.aggregatedListAddresses(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable<
+ AggregatedListAddressesHttpRequest, AggregatedListAddressesPagedResponse>
+ aggregatedListAddressesPagedCallable() {
+ return stub.aggregatedListAddressesPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of addresses.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * AggregatedListAddressesHttpRequest request = AggregatedListAddressesHttpRequest.newBuilder()
+ * .setProject(project.toString())
+ * .build();
+ * ApiFuture<AggregatedListAddressesPagedResponse> future = addressClient.aggregatedListAddressesPagedCallable().futureCall(request);
+ * // Do something
+ * for (AddressesScopedList element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * AggregatedListAddressesHttpRequest request = AggregatedListAddressesHttpRequest.newBuilder()
+ * .setProject(project.toString())
+ * .build();
+ * while (true) {
+ * AddressAggregatedList response = addressClient.aggregatedListAddressesCallable().call(request);
+ * for (AddressesScopedList element : response.getItemsMap()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ *
+ * @param address Name of the address resource to delete.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Operation deleteAddress(ProjectRegionAddressName address) {
+
+ DeleteAddressHttpRequest request =
+ DeleteAddressHttpRequest.newBuilder()
+ .setAddress(address == null ? null : address.toString())
+ .build();
+ return deleteAddress(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified address resource.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+ * Operation response = addressClient.deleteAddress(address);
+ * }
+ *
+ *
+ * @param address Name of the address resource to delete.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Operation deleteAddress(String address) {
+
+ DeleteAddressHttpRequest request =
+ DeleteAddressHttpRequest.newBuilder().setAddress(address).build();
+ return deleteAddress(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified address resource.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+ * Operation response = addressClient.deleteAddress(address.toString());
+ * }
+ *
+ *
+ * @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
+ public final Operation deleteAddress(DeleteAddressHttpRequest request) {
+ return deleteAddressCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified address resource.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+ * DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder()
+ * .setAddress(address.toString())
+ * .build();
+ * Operation response = addressClient.deleteAddress(request);
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+ * DeleteAddressHttpRequest request = DeleteAddressHttpRequest.newBuilder()
+ * .setAddress(address.toString())
+ * .build();
+ * ApiFuture<Operation> future = addressClient.deleteAddressCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
+ * }
+ *
+ *
+ * @param address Name of the address resource to return.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Address getAddress(ProjectRegionAddressName address) {
+
+ GetAddressHttpRequest request =
+ GetAddressHttpRequest.newBuilder()
+ .setAddress(address == null ? null : address.toString())
+ .build();
+ return getAddress(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the specified address resource.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+ * Address response = addressClient.getAddress(address);
+ * }
+ *
+ *
+ * @param address Name of the address resource to return.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Address getAddress(String address) {
+
+ GetAddressHttpRequest request = GetAddressHttpRequest.newBuilder().setAddress(address).build();
+ return getAddress(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the specified address resource.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+ * Address response = addressClient.getAddress(address.toString());
+ * }
+ *
+ *
+ * @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
+ public final Address getAddress(GetAddressHttpRequest request) {
+ return getAddressCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the specified address resource.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+ * GetAddressHttpRequest request = GetAddressHttpRequest.newBuilder()
+ * .setAddress(address.toString())
+ * .build();
+ * Address response = addressClient.getAddress(request);
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionAddressName address = ProjectRegionAddressName.of("[PROJECT]", "[REGION]", "[ADDRESS]");
+ * GetAddressHttpRequest request = GetAddressHttpRequest.newBuilder()
+ * .setAddress(address.toString())
+ * .build();
+ * ApiFuture<Address> future = addressClient.getAddressCallable().futureCall(request);
+ * // Do something
+ * Address response = future.get();
+ * }
+ *
+ *
+ * @param region Name of the region for this request.
+ * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (==
+ * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for
+ * v1.globalAddresses ==)
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Operation insertAddress(ProjectRegionName region, Address addressResource) {
+
+ InsertAddressHttpRequest request =
+ InsertAddressHttpRequest.newBuilder()
+ .setRegion(region == null ? null : region.toString())
+ .setAddressResource(addressResource)
+ .build();
+ return insertAddress(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates an address resource in the specified project using the data included in the request.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+ * Address addressResource = Address.newBuilder().build();
+ * Operation response = addressClient.insertAddress(region, addressResource);
+ * }
+ *
+ *
+ * @param region Name of the region for this request.
+ * @param addressResource A reserved address resource. (== resource_for beta.addresses ==) (==
+ * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for
+ * v1.globalAddresses ==)
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Operation insertAddress(String region, Address addressResource) {
+
+ InsertAddressHttpRequest request =
+ InsertAddressHttpRequest.newBuilder()
+ .setRegion(region)
+ .setAddressResource(addressResource)
+ .build();
+ return insertAddress(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates an address resource in the specified project using the data included in the request.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+ * Address addressResource = Address.newBuilder().build();
+ * Operation response = addressClient.insertAddress(region.toString(), addressResource);
+ * }
+ *
+ *
+ * @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
+ public final Operation insertAddress(InsertAddressHttpRequest request) {
+ return insertAddressCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates an address resource in the specified project using the data included in the request.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+ * Address addressResource = Address.newBuilder().build();
+ * InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder()
+ * .setRegion(region.toString())
+ * .setAddressResource(addressResource)
+ * .build();
+ * Operation response = addressClient.insertAddress(request);
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+ * Address addressResource = Address.newBuilder().build();
+ * InsertAddressHttpRequest request = InsertAddressHttpRequest.newBuilder()
+ * .setRegion(region.toString())
+ * .setAddressResource(addressResource)
+ * .build();
+ * ApiFuture<Operation> future = addressClient.insertAddressCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
+ * }
+ *
+ *
+ * @param region Name of the region for this request.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final ListAddressesPagedResponse listAddresses(ProjectRegionName region) {
+ ListAddressesHttpRequest request =
+ ListAddressesHttpRequest.newBuilder()
+ .setRegion(region == null ? null : region.toString())
+ .build();
+ return listAddresses(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves a list of addresses contained within the specified region.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+ * for (Address element : addressClient.listAddresses(region).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param region Name of the region for this request.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final ListAddressesPagedResponse listAddresses(String region) {
+ ListAddressesHttpRequest request =
+ ListAddressesHttpRequest.newBuilder().setRegion(region).build();
+ return listAddresses(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves a list of addresses contained within the specified region.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+ * for (Address element : addressClient.listAddresses(region.toString()).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
+ */
+ @BetaApi
+ public final ListAddressesPagedResponse listAddresses(ListAddressesHttpRequest request) {
+ return listAddressesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves a list of addresses contained within the specified region.
+ *
+ *
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+ * ListAddressesHttpRequest request = ListAddressesHttpRequest.newBuilder()
+ * .setRegion(region.toString())
+ * .build();
+ * for (Address element : addressClient.listAddresses(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+ * ListAddressesHttpRequest request = ListAddressesHttpRequest.newBuilder()
+ * .setRegion(region.toString())
+ * .build();
+ * ApiFuture<ListAddressesPagedResponse> future = addressClient.listAddressesPagedCallable().futureCall(request);
+ * // Do something
+ * for (Address element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AddressClient addressClient = AddressClient.create()) {
+ * ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
+ * ListAddressesHttpRequest request = ListAddressesHttpRequest.newBuilder()
+ * .setRegion(region.toString())
+ * .build();
+ * while (true) {
+ * AddressList response = addressClient.listAddressesCallable().call(request);
+ * for (Address element : response.getItemsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ *
+ *
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class AddressSettings extends ClientSettings
+ * AddressSettings.Builder addressSettingsBuilder =
+ * AddressSettings.newBuilder();
+ * addressSettingsBuilder.deleteAddressSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30));
+ * AddressSettings addressSettings = addressSettingsBuilder.build();
+ *
+ *
+ *
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+ * Operation response = autoscalerClient.deleteAutoscaler(autoscaler);
+ * }
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * To customize the endpoint:
+ *
+ *
+ * AutoscalerSettings autoscalerSettings =
+ * AutoscalerSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * AutoscalerClient autoscalerClient =
+ * AutoscalerClient.create(autoscalerSettings);
+ *
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class AutoscalerClient implements BackgroundResource {
+ private final AutoscalerSettings settings;
+ private final AutoscalerStub stub;
+
+ /** Constructs an instance of AutoscalerClient with default settings. */
+ public static final AutoscalerClient create() throws IOException {
+ return create(AutoscalerSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of AutoscalerClient, 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 AutoscalerClient create(AutoscalerSettings settings) throws IOException {
+ return new AutoscalerClient(settings);
+ }
+
+ /**
+ * Constructs an instance of AutoscalerClient, using the given stub for making calls. This is for
+ * advanced usage - prefer to use AutoscalerSettings}.
+ */
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public static final AutoscalerClient create(AutoscalerStub stub) {
+ return new AutoscalerClient(stub);
+ }
+
+ /**
+ * Constructs an instance of AutoscalerClient, 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 AutoscalerClient(AutoscalerSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((AutoscalerStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ protected AutoscalerClient(AutoscalerStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final AutoscalerSettings getSettings() {
+ return settings;
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public AutoscalerStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of autoscalers.
+ *
+ *
+ * AutoscalerSettings autoscalerSettings =
+ * AutoscalerSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AutoscalerClient autoscalerClient =
+ * AutoscalerClient.create(autoscalerSettings);
+ *
+ *
+ *
+ * @param project Project ID for this request.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(
+ ProjectName project) {
+ AggregatedListAutoscalersHttpRequest request =
+ AggregatedListAutoscalersHttpRequest.newBuilder()
+ .setProject(project == null ? null : project.toString())
+ .build();
+ return aggregatedListAutoscalers(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of autoscalers.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * for (AutoscalersScopedList element : autoscalerClient.aggregatedListAutoscalers(project).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param project Project ID for this request.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(String project) {
+ AggregatedListAutoscalersHttpRequest request =
+ AggregatedListAutoscalersHttpRequest.newBuilder().setProject(project).build();
+ return aggregatedListAutoscalers(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of autoscalers.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * for (AutoscalersScopedList element : autoscalerClient.aggregatedListAutoscalers(project.toString()).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
+ */
+ @BetaApi
+ public final AggregatedListAutoscalersPagedResponse aggregatedListAutoscalers(
+ AggregatedListAutoscalersHttpRequest request) {
+ return aggregatedListAutoscalersPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of autoscalers.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * AggregatedListAutoscalersHttpRequest request = AggregatedListAutoscalersHttpRequest.newBuilder()
+ * .setProject(project.toString())
+ * .build();
+ * for (AutoscalersScopedList element : autoscalerClient.aggregatedListAutoscalers(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable<
+ AggregatedListAutoscalersHttpRequest, AggregatedListAutoscalersPagedResponse>
+ aggregatedListAutoscalersPagedCallable() {
+ return stub.aggregatedListAutoscalersPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves an aggregated list of autoscalers.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * AggregatedListAutoscalersHttpRequest request = AggregatedListAutoscalersHttpRequest.newBuilder()
+ * .setProject(project.toString())
+ * .build();
+ * ApiFuture<AggregatedListAutoscalersPagedResponse> future = autoscalerClient.aggregatedListAutoscalersPagedCallable().futureCall(request);
+ * // Do something
+ * for (AutoscalersScopedList element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectName project = ProjectName.of("[PROJECT]");
+ * AggregatedListAutoscalersHttpRequest request = AggregatedListAutoscalersHttpRequest.newBuilder()
+ * .setProject(project.toString())
+ * .build();
+ * while (true) {
+ * AutoscalerAggregatedList response = autoscalerClient.aggregatedListAutoscalersCallable().call(request);
+ * for (AutoscalersScopedList element : response.getItemsMap()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ *
+ * @param autoscaler Name of the autoscaler to delete.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Operation deleteAutoscaler(ProjectZoneAutoscalerName autoscaler) {
+
+ DeleteAutoscalerHttpRequest request =
+ DeleteAutoscalerHttpRequest.newBuilder()
+ .setAutoscaler(autoscaler == null ? null : autoscaler.toString())
+ .build();
+ return deleteAutoscaler(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified autoscaler.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+ * Operation response = autoscalerClient.deleteAutoscaler(autoscaler);
+ * }
+ *
+ *
+ * @param autoscaler Name of the autoscaler to delete.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Operation deleteAutoscaler(String autoscaler) {
+
+ DeleteAutoscalerHttpRequest request =
+ DeleteAutoscalerHttpRequest.newBuilder().setAutoscaler(autoscaler).build();
+ return deleteAutoscaler(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified autoscaler.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+ * Operation response = autoscalerClient.deleteAutoscaler(autoscaler.toString());
+ * }
+ *
+ *
+ * @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
+ public final Operation deleteAutoscaler(DeleteAutoscalerHttpRequest request) {
+ return deleteAutoscalerCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the specified autoscaler.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+ * DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder()
+ * .setAutoscaler(autoscaler.toString())
+ * .build();
+ * Operation response = autoscalerClient.deleteAutoscaler(request);
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+ * DeleteAutoscalerHttpRequest request = DeleteAutoscalerHttpRequest.newBuilder()
+ * .setAutoscaler(autoscaler.toString())
+ * .build();
+ * ApiFuture<Operation> future = autoscalerClient.deleteAutoscalerCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
+ * }
+ *
+ *
+ * @param autoscaler Name of the autoscaler to return.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Autoscaler getAutoscaler(ProjectZoneAutoscalerName autoscaler) {
+
+ GetAutoscalerHttpRequest request =
+ GetAutoscalerHttpRequest.newBuilder()
+ .setAutoscaler(autoscaler == null ? null : autoscaler.toString())
+ .build();
+ return getAutoscaler(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the specified autoscaler resource. Gets a list of available autoscalers by making a
+ * list() request.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+ * Autoscaler response = autoscalerClient.getAutoscaler(autoscaler);
+ * }
+ *
+ *
+ * @param autoscaler Name of the autoscaler to return.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Autoscaler getAutoscaler(String autoscaler) {
+
+ GetAutoscalerHttpRequest request =
+ GetAutoscalerHttpRequest.newBuilder().setAutoscaler(autoscaler).build();
+ return getAutoscaler(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the specified autoscaler resource. Gets a list of available autoscalers by making a
+ * list() request.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+ * Autoscaler response = autoscalerClient.getAutoscaler(autoscaler.toString());
+ * }
+ *
+ *
+ * @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
+ public final Autoscaler getAutoscaler(GetAutoscalerHttpRequest request) {
+ return getAutoscalerCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns the specified autoscaler resource. Gets a list of available autoscalers by making a
+ * list() request.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+ * GetAutoscalerHttpRequest request = GetAutoscalerHttpRequest.newBuilder()
+ * .setAutoscaler(autoscaler.toString())
+ * .build();
+ * Autoscaler response = autoscalerClient.getAutoscaler(request);
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneAutoscalerName autoscaler = ProjectZoneAutoscalerName.of("[PROJECT]", "[ZONE]", "[AUTOSCALER]");
+ * GetAutoscalerHttpRequest request = GetAutoscalerHttpRequest.newBuilder()
+ * .setAutoscaler(autoscaler.toString())
+ * .build();
+ * ApiFuture<Autoscaler> future = autoscalerClient.getAutoscalerCallable().futureCall(request);
+ * // Do something
+ * Autoscaler response = future.get();
+ * }
+ *
+ *
+ * @param zone Name of the zone for this request.
+ * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to
+ * automatically scale virtual machine instances in managed instance groups according to an
+ * autoscaling policy that you define. For more information, read Autoscaling Groups of
+ * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
+ * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Operation insertAutoscaler(ProjectZoneName zone, Autoscaler autoscalerResource) {
+
+ InsertAutoscalerHttpRequest request =
+ InsertAutoscalerHttpRequest.newBuilder()
+ .setZone(zone == null ? null : zone.toString())
+ .setAutoscalerResource(autoscalerResource)
+ .build();
+ return insertAutoscaler(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates an autoscaler in the specified project using the data included in the request.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ * Operation response = autoscalerClient.insertAutoscaler(zone, autoscalerResource);
+ * }
+ *
+ *
+ * @param zone Name of the zone for this request.
+ * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to
+ * automatically scale virtual machine instances in managed instance groups according to an
+ * autoscaling policy that you define. For more information, read Autoscaling Groups of
+ * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
+ * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Operation insertAutoscaler(String zone, Autoscaler autoscalerResource) {
+
+ InsertAutoscalerHttpRequest request =
+ InsertAutoscalerHttpRequest.newBuilder()
+ .setZone(zone)
+ .setAutoscalerResource(autoscalerResource)
+ .build();
+ return insertAutoscaler(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates an autoscaler in the specified project using the data included in the request.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ * Operation response = autoscalerClient.insertAutoscaler(zone.toString(), autoscalerResource);
+ * }
+ *
+ *
+ * @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
+ public final Operation insertAutoscaler(InsertAutoscalerHttpRequest request) {
+ return insertAutoscalerCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates an autoscaler in the specified project using the data included in the request.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ * InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder()
+ * .setZone(zone.toString())
+ * .setAutoscalerResource(autoscalerResource)
+ * .build();
+ * Operation response = autoscalerClient.insertAutoscaler(request);
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ * InsertAutoscalerHttpRequest request = InsertAutoscalerHttpRequest.newBuilder()
+ * .setZone(zone.toString())
+ * .setAutoscalerResource(autoscalerResource)
+ * .build();
+ * ApiFuture<Operation> future = autoscalerClient.insertAutoscalerCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
+ * }
+ *
+ *
+ * @param zone Name of the zone for this request.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final ListAutoscalersPagedResponse listAutoscalers(ProjectZoneName zone) {
+ ListAutoscalersHttpRequest request =
+ ListAutoscalersHttpRequest.newBuilder()
+ .setZone(zone == null ? null : zone.toString())
+ .build();
+ return listAutoscalers(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves a list of autoscalers contained within the specified zone.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * for (Autoscaler element : autoscalerClient.listAutoscalers(zone).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param zone Name of the zone for this request.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final ListAutoscalersPagedResponse listAutoscalers(String zone) {
+ ListAutoscalersHttpRequest request =
+ ListAutoscalersHttpRequest.newBuilder().setZone(zone).build();
+ return listAutoscalers(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves a list of autoscalers contained within the specified zone.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * for (Autoscaler element : autoscalerClient.listAutoscalers(zone.toString()).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
+ */
+ @BetaApi
+ public final ListAutoscalersPagedResponse listAutoscalers(ListAutoscalersHttpRequest request) {
+ return listAutoscalersPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves a list of autoscalers contained within the specified zone.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * ListAutoscalersHttpRequest request = ListAutoscalersHttpRequest.newBuilder()
+ * .setZone(zone.toString())
+ * .build();
+ * for (Autoscaler element : autoscalerClient.listAutoscalers(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * ListAutoscalersHttpRequest request = ListAutoscalersHttpRequest.newBuilder()
+ * .setZone(zone.toString())
+ * .build();
+ * ApiFuture<ListAutoscalersPagedResponse> future = autoscalerClient.listAutoscalersPagedCallable().futureCall(request);
+ * // Do something
+ * for (Autoscaler element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * ListAutoscalersHttpRequest request = ListAutoscalersHttpRequest.newBuilder()
+ * .setZone(zone.toString())
+ * .build();
+ * while (true) {
+ * AutoscalerList response = autoscalerClient.listAutoscalersCallable().call(request);
+ * for (Autoscaler element : response.getItemsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ *
+ * @param autoscaler Name of the autoscaler to patch.
+ * @param zone Name of the zone for this request.
+ * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to
+ * automatically scale virtual machine instances in managed instance groups according to an
+ * autoscaling policy that you define. For more information, read Autoscaling Groups of
+ * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
+ * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Operation patchAutoscaler(
+ String autoscaler, ProjectZoneName zone, Autoscaler autoscalerResource) {
+
+ PatchAutoscalerHttpRequest request =
+ PatchAutoscalerHttpRequest.newBuilder()
+ .setAutoscaler(autoscaler)
+ .setZone(zone == null ? null : zone.toString())
+ .setAutoscalerResource(autoscalerResource)
+ .build();
+ return patchAutoscaler(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an autoscaler in the specified project using the data included in the request. This
+ * method supports PATCH semantics and uses the JSON merge patch format and processing rules.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * String autoscaler = "";
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ * Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone, autoscalerResource);
+ * }
+ *
+ *
+ * @param autoscaler Name of the autoscaler to patch.
+ * @param zone Name of the zone for this request.
+ * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to
+ * automatically scale virtual machine instances in managed instance groups according to an
+ * autoscaling policy that you define. For more information, read Autoscaling Groups of
+ * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
+ * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Operation patchAutoscaler(
+ String autoscaler, String zone, Autoscaler autoscalerResource) {
+
+ PatchAutoscalerHttpRequest request =
+ PatchAutoscalerHttpRequest.newBuilder()
+ .setAutoscaler(autoscaler)
+ .setZone(zone)
+ .setAutoscalerResource(autoscalerResource)
+ .build();
+ return patchAutoscaler(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an autoscaler in the specified project using the data included in the request. This
+ * method supports PATCH semantics and uses the JSON merge patch format and processing rules.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * String autoscaler = "";
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ * Operation response = autoscalerClient.patchAutoscaler(autoscaler, zone.toString(), autoscalerResource);
+ * }
+ *
+ *
+ * @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
+ public final Operation patchAutoscaler(PatchAutoscalerHttpRequest request) {
+ return patchAutoscalerCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an autoscaler in the specified project using the data included in the request. This
+ * method supports PATCH semantics and uses the JSON merge patch format and processing rules.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * String autoscaler = "";
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ * PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder()
+ * .setAutoscaler(autoscaler)
+ * .setZone(zone.toString())
+ * .setAutoscalerResource(autoscalerResource)
+ * .build();
+ * Operation response = autoscalerClient.patchAutoscaler(request);
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * String autoscaler = "";
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ * PatchAutoscalerHttpRequest request = PatchAutoscalerHttpRequest.newBuilder()
+ * .setAutoscaler(autoscaler)
+ * .setZone(zone.toString())
+ * .setAutoscalerResource(autoscalerResource)
+ * .build();
+ * ApiFuture<Operation> future = autoscalerClient.patchAutoscalerCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
+ * }
+ *
+ *
+ * @param autoscaler Name of the autoscaler to update.
+ * @param zone Name of the zone for this request.
+ * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to
+ * automatically scale virtual machine instances in managed instance groups according to an
+ * autoscaling policy that you define. For more information, read Autoscaling Groups of
+ * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
+ * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Operation updateAutoscaler(
+ String autoscaler, ProjectZoneName zone, Autoscaler autoscalerResource) {
+
+ UpdateAutoscalerHttpRequest request =
+ UpdateAutoscalerHttpRequest.newBuilder()
+ .setAutoscaler(autoscaler)
+ .setZone(zone == null ? null : zone.toString())
+ .setAutoscalerResource(autoscalerResource)
+ .build();
+ return updateAutoscaler(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an autoscaler in the specified project using the data included in the request.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * String autoscaler = "";
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ * Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone, autoscalerResource);
+ * }
+ *
+ *
+ * @param autoscaler Name of the autoscaler to update.
+ * @param zone Name of the zone for this request.
+ * @param autoscalerResource Represents an Autoscaler resource. Autoscalers allow you to
+ * automatically scale virtual machine instances in managed instance groups according to an
+ * autoscaling policy that you define. For more information, read Autoscaling Groups of
+ * Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
+ * resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi
+ public final Operation updateAutoscaler(
+ String autoscaler, String zone, Autoscaler autoscalerResource) {
+
+ UpdateAutoscalerHttpRequest request =
+ UpdateAutoscalerHttpRequest.newBuilder()
+ .setAutoscaler(autoscaler)
+ .setZone(zone)
+ .setAutoscalerResource(autoscalerResource)
+ .build();
+ return updateAutoscaler(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an autoscaler in the specified project using the data included in the request.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * String autoscaler = "";
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ * Operation response = autoscalerClient.updateAutoscaler(autoscaler, zone.toString(), autoscalerResource);
+ * }
+ *
+ *
+ * @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
+ public final Operation updateAutoscaler(UpdateAutoscalerHttpRequest request) {
+ return updateAutoscalerCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an autoscaler in the specified project using the data included in the request.
+ *
+ *
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * String autoscaler = "";
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ * UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder()
+ * .setAutoscaler(autoscaler)
+ * .setZone(zone.toString())
+ * .setAutoscalerResource(autoscalerResource)
+ * .build();
+ * Operation response = autoscalerClient.updateAutoscaler(request);
+ * }
+ *
+ */
+ @BetaApi
+ public final UnaryCallable
+ * try (AutoscalerClient autoscalerClient = AutoscalerClient.create()) {
+ * String autoscaler = "";
+ * ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
+ * Autoscaler autoscalerResource = Autoscaler.newBuilder().build();
+ * UpdateAutoscalerHttpRequest request = UpdateAutoscalerHttpRequest.newBuilder()
+ * .setAutoscaler(autoscaler)
+ * .setZone(zone.toString())
+ * .setAutoscalerResource(autoscalerResource)
+ * .build();
+ * ApiFuture<Operation> future = autoscalerClient.updateAutoscalerCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
+ * }
+ *
+ *
+ *
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class AutoscalerSettings extends ClientSettings
+ * AutoscalerSettings.Builder autoscalerSettingsBuilder =
+ * AutoscalerSettings.newBuilder();
+ * autoscalerSettingsBuilder.deleteAutoscalerSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30));
+ * AutoscalerSettings autoscalerSettings = autoscalerSettingsBuilder.build();
+ *
+ *