|
28 | 28 | import com.google.api.gax.rpc.OperationCallable; |
29 | 29 | import com.google.api.gax.rpc.PageContext; |
30 | 30 | import com.google.api.gax.rpc.UnaryCallable; |
| 31 | +import com.google.cloud.location.GetLocationRequest; |
| 32 | +import com.google.cloud.location.ListLocationsRequest; |
| 33 | +import com.google.cloud.location.ListLocationsResponse; |
| 34 | +import com.google.cloud.location.Location; |
31 | 35 | import com.google.cloud.netapp.v1.stub.NetAppStub; |
32 | 36 | import com.google.cloud.netapp.v1.stub.NetAppStubSettings; |
33 | 37 | import com.google.common.util.concurrent.MoreExecutors; |
@@ -5009,6 +5013,160 @@ public final OperationFuture<Replication, OperationMetadata> reverseReplicationD |
5009 | 5013 | return stub.reverseReplicationDirectionCallable(); |
5010 | 5014 | } |
5011 | 5015 |
|
| 5016 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 5017 | + /** |
| 5018 | + * Lists information about the supported locations for this service. |
| 5019 | + * |
| 5020 | + * <p>Sample code: |
| 5021 | + * |
| 5022 | + * <pre>{@code |
| 5023 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 5024 | + * // It will require modifications to work: |
| 5025 | + * // - It may require correct/in-range values for request initialization. |
| 5026 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 5027 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 5028 | + * try (NetAppClient netAppClient = NetAppClient.create()) { |
| 5029 | + * ListLocationsRequest request = |
| 5030 | + * ListLocationsRequest.newBuilder() |
| 5031 | + * .setName("name3373707") |
| 5032 | + * .setFilter("filter-1274492040") |
| 5033 | + * .setPageSize(883849137) |
| 5034 | + * .setPageToken("pageToken873572522") |
| 5035 | + * .build(); |
| 5036 | + * for (Location element : netAppClient.listLocations(request).iterateAll()) { |
| 5037 | + * // doThingsWith(element); |
| 5038 | + * } |
| 5039 | + * } |
| 5040 | + * }</pre> |
| 5041 | + * |
| 5042 | + * @param request The request object containing all of the parameters for the API call. |
| 5043 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 5044 | + */ |
| 5045 | + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { |
| 5046 | + return listLocationsPagedCallable().call(request); |
| 5047 | + } |
| 5048 | + |
| 5049 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 5050 | + /** |
| 5051 | + * Lists information about the supported locations for this service. |
| 5052 | + * |
| 5053 | + * <p>Sample code: |
| 5054 | + * |
| 5055 | + * <pre>{@code |
| 5056 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 5057 | + * // It will require modifications to work: |
| 5058 | + * // - It may require correct/in-range values for request initialization. |
| 5059 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 5060 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 5061 | + * try (NetAppClient netAppClient = NetAppClient.create()) { |
| 5062 | + * ListLocationsRequest request = |
| 5063 | + * ListLocationsRequest.newBuilder() |
| 5064 | + * .setName("name3373707") |
| 5065 | + * .setFilter("filter-1274492040") |
| 5066 | + * .setPageSize(883849137) |
| 5067 | + * .setPageToken("pageToken873572522") |
| 5068 | + * .build(); |
| 5069 | + * ApiFuture<Location> future = netAppClient.listLocationsPagedCallable().futureCall(request); |
| 5070 | + * // Do something. |
| 5071 | + * for (Location element : future.get().iterateAll()) { |
| 5072 | + * // doThingsWith(element); |
| 5073 | + * } |
| 5074 | + * } |
| 5075 | + * }</pre> |
| 5076 | + */ |
| 5077 | + public final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse> |
| 5078 | + listLocationsPagedCallable() { |
| 5079 | + return stub.listLocationsPagedCallable(); |
| 5080 | + } |
| 5081 | + |
| 5082 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 5083 | + /** |
| 5084 | + * Lists information about the supported locations for this service. |
| 5085 | + * |
| 5086 | + * <p>Sample code: |
| 5087 | + * |
| 5088 | + * <pre>{@code |
| 5089 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 5090 | + * // It will require modifications to work: |
| 5091 | + * // - It may require correct/in-range values for request initialization. |
| 5092 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 5093 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 5094 | + * try (NetAppClient netAppClient = NetAppClient.create()) { |
| 5095 | + * ListLocationsRequest request = |
| 5096 | + * ListLocationsRequest.newBuilder() |
| 5097 | + * .setName("name3373707") |
| 5098 | + * .setFilter("filter-1274492040") |
| 5099 | + * .setPageSize(883849137) |
| 5100 | + * .setPageToken("pageToken873572522") |
| 5101 | + * .build(); |
| 5102 | + * while (true) { |
| 5103 | + * ListLocationsResponse response = netAppClient.listLocationsCallable().call(request); |
| 5104 | + * for (Location element : response.getLocationsList()) { |
| 5105 | + * // doThingsWith(element); |
| 5106 | + * } |
| 5107 | + * String nextPageToken = response.getNextPageToken(); |
| 5108 | + * if (!Strings.isNullOrEmpty(nextPageToken)) { |
| 5109 | + * request = request.toBuilder().setPageToken(nextPageToken).build(); |
| 5110 | + * } else { |
| 5111 | + * break; |
| 5112 | + * } |
| 5113 | + * } |
| 5114 | + * } |
| 5115 | + * }</pre> |
| 5116 | + */ |
| 5117 | + public final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() { |
| 5118 | + return stub.listLocationsCallable(); |
| 5119 | + } |
| 5120 | + |
| 5121 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 5122 | + /** |
| 5123 | + * Gets information about a location. |
| 5124 | + * |
| 5125 | + * <p>Sample code: |
| 5126 | + * |
| 5127 | + * <pre>{@code |
| 5128 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 5129 | + * // It will require modifications to work: |
| 5130 | + * // - It may require correct/in-range values for request initialization. |
| 5131 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 5132 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 5133 | + * try (NetAppClient netAppClient = NetAppClient.create()) { |
| 5134 | + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); |
| 5135 | + * Location response = netAppClient.getLocation(request); |
| 5136 | + * } |
| 5137 | + * }</pre> |
| 5138 | + * |
| 5139 | + * @param request The request object containing all of the parameters for the API call. |
| 5140 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 5141 | + */ |
| 5142 | + public final Location getLocation(GetLocationRequest request) { |
| 5143 | + return getLocationCallable().call(request); |
| 5144 | + } |
| 5145 | + |
| 5146 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 5147 | + /** |
| 5148 | + * Gets information about a location. |
| 5149 | + * |
| 5150 | + * <p>Sample code: |
| 5151 | + * |
| 5152 | + * <pre>{@code |
| 5153 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 5154 | + * // It will require modifications to work: |
| 5155 | + * // - It may require correct/in-range values for request initialization. |
| 5156 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 5157 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 5158 | + * try (NetAppClient netAppClient = NetAppClient.create()) { |
| 5159 | + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); |
| 5160 | + * ApiFuture<Location> future = netAppClient.getLocationCallable().futureCall(request); |
| 5161 | + * // Do something. |
| 5162 | + * Location response = future.get(); |
| 5163 | + * } |
| 5164 | + * }</pre> |
| 5165 | + */ |
| 5166 | + public final UnaryCallable<GetLocationRequest, Location> getLocationCallable() { |
| 5167 | + return stub.getLocationCallable(); |
| 5168 | + } |
| 5169 | + |
5012 | 5170 | @Override |
5013 | 5171 | public final void close() { |
5014 | 5172 | stub.close(); |
@@ -5501,4 +5659,80 @@ protected ListReplicationsFixedSizeCollection createCollection( |
5501 | 5659 | return new ListReplicationsFixedSizeCollection(pages, collectionSize); |
5502 | 5660 | } |
5503 | 5661 | } |
| 5662 | + |
| 5663 | + public static class ListLocationsPagedResponse |
| 5664 | + extends AbstractPagedListResponse< |
| 5665 | + ListLocationsRequest, |
| 5666 | + ListLocationsResponse, |
| 5667 | + Location, |
| 5668 | + ListLocationsPage, |
| 5669 | + ListLocationsFixedSizeCollection> { |
| 5670 | + |
| 5671 | + public static ApiFuture<ListLocationsPagedResponse> createAsync( |
| 5672 | + PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, |
| 5673 | + ApiFuture<ListLocationsResponse> futureResponse) { |
| 5674 | + ApiFuture<ListLocationsPage> futurePage = |
| 5675 | + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); |
| 5676 | + return ApiFutures.transform( |
| 5677 | + futurePage, |
| 5678 | + input -> new ListLocationsPagedResponse(input), |
| 5679 | + MoreExecutors.directExecutor()); |
| 5680 | + } |
| 5681 | + |
| 5682 | + private ListLocationsPagedResponse(ListLocationsPage page) { |
| 5683 | + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); |
| 5684 | + } |
| 5685 | + } |
| 5686 | + |
| 5687 | + public static class ListLocationsPage |
| 5688 | + extends AbstractPage< |
| 5689 | + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { |
| 5690 | + |
| 5691 | + private ListLocationsPage( |
| 5692 | + PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, |
| 5693 | + ListLocationsResponse response) { |
| 5694 | + super(context, response); |
| 5695 | + } |
| 5696 | + |
| 5697 | + private static ListLocationsPage createEmptyPage() { |
| 5698 | + return new ListLocationsPage(null, null); |
| 5699 | + } |
| 5700 | + |
| 5701 | + @Override |
| 5702 | + protected ListLocationsPage createPage( |
| 5703 | + PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, |
| 5704 | + ListLocationsResponse response) { |
| 5705 | + return new ListLocationsPage(context, response); |
| 5706 | + } |
| 5707 | + |
| 5708 | + @Override |
| 5709 | + public ApiFuture<ListLocationsPage> createPageAsync( |
| 5710 | + PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, |
| 5711 | + ApiFuture<ListLocationsResponse> futureResponse) { |
| 5712 | + return super.createPageAsync(context, futureResponse); |
| 5713 | + } |
| 5714 | + } |
| 5715 | + |
| 5716 | + public static class ListLocationsFixedSizeCollection |
| 5717 | + extends AbstractFixedSizeCollection< |
| 5718 | + ListLocationsRequest, |
| 5719 | + ListLocationsResponse, |
| 5720 | + Location, |
| 5721 | + ListLocationsPage, |
| 5722 | + ListLocationsFixedSizeCollection> { |
| 5723 | + |
| 5724 | + private ListLocationsFixedSizeCollection(List<ListLocationsPage> pages, int collectionSize) { |
| 5725 | + super(pages, collectionSize); |
| 5726 | + } |
| 5727 | + |
| 5728 | + private static ListLocationsFixedSizeCollection createEmptyCollection() { |
| 5729 | + return new ListLocationsFixedSizeCollection(null, 0); |
| 5730 | + } |
| 5731 | + |
| 5732 | + @Override |
| 5733 | + protected ListLocationsFixedSizeCollection createCollection( |
| 5734 | + List<ListLocationsPage> pages, int collectionSize) { |
| 5735 | + return new ListLocationsFixedSizeCollection(pages, collectionSize); |
| 5736 | + } |
| 5737 | + } |
5504 | 5738 | } |
0 commit comments