|
30 | 30 | import com.google.api.gax.rpc.UnaryCallable; |
31 | 31 | import com.google.cloud.certificatemanager.v1.stub.CertificateManagerStub; |
32 | 32 | import com.google.cloud.certificatemanager.v1.stub.CertificateManagerStubSettings; |
| 33 | +import com.google.cloud.location.GetLocationRequest; |
| 34 | +import com.google.cloud.location.ListLocationsRequest; |
| 35 | +import com.google.cloud.location.ListLocationsResponse; |
| 36 | +import com.google.cloud.location.Location; |
33 | 37 | import com.google.common.util.concurrent.MoreExecutors; |
34 | 38 | import com.google.longrunning.Operation; |
35 | 39 | import com.google.protobuf.Empty; |
@@ -2958,6 +2962,148 @@ public final OperationFuture<Empty, OperationMetadata> deleteDnsAuthorizationAsy |
2958 | 2962 | return stub.deleteDnsAuthorizationCallable(); |
2959 | 2963 | } |
2960 | 2964 |
|
| 2965 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 2966 | + /** |
| 2967 | + * Lists information about the supported locations for this service. |
| 2968 | + * |
| 2969 | + * <p>Sample code: |
| 2970 | + * |
| 2971 | + * <pre>{@code |
| 2972 | + * // This snippet has been automatically generated for illustrative purposes only. |
| 2973 | + * // It may require modifications to work in your environment. |
| 2974 | + * try (CertificateManagerClient certificateManagerClient = CertificateManagerClient.create()) { |
| 2975 | + * ListLocationsRequest request = |
| 2976 | + * ListLocationsRequest.newBuilder() |
| 2977 | + * .setName("name3373707") |
| 2978 | + * .setFilter("filter-1274492040") |
| 2979 | + * .setPageSize(883849137) |
| 2980 | + * .setPageToken("pageToken873572522") |
| 2981 | + * .build(); |
| 2982 | + * for (Location element : certificateManagerClient.listLocations(request).iterateAll()) { |
| 2983 | + * // doThingsWith(element); |
| 2984 | + * } |
| 2985 | + * } |
| 2986 | + * }</pre> |
| 2987 | + * |
| 2988 | + * @param request The request object containing all of the parameters for the API call. |
| 2989 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 2990 | + */ |
| 2991 | + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { |
| 2992 | + return listLocationsPagedCallable().call(request); |
| 2993 | + } |
| 2994 | + |
| 2995 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 2996 | + /** |
| 2997 | + * Lists information about the supported locations for this service. |
| 2998 | + * |
| 2999 | + * <p>Sample code: |
| 3000 | + * |
| 3001 | + * <pre>{@code |
| 3002 | + * // This snippet has been automatically generated for illustrative purposes only. |
| 3003 | + * // It may require modifications to work in your environment. |
| 3004 | + * try (CertificateManagerClient certificateManagerClient = CertificateManagerClient.create()) { |
| 3005 | + * ListLocationsRequest request = |
| 3006 | + * ListLocationsRequest.newBuilder() |
| 3007 | + * .setName("name3373707") |
| 3008 | + * .setFilter("filter-1274492040") |
| 3009 | + * .setPageSize(883849137) |
| 3010 | + * .setPageToken("pageToken873572522") |
| 3011 | + * .build(); |
| 3012 | + * ApiFuture<Location> future = |
| 3013 | + * certificateManagerClient.listLocationsPagedCallable().futureCall(request); |
| 3014 | + * // Do something. |
| 3015 | + * for (Location element : future.get().iterateAll()) { |
| 3016 | + * // doThingsWith(element); |
| 3017 | + * } |
| 3018 | + * } |
| 3019 | + * }</pre> |
| 3020 | + */ |
| 3021 | + public final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse> |
| 3022 | + listLocationsPagedCallable() { |
| 3023 | + return stub.listLocationsPagedCallable(); |
| 3024 | + } |
| 3025 | + |
| 3026 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 3027 | + /** |
| 3028 | + * Lists information about the supported locations for this service. |
| 3029 | + * |
| 3030 | + * <p>Sample code: |
| 3031 | + * |
| 3032 | + * <pre>{@code |
| 3033 | + * // This snippet has been automatically generated for illustrative purposes only. |
| 3034 | + * // It may require modifications to work in your environment. |
| 3035 | + * try (CertificateManagerClient certificateManagerClient = CertificateManagerClient.create()) { |
| 3036 | + * ListLocationsRequest request = |
| 3037 | + * ListLocationsRequest.newBuilder() |
| 3038 | + * .setName("name3373707") |
| 3039 | + * .setFilter("filter-1274492040") |
| 3040 | + * .setPageSize(883849137) |
| 3041 | + * .setPageToken("pageToken873572522") |
| 3042 | + * .build(); |
| 3043 | + * while (true) { |
| 3044 | + * ListLocationsResponse response = |
| 3045 | + * certificateManagerClient.listLocationsCallable().call(request); |
| 3046 | + * for (Location element : response.getLocationsList()) { |
| 3047 | + * // doThingsWith(element); |
| 3048 | + * } |
| 3049 | + * String nextPageToken = response.getNextPageToken(); |
| 3050 | + * if (!Strings.isNullOrEmpty(nextPageToken)) { |
| 3051 | + * request = request.toBuilder().setPageToken(nextPageToken).build(); |
| 3052 | + * } else { |
| 3053 | + * break; |
| 3054 | + * } |
| 3055 | + * } |
| 3056 | + * } |
| 3057 | + * }</pre> |
| 3058 | + */ |
| 3059 | + public final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() { |
| 3060 | + return stub.listLocationsCallable(); |
| 3061 | + } |
| 3062 | + |
| 3063 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 3064 | + /** |
| 3065 | + * Gets information about a location. |
| 3066 | + * |
| 3067 | + * <p>Sample code: |
| 3068 | + * |
| 3069 | + * <pre>{@code |
| 3070 | + * // This snippet has been automatically generated for illustrative purposes only. |
| 3071 | + * // It may require modifications to work in your environment. |
| 3072 | + * try (CertificateManagerClient certificateManagerClient = CertificateManagerClient.create()) { |
| 3073 | + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); |
| 3074 | + * Location response = certificateManagerClient.getLocation(request); |
| 3075 | + * } |
| 3076 | + * }</pre> |
| 3077 | + * |
| 3078 | + * @param request The request object containing all of the parameters for the API call. |
| 3079 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 3080 | + */ |
| 3081 | + public final Location getLocation(GetLocationRequest request) { |
| 3082 | + return getLocationCallable().call(request); |
| 3083 | + } |
| 3084 | + |
| 3085 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 3086 | + /** |
| 3087 | + * Gets information about a location. |
| 3088 | + * |
| 3089 | + * <p>Sample code: |
| 3090 | + * |
| 3091 | + * <pre>{@code |
| 3092 | + * // This snippet has been automatically generated for illustrative purposes only. |
| 3093 | + * // It may require modifications to work in your environment. |
| 3094 | + * try (CertificateManagerClient certificateManagerClient = CertificateManagerClient.create()) { |
| 3095 | + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); |
| 3096 | + * ApiFuture<Location> future = |
| 3097 | + * certificateManagerClient.getLocationCallable().futureCall(request); |
| 3098 | + * // Do something. |
| 3099 | + * Location response = future.get(); |
| 3100 | + * } |
| 3101 | + * }</pre> |
| 3102 | + */ |
| 3103 | + public final UnaryCallable<GetLocationRequest, Location> getLocationCallable() { |
| 3104 | + return stub.getLocationCallable(); |
| 3105 | + } |
| 3106 | + |
2961 | 3107 | @Override |
2962 | 3108 | public final void close() { |
2963 | 3109 | stub.close(); |
@@ -3328,4 +3474,80 @@ protected ListDnsAuthorizationsFixedSizeCollection createCollection( |
3328 | 3474 | return new ListDnsAuthorizationsFixedSizeCollection(pages, collectionSize); |
3329 | 3475 | } |
3330 | 3476 | } |
| 3477 | + |
| 3478 | + public static class ListLocationsPagedResponse |
| 3479 | + extends AbstractPagedListResponse< |
| 3480 | + ListLocationsRequest, |
| 3481 | + ListLocationsResponse, |
| 3482 | + Location, |
| 3483 | + ListLocationsPage, |
| 3484 | + ListLocationsFixedSizeCollection> { |
| 3485 | + |
| 3486 | + public static ApiFuture<ListLocationsPagedResponse> createAsync( |
| 3487 | + PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, |
| 3488 | + ApiFuture<ListLocationsResponse> futureResponse) { |
| 3489 | + ApiFuture<ListLocationsPage> futurePage = |
| 3490 | + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); |
| 3491 | + return ApiFutures.transform( |
| 3492 | + futurePage, |
| 3493 | + input -> new ListLocationsPagedResponse(input), |
| 3494 | + MoreExecutors.directExecutor()); |
| 3495 | + } |
| 3496 | + |
| 3497 | + private ListLocationsPagedResponse(ListLocationsPage page) { |
| 3498 | + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); |
| 3499 | + } |
| 3500 | + } |
| 3501 | + |
| 3502 | + public static class ListLocationsPage |
| 3503 | + extends AbstractPage< |
| 3504 | + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { |
| 3505 | + |
| 3506 | + private ListLocationsPage( |
| 3507 | + PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, |
| 3508 | + ListLocationsResponse response) { |
| 3509 | + super(context, response); |
| 3510 | + } |
| 3511 | + |
| 3512 | + private static ListLocationsPage createEmptyPage() { |
| 3513 | + return new ListLocationsPage(null, null); |
| 3514 | + } |
| 3515 | + |
| 3516 | + @Override |
| 3517 | + protected ListLocationsPage createPage( |
| 3518 | + PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, |
| 3519 | + ListLocationsResponse response) { |
| 3520 | + return new ListLocationsPage(context, response); |
| 3521 | + } |
| 3522 | + |
| 3523 | + @Override |
| 3524 | + public ApiFuture<ListLocationsPage> createPageAsync( |
| 3525 | + PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, |
| 3526 | + ApiFuture<ListLocationsResponse> futureResponse) { |
| 3527 | + return super.createPageAsync(context, futureResponse); |
| 3528 | + } |
| 3529 | + } |
| 3530 | + |
| 3531 | + public static class ListLocationsFixedSizeCollection |
| 3532 | + extends AbstractFixedSizeCollection< |
| 3533 | + ListLocationsRequest, |
| 3534 | + ListLocationsResponse, |
| 3535 | + Location, |
| 3536 | + ListLocationsPage, |
| 3537 | + ListLocationsFixedSizeCollection> { |
| 3538 | + |
| 3539 | + private ListLocationsFixedSizeCollection(List<ListLocationsPage> pages, int collectionSize) { |
| 3540 | + super(pages, collectionSize); |
| 3541 | + } |
| 3542 | + |
| 3543 | + private static ListLocationsFixedSizeCollection createEmptyCollection() { |
| 3544 | + return new ListLocationsFixedSizeCollection(null, 0); |
| 3545 | + } |
| 3546 | + |
| 3547 | + @Override |
| 3548 | + protected ListLocationsFixedSizeCollection createCollection( |
| 3549 | + List<ListLocationsPage> pages, int collectionSize) { |
| 3550 | + return new ListLocationsFixedSizeCollection(pages, collectionSize); |
| 3551 | + } |
| 3552 | + } |
3331 | 3553 | } |
0 commit comments