11/*
2- * Copyright 2021 Google LLC
2+ * Copyright 2022 Google LLC
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
1818
1919import com .google .api .core .ApiFuture ;
2020import com .google .api .core .ApiFutures ;
21- import com .google .api .core .BetaApi ;
2221import com .google .api .gax .core .BackgroundResource ;
2322import com .google .api .gax .paging .AbstractFixedSizeCollection ;
2423import com .google .api .gax .paging .AbstractPage ;
4241 * calls that map to API methods. Sample code to get started:
4342 *
4443 * <pre>{@code
44+ * // This snippet has been automatically generated for illustrative purposes only.
45+ * // It may require modifications to work in your environment.
4546 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
4647 * AutoscalingPolicyServiceClient.create()) {
4748 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
8182 * <p>To customize credentials:
8283 *
8384 * <pre>{@code
85+ * // This snippet has been automatically generated for illustrative purposes only.
86+ * // It may require modifications to work in your environment.
8487 * AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings =
8588 * AutoscalingPolicyServiceSettings.newBuilder()
8689 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
9295 * <p>To customize the endpoint:
9396 *
9497 * <pre>{@code
98+ * // This snippet has been automatically generated for illustrative purposes only.
99+ * // It may require modifications to work in your environment.
95100 * AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings =
96101 * AutoscalingPolicyServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
97102 * AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
98103 * AutoscalingPolicyServiceClient.create(autoscalingPolicyServiceSettings);
99104 * }</pre>
100105 *
106+ * <p>To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
107+ * the wire:
108+ *
109+ * <pre>{@code
110+ * // This snippet has been automatically generated for illustrative purposes only.
111+ * // It may require modifications to work in your environment.
112+ * AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings =
113+ * AutoscalingPolicyServiceSettings.newBuilder()
114+ * .setTransportChannelProvider(
115+ * AutoscalingPolicyServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
116+ * .build();
117+ * AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
118+ * AutoscalingPolicyServiceClient.create(autoscalingPolicyServiceSettings);
119+ * }</pre>
120+ *
101121 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
102122 */
103123@ Generated ("by gapic-generator-java" )
@@ -124,7 +144,6 @@ public static final AutoscalingPolicyServiceClient create(
124144 * Constructs an instance of AutoscalingPolicyServiceClient, using the given stub for making
125145 * calls. This is for advanced usage - prefer using create(AutoscalingPolicyServiceSettings).
126146 */
127- @ BetaApi ("A restructuring of stub classes is planned, so this may break in the future" )
128147 public static final AutoscalingPolicyServiceClient create (AutoscalingPolicyServiceStub stub ) {
129148 return new AutoscalingPolicyServiceClient (stub );
130149 }
@@ -140,7 +159,6 @@ protected AutoscalingPolicyServiceClient(AutoscalingPolicyServiceSettings settin
140159 this .stub = ((AutoscalingPolicyServiceStubSettings ) settings .getStubSettings ()).createStub ();
141160 }
142161
143- @ BetaApi ("A restructuring of stub classes is planned, so this may break in the future" )
144162 protected AutoscalingPolicyServiceClient (AutoscalingPolicyServiceStub stub ) {
145163 this .settings = null ;
146164 this .stub = stub ;
@@ -150,7 +168,6 @@ public final AutoscalingPolicyServiceSettings getSettings() {
150168 return settings ;
151169 }
152170
153- @ BetaApi ("A restructuring of stub classes is planned, so this may break in the future" )
154171 public AutoscalingPolicyServiceStub getStub () {
155172 return stub ;
156173 }
@@ -162,6 +179,8 @@ public AutoscalingPolicyServiceStub getStub() {
162179 * <p>Sample code:
163180 *
164181 * <pre>{@code
182+ * // This snippet has been automatically generated for illustrative purposes only.
183+ * // It may require modifications to work in your environment.
165184 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
166185 * AutoscalingPolicyServiceClient.create()) {
167186 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
@@ -202,6 +221,8 @@ public final AutoscalingPolicy createAutoscalingPolicy(
202221 * <p>Sample code:
203222 *
204223 * <pre>{@code
224+ * // This snippet has been automatically generated for illustrative purposes only.
225+ * // It may require modifications to work in your environment.
205226 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
206227 * AutoscalingPolicyServiceClient.create()) {
207228 * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
@@ -242,6 +263,8 @@ public final AutoscalingPolicy createAutoscalingPolicy(
242263 * <p>Sample code:
243264 *
244265 * <pre>{@code
266+ * // This snippet has been automatically generated for illustrative purposes only.
267+ * // It may require modifications to work in your environment.
245268 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
246269 * AutoscalingPolicyServiceClient.create()) {
247270 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
@@ -278,6 +301,8 @@ public final AutoscalingPolicy createAutoscalingPolicy(String parent, Autoscalin
278301 * <p>Sample code:
279302 *
280303 * <pre>{@code
304+ * // This snippet has been automatically generated for illustrative purposes only.
305+ * // It may require modifications to work in your environment.
281306 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
282307 * AutoscalingPolicyServiceClient.create()) {
283308 * CreateAutoscalingPolicyRequest request =
@@ -303,6 +328,8 @@ public final AutoscalingPolicy createAutoscalingPolicy(CreateAutoscalingPolicyRe
303328 * <p>Sample code:
304329 *
305330 * <pre>{@code
331+ * // This snippet has been automatically generated for illustrative purposes only.
332+ * // It may require modifications to work in your environment.
306333 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
307334 * AutoscalingPolicyServiceClient.create()) {
308335 * CreateAutoscalingPolicyRequest request =
@@ -331,6 +358,8 @@ public final AutoscalingPolicy createAutoscalingPolicy(CreateAutoscalingPolicyRe
331358 * <p>Sample code:
332359 *
333360 * <pre>{@code
361+ * // This snippet has been automatically generated for illustrative purposes only.
362+ * // It may require modifications to work in your environment.
334363 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
335364 * AutoscalingPolicyServiceClient.create()) {
336365 * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
@@ -356,6 +385,8 @@ public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy)
356385 * <p>Sample code:
357386 *
358387 * <pre>{@code
388+ * // This snippet has been automatically generated for illustrative purposes only.
389+ * // It may require modifications to work in your environment.
359390 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
360391 * AutoscalingPolicyServiceClient.create()) {
361392 * UpdateAutoscalingPolicyRequest request =
@@ -382,6 +413,8 @@ public final AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRe
382413 * <p>Sample code:
383414 *
384415 * <pre>{@code
416+ * // This snippet has been automatically generated for illustrative purposes only.
417+ * // It may require modifications to work in your environment.
385418 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
386419 * AutoscalingPolicyServiceClient.create()) {
387420 * UpdateAutoscalingPolicyRequest request =
@@ -407,6 +440,8 @@ public final AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRe
407440 * <p>Sample code:
408441 *
409442 * <pre>{@code
443+ * // This snippet has been automatically generated for illustrative purposes only.
444+ * // It may require modifications to work in your environment.
410445 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
411446 * AutoscalingPolicyServiceClient.create()) {
412447 * AutoscalingPolicyName name =
@@ -446,6 +481,8 @@ public final AutoscalingPolicy getAutoscalingPolicy(AutoscalingPolicyName name)
446481 * <p>Sample code:
447482 *
448483 * <pre>{@code
484+ * // This snippet has been automatically generated for illustrative purposes only.
485+ * // It may require modifications to work in your environment.
449486 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
450487 * AutoscalingPolicyServiceClient.create()) {
451488 * String name =
@@ -484,6 +521,8 @@ public final AutoscalingPolicy getAutoscalingPolicy(String name) {
484521 * <p>Sample code:
485522 *
486523 * <pre>{@code
524+ * // This snippet has been automatically generated for illustrative purposes only.
525+ * // It may require modifications to work in your environment.
487526 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
488527 * AutoscalingPolicyServiceClient.create()) {
489528 * GetAutoscalingPolicyRequest request =
@@ -511,6 +550,8 @@ public final AutoscalingPolicy getAutoscalingPolicy(GetAutoscalingPolicyRequest
511550 * <p>Sample code:
512551 *
513552 * <pre>{@code
553+ * // This snippet has been automatically generated for illustrative purposes only.
554+ * // It may require modifications to work in your environment.
514555 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
515556 * AutoscalingPolicyServiceClient.create()) {
516557 * GetAutoscalingPolicyRequest request =
@@ -539,6 +580,8 @@ public final AutoscalingPolicy getAutoscalingPolicy(GetAutoscalingPolicyRequest
539580 * <p>Sample code:
540581 *
541582 * <pre>{@code
583+ * // This snippet has been automatically generated for illustrative purposes only.
584+ * // It may require modifications to work in your environment.
542585 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
543586 * AutoscalingPolicyServiceClient.create()) {
544587 * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
@@ -577,6 +620,8 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(Locati
577620 * <p>Sample code:
578621 *
579622 * <pre>{@code
623+ * // This snippet has been automatically generated for illustrative purposes only.
624+ * // It may require modifications to work in your environment.
580625 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
581626 * AutoscalingPolicyServiceClient.create()) {
582627 * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
@@ -615,6 +660,8 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(Region
615660 * <p>Sample code:
616661 *
617662 * <pre>{@code
663+ * // This snippet has been automatically generated for illustrative purposes only.
664+ * // It may require modifications to work in your environment.
618665 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
619666 * AutoscalingPolicyServiceClient.create()) {
620667 * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
@@ -651,6 +698,8 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(String
651698 * <p>Sample code:
652699 *
653700 * <pre>{@code
701+ * // This snippet has been automatically generated for illustrative purposes only.
702+ * // It may require modifications to work in your environment.
654703 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
655704 * AutoscalingPolicyServiceClient.create()) {
656705 * ListAutoscalingPoliciesRequest request =
@@ -681,6 +730,8 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(
681730 * <p>Sample code:
682731 *
683732 * <pre>{@code
733+ * // This snippet has been automatically generated for illustrative purposes only.
734+ * // It may require modifications to work in your environment.
684735 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
685736 * AutoscalingPolicyServiceClient.create()) {
686737 * ListAutoscalingPoliciesRequest request =
@@ -710,6 +761,8 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(
710761 * <p>Sample code:
711762 *
712763 * <pre>{@code
764+ * // This snippet has been automatically generated for illustrative purposes only.
765+ * // It may require modifications to work in your environment.
713766 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
714767 * AutoscalingPolicyServiceClient.create()) {
715768 * ListAutoscalingPoliciesRequest request =
@@ -721,7 +774,7 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(
721774 * while (true) {
722775 * ListAutoscalingPoliciesResponse response =
723776 * autoscalingPolicyServiceClient.listAutoscalingPoliciesCallable().call(request);
724- * for (AutoscalingPolicy element : response.getResponsesList ()) {
777+ * for (AutoscalingPolicy element : response.getPoliciesList ()) {
725778 * // doThingsWith(element);
726779 * }
727780 * String nextPageToken = response.getNextPageToken();
@@ -747,6 +800,8 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(
747800 * <p>Sample code:
748801 *
749802 * <pre>{@code
803+ * // This snippet has been automatically generated for illustrative purposes only.
804+ * // It may require modifications to work in your environment.
750805 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
751806 * AutoscalingPolicyServiceClient.create()) {
752807 * AutoscalingPolicyName name =
@@ -787,6 +842,8 @@ public final void deleteAutoscalingPolicy(AutoscalingPolicyName name) {
787842 * <p>Sample code:
788843 *
789844 * <pre>{@code
845+ * // This snippet has been automatically generated for illustrative purposes only.
846+ * // It may require modifications to work in your environment.
790847 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
791848 * AutoscalingPolicyServiceClient.create()) {
792849 * String name =
@@ -826,6 +883,8 @@ public final void deleteAutoscalingPolicy(String name) {
826883 * <p>Sample code:
827884 *
828885 * <pre>{@code
886+ * // This snippet has been automatically generated for illustrative purposes only.
887+ * // It may require modifications to work in your environment.
829888 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
830889 * AutoscalingPolicyServiceClient.create()) {
831890 * DeleteAutoscalingPolicyRequest request =
@@ -854,6 +913,8 @@ public final void deleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest request
854913 * <p>Sample code:
855914 *
856915 * <pre>{@code
916+ * // This snippet has been automatically generated for illustrative purposes only.
917+ * // It may require modifications to work in your environment.
857918 * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
858919 * AutoscalingPolicyServiceClient.create()) {
859920 * DeleteAutoscalingPolicyRequest request =
0 commit comments